Questions tagged [associated-token-account]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4 votes
2 answers
55 views

Why do some token accounts own themselves?

I was under the impression that accounts owned by users owned a set of token accounts which each represent one distinct token that they own - meaning token accounts would only be owned by a user. For ...
xxl's user avatar
  • 43
0 votes
0 answers
15 views

Please I mistakenly copied my Associated Token Address and sent USDT SPL to it instead of the normal USDT SPL address worth$9.4 Please help

Good morning, please I mistakenly copied my Associated Token Address and sent USDT SPL to it instead of the normal USDT SPL address worth$9.4 Please what can i do to recover it. Thanks
Nielz's user avatar
  • 1
0 votes
0 answers
23 views

How to complete withdrawal on tokenswap program InstructionError: [ 0, { Custom: 24 }

Keypair, LAMPORTS_PER_SOL, PublicKey, SystemProgram, Transaction, TransactionInstruction, sendAndConfirmTransaction, } from "@solana/web3.js"; import BN from "bn.js"; ...
Mark's user avatar
  • 21
1 vote
0 answers
135 views

how to work sniper bots [closed]

please explain me how sniper bots work in solana. i am interested in their logic of operation. how does it work? the bot finds a coin, but the trading pair may not appear immediately. What does the ...
john mlan's user avatar
2 votes
2 answers
102 views

InterfaceAccount<'_, TokenAccount> fails to create Associated Token Account

I have basic instruction, all it does is create an ATA for a user (mint is already initialized), this is what my context looks like // lib.rs use { crate::constants::*, crate::states::*, ...
Isaac Frank's user avatar
0 votes
1 answer
199 views

For recent created Liquidity pools on Raydium, getTokenAccountBalance returns an error

I'm using hellomoon.io data streaming to know when a new Liquidity Pool is created (on Raydium for any pair that has SOL in it), when one is created I want to check how much liquidity in USD it has. ...
shackra's user avatar
  • 105
3 votes
1 answer
127 views

Parse transactions in human readable format

How can I convert the data to the same form as it is done on the solana explorer for better readability?
slntrx's user avatar
  • 97
0 votes
2 answers
203 views

how to find a new token in the block

I searched for a similar question but couldn't find one. So, I get the last block, then inside this, block I parsing all transactions. My task is to find information that a new token has been created. ...
slntrx's user avatar
  • 97
2 votes
1 answer
97 views

SPL token account creation and airdrop

I created a spl-token and I want to let users claim airdrops from my website. My current implementation in short: Calculate associated token account Check if the token account exist If not, create ...
Amos Wu's user avatar
  • 23
2 votes
2 answers
55 views

How many PDA accounts can I create? Is it unlimited?

I am going to store huge number of record for my on-chain program. Each record's size is small (likely 100Bytes), but need to store many(maybe millions) records on-chain. From what I have known ...
breeze wang's user avatar
1 vote
1 answer
58 views

Ways to fetch ATA account in typescript?

I have the following code that works fine with PDAs. const escrow_pda = PublicKey.findProgramAddressSync([Buffer.from("escrow"), fundraiser.publicKey.toBytes()], program.programId)[0]; const ...
WowBow's user avatar
  • 135
2 votes
2 answers
102 views

What does the get_associated_token_address()] function return if the associated token addresshas not yet been create?

What does the get_associated_token_address() function return if the associated token addresshas not yet been created (function create_associated_token_account() has not yet been executed) ? use ...
Leo Loki's user avatar
  • 362
0 votes
2 answers
129 views

How can I create an Associated Token Account for USDC on my Solana wallet?

I have a Solana wallet (on testnet) and I read that ATAs are automatically created for the wallet once any other token aside Solana is sent to the wallet. I tried sending some test USDC to my solana ...
Ugwu Hilary's user avatar
0 votes
1 answer
185 views

Getting frozen account when trying to transfer NFT for created ATA

Im getting frozen account when trying to transfer some NFTs from a recently created ATA: I create the ATA in the same transaction that im sending the NFT for , and getting this error:
ZuckOFB's user avatar
0 votes
2 answers
38 views

Can assosiated addresses be generated on an account with no SOL on it?

Let's say, I've generated 1000 accounts manually, via code. I also want to generate USDT and USDC addresses for each of them. Then I'll give them to the users of my service for them to send USDT and ...
Camila326's user avatar
  • 149
1 vote
3 answers
136 views

Do I have to explicitly create a USDC account to be able to receive USDC coins?

I have a Solana (#1) and USDT (#2) adddresses on the same account. I have some USDT coins in it. There's no USDC, though. I've already sent some USDC to the #1 in testnet, from a faucet, but none of ...
Camila326's user avatar
  • 149
3 votes
2 answers
838 views

What is the difference between a Token Account and an Associated Token Account?

The docs mention both 'Token Account' and an 'Associated Token Account'. Are 'Token Account' and 'Associated Token Account' the same thing, or different? What is the relationship between these two?
mikemaccana's user avatar
  • 1,650
4 votes
2 answers
212 views

Can I create an ATA of PDA account?

I get this error: "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL invoke [2]", "Program log: Create", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]...
Abhishek Faliya's user avatar
0 votes
1 answer
136 views

I have a question about token 2022 program with migration

I wonder what happens to the existing ATA if I migrate from the existing token program to the token 2022 program. If the migration is completed, can't use the existing ATA (before migration) If the ...
jeong's user avatar
  • 23
0 votes
0 answers
172 views

Frozen Token Account when sending nfts to an address

I've recently tried to transfer 3 nfts from 3 different collections on 2 different days to a address. Each time when I've tried transfering them I got 0x11 custom program error. From what I've ...
Andrei Rohatin's user avatar
0 votes
2 answers
889 views

SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: incorrect program id for instruction

I am trying to create associated token account. Token mint works fine. The error is thrown when trying to create token account. Here's the code: async function mintToken( connection: web3....
denimcodes's user avatar
0 votes
0 answers
167 views

Solana rent account questoin

I have a question. If I hold solana token on my wallet - do I need to pay a rent for my account on chain ? I've red official documentation and I see that there is a garbage collector in solana chain ...
Andriy Vasyltsiv's user avatar
1 vote
2 answers
333 views

How can I freeze only some tokens in an account?

The SPL token program has support for a freeze/thaw authority where the authority can block any transaction involving a given account. How can I lock only some tokens in an account? E.g. a token ...
lameren's user avatar
  • 133
1 vote
1 answer
118 views

Is gas or fees required for creating an assosiate token account?

Is gas or fees required for creating an assosiate token account? Or can it be created without any gas?
Camila326's user avatar
  • 149
1 vote
2 answers
97 views

Associated Token Account address not correct?

I'm trying to access this associated token account: https://solscan.io/account/DizwsnTVoLCXskwqLMxYCaLqssrArUP2NRQb7dHzDprb via the following code: const token = new PublicKey("...
Thud's user avatar
  • 41
2 votes
1 answer
47 views

can i transfer the token directly to the publickey?

I save a list of pubkeys I need to transfer tokens to, can I pass it directly in a smart contract or I will have to generate ATA from the client to handle this? thank you. I try: let transfer_ix = ...
Hieu Tran's user avatar
0 votes
1 answer
218 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 ...
Burger Bob's user avatar
  • 1,256
4 votes
2 answers
532 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 ...
Ahri's user avatar
  • 2,393
0 votes
1 answer
116 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 ...
Burger Bob's user avatar
  • 1,256
3 votes
1 answer
62 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 ...
LAUR_NASA's user avatar
  • 173
2 votes
1 answer
108 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 ...
Camila326's user avatar
  • 149
2 votes
1 answer
714 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 ...
Brijesh Lukhi's user avatar
2 votes
1 answer
383 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, ...
Kum's user avatar
  • 107
2 votes
0 answers
58 views

TokenNotFoundError using getAssociatedTokenAddress() on MKRS NFT [closed]

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. ...
incog's user avatar
  • 567
3 votes
1 answer
143 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()], ...
Abdullah Qureshi's user avatar
4 votes
1 answer
353 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 ...
mikemaccana's user avatar
  • 1,650
3 votes
1 answer
433 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(...
Mahesh Ghamaand's user avatar
1 vote
2 answers
46 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 ...
sayantank's user avatar
  • 425
1 vote
1 answer
54 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 ...
Noe Trejo's user avatar
2 votes
2 answers
802 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 ...
Noah's user avatar
  • 63
2 votes
2 answers
241 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, ...
Michael's user avatar
  • 308
2 votes
0 answers
428 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 ...
mcshell's user avatar
  • 205
3 votes
1 answer
587 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 ...
devMonster's user avatar
0 votes
1 answer
32 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 ...
Sumit Ghosh's user avatar
0 votes
1 answer
389 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-...
OCDev's user avatar
  • 712
1 vote
1 answer
120 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 ...
OCDev's user avatar
  • 712
1 vote
0 answers
72 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 ...
Zantetsu's user avatar
  • 136
0 votes
1 answer
81 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 ...
OCDev's user avatar
  • 712
3 votes
2 answers
2k 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:...
Sebastian Dine's user avatar
2 votes
1 answer
25 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?
user2028's user avatar