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 not deleted user 153
14 votes
Accepted

How can I increase an existing account size?

#[derive(Accounts)] pub struct Example { #[account(mut)] pub payer: Signer<'info>, #[account( mut, seeds = [b"example"], bump, realloc = 8 + std::mem::size_of … ::() + 100, realloc::payer = payer, realloc::zero = false, )] pub acc: Account<'info, MyType>, pub system_program: Program<'info, System>, } You can find more info in this …
sohrab's user avatar
  • 1,851
4 votes
Accepted

What's the difference between Anchor Accounts and account attributes?

We just sometimes need to add more metadata to the account validation, like also check if they are writable so we add an explicit #[account(mut)]. … Source code references: Accounts trait account macro Btw, you may also encounter #[account] on structs themselves, like one that would be on BaseAccount struct from your tutorial. …
sohrab's user avatar
  • 1,851
2 votes
Accepted

Can I read information stored by a PDA without having to deserialize its byte array?

You should be able to get any account and deserialise it using the client: let program = client.program(*Program Address*); let my_data: MyData = program.account(*PDA ADDRESS*)? …
sohrab's user avatar
  • 1,851
1 vote

How to convert accountKeys returned from the getTransaction method to public keys?

Use .toBase58() method on those keys.
sohrab's user avatar
  • 1,851
1 vote

Find amount of tokens swapped in a transaction?

Solscan does this by looking at the inner instructions of a transaction and finding all token transfer instructions. In your example transaction, you'll find 5 token transfer inner instructions. You c …
sohrab's user avatar
  • 1,851