Skip to main content

Questions tagged [associated-token-account]

The tag has no usage guidance.

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

How to set contract ATA's authority to my program

I know how ATA and PDA works. I know that an ATA is a PDA, and so the account which the PDA was derived from is the one that can sign transactions for this PDA. So, I assume that a contract's ATA's ...
Nathan's user avatar
  • 177
2 votes
1 answer
44 views

Unable to use getOrCreateAssociatedTokenAccount for accounts that don't have the token

I am using the wallet-adapter-react with spl-token and web3.js libraries. I can send an SPL token to an account that already holds it, but I cant seem to send anything to an account that was just ...
Poot Coin's user avatar
0 votes
1 answer
113 views

How to create a solana token staking program with @solana/spl-token?

I need to create a spl token staking program with the following logic: The token owner stakes the spl-tokens We save the price at which tokens were staked off chain The user can only withdraw tokens ...
Anas's user avatar
  • 41
2 votes
1 answer
82 views

Creating a new Associated Token Account is 10 times more expensive than expected

I have two questions. import { createAssociatedTokenAccount } from "@solana/spl-token" import { Connection, Keypair, PublicKey, clusterApiUrl } from "@solana/web3.js" import { ...
Ariel's user avatar
  • 21
1 vote
1 answer
76 views

Why do we close WSOL Token Program accounts?

Background: If I understand correctly: During transactions where we transfer SOL to/from wallets, we need to wrap the SOL in a temporarily created WSOL Token Program account. Then use that to transfer ...
Joe's user avatar
  • 123
1 vote
1 answer
29 views

Problem with associated token account of a mint account which initialized using Token2022

I have a mint account created from this script which utilizes Token2022 Program: Solana playground.. Now I am trying to create an ATA(Associated token account) by passing the mint account and user's ...
Rishabh Jamwal's user avatar
1 vote
2 answers
56 views

How to Display Custom Balance of an SPL-Token without Associated Token Account?

I'm in the process of migrating a rebasing token from EVM to Solana. The rebasing of the token is achieved by using a rate multiplier modified by an oracle. In order to acomplish this a custom ...
Juan Cruz Arancibia's user avatar
1 vote
1 answer
60 views

seeds do not result in a valid address javascript

async function ata() { const secretKey = Uint8Array.from(JSON.parse(process.env.PRIVATE_KEY)); const keypair = Keypair.fromSecretKey(secretKey); const owner = new PublicKey(keypair.publicKey); ...
Roomka's user avatar
  • 47
0 votes
0 answers
15 views

how to write spl-associated-token-account this kinda instruction by solana/web3js?

https://solscan.io/tx/4s48QaCiKj6PwdCH1QjgAEfpoWFNEjv84puH8KMYxvHGqyxiCTMzmzVHafhqx8KW9ATXBhki5vXjGukrY5Z1kMPB this tx assign a new generate account to a program and create a token account under this ...
noel yous's user avatar
0 votes
0 answers
23 views

Accidentally sent tokens to Associated Token Account Program ID

I made a mistake and accidentally sent my tokens directly to the Associated Token Account Program ID: ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL. I understand that this is a program ID and not a ...
Syntax Surge's user avatar
0 votes
2 answers
47 views

How to determine the cost of creating an associated Token Account

Using getOrCreateAssociatedTokenAccount is there a way to determine the cost associated with opening a new Associated Token Account? The function returns an Account.
Ariel's user avatar
  • 21
0 votes
1 answer
30 views

Who gets to create token associated accounts on Solana?

I understand the differences between token mint accounts and token associated accounts. As I'm building a web-app allowing people to mint spl tokens on our website, we are facing a question about who ...
Maxareo's user avatar
  • 101
0 votes
1 answer
20 views

How to filter most recently created pdas of a program

How to filter most recently created pdas of a program, How should date be store in pda data so that we can directly filter based on the data stored in pda. For ex. filtering all pda of a program ...
ashish0411's user avatar
0 votes
0 answers
75 views

Transaction cost associated with Creating a new Associated Token Account ~10X higher than expected

I am creating a new SPL Token, and creating Associated Token Accounts for two wallets. The documentation indicates that the cost of creating a new Associated Token Account is ~0.00204428 Sol ($0....
Ariel's user avatar
  • 21
1 vote
1 answer
55 views

Minting a Fungible SPL token to same ATA (more than 1 time) always fails

I'm pretty new solana ecosystem and have been following multiple tutorials on minting Fungible SPL tokens. On all the tutorials, you create a Mint and ATA and the then the first time the mint ...
newbreedofgeek's user avatar
4 votes
2 answers
137 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
22 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
1 vote
0 answers
33 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
  • 31
1 vote
0 answers
377 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
218 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
1k 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
1k 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
  • 111
0 votes
3 answers
855 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
  • 111
2 votes
1 answer
402 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
111 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
132 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
276 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
  • 392
0 votes
2 answers
344 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
467 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
43 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
  • 159
1 vote
3 answers
336 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
  • 159
4 votes
2 answers
2k 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
  • 2,091
4 votes
2 answers
317 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
212 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
2 answers
2k 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
249 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
575 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
  • 153
1 vote
1 answer
357 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
  • 159
1 vote
2 answers
210 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
67 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
318 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,456
4 votes
2 answers
850 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
  • 4,150
1 vote
1 answer
192 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,456
3 votes
1 answer
69 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
  • 183
2 votes
1 answer
135 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
  • 159
2 votes
1 answer
1k 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
729 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
65 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
198 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
622 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
  • 2,091