Options
All
  • Public
  • Public/Protected
  • All
Menu

Token class for interacting with ERC20 tokens The constructor is private so must be instantiated with Token.Create

Hierarchy

  • Token

Index

Constructors

  • Returns Token

Properties

_contract?: ERC20
address: string
approve: (spender: string, amount: number | BigNumber) => Promise<ContractTransaction> = ...

Type declaration

    • (spender: string, amount: number | BigNumber): Promise<ContractTransaction>
    • Approve a spender to spend the signers accounts tokens

      Parameters

      • spender: string

        the address of the contract that will spend the tokens

      • amount: number | BigNumber

        the amount the signer is allowing the spender to spend

      Returns Promise<ContractTransaction>

      an ethers transaction

connect: (provider: Provider | Signer) => void = ...

Type declaration

    • (provider: Provider | Signer): void
    • Replaces the provider and connects the contract instance

      Parameters

      • provider: Provider | Signer

        The new provider to connect to

      Returns void

decimals: number
fetchAllowance: (spender: string, account: string) => Promise<BigNumber> = ...

Type declaration

    • (spender: string, account: string): Promise<BigNumber>
    • Fetch an accounts allowance for a given spender

      Parameters

      • spender: string

        Spender of the accounts tokens

      • account: string

        Account to check allowance

      Returns Promise<BigNumber>

      the allowance the account has given to the spender address to spend this token

fetchBalance: (account: string) => Promise<BigNumber> = ...

Type declaration

    • (account: string): Promise<BigNumber>
    • Fetch an accounts balance for this token

      Parameters

      • account: string

        Account to check balance of

      Returns Promise<BigNumber>

      The accounts balance formatted in a BigNumber

init: (tokenInfo: IToken) => Promise<void> = ...

Type declaration

multicallProvider: undefined | Signer | MulticallProvider
name: string
provider: undefined | Provider | Signer
symbol: string
Create: (tokenInfo: IToken) => Promise<Token> = ...

Type declaration

    • Replacement constructor pattern to support async initialisations

      Parameters

      Returns Promise<Token>

      a Promise containing an initialised Token class ready to be used

CreateDefault: () => Token = ...

Type declaration

    • Creates an empty Token that can be used as a default

      Returns Token

      default constructed token

Generated using TypeDoc