doppler-v3-sdk
Version:
SDK for interacting with Doppler v3 protocol
66 lines • 2.98 kB
TypeScript
import { ReadContract, ReadAdapter, Drift, FunctionReturn, FunctionArgs } from "@delvtech/drift";
import { Address } from "viem";
import { derc20Abi } from "../../../abis";
export type Derc20ABI = typeof derc20Abi;
/**
* A class providing read-only access to a DERC20 token contract.
* Enables querying standard ERC20 token properties along with custom vesting
* and minting-related state information.
*/
export declare class ReadDerc20 {
/** Underlying contract instance for direct DERC20 interactions */
contract: ReadContract<Derc20ABI>;
/**
* Create a ReadDerc20 instance
* @param address - Contract address of the DERC20 token
* @param drift - Drift instance for blockchain interaction (defaults to new instance)
*/
constructor(address: Address, drift?: Drift<ReadAdapter>);
/** Get the human-readable name of the token */
getName(): Promise<string>;
/** Get the symbol/ticker of the token */
getSymbol(): Promise<string>;
/** Get the number of decimals used for token divisions */
getDecimals(): Promise<number>;
/** Get the token URI for the token */
getTokenURI(): Promise<string>;
/**
* Get the allowance granted by an owner to a spender
* @param params - Arguments for the allowance contract method
*/
getAllowance(params: FunctionArgs<Derc20ABI, "allowance">): Promise<bigint>;
/**
* Get the token balance of a specific account
* @param account - Address to check balance for
*/
getBalanceOf(account: Address): Promise<bigint>;
/** Get the total supply of tokens in circulation */
getTotalSupply(): Promise<bigint>;
/** Get the duration (in seconds) of the vesting period */
getVestingDuration(): Promise<bigint>;
/** Get the timestamp when vesting begins */
getVestingStart(): Promise<bigint>;
/** Get the total amount of tokens allocated for vesting */
getVestedTotalAmount(): Promise<bigint>;
/** Get the amount of vested tokens available for a specific address */
getAvailableVestedAmount(account: Address): Promise<bigint>;
/** Get the current annual mint rate in tokens per year */
getYearlyMintRate(): Promise<bigint>;
/** Get the pool address for the token */
getPool(): Promise<Address>;
/** Check if the liquidity pool is unlocked */
getIsPoolUnlocked(): Promise<boolean>;
/** Get the timestamp when token minting begins */
getCurrentYearStart(): Promise<bigint>;
/** Get the timestamp of the last mint */
getLastMintTimestamp(): Promise<bigint>;
/**
* Get detailed vesting information for a specific account
* @param account - Address to retrieve vesting data for
* @returns Object containing:
* - totalAmount: Total amount of tokens vested
* - releasedAmount: Amount already claimed
*/
getVestingData(account: Address): Promise<FunctionReturn<Derc20ABI, "getVestingDataOf">>;
}
//# sourceMappingURL=ReadDerc20.d.ts.map