Class DeFiData

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`
const defiData = new DeFiData();

// Wait for the library to be ready
await defiData.ready();

// Use the `DeFiData` library...

Hierarchy

  • DeFiData

Constructors

Properties

Methods

Constructors

  • Creates an instance of DeFiData.

    Parameters

    • userSettings: undefined | Record<number, Partial<Settings>> = undefined

      The user-provided settings to override the default settings.

    Returns DeFiData

Properties

tokens: Tokens

The Tokens class instance.

timelocks: {
    PinkLock: PinkLock;
    UniCrypt: UniCrypt;
}

The instances of the timelocks classes.

Type declaration

Methods

  • Returns a Promise that resolves when the library are ready.

    Returns Promise<void>

Generated using TypeDoc