Skip to main content
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
Results tagged with
Search options answers only not deleted user 1708
0 votes
Accepted

How to fetch PDA data on a TS client

Serban pointed out that it should have been a lowercase p. this error arose when I was importing the IDL and ended up importing the second object, which is the types I think.
Jimii's user avatar
  • 7,672
-1 votes

How do I verify if a PDA is belonging to the payer? (without Anchor)

You could add a field authority to the account data and initialize it with the payer's address. Below is pseudo-code for illustration purposes account.authority = payer You could then do an initiatio …
Jimii's user avatar
  • 7,672
1 vote
Accepted

Best to have PDA own a System Account or be the System Account to move SOL tokens?

Can't delete this but Jon's answer is the correct one.
Jimii's user avatar
  • 7,672
1 vote

Problem with testing pda contract

For example: - await program.methods - .init() - .accounts({ - pda: ..., - signer: ..., - systemProgram: ..., - }) - .rpc(); + await program.methods.init().rpc(); …
Jimii's user avatar
  • 7,672
0 votes

Pay for PDA by a centralized wallet

Could you change the PDA derivation to [deadcasterAddress, bump] = PublicKey.findProgramAddressSync( [Buffer.from('dead_caster'), newAccount.publicKey.toBuffer()], program.programId …
Jimii's user avatar
  • 7,672
2 votes

Is it possible to close or create a PDA from within an Anchor function

As long as your program owns said account/PDA, you can delete it together with its contents. but what do you mean by another function. …
Jimii's user avatar
  • 7,672
2 votes
Accepted

Anchor: Do I need to validate PDAs when passing them into my program?

Not really, But you should. You can do it as suggested using an anchor constraint in the #[derive(Accounts)] struct #[account( seeds = [b"some_seed"], bump, seeds::program …
Jimii's user avatar
  • 7,672
1 vote
Accepted

Make mint authority the program itself

The PDA strategy you highlighted is a better and safer alternative. …
Jimii's user avatar
  • 7,672
1 vote

Error Number: 2006. Error Message: A seeds constraint was violated

You migh be deriving the lottery address incorrectly, Try this and check whether the tests pass const [lotteryPda, lotteryBump] = PublicKey.findProgramAddressSync( [Buffer.from(lotterySeed), ne …
Jimii's user avatar
  • 7,672
1 vote
Accepted

Can I reclaim SOL from PDA after I accidently close the program?

With that in mind: If you are talking about a PDA owned by your program then this is impossible since you need your program to close any PDA's it's owned. …
Jimii's user avatar
  • 7,672
1 vote

how i transfer my spl token by js

The Official guide that you provided uses the Token extensions program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA to mint the token. Change the programId where neccessary to point to it TokenkegQfeZy …
Jimii's user avatar
  • 7,672
1 vote

Transfering sol from pda to a hardcoded account pubkey

This isn't possible, with Anchor. You need to pass in the required AccountInfo's to use them and can't do anything, except address validations if you pass in a public key address To transfer sol ctx.a …
Jimii's user avatar
  • 7,672
0 votes

"Anchor Solana: InvalidProgramId Error When Passing AccountInfo for SOL Pool PDA

Are you marking the ATA as a PDA when deriving it let protocolIcoTokenPda = getAssociatedTokenAddressSync( mint, provider.publicKey, true // here ); …
Jimii's user avatar
  • 7,672
0 votes

cargo build works but `cargo build-sbf` and `anchor build` fail with unsupported target error

cargo build-bpf is deprecated and was removed in favour of cargo build-sbf, ref https://github.com/anza-xyz/agave/pull/2040 Make sure you have the latest version of the Solana CLI sh -c "$(curl -sSfL …
Jimii's user avatar
  • 7,672
1 vote
Accepted

Could not find `pda` and `state` in `mpl_token_metadata`

These imports are for older versions From the latest version import them like this use mpl_token_metadata::accounts::{ MasterEdition, Metadata as MetadataAccount }; usage #[account( mut, …
Jimii's user avatar
  • 7,672

15 30 50 per page