Solana.SPL.Token.Mint (Solana v0.1.0)

View Source

Functions for interacting with the mint accounts of Solana's Token Program.

Summary

Types

t()

Token Program mint account metadata.

Functions

The size of a serialized token mint account.

Genereates the instructions to initialize a mint account.

Types

t()

@type t() :: %Solana.SPL.Token.Mint{
  authority: Solana.key() | nil,
  decimals: byte(),
  freeze_authority: Solana.key() | nil,
  initialized?: boolean(),
  supply: non_neg_integer()
}

Token Program mint account metadata.

Functions

byte_size()

@spec byte_size() :: pos_integer()

The size of a serialized token mint account.

from_account_info(info)

@spec from_account_info(info :: map()) :: t() | :error

Translates the result of a Solana.RPC.Request.get_account_info/2 into a Solana.SPL.Token.Mint.t/0.

init(opts)

Genereates the instructions to initialize a mint account.

Options

  • :payer - Required. The account that will pay for the mint creation

  • :balance (non_neg_integer/0) - Required. The lamport balance the mint account should have

  • :decimals - Required. decimals for the new mint

  • :authority - Required. authority for the new mint

  • :freeze_authority - freeze authority for the new mint

  • :new - Required. public key for the new mint