Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Coin

Index

Constructors

  • new Coin(symbol: string, decimals: number, mint: PublicKey, mintAuthority: Keypair, freezeAuthority: null | Keypair): Coin
  • Parameters

    • symbol: string
    • decimals: number
    • mint: PublicKey
    • mintAuthority: Keypair
    • freezeAuthority: null | Keypair

    Returns Coin

Properties

_decimals: number
_freezeAuthority: null | Keypair
_mint: PublicKey
_mintAuthority: Keypair
_symbol: string

Accessors

  • get decimals(): number
  • get freezeAuthority(): null | Keypair
  • get mint(): PublicKey
  • get mintAuthority(): Keypair
  • get symbol(): string

Methods

  • fundAccount(decimalAmount: number, owner: Keypair, connection: Connection): Promise<void>
  • Fund the owner key-pair with the specified amount of this coin.

    Parameters

    • decimalAmount: number

      The amount of tokens to fund account with, in decimal notation.

    • owner: Keypair

      The Keypair to fund.

    • connection: Connection

      The Connection object to connect to Solana.

    Returns Promise<void>

  • getBalance(owner: Keypair, connection: Connection): Promise<RpcResponseAndContext<TokenAmount>>
  • Get the token balance for the specified owner.

    Parameters

    • owner: Keypair

      The Keypair whose balance to fetch.

    • connection: Connection

      The Connection object to connect to Solana.

    Returns Promise<RpcResponseAndContext<TokenAmount>>

  • isEqual(to: Coin): boolean
  • Equality check between two Coins.

    Parameters

    • to: Coin

      The Coin object to compare to.

    Returns boolean

  • load(connection: Connection, symbol: string, mint: PublicKey, mintAuthority: Keypair, freezeAuthority: null | Keypair): Promise<Coin>
  • Load an exisiting mint as a Coin.

    Parameters

    • connection: Connection

      The Connection object to connect to Solana.

    • symbol: string

      The symbol to assign to the coin.

    • mint: PublicKey

      The PublicKey of the Mint for the coin.

    • mintAuthority: Keypair

      The minting authority Keypair for the coin.

    • freezeAuthority: null | Keypair

      The optional freezing authority Keypair for the coin.

    Returns Promise<Coin>

Generated using TypeDoc