Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
1
vote
Error processing Instruction 0: custom program error: 0x12
0x12 in hex is 18 in decimal. So I think the error you're seeing is:
/// Mint decimals mismatch between the client and mint
#[error("The provided decimals value different from the Mint decimals")]
Min …
3
votes
Transferring tokens to another user, with sender-funding, via JS
You can create the token account first, which you can do in JS like this:
const toTokenAccount = await getOrCreateAssociatedTokenAccount(
connection,
payer, // this is the funder (a signer)
mint …
4
votes
Accepted
The bigest decimal place recomended for SPL-Token, and what type to use for it insteead of u...
You can represent 18 decimal places in a 64-bit integer.
If you put 2^64 into wolfram alpha then you'll get its scientific notation: 1.8446744073709551616 × 10^19. The 19 tells you that it can represe …
2
votes
Accepted
What are the potential pitfalls of making the mint authority and freeze authority the same a...
I'm not certain, but I think you'll find that once initialised the mint address can't be used to pay fees because it's not owned by the system program (it'll be owned by the token program). That'd mak …
3
votes
Accepted
How can i mint token again?
If you followed that guide then at some point you'll have done spl-token mint <mint address> 100. Just do that again with any amount to mint more to yourself.
Every token has a mint authority, which i …
1
vote
Accepted
How to use SystemProgram.assign?
You can use SystemProgram.assign to make the first account owned by a program. I'm not sure if it'll let you assign to an account that is not a program (eg it could check the owner is executable). It' …
1
vote
Accepted
Custom token smart contract in Solana
First of all, msol and jitosol are both owned by the standard token program, so they don't use a custom program. You can see this by calling getProgramAccount, eg:
curl https://api.mainnet-beta.solana …
3
votes
How to differentiate spl token vs lp token vs nft?
You can use connection.getParsedAccountInfo(mint), which will give you the JSON of the mint account.
Stackblitz example: https://stackblitz.com/edit/node-6hvxsq?file=index.mjs
const mint = await conne …
1
vote
Token transfer with splToken throwing error wehen asking to sign
getAssociatedTokenAddress takes as input, in order, the mint and then the owner to get the token account for. The token program and associated token program IDs are not required if you're using the de …
1
vote
Given a list of token accounts for a wallet, how do I determine which accounts the user/wall...
You can fetch multiple accounts together, using the getMultipleAccounts RPC call. That's also available in web3.js as connection.getMultipleAccountsInfo and connection.getMultipleParsedAccounts. In an …
3
votes
Accepted
where to get information about isSigner and isWritable from the transaction data?
The information about isSigner and isWritable comes from the header field of the transaction. It contains this data:
numReadonlyUnsignedAccounts: number;
numReadonlySignedAccounts: number;
numRequired …
1
vote
How to remove/change "Estimated Changes" in Phantom app?
This isn't something apps are able to configure, and wallets are free to display whatever they like. This is a security feature for users. Usually the estimated changes are based on transaction simula …
24
votes
Accepted
What is the difference between Transfer and TransferChecked instruction from the SPL Token P...
I looked into this a bit myself a while ago, definitely not an expert but this is what I figured out: I think it's basically that the _checked variant requires you to pass the mint account and the num …
1
vote
TypeError: Cannot read properties of undefined (reading 'toBase58')
The Connection object doesn't have a publicKey field, which is why you're getting an undefined address. You can see all its fields/methods here: https://solana-labs.github.io/solana-web3.js/classes/Co …