Questions tagged [spl-token]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
7 votes
4 answers
1k views

How many instructions can I add to a single transaction?

I am looking to create a bulk spl-token airdrop script using nodeJS and Solana npm packages. I know that we can add multiple instructions to a transaction but I suppose, each instruction would have a ...
Oguzhan's user avatar
  • 317
10 votes
3 answers
1k views

How do I transfer an SPL token using web3.js?

I know the SPL-Token account and own some amount of the token in my account. How can I send some of it to another account using web3.js?
Ahri's user avatar
  • 3,245
7 votes
4 answers
800 views

What is an Associated Token Account?

The term "Associated Token Account" is often used when talking about tokens on Solana. What is it?
Jacob Creech's user avatar
  • 3,779
5 votes
3 answers
4k views

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

I want to receive information about newly created tokens on the Solana blockchain with minimal latency. What are some ways to do this? So that I get information about a freshly created token after, ...
Andrew Swift's user avatar
5 votes
2 answers
606 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
  • 1,805
3 votes
1 answer
954 views

How can I wrap Native Sol in JS?

I am trying to wrap SOL in a typescript application. I am looking at the example found at https://spl.solana.com/token#example-wrapping-sol-in-a-token. I am running into issues importing ...
Ben Hawkins's user avatar
2 votes
1 answer
61 views

Where to specify SPL token name or address when transferring

Somebody from Discord was nice enough to point me to look at https://solana-labs.github.io/solana-program-library/token/js/modules.html#transfer but where do I specify what SPL token I want to ...
ratib90486's user avatar
1 vote
2 answers
749 views

Where can I read current token information now solana-labs/token-list is deprecated?

The npm package for @solana/spl-token-registry says PRs are paused, and there hasn't been any updates since them. What can I read current information on Solana tokens? Eg their mint addresses, icons, ...
mikemaccana's user avatar
  • 1,805
1 vote
3 answers
632 views

Failing to create associated token account in rust tests. It says insufficient account keys for instruction

https://github.com/SushantChandla/test-mint-bug/blob/main/programs/mint-bug/tests/mint.rs I am trying to create an associated token account please have a look at the github file. The error I get is ...
Sushant Chandla's user avatar
6 votes
1 answer
162 views

Is Token Program 2022 Live?

so I wanted to enquire that whether the token program 2022 is live and is being used by in place of the original token program?
Muhammad Ali's user avatar
5 votes
5 answers
187 views

Is randomness achievable on-chain?

How, for example, might you implement a simple "coin-flip" game as an on-chain Solana program? The concept is that a player deposits a coin or token, and the onchain program generates a &...
Nate's user avatar
  • 411
4 votes
2 answers
681 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
  • 3,245
3 votes
3 answers
2k views

How to calculate token prices from LP pairs?

On EVM networks you can query the blockchain for the balance of the LP pair reserves (token0, token1) and calculate prices from there. How do I replicate something similar on the solana blockchain. I'...
0xKRN's user avatar
  • 31
3 votes
2 answers
863 views

How to create ATA (Associated Token Account ) for a PDA (Program Derived Addresses) on devnet?

I am creating a token-sale program, to sale tokens, I want to transfer spl-tokens to a PDA-address, so I can transfer them from PDA-token-account to recipient(transaction-signer)-token-account by ...
Mahesh Ghamaand's user avatar
3 votes
1 answer
183 views

Token name and icon are not showing on explorers

The token name and icon are not showing on Solana explorers: https://explorer.solana.com/address/3Gx8FbPiWfSdgXoBMzT4r22n9nhyF5CiRv52qf3WhEL8 https://solscan.io/token/...
spl-token22's user avatar
3 votes
1 answer
262 views

T2022 Transfer fees swap?

I've been interested in Solana's ecosystem recently and digged a lot of documentation. While going through token-2022 docs I found out that the transfer fees that occur on ALL transfers are like a ...
snappy410's user avatar
3 votes
1 answer
701 views

How to create an associated Token Account in anchor, I'm getting the following error: "insufficient account keys for instruction"

I need to create a SPL-Token before each test I'm running So I created the 2 following functions : createMint and createUserAndAssociatedWallet I'm able to create a mint but I can't create the ...
devMonster's user avatar
3 votes
2 answers
2k views

Adding Metadata for Fungible SPL tokens (Metaplex)

I'm trying to add metadata for a fungible SPL token, which was done via token-list before. I have tried using strata protocol, but it does not show up on the list so cannot be done. Is there a simple ...
gud's user avatar
  • 395
2 votes
1 answer
123 views

Where can I find more information about "token-2022" and how it relates to the current token program?

Where can I read about the need for token-2022, it's overall design, expected benefits, and how it relates to the current token program? I've been through the following resources: current token ...
Nate's user avatar
  • 411
2 votes
2 answers
105 views

How is Token Account Owner Different from Account Owner and Account Holder?

I am learning about Solana's account model. So far so good, these are the things I have found: Solana account is represented by the AccountInfo struct and whose structure is basically this: pub ...
dade's user avatar
  • 292
2 votes
2 answers
160 views

Need some guide or snippet, demo to transfer SPL token out from program's PDA account

My goal is to have my own program receive any Token, store in one of PDAs of program. Then transfer they out to end user wallet. Currently I successfully send token to program's PDA, but still not ...
breeze wang's user avatar
2 votes
1 answer
176 views

Can I Create an Account and Transfer Tokens in the same Transaction?

Is it possible to create associated token account and transfer token to that token account at the same time in one transaction?
Muhit Raihan's user avatar
2 votes
2 answers
268 views

How can I recover SPL tokens from an account that is nested inside another ATA account?

We have a Kin account that is nested under a USDC account. We have 2 USDC accounts, and the Kin is nested under a USDC account [1] that wasn’t created by the Associated Token Account program [2], ...
rory's user avatar
  • 21
2 votes
2 answers
460 views

Check if an account is a Token Account

We are given some public key that may be a token account (could be ATA or not) and want to find out if it is. Currently I am doing this by calling getAccount from @solana/spl-token and seeing if it ...
Ahri's user avatar
  • 3,245
2 votes
1 answer
311 views

solana token program 0xc Invalid Instruction

I have recently begun getting the below error when running the createMint instruction from @solana/spl-token. To my knowledge, I have not changed any code or dependencies that would affect this. ...
austinmilt's user avatar
1 vote
1 answer
75 views

How to transfer frozen NFT's

I've got a problem. I can't send NFT in my JS code, or rather include in transaction token NFT account which has state - frozen. How can I unfreeze it? I've seen an example that I need to use Metaplex....
Adrew Token's user avatar
1 vote
1 answer
106 views

Why is AssociatedToken Program not needed when using associated_token constraint in anchor?

I wrote a piece of code that uses associated_token::mint and associated_token::authority and I passed the Token Program but did not pass the Associated Token Program. Considering All Accounts must be ...
chinepun.sol's user avatar
1 vote
2 answers
383 views

spl-token-cli: "Attempt to debit an account but found no record of a prior credit" after `solana airdrop 1`

I'm working through the https://spl.solana.com/token docs using spl-token-cli built from source and getting an unexpected error near the very beginning. ~/solana-program-library:master:> cargo ...
Bert Muthalaly's user avatar
1 vote
2 answers
286 views

How to create a PDA and enable data storage?

I'm using PDA to hold the funds and the smart contract will sign it to transfer funds from the PDA to anyone. What's the best way to create a PDA to store multiple NFTs/tokens and also custom data ...
NaveeN .G's user avatar
1 vote
1 answer
178 views

Get all balances for token mint

How do I get all token balances for a specific mint? I want a list of all owners and their balance. I would also like to do this at a historical point in time using a snapshot.
the-fool's user avatar
1 vote
1 answer
179 views

unable to get token account balance from AccountInfo

can anyone help me over here, please. use solana_program::account_info::AccountInfo; use spl_token::state::Account; fn get_token_account_data(account_info: &AccountInfo) -> Result<Account, ...
devansh sanghvi's user avatar
1 vote
3 answers
5k views

I want to add metadata to the Solana token on cli

I have created a token in solana using the cli but now I'm unable to add metadata can someone please help me. https://solscan.io/token/Gy5oaTpM6tkc9aj4BZkjMXHaWm2U16CsfBtL4jBMKztX
John sparrow's user avatar
0 votes
1 answer
40 views

Error: Signature verification failed (ThawAccount)

I'm trying to add ThawAccountInstruction to my main transaction but but I'm getting an error Signature verification failed. I'm trying to unfreeze the frozen accounts (NFT) in my wallet and send them ...
Adrew Token's user avatar
0 votes
2 answers
281 views

I need to understand the escrow flow in Rust on Solana

I want to create an escrow program in Rust on Solana with the following requirements: Anyone can send an amount to the escrow, a lottery function runs on the backend to select a winner, and the NFT is ...
Maidi's user avatar
  • 444
0 votes
1 answer
91 views

Invalid account data on multisig token transfer from nodejs

I have a multisig address with 3 other signers. Not sure if this was created with cli or serum project (the developer that created it is working anymore). When trying to transfer a token, I get this ...
recoverySol's user avatar
0 votes
1 answer
1k views

How to transfer SPL Tokens?

I'm running a Solana node and I'd like to send a transfer request to my running node. I can transfer SOL but I don't know what I need to do for transferring SPL Tokens like GMT or SRM. I was looking ...
korimusk's user avatar