An abstract fungible token.

Hierarchy

Implements

Constructors

Properties

address?: string

Address of the contract on the chain.

agent?: Agent

Agent that will interact with the contract.

codeHash?: string

Code hash confirming the contract's integrity.

decimals: null | number = null

The decimal precision of the token.

fee?: IFee

Default fee for all contract transactions.

fees: Record<string, IFee> = {}

Default fee for specific transactions.

log: Scrt.Console = ...
meta: Contract<any>

Contract metadata.

name: null | string = null

The full name of the token.

symbol: null | string = null

The market symbol of the token.

totalSupply: null | string = null

The total supply of the token.

Accessors

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>

  • Parameters

    • address: string
    • key: string

    Returns Promise<string>

  • Get the recommended fee for a specific transaction.

    Parameters

    • Optional msg: string | Record<string, unknown>

    Returns undefined | IFee

  • Increase allowance to spender

    Parameters

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

    Returns Promise<unknown>

  • Mint SNIP20 tokens

    Parameters

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

    Returns Promise<unknown>

  • 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>

  • Throw if fetched metadata differs from configured.

    Parameters

    • kind: string
    • expected: any
    • actual: any

    Returns void

  • Create a SNIP20 init message.

    Parameters

    • name: string
    • symbol: string
    • decimals: number
    • admin: string | {
          address: string;
      }
    • config: Partial<Scrt.Snip20InitConfig> = {}
    • balances: {
          address: string;
          amount: string;
      }[] = []

    Returns Scrt.Snip20InitMsg

Generated using TypeDoc