Skip to main content

Questions tagged [spl-token]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
129 views

Amount not showing in wallet for spl-token transfer

I am working on some code to transfer some spl-tokens from a user connected wallet. But when I send the transfer instructions, the amount does not show up in the wallet for user approval; and ...
PutCallTheta's user avatar
0 votes
1 answer
24 views

Getting an error after adding solana to my project

I have been getting the following error after adding solana to my project. I have tried adding the @solana/spl-token package ($ yarn add @solana/spl-token) but that didn't work. Please help.
Muskaan Sharma's user avatar
0 votes
1 answer
64 views

Close Token Account With Multiple Destinations

Is it possible to call close_account function by providing multiple destinations? If so, how do I do it. Otherwise, is using a proxy account as a destination which will send the rent money to multiple ...
user avatar
1 vote
1 answer
186 views

SOL program to Lock SPL Token for short period

I am looking for way to hold/lock/pledge/promise a fixed amount of tokens from a sender, and later in about few hours or days later transfer those to some recipients. Can we achieve this while keeping ...
Subash Chaturanga's user avatar
1 vote
1 answer
944 views

What is the difference between TOKEN_PROGRAM_ID and ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID?

There are two program ids in the code base of solana-program-library. To be precise: ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL' TOKEN_PROGRAM_ID = '...
unegare's user avatar
  • 231
1 vote
1 answer
182 views

SPL equivalent to erc20 allowance

Is there an allowance function on Solana that sets a limit of SPL tokens that can be withdrawn from your account by an approved address. If not what would you say is a good way to simulate this ...
colinwink's user avatar
0 votes
1 answer
137 views

Do I need to set authority on newly minted token after I transfer it?

I have a program to mint tokens on behalf of users (with user-provided metadata for the tokens) and after the minting is done, I transfer the token to the user address. Now, my question is - do I need ...
Milkncookiez's user avatar
1 vote
3 answers
655 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
1 vote
1 answer
101 views

What are the limitations of the devnet?

I am running an SPL token program that is used as a currency. Only my wallet can issue this token. I am on the devnet and while I understand that Solana tokens are not real, I do not understand what ...
colinwink's user avatar
3 votes
1 answer
169 views

Getting Error processing Instruction 0: Cross-program invocation with unauthorized signer or writable account

I tried creating a PDA for my escrow program but I keep running into the error above. I ensured the seeds used in my testing code FindProgramAddress and the rust file are the same, but I still get ...
Aengus's user avatar
  • 147
2 votes
1 answer
130 views

See delegates for a particular account

If I were to delegate an amount of spl tokens to a certain pubkey, how can I see (in the future) how much is there left as delegated token amount and which was the pubkey I delegated to?
Valentin Cazaciuc's user avatar
4 votes
1 answer
537 views

How do I create a spl token with a rust anchor and add it to the token list?

I want to create my SPL token and upload it to https://github.com/solana-labs/token-list. But I found only articles with no-code solution: https://learn.figment.io/tutorials/sol-mint-token or using ...
Watchman's user avatar
0 votes
1 answer
30 views

Is there a public smart contract for ICOs? [closed]

I am looking for a smart contract template for my ICO but cannot find any. Do I even need one?
samuelnihoul's user avatar
4 votes
1 answer
260 views

How can I use @solana/spl-token's createMint() and mintTo() functions with solana wallet adapter?

I am trying to create a front end for minting and transferring tokens to accounts, and the @solana/spl-token library demands a private key for their functions. Is there a way to use solana wallet ...
incog's user avatar
  • 567
1 vote
0 answers
358 views

Find Staked NFTs Of A Wallet

I want to build a portfolio tracker for SOL wallets. I'm stuck on finding the staked NFTs of a user(wallet). Do I have to dig over the transactions or is there a smart way to find the staked NFTs of a ...
IsthereAnyoneee's user avatar
5 votes
2 answers
4k views

Get Token Metadata (decimals,symbol,name...)

I'm looking to query token metadata by looking up the token address(pubkey or mint). Specifically looking for data around the name, symbol, and decimals. Is there an RPC method for this? How does ...
Casey Wilcox's user avatar
1 vote
1 answer
84 views

How do you get the wallet address that initiated the minting of an NFT?

I have the NFT Address. I think I need to start by getting its mint authority? Searching the docs for something that will help me right now but am having no luck. Edit1: found getMint(). Trying now. ...
a_rubik's user avatar
  • 103
2 votes
1 answer
62 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
4 votes
2 answers
2k views

SPL token image not showing in Phantom wallet

Does anyone uploaded metadata for a SPL token on the mainnet (https://api.mainnet-beta.solana.com) recently ? I uploaded the metadata, hosted on arweave both image and metadata json, but only the text ...
Zjeed's user avatar
  • 53
2 votes
1 answer
101 views

Replace import syntax for Vanilla JS such as - import { Token, TOKEN_PROGRAM_ID } from "@solana/spl-token";

I'm new to JS ES stuff and Solana. I'm trying to transfer SPL token from one wallet to another. I've seen almost all SOL tutorials using imports like: import { Token, TOKEN_PROGRAM_ID } from "@...
ratib90486's user avatar
0 votes
1 answer
217 views

Transfer USDC from one wallet address to another address

I'm new to SOL. I've been reading this and this but there's no vanilla JS code. And this actually mixes a lot of conditions - from knowing the wallet private key to transferring from a wallet ...
ratib90486's user avatar
3 votes
1 answer
1k 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
9 votes
2 answers
623 views

When creating Associated Token Account "Provided owner is not allowed"

I am trying to create associated token accounts for SPL Transfers and I keep running into Provided Owner not allowed. I have never seen this error before and I am checking to make sure the token ...
0xDon's user avatar
  • 91
1 vote
1 answer
62 views

need some example of spl token or sol transfer [closed]

I stored the amount and Pubkey inside my smart contract. I tried transferring to that pubkey, but the function is asking AccountInfo. I tried instantiating Accountinfo but I don't know other fields ...
pramitgaha's user avatar
2 votes
1 answer
98 views

Is executing `SystemProgram.createAccount` and `Token. InitializeAccount` in different transactions considered safe?

Solana Docs for the Token program state that: It's important to note that the InitializeAccount instruction does not require the Solana account being initialized also be a signer. The ...
eRunner's user avatar
  • 226
4 votes
1 answer
175 views

How to createAssociatedTokenAccount for PDA?

Currently, I face into the TokenOwnerOffCurveError error trying to call createAccount from @solana/spl-token, what with createAssociatedTokenAccount being invoked under the hood which, in turn, calls ...
unegare's user avatar
  • 231
2 votes
1 answer
192 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
0 votes
2 answers
292 views

How to mint an existing spl token with React?

I'm building a platform where users play games and receive tokens. Once user have some tokens I'd like to have a "claim" button to transfer (or should I say mint?) these tokens to user's ...
Zjeed's user avatar
  • 53
1 vote
3 answers
217 views

Cross-program invocation with unauthorized signer or writable account

Facing verification failed issue and found many similar issues on StackExchange but couldn't solve my problem so posting here. I have deployed a staking program on devnet. It initiates spl_token ...
Krati Jain's user avatar
3 votes
1 answer
799 views

What is a SPL Token "Approve" instruction?

I'm trying to do a token swap through the SPL token swap program. I have been looking at transactions in solscan to get an idea about which instructions are needed. An example here: https://solscan.io/...
CTKI's user avatar
  • 43
4 votes
1 answer
66 views

Authority Delegated SPL token transactions without a program

i want to use authority delegation so a user can delegate his tokens and later a transaction can be created to transfer those tokens. can this be done without a smart contract and can the authority be ...
OverAchiever's user avatar
1 vote
1 answer
718 views

How to find all transfers for a specific token

Is there a way to find all transfers of a specific token mint? Say I want to find all USDC transfers which happened on blockchain. Can it be done efficiently?
RowanStone's user avatar
2 votes
2 answers
132 views

I transferred my tokens to an ATA derived from an ATA. Can I get them back?

I transferred token to an associated token account derived from an associated token account, can I get my tokens back?
reditable's user avatar
1 vote
2 answers
2k views

The bigest decimal place recomended for SPL-Token, and what type to use for it insteead of u64 to prevent overflows in math?

I have a question about token decimals, as I could not find a clear answer to it. Is there some recommended maximum of the token decimal on Solana, by default it has 9? If it will be bigger, for ...
Andriy Slisarchuk's user avatar
4 votes
3 answers
4k views

Transaction simulation failed: failed to send transaction: Transaction simulation…ocessing Instruction 0: custom program error: 0x1

when I transfer nft to my another account. It makes error. export const createWalletKey = async () => { const bs58 = require("bs58"); const bs = bs58.decode(secretKey); const wallet ...
Jerry's user avatar
  • 161
10 votes
3 answers
2k 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,325
1 vote
0 answers
114 views

Getting unexpected `TokenAccountNotFoundError` while creating a new Associated Token Account

I am creating an ATA by the following code: export const createAta = async (mint: web3.PublicKey, keyPair: web3.Signer) => { const { connection } = useWorkspace(); try { const ata = await ...
CeNiEi's user avatar
  • 11
1 vote
1 answer
1k views

How do I get or create associated token accounts with the wallet adapter?

I'm trying to send SPL tokens to a specific address using a Wallet Adapter. Also I need to create an associated account for recipient, but the getOrCreateAssociatedTokenAccount @solana/spl-token ...
Kanitelk's user avatar
1 vote
2 answers
77 views

Is there any way to use custom token program over token program?

I understand that making SPL-tokens is based on token program, and wallets/solscan only recognize token which is made by token program. What I want to achieve is to make spl-token with custom token ...
yacho's user avatar
  • 107
5 votes
5 answers
192 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
1 vote
2 answers
394 views

(SPL-Token) Solana Create Token Account with Wallet Adapter | React, JS

Problem with solana-wallet-adapter I am developing a Dapp with a token I created, I use the React Wallet Adapter provided by solana (solana-wallet-adapter). I am using javascript, but when I use the ...
KinimoX's user avatar
  • 11
0 votes
1 answer
145 views

Anonymity spl token transfer

I want to create a vault program to store spl token which transferred by A to B. What is the best way to achieve anonymity of B when the token remains in the vault? If B's key is encrypted, how can B ...
Wong Liong Hung's user avatar
1 vote
1 answer
153 views

Get Solana SPL Address from base 58 string

Hi I have a base58 string for an SPL token address (called a mint in the Solana docs); This is how I generated this string: const mint = await createMint( connection, payer, ...
colinwink's user avatar
2 votes
1 answer
122 views

How does one read a confirmed spl-transfer transaction's instructions?

Creating an spl-transfer transaction: const transaction = new Transaction().add( createTransferInstruction( // Pretend this is filled in ) ) const signature = await ...
Emma Zhu's user avatar
3 votes
2 answers
248 views

How can I make token accounts rent exempt when I create them?

Hi I am struggling to understand how to make token accounts rent exempt. I have used the following code to create my token account for an SPL token lifted out of the Solana docs. I see that Solana is ...
colinwink's user avatar
1 vote
1 answer
293 views

SPL Token `createMint` returns "Cannot read properties of undefined (reading 'toString')"

I want to use the createMint function in '@solana/spl-token'. I don't want to use Keypair.generate() when I call a function. Here is my code: export const createToken = async () => { const wallet ...
Jerry's user avatar
  • 161
1 vote
0 answers
58 views

IDO program for saling token using Anchor [closed]

I'm looking for the code example of the IDO program using off-chain signature or Merkle tree. Does anyone know where I can find it? The idea is to use the off-chain signature or Merkle tree to conduct ...
thong.pb's user avatar
5 votes
5 answers
1k views

Getting Error: failed to send transaction: Transaction simulation failed: Attempt to load a program that does not exist

I'm currently trying to run an escrow program and when i turn on the solana-test-validator in a different terminal it gives me this error: failed to send transaction: Transaction simulation failed: ...
Aengus's user avatar
  • 147
1 vote
1 answer
86 views

Token sale program [closed]

I have a pre-minted spl-token I want users to buy my spl-token direct to their wallet from my website.
Manunyi's user avatar
  • 13
1 vote
1 answer
99 views

Is there a standard value for burn account?

From the solana docs it seems that there is no specific burn account (see link). Is there a conventional value that people use to signify a burn? The context here is marking a token transfer as a burn ...
liamvovk's user avatar
  • 168

1
8 9 10
11
12