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 712
1 vote

Reintialize Solana PDA

Your explorer link just points to a normal account so its not a PDA and its not intialized. … From your comments it looks like you want to transfer a token from a token account where the owner is a PDA. …
Jonas H.'s user avatar
  • 7,219
2 votes

Anchor pass parameters to PDA creation from initialization

I think bn is little endian. I just tried it in a progam and this works: Try in the client: const extraSeeds = new anchor.BN(10).toArrayLike(Buffer, "le", 8); const [playerPDA] = anchor.web3.PublicKe …
Jonas H.'s user avatar
  • 7,219
0 votes

Stack offset of 4376 exceeded max offset of 4096 by 280 bytes, please minimize large stack v...

If you have big structs you can use zero copy and move everything to the heap. This struct for example would not fit on the stack, but with zero copy you can access it directly in memory: const BOARD_ …
Jonas H.'s user avatar
  • 7,219
0 votes

A seeds constraint was violated. Can't find matched PDAs

Pretty sure its a problem with the case_id. Could you try: const [versionPda, _] = await anchor.web3.PublicKey.findProgramAddressSync( [ Buffer.from("version"), casePDA.toB …
Jonas H.'s user avatar
  • 7,219
6 votes
Accepted

Anchor Realloc PDA

different ways to work with big accounts: https://github.com/solana-developers/anchor-zero-copy-example/blob/main/programs/zero-copy/src/lib.rs The error you are getting indicates that you are using a PDA
Jonas H.'s user avatar
  • 7,219
3 votes
Accepted

Anchor Program unable to sign a transfer with a PDA

You need to instead change hte lamports directly if you want to substract from a PDA. Here is an example explaining the difference: https://beta.solpg.io/tutorials/tiny-adventure-two …
Jonas H.'s user avatar
  • 7,219
2 votes
Accepted

Error sending SOL from PDA to system account

You can not use system program transfer with a PDA that is owned by your program. Only with accounts that are owned by the system program. …
Jonas H.'s user avatar
  • 7,219
4 votes
Accepted

Difference between bump vs account.bump in anchor

This is because to find a PDA that is off curve internally anchor calls create_program_address repedadly with decreasing bumbs until it finds a PDA thats not on the curve. … { "Find PDA" => Pubkey::find_program_address(&[b"counter"], ctx.program_id); } // 1,651 CUs compute_fn! …
Jonas H.'s user avatar
  • 7,219
3 votes
Accepted

How to use timestamp as seed for my PDA?

If you just want a unique PDA you could just save a counter in an account and increase it with every new PDA like here: https://github.com/brimigs/solana-payroll/blob/main/anchor/programs/payroll/src/lib.rs …
Jonas H.'s user avatar
  • 7,219
2 votes
Accepted

Websocket version of getProgramAccounts

If you know the seeds you can use connection.onAccountChange to listen to account changes via web socket. You can then subscribe to all the accounts you are interested in. If you use an ascending id a …
Jonas H.'s user avatar
  • 7,219
1 vote

PDA takes ~10s to upate even after tx is confirmed

What i suspect is happening is that you are requesting the PDA data with a 'finalized' confirmation flag. This one would not get you the new value until the transaction is finalized. …
Jonas H.'s user avatar
  • 7,219
1 vote

Transaction Error: Signature Verification Failed: Missing Signature For PublicKey

Some ways to debug this: Print the transaction before you send it and make sure all the accounts are the same and double check mut and signer parameters. console.log(JSON.stringify(tx)); Skip prefl …
Jonas H.'s user avatar
  • 7,219
1 vote

Anchor PDA Seed

space = 10240, // 8 + all the tiles a game config seeds = [level_seed.as_ref()], bump, )] But you would need to make sure somehow that only the correct people can change your PDA
Jonas H.'s user avatar
  • 7,219