Questions tagged [associated-token-account]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
28 views

How to close associated token accounts on a program-owned account?

In my program I am making the program-owned account receive token payments. So I was wondering the following? Questions: Is there anything wrong with creating associated token accounts (ATAs) on a ...
  • 453
3 votes
2 answers
141 views

Determine if a key is an associated token account

If I am given an arbitrary Solana public key without any transactions associated to it, is there a way I can determine if this is a normal account or an ATA? My initial approach would be to see if it ...
0 votes
1 answer
32 views

How to handle multiple tokens + SOL in a payments program?

Context Depending on the item price in USD, users should be able to pay for items with different tokens/currencies (this is made possible with Switchboard Oracles). The payments then go towards a ...
  • 453
2 votes
1 answer
34 views

Where does a Account of a TokenMint store the maximum capacity it has at the moment?

I just started learning Solana, and I have a question that is confusing me. A tokenMint are account that holds specific information about a token. But createMint only requires the mint freeze ...
  • 59
2 votes
1 answer
46 views

Does one have to generate a special token address for USDT, USDC... when one generates a new address?

In my application I need to generate new addresses from time to time. I need them for SOL as well as for the stable coins on Solana. A new address will be assigned to a new user. Since Solana has ...
1 vote
1 answer
54 views

Transaction simulation failed: Error processing Instruction 1: invalid account data for instruction

I am trying to transfer NFT from One Account to Another account. Where I am creating an associated account address if it is not available. A number of NFTS can transfer but only One NFT can not ...
2 votes
1 answer
52 views

Are addresses in Solana unique accross all the tokens?

I'm working on a system wherein there're multiple blockchains involved, and withing each one, native assets and tokens too are used together, as well as wallet addresses of them. In Ethereum and TRON, ...
  • 107
2 votes
0 answers
41 views

TokenNotFoundError using getAssociatedTokenAddress() on MKRS NFT

I am working on a project that is pretty urgent and this error stays prominent when I try and fetch the Token Account of an MKRS NFT: All other NFTs work fine, so I'm not sure why this one doesn't. ...
  • 515
3 votes
1 answer
29 views

Do I need to create ATA for TokenAccount

library: use anchor_spl::token::{ Token, TokenAccount, Transfer } Token Account: #[account( mut, seeds = [mint.key().as_ref(), b"nfts_vault_seed", from.key().as_ref()], ...
4 votes
1 answer
33 views

Why is one of the transactions for my token account missing from my wallet in Solana Explorer?

I have a wallet 5FHwkrdxntdK24hgQU8qgBjn35Y1zwhz1GZwCkP2UJnM that has a token account Tig6ugKWyQqyRgs8CeDCuC3AaenQzRJ5eVpmT5bboDc. I can see the transaction ...
3 votes
1 answer
52 views

How to get Mint Address of of SPL token using associated token account?

I want to know if there is any way I can find out mint-address of spl-token if I using associated token-account of any one of the holders Something like this: const mintAddress = getMintAddress(...
1 vote
2 answers
33 views

spl-token CLI unexpected behaviour

I'm writing a bash script to do some creating of mints, associated token accounts and minting. What I'm trying to do is, create a mint with a mint_authority A keypair, and then create a associated ...
  • 375
1 vote
1 answer
40 views

Error Creating AssociatedTokenAccount when the signer/funder is one of the seeds. Any way around this?

Im getting this error "Transaction simulation failed: Error processing Instruction 0: incorrect program id for instruction" I think its because Im passing in the same account twice one as ...
0 votes
0 answers
24 views

Error: when creating ATA using createAssociatedTokenAccount() or createAssosciatedTokenAccountInstruction

When I try to create an Associated Token Account using createAssociatedTokenAccount() , I get this error Error: failed to send transaction: Transaction simulation failed: Error processing Instruction ...
0 votes
1 answer
193 views

TokenAccountNotFoundError after calling getOrCreateAssociatedTokenAccount

I have an API route where I generate a new wallet with web3.Keypair function. Then I want to getOrCreateAssociatedTokenAccount for my spl token and get the balance. The first few times I call this API ...
  • 43
1 vote
1 answer
106 views

getOrCreateAssociatedTokenAccount() throws TokenAccountNotFoundError

I am trying to figure out why createAssociatedAccount does not work. This is the code: const SendTransaction = ({ children }) => { const { connection } = useConnection(); const { publicKey, ...
  • 168
1 vote
0 answers
62 views

Token accounts and "setAuthority"

I've been trying to understand the intended use cases of setAuthority function in the context of Token accounts. For Mint accounts, it is clear that setAuthority can be used to set the mint and freeze ...
  • 195
3 votes
1 answer
259 views

How to create an associated Token Account in anchor, I'm getting the following error: "insufficient account keys for instruction"

I need to create a SPL-Token before each test I'm running So I created the 2 following functions : createMint and createUserAndAssociatedWallet I'm able to create a mint but I can't create the ...
0 votes
1 answer
25 views

What's the best practice around supporting token accounts other than associated token accounts

In my program, suppose I want to take tokens from a user, or send tokens to that user, etc. Should I support any token accounts (given the mint and the owner matches of course), or only the associated ...
0 votes
1 answer
60 views

Is the process of creating an Associated Token Account idempotent?

I was unable to determine from the documentation if the process of creating Associated Token Accounts is idempotent: https://spl.solana.com/associated-token-account#creating-an-associated-token-...
  • 592
1 vote
1 answer
52 views

Since an Associated Token Account for a wallet can be created by anybody, how can we enforce that Token-2022 immutable ownership is performed on ATAs?

Here we see that anybody can create an ATA for anybody else's wallet for any token: https://spl.solana.com/associated-token-account#creating-an-associated-token-account But the process of enforcing ...
  • 592
1 vote
0 answers
19 views

If I'm already checking that the associated token account is owned by the expected owner, is there any benefit to token-2022's ImmutableOwner feature?

I was surprised to see this logging appear when my transaction was executed: "Please upgrade to SPL Token 2022 for immutable owner support" Leaving aside my surprise at the fact that the ...
  • 126
0 votes
1 answer
38 views

What does it mean exactly for token account owners to reassign ownership to another address?

In review of this Token-22 extension, it says that token account owners can reassign ownership to another address: https://spl.solana.com/token-2022/extensions#immutable-owner I am having a hard time ...
  • 592
3 votes
2 answers
607 views

Creating an Associated Token Account via Solana Program

I am struggling with creating a program that creates an Associated Token Account (ATA) for a mint I created. I am using the anchor_spl::associated_token for the task. Here is my code: use anchor_lang:...
1 vote
1 answer
19 views

Error: failed to request getAccount

Does anyone know why I failed to request getAccount immediately after creating an Associated Token Account? How can I verify that an Associated Account Token has been created?
0 votes
0 answers
15 views

Does a `keypair` thats owns an `associated token account` have to be created as an account and pay rent itself?

does a keypair thats owns an associated token account have to be created as an account and pay rent itself? Or is this only required for data and program accounts?
0 votes
1 answer
35 views

How to get all associated token accounts under the public key

Is there a way to get all associated token account under a public key? Is there a Solana sdk do that for ys?
1 vote
2 answers
69 views

Conditional CreateAccount Instruction - Associated Token Program

Is there a way to build a transaction that creates an account iff only it doesn't exist. I sometimes run into a race condition between checking that the account exist, broadcasting the transaction and ...
0 votes
0 answers
66 views

Is there any case where the owner of a token Account is not the Token Program? And associated token accounts?

I'm talking about the owner, not the authority. If so...Does ATA follow the same rule? Thanks
0 votes
1 answer
35 views

Where is the associated token account in Metaplex .create() output?

From https://github.com/metaplex-foundation/js#create: This will take care of creating the mint account, the associated token account, the metadata PDA and the original edition PDA (a.k.a. the master ...
0 votes
0 answers
15 views

Practical NFT handling in wallets

Each non-native token (all except SOL) needs a dedicated token account to handle it. It means that: either NFT buyer need to inform NFT seller where to send the NFT (in case of HD wallets for ...
  • 113
9 votes
2 answers
254 views

When creating Associated Token Account "Provided owner is not allowed"

I am trying to create associated token accounts for SPL Transfers and I keep running into Provided Owner not allowed. I have never seen this error before and I am checking to make sure the token ...
  • 91
2 votes
2 answers
32 views

Make reading from PDAs private

If I remember correctly, PDA can be found out by anyone who knows the seed, Public Keys and the Program ID related to a Solana program. Is there a mechanism through which no one except the public key ...
  • 250
1 vote
0 answers
50 views

Getting unexpected `TokenAccountNotFoundError` while creating a new Associated Token Account

I am creating an ATA by the following code: export const createAta = async (mint: web3.PublicKey, keyPair: web3.Signer) => { const { connection } = useWorkspace(); try { const ata = await ...
  • 11
0 votes
1 answer
78 views

Test Validator SPL Associated Token Account IncorrectProgramId

I'm running a Solana test validator, and I am using spl_associated_token_account::instruction::create_associated_token_account in a transaction to create an associated token account. The transaction ...
5 votes
1 answer
75 views

How to efficiently transfer NATIVE SOL to a program accepting WRAPPED SOL?

I am writing a program in which the accepted payment MUST be from a token account. Anchor context snippet here: pub struct Payment<'info> { #[account(mut)] pub buyer_token_account: ...
  • 453
1 vote
1 answer
47 views

Freeze Delegated Account Not working in Anchor program

I have been trying to freeze the token account by using freeze delegated account in an anchor program, but no matter what I try its not working. The latest update in my trial gives me 0x39. I can't ...
3 votes
1 answer
87 views

Are new SPL tokens typically transferred from a Mint's token account to a user's Associated Token Account?

I'm trying to mentally put together the relationship between the various types of accounts involved in SPL tokens according to the Solana Cookbook: The cookbook says: This mint account is later used ...
1 vote
2 answers
48 views

Fee payer query

Is it possible to take the token account creation fee from the wallet to which the token will be sent? Would they need to sign the transaction in order to achieve this?
1 vote
2 answers
86 views

dynamic seed generation | seed not getting recognised when passing from frontend/cli

I am following the following tutorial: https://dev.to/findiglay/building-a-blog-on-solana-2pg8 But in the code below it is creating seeds using the value from blog_account. I want to pass some ...
1 vote
2 answers
68 views

How to pay/sign an ATA with a different owner?

I'm trying to learn solana and currently doing NFTs. I'm wondering if it's possible to create an Associated Token Account with an owner that differs from the signer and then mint an NFT to that ATA? ...
  • 25
5 votes
3 answers
233 views

How to create a program that has the authority to mint tokens

Trying to create a program that has the authority to mint tokens to the wallet signing the transaction. However, one of my tests keeps failing with: "insufficient account keys for instruction&...
  • 101
2 votes
1 answer
58 views

Can I withdraw excess SOL from an associated token account?

Hey I have created an associated token account, from my public key but accidentally sent some Sol to it. Is there a way to withdraw the sol from it? Will closing the account withdraw the sol from it? ...
0 votes
1 answer
19 views

What is Owner Validation Program? [duplicate]

I was reading the source code of sollet.io. Whenever they are creating an ATA, they are also calling some instruction of the Owner Validation Program: https://github.com/project-serum/spl-token-wallet/...
1 vote
1 answer
71 views

Which program is this: 4MNPdKu9wFMvEeZBMt3Eipfs5ovVWTJb31pEXDJAAxX5?

I was trying to transfer a token from Wallet 1 -> Wallet 2 using sollet.io on testnet. It showed this error: failed to send transaction: Transaction simulation failed: Attempt to load a program ...
3 votes
2 answers
75 views

Why don't wallets auto-create an associated token account if one doesn't exist?

I have a fake USDC coin that I created on testnet. I minted 100 FUSDC to a token account belonging to Wallet 1. Then tried to send it from Wallet 1 -> Wallet 2 which also reside in my Phantom ...