Solana.SPL.AssociatedToken (Solana v0.1.0)
View SourceFunctions for interacting with the Associated Token Account Program.
An associated token account's address is derived from a user's main system account and the token mint, which means each user can only have one associated token account per token.
Summary
Functions
Creates an associated token account.
Creates an associated token account idempotently, ie it doesn't do anything if account is already created.
Finds the token account address associated with a given owner and mint.
The Associated Token Account's Program ID
Functions
Creates an associated token account.
This will be owned by the owner
regardless of who actually creates it.
Options
:payer
- Required. The account which will pay for thenew
account's creation:owner
- Required. The account which will own thenew
account:new
- Required. Public key of the associated token account to create:mint
- Required. The mint of thenew
account
Creates an associated token account idempotently, ie it doesn't do anything if account is already created.
This will be owned by the owner
regardless of who actually creates it.
Options
:payer
- Required. The account which will pay for thenew
account's creation:owner
- Required. The account which will own thenew
account:new
- Required. Public key of the associated token account to create:mint
- Required. The mint of thenew
account
@spec find_address(mint :: Solana.key(), owner :: Solana.key()) :: {:ok, Solana.key()} | :error
Finds the token account address associated with a given owner and mint.
This address will be unique to the mint/owner combination.
The Associated Token Account's Program ID