Skip to main content

Questions tagged [account-data]

The tag has no usage guidance.

1 vote
2 answers
106 views

Are enums with associated values permitted?

Not sure if this is really an anchor or solana related question, since I am able to compile, just not to run tests. I can run code and test against code that has an account that has following enum: #[...
mega_creamery's user avatar
1 vote
1 answer
90 views

Get all accounts from ledger

To obtain all account information from the ledger, I used the following command: solana-ledger-tool --ledger /mnt/ledger/ accounts However, only the following information is printed, and the account ...
Solextra's user avatar
1 vote
1 answer
133 views

The data structure of an associated token account's data field

I used 'solana account --output json 'address'' to obtain the data field of a Token account, which is encoded in base64. I would like to know how it is structured.
Solextra's user avatar
3 votes
2 answers
337 views

What determines the data type sizes for Solana accounts?

Looking through examples like Soldev, one sees PDAs sizes calculated using code like: pub fn get_account_size(title: String, description: String) -> usize { return (4 + MovieAccountState::...
mikemaccana's user avatar
  • 2,150
3 votes
1 answer
223 views

How do you repopen a closed account?

If an account has been closed with the following anchor context: #[account( mut, close = user, seeds = [ SEED_SCHEMA.as_bytes(), &user.key().as_ref()...
mega_creamery's user avatar
4 votes
1 answer
79 views

Storing and reading data on user account

Is it possible to store user notes in his account or maybe some way around? Wanna make some kind of on-chain KeePass. Ideally just with web API in React or smth. Thank you.
Mukhtar's user avatar
  • 43
7 votes
2 answers
511 views

How to correctly read data from a Zero Copy account

I'm having trouble reading data in the client from a program with a zero copy account. I've defined the account as follows: #[account(zero_copy)] #[repr(packed)] pub struct EventQueue { header: ...
rumika howdie's user avatar
1 vote
1 answer
312 views

How can any program in Solana read an account of another program? Give an example

The Solana docs states that Any program can read or credit another account. Ref: https://docs.solana.com/developing/intro/programs. Please explain this line. Does that mean I can extract all past ...
Suvadra Barua's user avatar
0 votes
1 answer
102 views

Invalid account data on multisig token transfer from nodejs

I have a multisig address with 3 other signers. Not sure if this was created with cli or serum project (the developer that created it is working anymore). When trying to transfer a token, I get this ...
recoverySol's user avatar
2 votes
2 answers
489 views

How to deserialize raw account data from tx in rust?

I get a b64 encoded data for an account from the transaction. I need to decode it into my account data struct called "Entity". I deserialize the b64 data into bytes then :- I tried to ...
Dev Bharel's user avatar
0 votes
0 answers
272 views

Solana rent account questoin

I have a question. If I hold solana token on my wallet - do I need to pay a rent for my account on chain ? I've red official documentation and I see that there is a garbage collector in solana chain ...
Andriy Vasyltsiv's user avatar
2 votes
1 answer
38 views

Am I allowed to use a BinaryHeap in an account?

I'm pretty sure std::collections::BinaryHeap supports Borsh, so I thought I could use it with an account. Here is the account: #[account] pub struct Voter { pub claim_queue: BinaryHeap<...
Varun Siva's user avatar
1 vote
1 answer
733 views

Error: AnchorError: AnchorError caused by account: base_account. Error Code: AccountNotInitialized

I wrote a Solana Program with two functions, one for the initialization of an account and a second to upload data to the account. While testing on localhost it was working fine, but when I uploaded it ...
Rounak Naik's user avatar
3 votes
1 answer
537 views

Can Solana Accounts be accessed by any Solana Program using its address?

If I have a deployed Solana Program which creates some Solana accounts for storing data in it. Can these Solana accounts be accessed by any other Solana program using the account addresses? I am ...
Rounak Naik's user avatar
3 votes
1 answer
409 views

Getting transaction info on account changes using JS

Using JS, how would I go about getting transaction information on transactions that affect the balance of a specific account? I've been able to listen for account changes with the following code, but ...
gxc's user avatar
  • 165

15 30 50 per page