Skip to content

Core

spl.token.core

Helper code for client.py and async_client.py.

AccountInfo

Information about an account.

Source code in spl/token/core.py
class AccountInfo(NamedTuple):
    """Information about an account."""

    mint: Pubkey
    """The mint associated with this account."""
    owner: Pubkey
    """Owner of this account."""
    amount: int
    """Amount of tokens this account holds."""
    delegate: Optional[Pubkey]
    """The delegate for this account."""
    delegated_amount: int
    """The amount of tokens the delegate authorized to the delegate."""
    is_initialized: bool
    """ Is this account initialized."""
    is_frozen: bool
    """Is this account frozen."""
    is_native: bool
    """Is this a native token account."""
    rent_exempt_reserve: Optional[int]
    """If this account is a native token, it must be rent-exempt.

    This value logs the rent-exempt reserve which must remain in the balance
    until the account is closed.
    """
    close_authority: Optional[Pubkey]
    """Optional authority to close the account."""

amount: int

Amount of tokens this account holds.

close_authority: Optional[solders.pubkey.Pubkey]

Optional authority to close the account.

delegate: Optional[solders.pubkey.Pubkey]

The delegate for this account.

delegated_amount: int

The amount of tokens the delegate authorized to the delegate.

is_frozen: bool

Is this account frozen.

is_initialized: bool

Is this account initialized.

is_native: bool

Is this a native token account.

mint: Pubkey

The mint associated with this account.

owner: Pubkey

Owner of this account.

rent_exempt_reserve: Optional[int]

If this account is a native token, it must be rent-exempt.

This value logs the rent-exempt reserve which must remain in the balance until the account is closed.

MintInfo

Information about the mint.

Source code in spl/token/core.py
class MintInfo(NamedTuple):
    """Information about the mint."""

    mint_authority: Optional[Pubkey]
    """"Optional authority used to mint new tokens.

    The mint authority may only be provided during mint creation. If no mint
    authority is present then the mint has a fixed supply and no further tokens
    may be minted.
    """
    supply: int
    """Total supply of tokens."""
    decimals: int
    """Number of base 10 digits to the right of the decimal place."""
    is_initialized: bool
    """Is this mint initialized."""
    freeze_authority: Optional[Pubkey]
    """ Optional authority to freeze token accounts."""

decimals: int

Number of base 10 digits to the right of the decimal place.

freeze_authority: Optional[solders.pubkey.Pubkey]

Optional authority to freeze token accounts.

is_initialized: bool

Is this mint initialized.

mint_authority: Optional[solders.pubkey.Pubkey]

"Optional authority used to mint new tokens.

The mint authority may only be provided during mint creation. If no mint authority is present then the mint has a fixed supply and no further tokens may be minted.

supply: int

Total supply of tokens.