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
DeFiData
class is the main class and represents theDeFiData
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 theTokens
class, which provides the methods for fetching the information of any token that comply with theERC-20
standard.pinlock
: An instance of thePinkLock
class, 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 theUniCrypt
class, which provides the methods for retrieving token timelocks associated with user addresses and token addresses from different versions ofUniCrypt
's contracts.In addition, the
DeFiData
classconstructor
accepts a partial object of typeSettings
, allowing the user to provide custom configuration to override the default settings.The only method defined by the
DeFiData
class is theready
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: