@anton-seriesfi/doppler-v3-sdk
Version:
SDK for interacting with Doppler v3 protocol
55 lines • 2.16 kB
TypeScript
import { ReadAdapter, Drift } from "@delvtech/drift";
import { Address } from "viem";
/**
* A class providing read-only access to Ethereum (ETH) token information and balances.
*
* @remarks
* This class implements a consistent interface with other token implementations (like DERC20)
* but handles ETH-specific behavior such as:
* - Hardcoded token metadata (name, symbol, decimals)
* - Simulating unlimited allowance for ETH transfers
* - Querying native ETH balances through the Drift provider
*/
export declare class ReadEth {
/** Configured Drift instance for blockchain interactions */
drift: Drift<ReadAdapter>;
/** Static ETH address identifier (zero address) */
static address: "0x0000000000000000000000000000000000000000";
/**
* Create a ReadEth instance
* @param drift - Configured Drift instance for blockchain interactions
* (defaults to new instance with default settings)
*/
constructor(drift?: Drift<ReadAdapter>);
/**
* Get the human-readable name of the token
* @returns Promise resolving to "Ether" (hardcoded ETH name)
*/
getName(): Promise<string>;
/**
* Get the ticker symbol of the token
* @returns Promise resolving to "ETH" (hardcoded ETH symbol)
*/
getSymbol(): Promise<string>;
/**
* Get the number of decimal places used by the token
* @returns Promise resolving to 18 (standard ETH decimals)
*/
getDecimals(): Promise<number>;
/**
* Get the allowance granted to a spender (always returns maximum value)
* @returns Promise resolving to 2^256 - 1 (simulates unlimited ETH allowance)
*
* @remarks
* ETH doesn't have an allowance mechanism, so this returns max uint256 value
* to represent unlimited approval in systems expecting ERC20-like interfaces
*/
getAllowance(): Promise<bigint>;
/**
* Get the ETH balance of a specified account
* @param account - Address of the account to query
* @returns Promise resolving to the account's ETH balance in wei
*/
getBalanceOf(account: Address): Promise<bigint>;
}
//# sourceMappingURL=ReadEth.d.ts.map