Questions tagged [account]
The account tag has no usage guidance.
27 questions
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?
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?
8
votes
1
answer
2k
views
What is Anchor (8 bytes) discriminator
The question should be straightforward.
4
votes
1
answer
2k
views
Calculating Solana Fees
How are fees calculated in Solana ?
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 ...
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.
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-...
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 ...
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.
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 ...
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: ...
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'...
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/...
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 ...
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&...
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 ...
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
...
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.
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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?
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 ...