Utility class for token operations on Demos Network.

Constructors

Methods

  • Creates an approve transaction.

    Parameters

    • tokenAddress: string

      Token contract address

    • spender: string

      Spender address

    • amount: string

      Amount to approve (as string for bigint)

    Returns Promise<Transaction>

    Unsigned transaction

  • Creates a burn transaction.

    Parameters

    • tokenAddress: string

      Token contract address

    • from: string

      Address to burn from

    • amount: string

      Amount to burn (as string for bigint)

    Returns Promise<Transaction>

    Unsigned transaction

  • Calls a custom script method.

    Parameters

    • tokenAddress: string

      Token contract address

    • method: string

      Method name

    • params: unknown[]

      Method parameters

    Returns Promise<Transaction>

    Unsigned transaction

  • Calls a view function on a scripted token (read-only).

    Parameters

    • tokenAddress: string

      Token contract address

    • method: string

      Method name

    • params: unknown[]

      Method parameters

    Returns Promise<unknown>

    Method return value

  • Gets allowance for spender.

    Parameters

    • tokenAddress: string

      Token contract address

    • ownerAddress: string

      Owner address

    • spenderAddress: string

      Spender address

    Returns Promise<string>

    Allowance amount as string

  • Creates a grant permissions transaction.

    Parameters

    • tokenAddress: string

      Token contract address

    • address: string

      Address to grant permissions to

    • permissions: string[]

      Permissions to grant

    Returns Promise<Transaction>

    Unsigned transaction

  • Creates a mint transaction.

    Parameters

    • tokenAddress: string

      Token contract address

    • to: string

      Recipient address

    • amount: string

      Amount to mint (as string for bigint)

    Returns Promise<Transaction>

    Unsigned transaction

  • Creates a revoke permissions transaction.

    Parameters

    • tokenAddress: string

      Token contract address

    • address: string

      Address to revoke permissions from

    • permissions: string[]

      Permissions to revoke

    Returns Promise<Transaction>

    Unsigned transaction

  • Creates a transfer transaction.

    Parameters

    • tokenAddress: string

      Token contract address

    • to: string

      Recipient address

    • amount: string

      Amount to transfer (as string for bigint)

    Returns Promise<Transaction>

    Unsigned transaction

  • Creates a transferFrom transaction.

    Parameters

    • tokenAddress: string

      Token contract address

    • from: string

      Owner address

    • to: string

      Recipient address

    • amount: string

      Amount to transfer (as string for bigint)

    Returns Promise<Transaction>

    Unsigned transaction

  • Creates a transfer ownership transaction.

    Parameters

    • tokenAddress: string

      Token contract address

    • newOwner: string

      New owner address

    Returns Promise<Transaction>

    Unsigned transaction