UNPKG

@tempus-labs/utils

Version:

Tempus utility helpers

56 lines 2.64 kB
import { Decimal } from "../utils/Decimal"; import { Numberish } from "../utils/DecimalUtils"; import { DecimalConvertible } from "../utils/DecimalConvertible"; import { Signer, Addressable } from "../utils/ContractBase"; import { IERC20 } from "./IERC20"; /** * Typed wrapper for Ether which implements ERC20, * so that we can simplify tests on native ETH based pools */ export declare class ERC20Ether extends DecimalConvertible implements IERC20 { address: string; constructor(); /** @return ERC20 name of this contract */ name(): Promise<string>; /** @return ERC20 symbol of this contract */ symbol(): Promise<string>; /** * @returns Total supply of this ERC20 token as a decimal, such as 10.0 */ totalSupply(): Promise<Decimal>; /** * @param account ERC20 account's address * @returns Balance of ERC20 address in decimals, eg 2.0 */ balanceOf(account: Addressable): Promise<Decimal>; /** * @dev Moves `amount` tokens from the sender's account to `recipient`. * @param sender The sender/caller of this transfer * @param recipient ERC20 transfer recipient's address * @param amount Amount of tokens to send in contract decimals, eg 2.0 or "0.00001" */ transfer(sender: Signer, recipient: Addressable, amount: Numberish): Promise<any>; /** * @param owner ERC20 owner's address * @param spender ERC20 spender's address * @returns The remaining number of tokens that `spender` will be allowed to * spend on behalf of `owner` through {transferFrom}. This is zero by default. */ allowance(owner: Addressable, spender: Addressable): Promise<Decimal>; /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * @param caller The caller who is sending this approve * @param spender ERC20 approve's, spender's address * @param amount Amount of tokens to approve in contract decimals, eg 2.0 or "0.00001" */ approve(caller: Signer, spender: Addressable, amount: Numberish): Promise<any>; /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's allowance. * @param sender ERC20 transferFrom sender's address * @param recipient ERC20 transferFrom recipient's address * @param amount Amount of tokens to send in contract decimals, eg 2.0 or "0.00001" */ transferFrom(sender: Signer, recipient: Addressable, amount: Numberish): Promise<any>; } //# sourceMappingURL=ERC20Ether.d.ts.map