Skip to main content

New answers tagged

0 votes

how to get owner of token account

request = requests.get(f"https://public-api.solscan.io/token/holders?tokenAddress={hash}&limit=1&offset=0") request = request.json() owner = request["data"][0]["owner&...
Văn Lâm Nguyễn's user avatar
0 votes

TokenAccountNotFoundError when sending SPL tokens in React

I use createAssociatedTokenAccountIdempotent for instead and it works createAssociatedTokenAccountIdempotent(provider.connection, payer.payer, mint, payer.publicKey, {}, TOKEN_2022_PROGRAM_ID);
yuan wang's user avatar
2 votes

({"err":{"InstructionError":[2,"PrivilegeEscalation"]}})

Try this in withdraw_tokens function:- let bump = &[ctx.bumps.pda_signer]; let binding = ctx.accounts.mint.key(); let signer_seeds = &[&[b"sale", binding.as_ref(), ...
Aditya's user avatar
  • 157
1 vote

SNS - Retrieve all Domains+Subdomains of an User

This is correct in all cases -- domains also have the owner written after 32 bytes. Here's the only data used for SNS accounts: https://github.com/solana-labs/solana-program-library/blob/...
Jon C's user avatar
  • 15.6k
1 vote

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

If you're using @solana/spl-token, you can get the amount required to create a token account using getMinimumBalanceForRentExemptAccount https://github.com/solana-labs/solana-program-library/blob/...
Jon C's user avatar
  • 15.6k
3 votes
Accepted

Transfer specific token to and from a known account

This looks okay, What I would add is checking whether the holding account to_ata is initialized, If it's not you could use anchor associated_token constraints #[derive(Accounts)] pub struct ...
Jimii's user avatar
  • 3,270

Top 50 recent answers are included