The DeFiData class is the main class and represents the DeFiData library. It is responsible for exporting and initializing other classes that provide direct access to multiple protocols and standards deployed on various blockchain networks with support for smart contracts.
These are the classes exported by the DeFiData class:
tokens: An instance of the Tokens class, which provides the methods for fetching the information of any token that comply with the ERC-20 standard.
pinlock: An instance of the PinkLock class, which provides the methods for retrieving token timelocks associated with user addresses and token addresses from different versions of PinkLock's contracts.
unicrypt: An instance of the UniCrypt class, which provides the methods for retrieving token timelocks associated with user addresses and token addresses from different versions of UniCrypt's contracts.
In addition, the DeFiData class constructor accepts a partial object of type Settings, allowing the user to provide custom configuration to override the default settings.
The only method defined by the DeFiData class is the ready method, which returns a promise that resolves when the library is fully ready for the user to use.
Example
Here's an example of how the DeFiData class can be used:
// Import the `DeFiData` library import { DeFiData } from'defidata';
// Create an instance of `DeFiData` constdefiData = newDeFiData();
// Wait for the library to be ready awaitdefiData.ready();
The
DeFiDataclass is the main class and represents theDeFiDatalibrary. It is responsible for exporting and initializing other classes that provide direct access to multiple protocols and standards deployed on various blockchain networks with support for smart contracts.These are the classes exported by the
DeFiDataclass:tokens: An instance of theTokensclass, which provides the methods for fetching the information of any token that comply with theERC-20standard.pinlock: An instance of thePinkLockclass, which provides the methods for retrieving token timelocks associated with user addresses and token addresses from different versions ofPinkLock's contracts.unicrypt: An instance of theUniCryptclass, which provides the methods for retrieving token timelocks associated with user addresses and token addresses from different versions ofUniCrypt's contracts.In addition, the
DeFiDataclassconstructoraccepts a partial object of typeSettings, allowing the user to provide custom configuration to override the default settings.The only method defined by the
DeFiDataclass is thereadymethod, which returns a promise that resolves when the library is fully ready for the user to use.Example
Here's an example of how the
DeFiDataclass can be used: