Questions tagged [spl]
The spl tag has no usage guidance.
39
questions
1
vote
1
answer
27
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 ...
0
votes
2
answers
29
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 ...
0
votes
1
answer
45
views
How to set the token amount into the script
How can I incorporate tokens into the script? For instance, I need to send tokens like USDT, and the token value might be something like 12.067. When I send this value, it sometimes doesn't transfer ...
0
votes
1
answer
52
views
How to generate an associated token account when generating the one in SOL?
I have a web service in which I'll be generating to my users wallets in SOL and in USDT/USDC. The wallets will be custodial, for deposits, and it has to be this way.
And I need to obtain and parse ...
1
vote
1
answer
21
views
Why aren't SPL token TXs included in getSignaturesForAddress(...)?
For instance:
https://solscan.io/account/2LshMLoR8QJkuAv7m6xAs4tYaS5XTfF4Yame21f1Ls9o
Currently, there're 6 TXs on the main tab.
On the SPL Transfers tab the most recent TX with USDC ($1100) was made ...
1
vote
0
answers
30
views
Is there any JS library that support slip0023(BIP32 - EDD25519)?
Is there any JS library that support slip0023(BIP32 - EDD25519)?
I know about that Rust support slip0023, but I wanna know about JS library.
1
vote
2
answers
68
views
Can I use the meta plex js SDK to update SPL token meta data?
I am creating a token mint and was wondering, if i can use the meta plex sdk to upload meta data for it.
I am trying like this.
const mint = await createMint(
pg.connection,
pg.wallet.keypair,
...
1
vote
2
answers
187
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 ...
1
vote
1
answer
71
views
Empty pre/postTokenBalances when there is an actual token transfer
The RPC returns empty arrays for pre/postTokenBalances for the transaction below, when there is actually a token transfer.
https://explorer.solana.com/tx/...
3
votes
1
answer
46
views
Transferring tokens to another user, with sender-funding, via JS
I found pretty interesting documentation on spl.solana.com however I believe it's not accurate on one side!
The section below taken from the site shows a way we can send spl tokens, via JS by funding ...
0
votes
0
answers
23
views
Can you implement max wallet or max transaction for SPL tokens?
Similar to Solidity, can you implement max wallet or max transaction for SPL tokens?
2
votes
1
answer
170
views
How to import METADATA_PROGRAM_ID. (Buildspace Solana Staking Anchor course)
I'm doing the Anchor Staking part of the solana Buildspace course. I get this error when running the first test:
ReferenceError: METADATA_PROGRAM_ID is not defined
This is the Anchor Smartcontract I ...
1
vote
1
answer
149
views
How do I transfer the SOL on my token account?
I have a token account (example: https://solscan.io/account/3HJdseEK7G8cDEcDQPNmt5z1TuVb5AjCPxvqJCpkskbQ?cluster=devnet) and accidentally sent some SOL to it. I want to transfer this out to my SOL ...
2
votes
1
answer
103
views
SPL TOKEN recognized as NFT instead of a regular token
I created a spl-token using strata protocol and it is being recognized as NFT on my wallet, even on solscan it is not showing similar to any other token.
I found that maybe i would need to pull a ...
3
votes
1
answer
84
views
What is the Solana idiomatic way of logging/accessing information about who sent tokens via a program?
I have a Game-program. Several users can play a game and receive a reward afterwards. When a user starts a game, I create a Game account in which I store the game state and the sum of rewards (just a ...
3
votes
1
answer
111
views
Why we cannot transfer sol to the program address, but we can transfer the token created by spl-token to the program address
I have tried to transfer sol to the program address it fails, but transferring another token works, why ?? Both are the types of tokens.
3
votes
1
answer
324
views
TypeError: Cannot read properties of undefined (reading 'createInitMintInstruction')
I am getting this error.
TypeError: Cannot read properties of undefined (reading 'createInitMintInstruction')
I dont know where and how it went wrong.
Appreciate the help.
await program.rpc.mintNft({
...
1
vote
1
answer
64
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 ...
2
votes
1
answer
39
views
Modify / Import the spl-token to my program
I'm looking to make a basic solana program with just some slight modifications from the spl token program.
Is there an example of importing the spl program and then adding a function?
2
votes
0
answers
35
views
How to add twitter and website handles to my spl-token to show in solscan?
I have created an spl-token and added metadata using metaplex createMetadataInstruction. I have added twitter and website links in uri but it is not showing in solscan and even I tried by adding ...
2
votes
1
answer
59
views
Trying to send specific SPL Token but creates new token instead
I'm trying to send a SPL Token but when I execute the code below it creates an unknown token and sends it, It does not recognize the token address / programID. Where should I pass the token address?
...
1
vote
1
answer
111
views
SPL token metadata
Tell me please. I have created a SPL token, how do I add the website and social networks to the metadata now? Previously, this could be done with the help of PR on github.
1
vote
2
answers
53
views
How to get Solana program name
Is there a way to get the name of a Solana program, e.g. receive "Compute Budget Program" for "ComputeBudget111111111111111111111111111111"?
1
vote
2
answers
82
views
Conditional CreateAccount Instruction - Associated Token Program
Is there a way to build a transaction that creates an account iff only it doesn't exist. I sometimes run into a race condition between checking that the account exist, broadcasting the transaction and ...
1
vote
2
answers
253
views
how to get owner of token account
I'm using solana-py and trying to get the owner of an associated token account. I have gotten the associated account address like this:
from solana.publickey import PublicKey
from solana.rpc.api ...
2
votes
1
answer
166
views
get tokens balance [closed]
Looking for a way to fetch owner tokens and balance.
i have tried the following code:
const tokenAccounts = await this.solanaUtilService.connection.getTokenAccountsByOwner(
this.wallet.publicKey,
...
2
votes
1
answer
31
views
Is there a standard mint account for SOL? [closed]
Is there a convention to use as mint account for SOL? Similar to how ETH uses 0xeeeee.
3
votes
1
answer
347
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/...
1
vote
1
answer
52
views
How do I make a DAO in anchor?
I see theres a governance library in anchor spl, but i cant find any examples on how its supposed to work.
I already have a token in my program that i would like to use for vote weights,and i want to ...
1
vote
2
answers
73
views
Funding of wallets
I want to make a point of sale system project using solana with spl tokens. One thing where i'm stuck and where I need answers is the wallet funding.
When someone makes a new wallet(trust wallet for ...
1
vote
1
answer
86
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,
...
1
vote
1
answer
38
views
how to fetch SPL by owner without NFT tokens
I am using the following code:
public async getTokensAccountbyOwner(publicKey: PublicKey) {
const accounts = await this.connection.getParsedProgramAccounts(
TOKEN_PROGRAM_ID, // new PublicKey("...
-1
votes
1
answer
130
views
Are SPL Token Delegates **Exclusive** Transfer Authorities?
I'm reading the source here:
https://github.com/solana-labs/solana-program-library/blob/master/token/program/src/processor.rs
But my Rust is not so fluent right now.
Right around here:
match ...
5
votes
3
answers
274
views
How to Efficiently Subscribe to NFT Transfers of All NFTs in Collection ( The N+1 Problem )
The Ask
We are building a game and we want to also present trade stats to our players. We need to be able to efficiently index and track not just mints, but transfers of nfts in real time.
The Problem
...
0
votes
1
answer
258
views
How do you convert the byte array returned as "Data" for a given instruction into a human-readable form?
I am currently looking to query historical transaction data for specific programs/wallets using the Solana CLI. The command I'm using, as an example, looks like this:
solana transaction-history --show-...
0
votes
1
answer
44
views
Does Anchor localnet come with the spl_token loaded?
I have been fiddling around with tests using Anchor. I spent a fair deal of time ensuring that spl token was included in my localnet before running tests. However, after getting my initial call to the ...
0
votes
1
answer
26
views
What is Owner Validation Program? [duplicate]
I was reading the source code of sollet.io.
Whenever they are creating an ATA, they are also calling some instruction of the Owner Validation Program: https://github.com/project-serum/spl-token-wallet/...
-2
votes
2
answers
61
views
Circulating Supply of an SPL Token
I'm seeking out the simplest method to determine the circulating supply of an SPL token. This should be available to query via HTTPS.
My first thought is to use:
getTokenSupply - locked tokens = circ ...
12
votes
5
answers
2k
views
How to close SPL token accounts to redeem SOL
I have a bunch of 0 balance SPL token accounts. How do I close these accounts to redeem the rent lamports?