ao-js-sdk - v0.4.1
    Preparing search index...

    Interface IAOTokenClient

    Interface for interacting with ao token processes. Implements the standard token interface specification for managing transferable assets.

    interface IAOTokenClient {
        balance(entityId: string): Promise<string>;
        getInfo(token?: string): Promise<TokenInfo>;
        mint(quantity: string): Promise<boolean>;
        transfer(
            recipient: string,
            quantity: string,
            forwardedTags?: Tags,
        ): Promise<boolean>;
    }

    Implemented by

    Index

    Methods

    • Gets the balance of a specific identifier (address) in the token ledger. This is a read-only operation that queries the current state of the ledger.

      Parameters

      • entityId: string

      Returns Promise<string>

      Promise resolving to the current balance as a string

    • Gets information about a token process including name, ticker, logo, and denomination. These are immutable parameters set when the token process was spawned.

      Parameters

      • Optionaltoken: string

        Optional token process ID to get information for. If not provided, uses the current process ID.

      Returns Promise<TokenInfo>

      Promise resolving to TokenInfo with token information

    • Mints new tokens, increasing the total supply. This operation can only be performed on the root token process.

      Parameters

      • quantity: string

        The amount of new tokens to create

      Returns Promise<boolean>

      Promise resolving to true if minting was successful

    • Transfers tokens from the caller's balance to one or more target addresses. This operation modifies the ledger state by updating balances.

      Parameters

      • recipient: string

        The target address to receive the tokens

      • quantity: string

        The amount of tokens to transfer

      • OptionalforwardedTags: Tags

        Optional tags to include with the transfer message for additional metadata or notifications

      Returns Promise<boolean>

      Promise resolving to true if the transfer was successful