Questions tagged [spl-associated-token-account]
The spl-associated-token-account tag has no usage guidance.
91 questions
1
vote
2
answers
57
views
Cannot Create an Associated Token Account
I'm not the first to ask a question about this problem, but none of the questions asked were answered. The problem is that I'm trying to create an associated token account to mint an NFT, but the ...
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
52
views
How to received typed getTransaction response with jsonParsed encoding?
Context:
I am using @solana/web3.js 2.0 to invoke the getTransaction RPC method with encoding: "jsonParsed". The transaction is expected to have SPL Token instructions (create, ...
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 ...
2
votes
1
answer
60
views
Spl Tokens deployed with Token 2022 program giving error during ATA creation with Solana/Web3.js
When i try to use methods like createAssociatedTokenAccount, getAssociatedTokenAddress i get error as "incorrect program id for instruction". The token address used her was my spl tokens ...
1
vote
1
answer
35
views
error while executing create token account instruction
const sleeperAccountInstruction = await program.methods
.createNewSleeper("test")
.accountsPartial({
payer: account,
mint: mintPDA,
sleeperAccount: sleeperPDA,
...
0
votes
2
answers
60
views
Close Associated Token Account (token 2022 program) to get back deposited sol
I have created 2 types of Associated Token Account:
1, Use token program: https://solscan.io/tx/3BC6yNwcaandgzSgFX4YP1nYopPLsa9RyRdqi4bDmKLpWsjiRqMKRaQaoZhgbBQpEsMhcFLoZwobKMVZvrLuUi6C
2, Use token ...
0
votes
1
answer
219
views
Is their any API to fetch tranding meme tokens of solana?
I want to fetch all the meme tokens listed on solana network sorted according to the top tranding token first.
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 ...
0
votes
2
answers
34
views
Freeze, Token two-level smart contract
I need to create a token on Solana using a two-level smart contract so that platforms like Dexscreener do not display the alert: "This token is freezable."
Implementation Idea:
First Level: ...
1
vote
1
answer
40
views
how to use spl_associated_token_account in solana_porgram_test?
experiencing error: linking with cc failed: exit status: 1, when I am running ProgramTestContext , like I want to createATAinstruction so that I should have the data in the ata that shows it exists
...
0
votes
2
answers
68
views
Batch Airdrop Spl Tokens
I was working over batch airdrop script.js I found only I can airdrop spl-tokens only to 10 ATA accounts due to this Error: Transaction too large: 1270 > 1232
Is there any approach that helps me to ...
1
vote
1
answer
41
views
When I try to add metadata to my spl token on my Mainnet coin
For some reason when I try adding metadata to my spl token it never works, I’m using the program id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb and when I try to add metadata using my mint address it ...
1
vote
1
answer
36
views
How can I retrieve transactions of an address on a particular contract?
at the moment the only way I know is to get all the address signatures and then use getTransaction. But that is not efficient and I don't think it is the correct way to do it.
Any advice or solution?
3
votes
2
answers
171
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 ...
1
vote
2
answers
115
views
Associated Token Account for seed account?
I know it is technically possible to create an associated token account for a seed account, by setting the seed account as the owner and the allowOwnerOffCurve parameter to true when calling the ...
0
votes
1
answer
83
views
Can i get my tokens i made on my wallet?
I trying make a token according to official document I faced this part
https://solana.com/developers/guides/getstarted/how-to-create-a-token#mint-tokens
Look at picture first i should make an account ...
1
vote
1
answer
280
views
Getting build error: the `#[global_allocator]` in spl_token conflicts with global allocator in: spl_associated_token_account
Earlier I was able to build my solana programs using anchor build but suddenly getting strange error error: the #[global_allocator] in spl_token conflicts with global allocator in: ...
5
votes
1
answer
71
views
({"err":{"InstructionError":[2,"PrivilegeEscalation"]}})
use anchor_lang::prelude::*;
use anchor_spl::token::{Mint, Token, TokenAccount, Transfer};
declare_id!("5L3ky71YgB1rRMbJMxw9iH2vw9A59wZ2krWW7vdwfn61");
#[program]
pub mod hodl_token_lock {
...
1
vote
4
answers
4k
views
How can I get the bonding curve address for a pump.fun token?
I know that I can go through transactions and get the bonding curve address from buy/sell/create functions but I'm wondering if there is a way to do it through account info or something easier? I'm ...
2
votes
1
answer
154
views
Transfer specific token to and from a known account
Given that I have the following program
use anchor_lang::prelude::*;
use anchor_spl::token::{self, Mint, Token, TokenAccount, Transfer as SplTransfer};
declare_id!("...
2
votes
1
answer
36
views
SNS - Retrieve all Domains+Subdomains of an User
The following code is used to retrieve all Sub-Domains of a Public-Key.
const getAllSNSProgramAccounts = async () => {
const accounts = await connection.getProgramAccounts(new PublicKey('...
2
votes
1
answer
145
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
98
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 ...
1
vote
1
answer
588
views
Title: Error -32601 "Method not found" When Calling `getAccountInfo` in JSON-RPC API
I'm encountering an issue with the JSON-RPC API when trying to use the getAccountInfo method. Despite using the correct method structure (as I have successfully used similar structures for other ...
1
vote
0
answers
26
views
Fund associated token account
I am trying to swap SOL to USDC on the devnet. I get this error "Input token account empty". I know that this means that the associated token accounts A and B have to have some funds. I am ...
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
0
answers
427
views
Error: The amm account owner is not match with this program" error
Anyone can help, I am getting Program logged: "Error: The amm account owner is not match with this program" error,. Program returned error: "custom program error: 0x1b" I created ...
0
votes
0
answers
111
views
Fetch trending solana tokens without 3rd party API
GM Buildooors!
What's the optimal approach to fetching on-chain data about trending SPL tokens like we have on platforms like Dextools, Birdeye, Step Finance etc.?
Preferably without the help of 3rd ...
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 ...
0
votes
0
answers
54
views
How to fetch all information about spl token with token address in anchor or in javascript
i want to fetch token information of spl token directly from the solana blockchain . Give some solution to fetch metadata , tokenomics data and security data of spl token .
i want to fetch directly ...
0
votes
1
answer
748
views
Parsing Token Program Transactions
I'm currently working on monitoring the Solana Token Program with the address TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA.
My goal is to filter out specific events, namely Token Mints, Token Burns, ...
1
vote
0
answers
38
views
Sending transaction working locally but not on production
transaction.add(
SystemProgram.transfer({
fromPubkey: publicKey,
toPubkey: new PublicKey(
"wallet here"
),
lamports: 0.0069 * 10 ** 9,
})
);
const {
...
1
vote
1
answer
284
views
spl-token-cli: how to fix this error
$ spl-token transfer --expected-fee 0.000005 ++m+++++++++++++++++2u++ 100000 destination.json
Transfer 100000 tokens
Sender: ++zt++++++++++++++++++Dw++
Recipient: ++LN+++++++++++++++++++75++
**...
2
votes
2
answers
458
views
Cross-program invocation with unauthorized signer or writable account. (I can't understand where I went wrong)
I am trying to call the create_associated_token_account function in my solana program. but I can't figure out what I am doing wrong.also when I run my program with my client, I get the error "...
1
vote
1
answer
351
views
How can I get metadata for newly minted tokens?
I'm trying to fetch metadata for newly minted tokens (SPL, not NFTs) and unable to get a lot of data apart from decimals, mint_authority etc, I'd like to get the Name, Picture of the token along with ...
0
votes
0
answers
400
views
Token registration
I would like to register a token, as currently seeing a warning ⚠️ sign in in the wallet. Also on one of the token scans. And can not find tokens within other wallets. It just doesn't show up by ...
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::*,
...
0
votes
1
answer
116
views
Multiple ATAs for the same mint
I've created a Python script that creates a wallet and monitors all SPL transactions of this wallet.
Using an example to illustrate the problem:
The generated public key belongs to account A with ...
1
vote
1
answer
107
views
Funding Native Mint: Sum of account balances before and after instruction do not match
I'm trying to fund a Native Mint token Account from a PDA and then Sync it like so.
**(funder.try_borrow_mut_lamports()?) -= excess_sol;
**(wrapped_sol_escrow.try_borrow_mut_lamports()?) += ...
1
vote
2
answers
421
views
Getting error while minting token to an account "Transaction simulation failed: Error processing Instruction 0: invalid account data for instruction"
My mint test cases are failing and I am clueless where it is going wrong
pub fn mint(ctx: Context<MintToken>, params: MintTokenParams) -> Result<()> {
// Check user balance ...
1
vote
1
answer
90
views
Can you retrieve funds of an ATA owned by another ATA?
I created a USDC ATA and was accepting funds there.
I closed the ATA and recouped the SOL. This means the ATA's owner became the System Program instead of the Token Program.
Finally, someone sent ...
0
votes
0
answers
49
views
Best advice for fixing spl-token in production
After creating and minting an spl-token, I moved all assets to a new wallet and authorized mint for metadata changes, i assumed wrong. Then ran the close command on the original minting wallet.
My ...
0
votes
0
answers
332
views
How can I fetch all the newly minted SPL tokens in real-time?
Can someone confirm whether all recently created SPL tokens originate from the same source protocol/contract, such as TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA?
If not, could you please provide ...
2
votes
2
answers
730
views
Making existing token immutable
How can I change an existing token I created from mutable to immutable? I want to change this on an SPL token would appreciate any help!
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 ...
3
votes
1
answer
363
views
How to Access SPL-Token ATA Account Inside a Program for Burning
I'm creating a Token-2022 token with a transfer hook that burns some of the token on transfer. However, the token I want to use I want to create in the CLI. However, in order the burn a token, I need ...
0
votes
3
answers
948
views
Is it possible to have reflection tokens like safemoon on solona?
A reminder on how reflection tokens like safemoon work is every ones balance is simply an equation instead of a fixed number. That way everyone's balance can be instantly updated with no gas needed ...