Top new questions this week:
|
I am trying to create a PDA with variable seeds like this #[derive(Accounts)] #[instruction(i: u8)] pub struct SendRequest<‘info> { #[account(mut)] pub owner: Signer<‘info>, #…
|
This is an example of account struct in an anchor project. #[derive(Accounts)] pub struct Create<‘info>{ #[account(init,payer=user,space=264)] pub calculator:Account<‘info,Calculator&…
|
I understand that the init keyword in anchor creates and set the default values of an account ,while the ini_if_needed does the same thing and also doesn’t throw an error if the account has already …
|
I am trying to get a bit better performance for a game and would like to have the block hash already there when I send the transaction so I don’t have to wait for the roundtrip to get it just before I …
|
to use the init_if_needed feature, i put in my Cargo.toml: [dependencies] anchor-lang = { version = “0.25.0”, features = [ “init_if_needed” ] } anchor-spl = “0.24.2” mpl-…
|
I made TypeScript code where I could make an NFT using an image-link as the metadata (taking help from the Solana Stack Exchange site). Now. When I tried to implement it in my frontend, I was getting …
|
In @solana/web3.js you’d normally make a Sol transaction with: const transferTransaction = new Transaction().add( SystemProgram.transfer({ fromPubkey: fromKeypair.publicKey, toPubkey: …
|
Greatest hits from previous weeks:
|
What is the best way to detect account switching in Phantom Wallet? I am using Nextjs.
|
I want to write arbitrary account data to an account. I tried using BPF Loader Upgradeable’s Write method, but there was a ton of padding at the start.. Is the only way to do this using an on-chain …
|
On EVM networks you can query the blockchain for the balance of the LP pair reserves (token0, token1) and calculate prices from there. How do I replicate something similar on the solana blockchain. I’…
|
Disclaimer: I asked this on SO and also in Discord, but was directed here, so here I am… I’m doing a simple transaction with a single transfer instruction for 0,1 SOL from one account to another. …
|
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: …
|
Following error occurs when I try to run anchor test: Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: Program failed to complete at Connection….
|
I’m trying to create a solana wallet using solana-keygen and then check it’s balance With this line I create the wallet with the spesific outfile C:\Users\Ali Berkin>solana-keygen new –force -o &…
|
Can you answer these questions?
|
I am switching my app from wallet-adapter to wallet-standard. Based on my reading, the wallets that support wallet-standard will be automatically detected. So I pass an empty array to the wallets …
|
Is there a repository somewhere with ways to add abi functions like on erc20 tokens? Reflections, taxes on buy/sell transfers and contract swaps at certain amounts, automated burns, etc.
|
How to merge two VersionedTransaction (V0 transaction format) into one Transaction in Rust? docs.rs/solana-sdk/latest/solana_sdk/transaction/struct.VersionedTransaction.html
|