An abstract fungible token.

Hierarchy (view full)

Implements

Constructors

Properties

connection?: Chain.Connection
decimals: number = null

The decimal precision of the token.

instance?: {
    address?: string;
    codeHash?: string;
}

Type declaration

  • Optional address?: string
  • Optional codeHash?: string
name: string = null

The full name of the token.

symbol: string = null

The market symbol of the token.

totalSupply: string = null

The total supply of the token.

Accessors

  • get asDescriptor(): Custom
  • Returns Custom

    self as plain Token.Custom with a hidden (from serialization!) client property pointing to this.

  • get id(): string
  • Get a comparable token ID.

    Returns string

Methods

  • Add addresses to be minters

    Parameters

    • minters: string[]

    Returns Promise<unknown>

  • Burn SNIP20 tokens

    Parameters

    • amount: string | number | bigint
    • Optional memo: string

    Returns Promise<unknown>

  • Change the admin of the token, who can set the minters

    Parameters

    • address: string

    Returns Promise<unknown>

  • Check the current allowance from owner to spender.

    Parameters

    • spender: string
    • owner: string
    • key: string

    Returns Promise<unknown>

  • Decrease allowance to spender

    Parameters

    • amount: string | number | bigint
    • spender: string

    Returns Promise<unknown>

  • Deposit native tokens into the contract.

    Parameters

    Returns Promise<unknown>

  • Execute a transaction on the specified instance as the specified Connection.

    Parameters

    • message: Message
    • options: {
          execFee?: IFee;
          execMemo?: string;
          execSend?: ICoin[];
      } = {}
      • Optional execFee?: IFee
      • Optional execMemo?: string
      • Optional execSend?: ICoin[]

    Returns Promise<unknown>

  • Parameters

    • address: string
    • key: string

    Returns Promise<string>

  • Increase allowance to spender

    Parameters

    • amount: string | number | bigint
    • spender: string

    Returns Promise<unknown>

  • Mint SNIP20 tokens

    Parameters

    • amount: string | number | bigint
    • recipient: string = ...

    Returns Promise<unknown>

  • Execute a query on the specified instance as the specified Connection.

    Type Parameters

    • Q

    Parameters

    Returns Promise<Q>

  • Redeem an amount of a native token from the contract.

    Parameters

    • amount: string | number | bigint
    • Optional denom: string

    Returns Promise<unknown>

  • Send tokens to address. Same as transfer but allows for receive callback.

    Parameters

    • amount: string | number | bigint
    • recipient: string
    • Optional callback: string | object

    Returns Promise<unknown>

  • Parameters

    • owner: string
    • amount: string
    • recipient: String
    • Optional hash: string
    • Optional msg: string
    • Optional memo: string

    Returns Promise<unknown>

  • Set specific addresses to be minters, remove all others

    Parameters

    • minters: string[]

    Returns Promise<unknown>

  • Transfer tokens to address

    Parameters

    • amount: string | number | bigint
    • recipient: string

    Returns Promise<unknown>

  • Parameters

    • owner: string
    • recipient: string
    • amount: string
    • Optional memo: string

    Returns Promise<unknown>

  • Create a SNIP20 init message.

    Parameters

    • __namedParameters: {
          admin: string | {
              address: string;
          };
          balances?: {
              address: string;
              amount: string;
          }[];
          config?: Partial<Snip20InitConfig>;
          decimals: number;
          name?: string;
          prngSeed?: string;
          symbol: string;
      }
      • admin: string | {
            address: string;
        }
      • Optional balances?: {
            address: string;
            amount: string;
        }[]
      • Optional config?: Partial<Snip20InitConfig>
      • decimals: number
      • Optional name?: string
      • Optional prngSeed?: string
      • symbol: string

    Returns Snip20InitMsg

Generated using TypeDoc