Service providing userful interactions with token information and actions.

Hierarchy

Constructors

Properties

allowances: Record<string, BigNumber> = {}
level: LogLevel
sdk: eBTC
tokens: Record<string, Token> = {}

Accessors

  • get address(): undefined | string
  • Returns undefined | string

  • get connector(): Signer | MulticallProvider
  • Returns Signer | MulticallProvider

  • get provider(): MulticallProvider
  • Returns MulticallProvider

  • get signer(): undefined | Signer
  • Returns undefined | Signer

Methods

  • Parameters

    • level: LogLevel
    • Optional message: any
    • Rest ...optionalParams: any[]

    Returns void

  • Attempt to resolve a token decimals

    Parameters

    • token: Erc20

      Token contract

    Returns Promise<number>

    Decimals if available, empty string if not

  • Attempt to resolve a token name

    Parameters

    • token: Erc20

      Token contract

    Returns Promise<string>

    Name if available, empty string if not

  • Attempt to resolve a token symbol

    Parameters

    • token: Erc20

      Token contract

    Returns Promise<string>

    Symbol if available, empty string if not

  • Parameters

    • Optional message: any
    • Rest ...optionalParams: any[]

    Returns void

  • Parameters

    • Optional message: any
    • Rest ...optionalParams: any[]

    Returns void

  • Increase token allowance for a given spender for requested token.

    Parameters

    • options: IncreaseAllowanceOptions

      Increase allowance paramters, enableErc20ApproveBackup If set to true, will attempt to use the ERC20 approve method if the increaseAllowance method fails.

    Returns Promise<TransactionStatus>

    Transaction status of the submitted increase allowance

  • Parameters

    • Optional message: any
    • Rest ...optionalParams: any[]

    Returns void

  • Load token allowance for a given token to a specific user

    Parameters

    • token: string

      Address of requested token

    • spender: string

      Target address to check against

    • Optional owner: string

      A requested address to check allowance, defaults to the connected address if available

    Returns Promise<BigNumber>

    Token allowance for the requested spender

  • Load token allowances for given tokens to a specific user

    Parameters

    • tokens: string[]

      Addresses of requested tokens

    • spender: string

      Target address to check against

    • Optional owner: string

      A requested address to check allowance, defaults to the connected address if available

    Returns Promise<Record<string, BigNumber>>

    Mapping from address to allowance

  • Load token balance for a given token

    Parameters

    • token: string

      Address of requested token

    • Optional owner: string

      A requested address to check balance, defaults to the connected address if available

    Returns Promise<BigNumber>

    Amount of token the owner has

  • Load token balances for a given list of tokens

    Parameters

    • tokens: string[]

      Addresses of requested tokens

    • Optional owner: string

      A requested address to check balances, defaults to the connected address if available

    Returns Promise<Record<string, BigNumber>>

    Mapping from address to token balance

  • Load token information for a given token

    Parameters

    • token: string

      Address of requested token

    Returns Promise<Token>

    Token information

  • Load token information for a given list of tokens

    Parameters

    • tokens: string[]

      Addresses of requested tokens

    Returns Promise<Record<string, Token>>

    Mapping from address to token information

  • Parameters

    • Optional message: any
    • Rest ...optionalParams: any[]

    Returns void

  • Checks a user's currently allowed tokens to be transfered by a given spender. If the allowance is not sufficient, a transaction to increase that allowance through an approve for the spender will be initiated.

    Parameters

    Returns Promise<TransactionStatus>

    Transaction status of the submitted approve

  • Checks a user's currently allowed tokens to be transfered by a given spender. If the allowance is not sufficient, a transaction to increase that allowance for the spender will be initiated.

    Parameters

    Returns Promise<TransactionStatus>

    Transaction status of the submitted increase allowance

  • Parameters

    • Optional message: any
    • Rest ...optionalParams: any[]

    Returns void

Generated using TypeDoc