You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
jrosendo 7a960f7d00 docs(blockchain): add blockchain branch subjects to public 2 years ago
..
README.md docs(blockchain): add blockchain branch subjects to public 2 years ago

README.md

Transfers History

Instructions

  • Create a JavaScript file transfersHistory.jsthat exports the function transfersHistory(address, address) that takes as parameters the address of a MinimalTokenEvent Smart Contract instance and the address of an user.

It returns an array with all the transfers from that account, starting from the most recent, positive if it is toward the user, and negative if it is outside.

Structure

const { ethers } = require("ethers");

async function transfersHistory(contractAddress, userAddress) {}
exports.transfersHistory = transfersHistory;

Usage

const { transfersHistory } = require("./transfersHistory.sl.js");

transfersHistory(
  "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc",
  "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
);
/* expected:
[50, -25, 200, 30, -230]
*/

Resources