Skip to main content

Questions tagged [spl-token-program]

Filter by
Sorted by
Tagged with
1 vote
1 answer
556 views

What SPL Token Program should I use, Token or Token2022?

I would like to create my own SPL token. However, I'm not sure which program is the best one to use since Token2022 is very new. Can you help me choose the best or right one?
Caroline's user avatar
2 votes
2 answers
862 views

Using @solana/spl-token-swap package on devnet

I'm following along with this site https://www.soldev.app/course/token-swap. However, there seems to be a version difference in the use of TokenSwap.withdrawAllTokenTypesInstruction: I'm using the ...
MONO's user avatar
  • 51
0 votes
1 answer
158 views

what the numbers in the array indicate?

I work with decoding data. I use the @solana/spl-token package for that. sometimes I get the TokenInvalidInstructionKeysError error I have this code ts. as keys I provide an array of keys that I have ...
slntrx's user avatar
  • 131
1 vote
1 answer
385 views

where to get information about isSigner and isWritable from the transaction data?

in the package @solana/web3.js there is such type AccountMeta /** * Account metadata used to define instructions */ type AccountMeta = { /** An account's public key */ pubkey: PublicKey; ...
slntrx's user avatar
  • 131
0 votes
0 answers
198 views

How to use "spl-token set-transfer-fee" CLI function in JS?

I noticed there is CLI function in SPL-token library for setting transfer fee but this function is missing from javascript SDK. CLI: https://github.com/solana-labs/solana-program-library/blob/master/...
LubWn's user avatar
  • 33
1 vote
0 answers
465 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
4 answers
6k views

how to decode data instructions with javascript

upd: https://docs.solana.com/developing/programming-model/transactions#instruction-data here, my task is to decode this data using js I tried to solve the issue with this post How to get Solana ...
slntrx's user avatar
  • 131
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::*, ...
Isaac Frank's user avatar
2 votes
1 answer
4k views

How do I get real-time information about new created tokens on Solana?

So guys, I followed this question How do I get real-time information about newly created tokens on Solana?. I configured a helius hook that monitors the token program at the address ...
slntrx's user avatar
  • 131
3 votes
1 answer
394 views

How to take a snapshot of Token2022 holders?

How to take a snapshot of all holders of a Token2022? I get an output of 0 require('dotenv').config(); const fs = require('fs'); const path = require('path'); const {PublicKey, Connection} = require('@...
David Dacruz's user avatar
2 votes
2 answers
3k views

How to swap SPL token using Raydium Liquidity Pool V4

Please let me know how to swap SPL token using Raydium Liquidity Pool V4. I need sample code. Please help me.
anders nielsen's user avatar
1 vote
0 answers
109 views

How to update Token2022 transfer fee? [duplicate]

Hello I would like to know if it's possible to update the transfer fee for a Token2022 using @solana/web3 or any other way I've been looking all I i can find is the ...
David Dacruz's user avatar
4 votes
1 answer
2k 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
  • 131
0 votes
3 answers
1k 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
  • 131
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 ...
theb's user avatar
  • 3
3 votes
1 answer
408 views

Transfer Hook: Not backwards compatible with common wallets

As far as I understand from documentation all the Token-2022 extensions should be backwards compatible with normal transfers from spl-token standard. However when testing Transfer Hooks I was only ...
LubWn's user avatar
  • 33
0 votes
1 answer
333 views

Getting Transaction simulation failed: Error processing Instruction 0: custom program error: 0x6, while creating permanent delegate

My instruction for creating permanent-delegate is invoke( &initialize_permanent_delegate( &ctx.accounts.token_program.key(), &ctx.accounts.mint_account.key()...
blackhorse's user avatar
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 ...
user7659's user avatar
1 vote
2 answers
623 views

Mint Token as a PDA via SPL

I'm converting my custom SPL token anchor program from using mint token as a newly generated anchor keypair, to using a PDA instead. It seems that SPL can take either a keypair or PDA for the mint ...
AceGravity's user avatar
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 ...
ReDNeQ's user avatar
  • 1
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 ...
Abdullah Aftab's user avatar
1 vote
2 answers
8k views

How to calculate token prices from LP pairs using `getTokenAccountBalance`?

I want to reference this post: https://solana.stackexchange.com/a/518/7486. I am trying to achieve the same as OP of that post. I want to fetch the price of a token. One response (the one I referenced)...
Eric Goerens's user avatar
1 vote
1 answer
306 views

Is this a standard SPL token?

I'm looking to deploy a new SPL token, hopefully with more custom features. This was some code I scraped together for a standard SPL fungible token. Do you see any issues with it? I'm doubting myself ...
AceGravity's user avatar
0 votes
1 answer
165 views

TokenAccountNotFoundError

I am a new developer trying to learn and dive into the Solana ecosystem. I'm currently trying to complete this lab: https://www.soldev.app/course/token-program. I'm on step 2 of the lab, where you ...
kapforty's user avatar
2 votes
2 answers
731 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!
Tony's user avatar
  • 21
1 vote
0 answers
269 views

5 questions from a newbie about token2022 [closed]

I created a token2022 with Spl token cli (windows) can i add a logo to this How should I technically proceed to add it to any exchange? Transaction History "Executable: No " " Current ...
Ali's user avatar
  • 11
1 vote
1 answer
145 views

Can a solona token contract handle two tokens instead of one?

I wanna create a solona token that awards people with a 2nd token to their account if they buy during a certain condition. is it possible to create such a token in solona?
OPP's user avatar
  • 11
1 vote
1 answer
338 views

Block tokens on someone else's address

I'm looking for a way to block tokens created on the Solana blockchain. Ideally I would like to do this using Python. Please provide code samples. Situation: I need to block an account that has my ...
Atr118's user avatar
  • 21
0 votes
1 answer
248 views

How to transfer large number of SPL tokens?

pub fn transfer<'info>(ctx: CpiContext<'_, '_, '_, 'info, Transfer<'info>>, amount: u64) -> Result<()> The above code is the method defenition used in rust to transfer SPL ...
Aravind Makam's user avatar
2 votes
1 answer
624 views

Does token-2022 allow selling fees instead of a basic transfer fee?

I understand now that the token-2022 standard allows transfer fees but does this also allow a fee that only enforces itself when the coin is being sold just like on Ethereum.
lolswag's user avatar
  • 21
2 votes
1 answer
744 views

"Program log: Instruction: GetAccountDataSize", "Program log: Error: IncorrectProgramId", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA

Based on reading [https://github.com/solana-labs/solana-program-library/blob/master/token/program/src/instruction.rs#L426][1] It looks like the Token program does in fact have GetAccountDataSize so I ...
dirtyzero's user avatar
1 vote
1 answer
600 views

Confused about Tokens

I am very new to Solana and am going through the Bootcamp on SOLANA YT channel. Can someone explain me what are tokens? Why do we need tokens? What is Mint? How is SPL different from SOL?
rossexotic's user avatar
3 votes
1 answer
114 views

Metaplex Transfer pNFT failing

I am trying to transfer a pNFT via an anchor program, but it is failing at the TokenProgram. Logs below
Jimii's user avatar
  • 7,712
3 votes
1 answer
482 views

How to get Mint Address of of SPL token using associated token account? without rpc call

I can get an associated token account knowing the mint address and wallet address with spl_associated_token_account::get_associated_token_address function But is it possible to get a mint address, ...
Scott's user avatar
  • 33
0 votes
1 answer
287 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
3 votes
1 answer
188 views

Token Rewards Calculation and Distribution

I'm doing a script to calculate rewards for a handful of addresses (from sensors). The script runs weekly where it takes a bunch of addresses from our DB, cleans the data and calculates the associated ...
witwiki's user avatar
  • 61
0 votes
1 answer
234 views

TokenAccountNotFoundError with getOrCreateAssociatedTokenAccount Typescript

I am trying to simulate minting 100 tokens to a wallet address and when I start the program, I get thrown this error: TokenAccountNotFoundError This is the typescript code for creating the token ...
kattyd's user avatar
  • 1
2 votes
1 answer
665 views

JSON RPC get all SPL token holders during specific time

I am trying to get all the holders of a specific SPL token during a specific time. I get the Error: {'code': -32010, 'message': 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA excluded from account ...
4 1's user avatar
  • 121
2 votes
1 answer
6k views

How to set token tax fee?

In certain tokens on others blockchains, people who are selling/buying/transferring the tokens will be hit by a 10% or more penalty tax fee on the transactions set by token creator. Some of the ...
overdeveloping's user avatar
2 votes
1 answer
820 views

SendTransactionError: failed to send transaction: Transaction simulation failed: Attempt to debit an account but found no record of a prior credit

SOL token has been airdropped successfully on the generated payer address. Still I am getting the above error. Here's the code: import * as spl from "@solana/spl-token"; import * as web3 ...
denimcodes's user avatar
0 votes
0 answers
106 views

Is there a Solana program that can facilitate the sale of an NFT to the highest bidder?

There is a use case where an NFT might be available in an auction where multiple bidders compete with SOL to win the NFT when the auction time expires. However, if an application is designed to trust ...
OCDev's user avatar
  • 782
0 votes
2 answers
86 views

Show USDC price of NFT in phantom wallet using Metaplex JS SDK Candy Machine V3

I built a V3 candy machine using metaplex sdk and have my collection payment in USDC instead of Sol. The price of the NFT doesn’t appear in phantom wallet during mint approval. Is there something I ...
Miles's user avatar
  • 1
1 vote
2 answers
664 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
  • 173
3 votes
2 answers
407 views

How to get the Collection's public key out of certain NFT in Anchor

How can I find out the Collection's public key of some NFT in Anchor? I know it was easy to do with the Solana SDK, but as far as I know it is not compatible with Anchor. More specifically, how can I ...
Ander's user avatar
  • 1,005
5 votes
2 answers
1k 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 ...
mikemaccana's user avatar
  • 2,754
2 votes
1 answer
195 views

How to i derive the owner account of an ATA (given the ATA)

One example will be the SyncNative instruction in Token Program - it gives the ATA but I want to retrieve the owner.
Sewy's user avatar
  • 95
0 votes
1 answer
92 views

Learning Programs Security in Solana

I'm looking at learning programs' security in solana. Was wondering if there was something equivalent to Ethernaut or Damn Vulnerable DeFi for Solana programs? Appreciate any help, cheers!
witwiki's user avatar
  • 61
1 vote
1 answer
1k views

Verifying SPL Token Code

I am looking for help wrapping my head around how upgrades to the SPL Token Program affect SPL Tokens that have already been deployed, and what the implications are for auditing. For context, I am ...
Alex Otsu's user avatar
  • 113
2 votes
1 answer
334 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 ...
Nooblantis District's user avatar
0 votes
1 answer
2k views

How can I register new spl-token to spl-token list(Naming and Logo)?

I'm going to register my spl-token to Solana spl-token list. I used to use https://github.com/solana-labs/token-list before. But today, I saw the message "This repository has been archived by the ...
genuine-developer's user avatar