Questions tagged [anchor-accounts]
The anchor-accounts tag has no usage guidance.
10 questions
0
votes
1
answer
33
views
what arguments are passed in the accounts method in program.methods."MyProgramInstructions"().accounts({?}).instructions()
I am trying to follow Solana Bootcamp 2024 project 9 that I will use as boilerplate for my dapp.
When I get to test the program I run into an error and I can't find anything in the docs (or I don't ...
0
votes
0
answers
44
views
Mainnet SPL token configuration in Anchor's Localnet tests
I have a query like I have deployed a token on mainnet and has declared that token on the anchor contracts. Now I want to know the best practices such that I can test in locally using anchor test .
...
1
vote
1
answer
155
views
Extend Account struct in anchor
Does Anchor support a way to extend/otherwise reduce duplication between Accounts for separate instructions? The way I'm writing instructions right now is by doing (obviously not all are AccountInfo ...
2
votes
1
answer
1k
views
: AccountOwnedByWrongProgram. Error Number: 3007
I'm trying to pass a switchboard aggregator as an account to my anchor program. However I encounter the following error:
Error: AnchorError caused by account: aggregator. Error Code: ...
1
vote
1
answer
142
views
How to calculate space for an account dynamically using remaining_accounts
Is it possible to allocate space to an account based on account provided in remaining_accounts? I want to allocate enough space to store public key of the accounts provided in remaining_accounts in a ...
2
votes
2
answers
2k
views
How to store data directly on the Solana blockchain?
I am a beginner in Solana Development and I recently learned that data in Solana blockchain can be stored inside accounts. Instead of this is it possible to store the data directly in a block instead ...
2
votes
1
answer
652
views
how many Accounts i can create & how much max data that each Account can store in Anchor PDA program?
I would like to know how many accounts I can create and how much max data each account can take in Anchor PDA Program.
2
votes
1
answer
378
views
Print in Solana Playground
I want to debug my program in Solana Playground. I am using the print function to get logs. The containing function is running but not producing any logs. Attaching a screenshot below.
4
votes
2
answers
329
views
How can one paginate large number of accounts fetch on solana?
Like fetching all candy machines using get .all() api of anchor ? How can one paginate the data or we can't until all accounts data is fetched ?
1
vote
1
answer
84
views
Defining composite fields using Anchor Accounts structs from other crates
Consider an anchor workspace set up like so:
programs/a/lib.rs
programs/b/lib.rs
programs/c/lib.rs
common/lib.rs
With accounts struct in the common crate:
// common/lib.rs
#[derive(Accounts)]
pub ...