UNPKG

@nexex/api

Version:
22 lines (21 loc) 1.12 kB
import { ERC20Token } from '@nexex/types'; import { Contract, Signer } from 'ethers'; import { Provider, TransactionRequest, TransactionResponse } from 'ethers/providers'; import { Amount } from '../model/Amount'; import { AnyNumber } from '../types'; export declare class ERC20Contract implements ERC20Token { contract: Contract; token: ERC20Token; private readonly provider; constructor(token: ERC20Token, provider: Provider); readonly decimals: number | null; readonly name: string | null; readonly symbol: string | null; readonly addr: string | null; allowance(owner: string, spender: string): Promise<Amount>; approve(signer: Signer, spender: string, amount: AnyNumber, opt?: TransactionRequest): Promise<TransactionResponse>; balanceOf(addr: string): Promise<Amount>; transfer(signer: Signer, toAddr: string, amount: AnyNumber, opt?: TransactionRequest): Promise<TransactionResponse>; transferFrom(signer: Signer, fromAddr: string, toAddr: string, amount: AnyNumber, opt?: TransactionRequest): Promise<TransactionResponse>; totalSupply(): Promise<Amount>; }