Skip to main content

Questions tagged [account]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
1 answer
76 views

Where does a Account of a TokenMint store the maximum capacity it has at the moment?

I just started learning Solana, and I have a question that is confusing me. A tokenMint are account that holds specific information about a token. But createMint only requires the mint freeze ...
LAUR_NASA's user avatar
  • 193
3 votes
1 answer
1k views

Extract specific information from a transaction

I need to extract this info from a transaction: from, to wallet addresses asset: SOL or a token (what token?) amount transfered block_timestamp I know how to get info of a transaction - https://docs....
Kum's user avatar
  • 107
3 votes
2 answers
515 views

Store text as string vs. bytes

Is there any advantage to using Vec<u8> over String to store text in storage account fields? And if so, why? From a storage perspective, they are nearly handled identically as far as I can tell ...
Sebastian Dine's user avatar
3 votes
1 answer
154 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
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
2 answers
502 views

Efficient way to get Account age?

So right now I'm calling getSignatures and getting blocktime of the earliest one I get returned. Is there a more efficient way of doing this?
Noe Trejo's user avatar
  • 115
3 votes
1 answer
282 views

Fetching transaction ID that created account

Background: In my application I am creating an account to store some arbitrary information. I then want to display the transaction id/address of the transaction that created such an account. Question: ...
Burger Bob's user avatar
  • 1,506
3 votes
1 answer
222 views

Creating Stake Account using CLI

I am using the following command using the reference link as https://docs.solana.com/cli/delegate-stake. However, I am getting an error - "Error: Dynamic program error: missing signature for ...
Manish D.'s user avatar
3 votes
1 answer
34 views

What if the rent exemption price goes up?

Given that new Solana accounts must be credited - at creation time - with enough SOL to be "rent-exempt", the balance of an account isn't allowed to go below its corresponding minimum "...
Iaroslav's user avatar
  • 199
3 votes
0 answers
77 views

How to do account white listing using merkle tree on solana native rust program? Is it really possible to do whitelist account using merkle on solana?

I did this code But have doubt that it will not work as desired:- use borsh::{BorshDeserialize, BorshSerialize}; use merkletreers::tree::MerkleTree; use merkletreers::utils::hash_it; use ...
Aditya's user avatar
  • 307
3 votes
0 answers
139 views

Is it possible to use conditional seed for PDA creation?

So, the two endpoints I am using are almost identical, the only difference being the seed used in the creation of PDA for each of the accounts. I will start with the abstract of my program: First of ...
0xShuk's user avatar
  • 1,991
2 votes
3 answers
1k views

Is there a limit to how many accounts one is able to pass into an Anchor Context?

I heard there is a limit of 30. Not sure if true or not.
Burger Bob's user avatar
  • 1,506
2 votes
3 answers
194 views

How to close account?

I am trying to close an account with a balance of 890880 lamport (getMinimumBalanceForRentExemption api result) for rent, and I send a transaction to transfer the 885880 amount via system transfer. ...
Koichi's user avatar
  • 81
2 votes
1 answer
593 views

How to get symbol and amount of a transaction in solana network?

I'm new to solana network and technology. I'm developing an application to confirm transaction receive to a specific wallet address on solana network. Right now I'm using this API "api.mainnet-...
mahmood's user avatar
  • 23
2 votes
2 answers
279 views

Zero_copy not working , Getting `Zeroable` is not implemented for `[Event; 25000]`, while trying example

I'm trying This example by anchor to initialize large accounts and using zero_copy on them. https://github.com/coral-xyz/anchor/blob/master/tests/zero-copy/programs/zero-copy/src/lib.rs#L156-L165 I'm ...
Abhishek Faliya'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
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
2 answers
481 views

AccountLoader for a struct from another Program

Say I have an account in Program A, and I know it looks like this: #[account(zero_copy)] pub struct SomeAcc { pub some_num: u32, } Now in my Program B, I copy and paste this struct exactly into ...
Whiteseal's user avatar
  • 3,607
2 votes
2 answers
744 views

TryingToInitPayerAsProgramAccount. Error Number: 4101. You cannot/should not initialize the payer account as a program account

I have a simple program: #[program] pub mod my_cool_project { use super::*; pub fn initialize(ctx: Context<Initialize>) -> Result<()> { let counter = &mut ctx....
Daniel Cukier's user avatar
2 votes
2 answers
129 views

Multiple account creation in one transaction

When we create a Solana PDA we construct the instruction, sign it and then send the transaction to Solana cluster. So I would like to know the transaction fees is charged based on nr. of instructions/...
Souvagya's user avatar
  • 131
2 votes
1 answer
964 views

How can I know if a account exists or not on solana blockchain in frontend?

I am creating PDA accounts which have seeds consisting of user-wallet-publicKey and a static-text In frontend I want to show either user-data if user already created his account or a button to deploy ...
Mahesh Ghamaand's user avatar
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
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,712
2 votes
1 answer
696 views

What does it mean Lamport?

What does it mean Lamport?. How many Lamports is one Solana?. Is it important?. What is Lamport balance?. How to calculate it?. How many Lamports should I have in my account to be estimated rent ...
Gus's user avatar
  • 21
2 votes
1 answer
1k views

How to generate address out of a seed phrase and a derivation path for Solana and some tokens?

I know how to generate addresses out of a seed phrase and a derivation path in Ethereum. And I need to do the same thing for Solana too. However, I've done a research and barely found anything. Also, ...
Camila326's user avatar
  • 169
2 votes
3 answers
40 views

Create an Address that can only receive tx from certain wallet?

Anyway to do something like this? like an account that can only accept txs from certain accounts?
Noe Trejo's user avatar
  • 115
2 votes
1 answer
1k views

Handling multiple accounts

I'm having a hard time trying to understand the best way (even better, trying to fully understand a way) to handle multiple accounts (both client(js / ts) and program(anchor/rust) side). If I want to ...
ASCorreia's user avatar
  • 318
2 votes
1 answer
135 views

Question about if accounts with NFTs and no Sol - will they be purged and NFT lost?

In this article in the beginning it explains that accounts with Sol will be purged. If there is an account that has 0 Sol but has an NFT in the account, will it be purged and if so what happens to the ...
paradigm111's user avatar
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
2 votes
1 answer
327 views

I want to create multiple PDA accounts made with different seeds belonging to a single user/wallet. to be exact I want to initialize multiple PDA Aco [closed]

I want to create multiple PDA accounts made with different seeds belonging to a single user/wallet. to be exact I want to initialize multiple PDA Accounts with different seeds or bumps belonging to a ...
Syed Murtaza Ali Shah's user avatar
2 votes
1 answer
23 views

Can Other Programs Write to PDA Accounts even if the `Account` type is used and the ownership is checked?

Question: Ownership and Write Permissions for PDA Accounts in Solana Programs I’ve been exploring how the #[account] macro in the Anchor framework interacts with the ownership model of PDA accounts, ...
castle_chain's user avatar
2 votes
1 answer
72 views

how to get an token account's Mint address on chain?

In my anchor program, I declare a uncheck account that will check by code inside instruction function /// CHECK: do check inside function. #[account(mut)] pub user_ata: UncheckedAccount&...
breeze wang's user avatar
2 votes
1 answer
261 views

Freeze Authority ? It says my account is frozen

Instruction #3 Failed - Account is frozen
user19282's user avatar
2 votes
1 answer
124 views

Is there a way to get size_of an account from the client?

I'd like to use getMinimumBalanceForRentExemption. With that said, it expects a parameter of the size of the data account. I'd like to know if there's a way to get the estimate size of an account or ...
techiejd's user avatar
2 votes
1 answer
220 views

Why does the active stake plus the rent reserve not equal to the total balance? How to correctly calculate the total balance?

So I am trying to report the difference balances on an staking account. My assumption was: total balance = active stake + rent reserve However, this equation is not true when looking at the numbers in ...
sibabtcs's user avatar
2 votes
1 answer
133 views

Is it bad practice to have instruction parameters as a part of the PDA seed?

Let us suppose I have made a design, where I would be able to derive the PDA just by knowing the ID. So I have made a PDA that uses the inputted instruction ID parameter as a part of the seed. #[...
Burger Bob's user avatar
  • 1,506
2 votes
1 answer
918 views

Are addresses in Solana unique accross all the tokens?

I'm working on a system wherein there're multiple blockchains involved, and withing each one, native assets and tokens too are used together, as well as wallet addresses of them. In Ethereum and TRON, ...
Kum's user avatar
  • 107
2 votes
2 answers
1k views

Write on remaining_accounts

I'm trying to push a value into a remaining_account Vec. Here it is my code: I have an Struct with a Vec<Pubkey> and I need to push a value. I am using try_from to get the account info but I ...
user3688985's user avatar
2 votes
2 answers
425 views

Can a mint's supply or decimals ever change?

I am building a data ingestion pipeline for solana blockchain data, and trying to determine whether it is safe for my processing pipeline to classify a given mint as an NFT based on whether the supply ...
Stephen Hawkins's user avatar
2 votes
1 answer
151 views

Solana account rent/fee determination

If I create a Solana wallet account via Rust by using instruction solana_program::system_instruction::create_account(...) The 3rd parameter is the nr. of exempted amount of lamport, in the end it's ...
Souvagya's user avatar
  • 131
2 votes
1 answer
168 views

Walllet is "locked". Can't pay transaction fees to close/update program

I am currently facing this issue that doesnt let me close my program (I don't really want to loose all the rent right now) https://forums.solana.com/t/help-me-my-wallet-was-locked-unable-to-pay-a-...
Yusuf-Uluc's user avatar
2 votes
1 answer
85 views

Is there a way to store a reference to a zero copy account in a regular account?

Is there a way to store reference to a zero copy account in a regular account? Something like #[account] pub struct HoldingAccount { [account(zero)] pub myReferenceToAZeroCopyAccount: Box<...
techiejd's user avatar
2 votes
2 answers
2k views

Transaction Error: Signature Verification Failed: Missing Signature For PublicKey

I'm building a transaction on devnet that previously worked when I tested my program. I don't think it's the program itself, but how I am passing down the signatures which is slightly different from ...
Brian M.'s user avatar
  • 141
2 votes
2 answers
212 views

How many PDA accounts can I create? Is it unlimited?

I am going to store huge number of record for my on-chain program. Each record's size is small (likely 100Bytes), but need to store many(maybe millions) records on-chain. From what I have known ...
breeze wang's user avatar
2 votes
1 answer
51 views

PDA have a higher balance then the transferred amount

Why does a PDA account have a higher balance than the transferred funds, despite having an initial balance of 0, after I used an anchor program to transfer Solana Lamports from a wallet account to it?
vicyyn's user avatar
  • 4,295
2 votes
1 answer
131 views

Who has the right to modify an account and who signs transactions?

I understand that in Solana, an account has an holder, which is the private key to the public key representing the account. An account also has anowner which is the program that is allowed to modify ...
Finlay Weber's user avatar
2 votes
2 answers
41 views

Make reading from PDAs private

If I remember correctly, PDA can be found out by anyone who knows the seed, Public Keys and the Program ID related to a Solana program. Is there a mechanism through which no one except the public key ...
felix's user avatar
  • 300
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
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
1 vote
2 answers
61 views

How likely is it that no bump will be found when searching for a PDA given some seeds and program_id?

The rust docs outline that The processes of finding a valid program address is by trial and error, and even though it is deterministic given a set of inputs it can take a variable amount of time to ...
Chris Rock's user avatar