List all transfers sent from me in a specific block rangeĪwait daiContract.queryFilter(filterFrom, 9843470, 9843480) Filter for all token transfers from meįilterFrom = (myAddress, null)
While an on-chain Contract may have many methods available, you can safely ignore any methods you don't need or use, providing a smaller subset of the ABI to the contract.Īn ABI often comes from the Solidity or Vyper compiler, but you can use the Human-Readable ABI in code, which the following examples use. This class is a meta-class, which means its methods are constructed at runtime, and when you pass in the ABI to the constructor it uses it to determine which methods to add. In order to communicate with the Contract on-chain, this class needs to know what methods are available and how to encode and decode the data, which is what the Application Binary Interface (ABI) provides. If you are familiar with Databases, this is similar to an Object Relational Mapper (ORM).
The Contract object makes it easier to use an on-chain Contract as a normal JavaScript object, with the methods mapped to encoding and decoding data for you. A Contract is an abstraction of program code which lives on the Ethereum blockchain.