Skip to main content
4 votes

How can I get all mint accounts created after calling createMint()?

import { Connection, GetProgramAccountsFilter } from "@solana/web3.js"; import { TOKEN_PROGRAM_ID } from "@solana/spl-token"; const rpcEndpoint = 'https://example.solana-mainnet....
Mr. J's user avatar
  • 146
3 votes
Accepted

Transfer specific token to and from a known account

This looks okay, What I would add is checking whether the holding account to_ata is initialized, If it's not you could use anchor associated_token constraints #[derive(Accounts)] pub struct ...
Jimii's user avatar
  • 3,120
2 votes

Error "process is not defined" when importing { Metaplex } from '@metaplex-foundation/js';

The package is depracated and not in active development. Please switch to Umi and use the associated plugins Metadata Program - @metaplex-foundation/mpl-token-metadata Core Program - @metaplex-...
Jimii's user avatar
  • 3,120
2 votes

Retrieve token metadata

To make your work easier, make the fetches using the DAS API and an RPC provider that supports it like Helius. Codewise, this would take the form. import { keypairIdentity, publicKey, } from &...
Jimii's user avatar
  • 3,120
2 votes

How to create spl-token not 2022, using @solana/spl-token-metadata?

With @solana/spl-token-metadata, you can only add metadata to the Token Extensions (previously token 2022) program using the metadata pointer extension. For spl-token program, you can use a library ...
Jimii's user avatar
  • 3,120
2 votes

Is it possible to create deflationary token on solana?

You can create a token with the "transfer fee" extension, and set the fee withdraw authority to the PDA for some simple program which allows anyone to withdraw and burn the fees on any ...
Jon C's user avatar
  • 15.3k
2 votes

How to create token using spl-token create-token with --enable-metadata

Initialized a token 22 mint with the metadata extension like this. Try removing the quotes and see if it there is a change. spl-token initialize-metadata teseCZW7zZkyFJvHpDp7gB6rgvzYJa65XdPWL3Y7ivf ...
Jimii's user avatar
  • 3,120
2 votes

Observing a contract's behavior and withdrawing tokens from it

There's a few steps you'll need to take: Check if it's open-source. You may need to do some searching on their website, docs, and github for this. If it is, then your life has just got a whole lot ...
Joey Meere's user avatar
  • 1,324
2 votes

How to fetch the current list of SPL tokens?

The United Token List API by SolFlare also provides token information. They have a JS SDK at https://github.com/solflare-wallet/utl-sdk
Jon C's user avatar
  • 15.3k
2 votes

How to fetch the current list of SPL tokens?

Have you checked out the Jupiter list API Here's a link to the docs https://station.jup.ag/docs/token-list/token-list-api#:~:text=The%20Jupiter%20Token%20List%20API,safer%20for%20users%20and%...
Jimii's user avatar
  • 3,120
2 votes

({"err":{"InstructionError":[2,"PrivilegeEscalation"]}})

Try this in withdraw_tokens function:- let bump = &[ctx.bumps.pda_signer]; let binding = ctx.accounts.mint.key(); let signer_seeds = &[&[b"sale", binding.as_ref(), ...
Aditya's user avatar
  • 157
2 votes
Accepted

SPL Token 2022 multisig initialization & update

So apparently: It can be a PDA, but it doesn’t need to be. It’s just not possible. To achieve that, the best is to put a PDA as the authority and have the program sign with it once it has verified ...
Vincent Berthier's user avatar
2 votes
Accepted

How can I initialize an SPL token mint using anchor_client?

I believe, or as I understand, there is no reason to construct the instructions via anchor_client. The Anchor client generates the client abstractions for the Anchor program so that instruction-...
chalda's user avatar
  • 1,082
1 vote

SPL-TOKEN with token extensions enabled specifically transfer hooks ... would the SPL-BURN instruction invoke the transfer hook?

The transfer hook only calls during transfers, and not burns or mints.
Jon C's user avatar
  • 15.3k
1 vote

Hide instructions in solana program transfer?

They are most likely using their own deployed program and directly changing the lamports probably like so: **ctx .accounts .chest_vault ....
Jonas H.'s user avatar
  • 5,727
1 vote
Accepted

About minting and decimal

Yep you have it correct! Just be careful about using a number that can be properly represented by a JS number, which is 9007199254740991. More info at https://developer.mozilla.org/en-US/docs/Web/...
Jon C's user avatar
  • 15.3k
1 vote
Accepted

Failed create CLMM using Token 2022 - Raydium Concentrated Liquidity: OpenPositionV2 (Program Error: "null")

According to the program logs, you have insufficient funds for the transfer The log messages Invoking System Program > Transfer: insufficient lamports 63964291, need 72161280 > Program ...
Jimii's user avatar
  • 3,120
1 vote

How to revoke freeze authority of spl token?

Here's the different ways to do this. You have to set the new authority as null. This also applies when you want to revoke the mint authority as well. Using @solana/spl-token import { AuthorityType, ...
Jimii's user avatar
  • 3,120
1 vote
Accepted

spl-token transfer to multiple wallets using smart contract

I had two concerns. The first is about the arguments of sendTransaction. Since you are passing two arguments, I believe you are passing either versionedTransaction and SendOptions, or the deprecated ...
2020 yuki's user avatar
1 vote
Accepted

Why the pump.fun sell transaction doesn't have a system transfer instruction to transfer sol from the bonding curve back to the user?

The withdrawal must be happening from a program-owned account. As such this isn't a traditional transfer IX that's being called but the authority of an account manipulating its lamport balance. Check ...
Jimii's user avatar
  • 3,120
1 vote

How to give up metadata update permission for spl token via solana api?

The mint you provided 9KXyn1GGcefXHX5yLg1GVH4NdWAeLSXJW4oEjrmdYpY8 indicates that the Token Program owns the token, and you aren't using the Metadata pointer. You are setting the Metadata using the ...
Jimii's user avatar
  • 3,120
1 vote

Cost of creating Spl-Token is higher when I use my own rust code than using generator tools

Usually, the cost for creating the token consists of rent (https://solana.com/docs/core/fees#rent) needed to be deposited to create Solana accounts. On removing accounts from Solana blockchain the ...
chalda's user avatar
  • 1,082
1 vote

Unable to use getOrCreateAssociatedTokenAccount for accounts that don't have the token

I did some more digging and stumbled upon the only solution around town that correctly uses the wallet-adapter and the connected wallet as the payer/signer: https://stackoverflow.com/a/73943145
Poot Coin's user avatar
1 vote

Error Code: ConstraintTokenMint. Error Number: 2014. Error Message: A token mint constraint was violated

At the top of my head some issues that come up token::authority = token_vault_account - You are trying to set the token vault's authority as itself, yet this account hasn't been initialized. I ...
Jimii's user avatar
  • 3,120
1 vote

SNS - Retrieve all Domains+Subdomains of an User

This is correct in all cases -- domains also have the owner written after 32 bytes. Here's the only data used for SNS accounts: https://github.com/solana-labs/solana-program-library/blob/...
Jon C's user avatar
  • 15.3k
1 vote

Sending SPL Token from PDA to ATA Problem

From your code, you are initializing a token account and not an Associated Token Account. Although, not secure, The first change I would recommend is using init_if_needed constraint to avoid account ...
Jimii's user avatar
  • 3,120
1 vote

How to add metadata (name, symbles, ...) to spl token?

You will need to add that using Metaplex Metadata Program](https://developers.metaplex.com/token-metadata) Using UMI and the helpers that they provide, you can have both create SPL and add metadata ...
Jimii's user avatar
  • 3,120
1 vote

How to fetch token metadata on chain?

You could use the DAS API and make use of the fetchAsset RPC call. More info, https://docs.helius.dev/compression-and-das-api/digital-asset-standard-das-api/get-asset The examples are in JS, but I ...
Jimii's user avatar
  • 3,120
1 vote

Can I set up the Token extensions (Token 2022) on a Solana spl-token I already made?

If you want to use token-2022 to create your token, you'll need to do a few things during your call to create-token: specify --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb add any flags for ...
Jon C's user avatar
  • 15.3k

Only top scored, non community-wiki answers of a minimum length are eligible