Questions tagged [spl-associated-token-account]

Filter by
Sorted by
Tagged with
1 vote
1 answer
28 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?
  • 111
0 votes
1 answer
42 views

Token-2022 extension enforcing immutable owner

I have a use case to assign a new owner to an associated token address (ATA) after it has been created. Having tried this against a local node I was met with an error saying that I could not change ...
3 votes
2 answers
215 views

Is it possible to make an ATA in one instruction, then use that created ATA in the next instruction, in a single transaction?

This is similar to Can I Create an Account and Transfer Tokens in the same Transaction? but the 'answer' to that question doesn't actually show how to use the token account created in the first ...
3 votes
1 answer
43 views

How can I use `instruction::recover_nested`?

I have a Solana account with a USDC associated token account (PDA), and within that, a nested USDC associated token account (PDA). I'd like to recover all the USDC and close the nested account. I see ...
  • 133
2 votes
1 answer
46 views

Sending USDC dev token not working until recepient wallet has >0 value of said token

I am trying to send usdc dev token using code to a wallet address but it kept on showing "Unable to simulate. Make sure you trust this website since approving can lead to loss of funds." And ...
2 votes
1 answer
60 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 ...
  • 111
1 vote
1 answer
51 views

How do I transfer the SOL on my token account?

I have a token account (example: https://solscan.io/account/3HJdseEK7G8cDEcDQPNmt5z1TuVb5AjCPxvqJCpkskbQ?cluster=devnet) and accidentally sent some SOL to it. I want to transfer this out to my SOL ...
  • 11
2 votes
1 answer
72 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
1 vote
1 answer
56 views

SPL TOKEN recognized as NFT instead of a regular token

I created a spl-token using strata protocol and it is being recognized as NFT on my wallet, even on solscan it is not showing similar to any other token. I found that maybe i would need to pull a ...
  • 11
2 votes
1 answer
59 views

Explanation for two token accounts for one owner?

These two token accounts have the same mint and owner. https://explorer.solana.com/address/2xPnqU4bWhUSjZ74CibY63NrtkHHw5eKntsxf8dzwiid https://explorer.solana.com/address/...
  • 31
2 votes
1 answer
120 views

TypeError: Cannot read properties of undefined (reading 'createInitMintInstruction')

I am getting this error. TypeError: Cannot read properties of undefined (reading 'createInitMintInstruction') I dont know where and how it went wrong. Appreciate the help. await program.rpc.mintNft({ ...
0 votes
1 answer
76 views

Error: Signature verification failed with PDA when transferring SPL token

I have been figuring this one out for a few days. Appreciate the help. I want to be able to send the tokens from the PDA ATA to the user who is removing his vault.\ This is the error I am getting: ...
2 votes
1 answer
256 views

TokenAccountNotFoundError when sending SPL tokens in React

When I try to send my SPL tokens I get this error: OrderRow.js:72 TokenAccountNotFoundError at unpackAccount (account.ts:170:1) at getAccount (account.ts:103:1) at async ...
  • 21
1 vote
2 answers
78 views

How can I recover SPL tokens from an account that is nested inside another ATA account?

We have a Kin account that is nested under a USDC account. We have 2 USDC accounts, and the Kin is nested under a USDC account [1] that wasn’t created by the Associated Token Account program [2], ...
  • 11
0 votes
1 answer
19 views

I sent Solana to an SPL token account on accident not realizing it can’t pay the fee to transfer it back - how to u retrieve? I have private key

How do i do this? Do i need to write a program? Is there an existing repo than can be cloned and run? I have tried using CLI in a terminal but haven’t had any luck.
  • 1
0 votes
2 answers
168 views

Can you send Custom tokens and NFTs to a PDA account?

I have used PDA account to send and receive sol, now I want to send spl token to PDA Account. What is the implementation for that?
  • 361
1 vote
1 answer
93 views

How to create Associated token Account onchain

Please help i'm trying to create an Associated token account for a PDA onchain using let create_accounts = Create { payer: ctx.accounts.signer.to_account_info().clone(), ...
  • 306
1 vote
1 answer
41 views

Why is AssociatedToken Program not needed when using associated_token constraint in anchor?

I wrote a piece of code that uses associated_token::mint and associated_token::authority and I passed the Token Program but did not pass the Associated Token Program. Considering All Accounts must be ...
1 vote
1 answer
124 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
0 votes
1 answer
281 views

Error: failed to get accounts owned by program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA excluded from account secondary indexes; this RPC

I am trying to find all the token accounts that belong to a specific wallet address however i keep getting this error: Error: failed to get accounts owned by program ...
0 votes
0 answers
26 views

Solana Sending SPL-Token Transaction

I am trying to send a transaction through a DAPP. I am using solana wallet adapter to connect to my wallet. Once my wallet is connected to my app, here is the method that is called.`` const sendNFTs = ...
2 votes
1 answer
53 views

Trying to send specific SPL Token but creates new token instead

I'm trying to send a SPL Token but when I execute the code below it creates an unknown token and sends it, It does not recognize the token address / programID. Where should I pass the token address? ...
0 votes
1 answer
27 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 ...
3 votes
2 answers
824 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
45 views

Error processing Instruction 0: custom program error: 0x12

I am getting this error when trying to do an SPL token transfer. Solana Docs makes it seem as if this is a 'Frozen Account' error. I am not sure why the account of the sender or the newly created ...
6 votes
2 answers
113 views

Looking for implementation example of anchor_spl::token::initialize_account

I want to use the initialize_account function from anchor_spl::token. The function is given below: pub fn initialize_account<'a, 'b, 'c, 'info>( ctx: CpiContext<'a, 'b, 'c, 'info, ...
  • 379
2 votes
1 answer
51 views

Solana can't mint to a different token account

Folks, I'm starting with Solana and it's been rough to learn. Despite the poor error messages and the learning curve of Rust, I'm making my way through it. I'm trying to develop a new token that will ...
0 votes
0 answers
22 views

(Rust) React on events when users balance changes for a given token

I want to react to events in my backend (written in Rust), whenever the user balance changes for a given token, I need to perform some calculations. I know the SPL token address I need to get all of ...
0 votes
1 answer
40 views

Amount not showing in wallet for spl-token transfer

I am working on some code to transfer some spl-tokens from a user connected wallet. But when I send the transfer instructions, the amount does not show up in the wallet for user approval; and ...
1 vote
2 answers
67 views

how to get owner of token account

I'm using solana-py and trying to get the owner of an associated token account. I have gotten the associated account address like this: from solana.publickey import PublicKey from solana.rpc.api ...
  • 33
0 votes
0 answers
37 views

How to Transfer thousand NFTs via command line?

Thousands of NFT's need to go from one wallet, to multiple other wallets. Can this be done via CLI? I'm thinking of automating this via bash script. Is there a single command I can use that handles ...
1 vote
3 answers
263 views

Failing to create associated token account in rust tests. It says insufficient account keys for instruction

https://github.com/SushantChandla/test-mint-bug/blob/main/programs/mint-bug/tests/mint.rs I am trying to create an associated token account please have a look at the github file. The error I get is ...