Skip to main content

Questions tagged [account]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
30 votes
6 answers
2k views

What is a Program Derived Address (PDA) exactly?

Is this an account or is it an address? Why do I need it? What problem or use case does it solve? Why can't I just use a regular account instead?
Dima Knivets's user avatar
6 votes
1 answer
492 views

How do I get historical AccountInfos at timestamp x, y, and z?

I would like to create transaction graphs for research purposes. To do this I need to obtain the data in the account at specific timestamps. What's the simplest way to do this?
amaz_ng's user avatar
  • 75
8 votes
1 answer
2k views

What is Anchor (8 bytes) discriminator

The question should be straightforward.
vicyyn's user avatar
  • 4,295
4 votes
1 answer
2k views

Calculating Solana Fees

How are fees calculated in Solana ?
vicyyn's user avatar
  • 4,295
1 vote
1 answer
613 views

Can I use Vec<> to pass multiple accounts into an anchor program?

I'm writing an escrow program for multiple assets in one swap. I was trying an effective way to input token mint & token accounts. So I tried using Vec<> as following but it poped up the ...
Gajesh Naik's user avatar
5 votes
1 answer
539 views

How to export all Solana accounts with positive balance?

Given access to Solana validator node and solana command, how to export a list of all account addresses with positive balance (at the latest block)? Preferably in CSV format.
kenorb's user avatar
  • 529
3 votes
1 answer
298 views

Can you create accounts with less lamports than the rent-exempt minimum?

Accounts on Solana are considered rent-exempt if they hold at least the cost of their rent for 2 years (based on the size of the account's data). Is it possible to create an account that's not rent-...
Joe C's user avatar
  • 1,116
1 vote
1 answer
325 views

How do I make a PDA own a system account

So im making a program that CPIs into marinade. In one of the instructions, they have a "transfer_sol_to" account requirement. I want the sol from that instruction to be transferred to a ...
SwayStar123's user avatar
9 votes
1 answer
683 views

How can I increase an existing account size?

ie. Initialize account with 255 byte space. Pay to double the space through anchor.
user2892730's user avatar
7 votes
1 answer
422 views

what is ledger space in solana?

from here On Solana, State Compression is the method of creating a "fingerprint" (or hash) of off-chain data and storing this fingerprint on-chain for secure verification. Effectively using ...
Yilmaz's user avatar
  • 1,264
5 votes
1 answer
403 views

How to efficiently transfer NATIVE SOL to a program accepting WRAPPED SOL?

I am writing a program in which the accepted payment MUST be from a token account. Anchor context snippet here: pub struct Payment<'info> { #[account(mut)] pub buyer_token_account: ...
Burger Bob's user avatar
  • 1,506
5 votes
2 answers
2k views

How do I fix 'please minimize large stack variables' error while testing my anchor program?

I'm getting the following error using Anchor 0.25.0 Stack offset of 11792 exceeded max offset of 4096 by 7696 bytes, please minimize large stack variables initializing my accounts on local testing. I'...
AceGravity's user avatar
5 votes
1 answer
537 views

Why is it possible to initialise a program account to my wallet address, stopping me from signing anything in future?

This was an accidental discovery when playing with the Solana Playground, but it surprised me and feels like a bug. I'm wondering why it works this way. Example: https://beta.solpg.io/...
Callum M's user avatar
  • 3,775
4 votes
1 answer
146 views

Handle big vector containing ton of structs

I'm looking for a way to handle a big struct. I want to understand how to create an account storing more than 10_000 structs inside is possible. Is there a simple way to do it? Or should I have to ...
GoT's user avatar
  • 97
3 votes
1 answer
346 views

"Error processing Instruction 0: invalid program argument" while invoking method of other program using cpi

The callee program #[program] pub mod puppet { use super::*; pub fn initialize(_ctx: Context<Initialize>) -> Result<()> { Ok(()) } pub fn set_data(ctx: Context&...
SolDev's user avatar
  • 33
3 votes
1 answer
153 views

How to create shard accounts to manage "unlimited" account size

Since there is a limitation inside Solana transactions (1kb), and Solana account (1Mb), I'm not able to create a huge account ^^ Someone suggests me to open a new question: Handle big vector ...
GoT's user avatar
  • 97
3 votes
1 answer
2k views

How to close a PDA account?

#[account( init, seeds = [ b"config".as_ref(), mint.key().as_ref(), ], bump, payer = sender, space = 90 ...
Abhishek Faliya's user avatar
2 votes
1 answer
106 views

What exactly are `Interface<'info, T>` and `InterfaceAccount<'info, T>`

InterfaceAccount<'info, T> and Interface<'info, T> and Anchor accounts types Would love to know more about them, where I should use them and what differentiates the two.
Jimii's user avatar
  • 7,672
2 votes
1 answer
165 views

change stake account withdraw auth where the auth is the account address it self

for development purposes i did the following: created stake account change its withdraw auth to the account address now i am trying to figure how i can change the withdraw auth back to wallet owner ...
Avaulto's user avatar
  • 112
2 votes
1 answer
317 views

How to create an account in any other program using CPI in which PDA is used as signer and payer

I just want to invoke initialize method of callee program from caller program in which pda account should be signer. Callee Program #[program] mod callee { use super::*; // I want to call ...
Panchal Vedant's user avatar
2 votes
1 answer
370 views

What dataLength to use for getMinimumBalanceForRentExemption() for a SOL account?

According to the Solana documentation the minimum balance/amount to be send to new SOL account can be calculated using getMinimumBalanceForRentExemption() getMinimumBalanceForRentExemption() takes a ...
mahnunchik's user avatar
2 votes
3 answers
5k views

How do I close a Solana Account?

We can easily close PDAs to redeem their rent to their owner, however what I'm wondering is can the same be done for a normal, on-curve Solana account? From what I can see once you've sent the minimum ...
McBain's user avatar
  • 5,384
2 votes
2 answers
205 views

How is Token Account Owner Different from Account Owner and Account Holder?

I am learning about Solana's account model. So far so good, these are the things I have found: Solana account is represented by the AccountInfo struct and whose structure is basically this: pub ...
dade's user avatar
  • 292
1 vote
2 answers
245 views

My account has become a Token Account, how can I solve it?

My account that I used commonly had some solanas which I left untouched for a while, now I tried to move my solanas again and it gives me an error and it doesn't allow me to make any transaction or ...
jeo's user avatar
  • 11
1 vote
1 answer
728 views

Why does "solana account" fail until after airdrop

I generate a new key pair by running: solana-keygen new --force I print out the address: solana address 2EHCPkQHcjiBUgWT6zpcHmLPbW2r6wKtb9RjYnoBwFb7 Now I tried to get the account details associated ...
dade's user avatar
  • 292
1 vote
1 answer
1k views

Can we change the owner of a Solana account?

I have a solana account created by a solana program deployed on the devnet. Is it possible to change the owner of the account? If yes then can you please tell how to do it?
Rounak Naik's user avatar
0 votes
0 answers
41 views

Can I use anchor address constraint with dynamic value from state

Here is the example of how address constraint is implemented, but the address is CONSTANT https://beta.solpg.io/66b37272cffcf4b13384d2aa I want to be able to change the authority who signs the ...
Nazar Havryliuk's user avatar