All Questions
Tagged with spl-associated-token-account associated-token-account
22 questions
0
votes
1
answer
29
views
Buy using TokenAccount with init errors on second call with "Provided owner is not allowed"
I have a buy instruction for a token which initializes the user's token in the context and it runs absolutely fine the first time I run / call it. But on subsequent calls I get the following error:
...
3
votes
1
answer
12
views
The case for accepting ANY valid ATA in your instruction, no matter what its authority is
Sometimes, your program doesn't care about the authority of the input ATA, as long as the ATA has the correct/valid Mint.
One such case is when you simply want to transfer some tokens to a recipient's ...
1
vote
1
answer
79
views
getOrCreateAssociatedTokenAccount fails all the time when Solana is under load
As part of the onboarding process for my project, I create wallets for users.
These wallets are fully onboarded to my game and are prefunded with the games native token. Users literally click 1 button ...
0
votes
1
answer
38
views
How to enter associated token address in solana playground?
I was following a youtube tutorial to mint nft tokens on solana playground. I wanna add Associated token address. In this tutorial there was an option to generate this using the owner account and mint ...
3
votes
2
answers
172
views
getAssociatedTokenAddressSync returns different token account address than the one in solscan
I am trying to get token accounts from mint and owner address.
Mint : 7HR9uH1QgDS53GfzoNgG9jieKVY1FARN1oYDQyZ63X4y
Owner: GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL -> Raydium LP Token
Token ...
2
votes
1
answer
146
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 { ...
2
votes
2
answers
538
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 ...
1
vote
1
answer
99
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 ...
0
votes
0
answers
33
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 ...
1
vote
1
answer
97
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 ...
2
votes
2
answers
458
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::*,
...
1
vote
1
answer
221
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 ...
2
votes
2
answers
460
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 ...
0
votes
2
answers
513
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 ...
0
votes
2
answers
61
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 ...
1
vote
3
answers
631
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 ...
2
votes
1
answer
552
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?
2
votes
1
answer
178
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 ...
2
votes
1
answer
918
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, ...
2
votes
2
answers
627
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, ...
0
votes
1
answer
37
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
4k
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:...