Class PinkLock

The PinkLock class provides methods for retrieving token timelocks associated with user addresses and token addresses from different versions of PinkLock's contracts. The class offers the following public methods:

  • getUsersLocks method: Retrieves timelocks associated with multiple user addresses.
  • getTokensLocks method: Retrieves timelocks associated with multiple token addresses.

To use the PinkLock class, you need to create an instance of the DeFiData class first and wait for it to be ready. You can then access the public methods of the PinkLock property from the DeFiData instance to fetch timelocks information.

Example

Here's an example of how to use the PinkLock class:

// 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();

// Access the `PinkLock` class
const locker = defiData.timelocks.PinkLock;

// Retrieve timelocks associated with user addresses
const users = ['0xUserAddress1', '0xUserAddress2'];
const userLocks = await locker.getUsersLocks(1, users);
console.log(userLocks);

// Retrieve timelocks associated with token addresses
const tokens = ['0xTokenAddress1', '0xTokenAddress2'];
const tokenLocks = await locker.getTokensLocks(1, tokens);
console.log(tokenLocks);

Hierarchy

  • PinkLock

Methods

  • Retrieves the timelocks associated with multiple user addresses from different versions of PinkLock's contracts.

    Parameters

    • networkId: number

      The ID of the network where the timelocks are located.

    • users: string[]

      An array containing user addresses for which to retrieve the timelocks.

    Returns Promise<Record<string, Timelock[]>>

    A Promise that resolves to an object where each key is a user address, and the value is an array of Timelock objects.

  • Retrieves the timelocks associated with multiple token addresses from different versions of PinkLock's contracts.

    Parameters

    • networkId: number

      The ID of the network where the timelocks are located.

    • tokens: string[]

      An array containing token addresses for which to retrieve the timelocks.

    Returns Promise<Record<string, Timelock[]>>

    A Promise that resolves to an object where each key is a token address, and the value is an array of Timelock objects.

Generated using TypeDoc