Skip to main content

Questions tagged [anchor-client]

Filter by
Sorted by
Tagged with
3 votes
2 answers
127 views

How the scope for memcmp works when the struct has multiple strings?

Let's imagine I have this account and I want to filter all the Program Accounts by the author: pub struct EntryBook { title: String, author: String } How would be the offset to target the ...
Silvestre Vivo's user avatar
2 votes
1 answer
702 views

Testing Anchor program with solana-program-test crate

I was trying to test my anchor program with rust tests. Test written in Typescript are working fine. I am getting with cargo test: note: run with `RUST_BACKTRACE=1` environment variable to display a ...
Sushant Chandla's user avatar
2 votes
1 answer
524 views

Intitalize Solana Program through IDL

I want to initialize solana program through IDL using rust (anchor-client) program as same as we do in JS let programNetworkDemand = new Program( IDL, programIDNetworkDemand, provider, ); I didn't ...
Mohammad Mavia's user avatar
2 votes
1 answer
412 views

solana token program 0xc Invalid Instruction

I have recently begun getting the below error when running the createMint instruction from @solana/spl-token. To my knowledge, I have not changed any code or dependencies that would affect this. ...
austinmilt's user avatar
1 vote
1 answer
4k views

Stuck at Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x0

I want to call a method of solana smartcontract. I have an IDL. While I'm calling it I'm getting the following error (when I'm calling await this.program.methods.initialize() method): Error: failed ...
Bakhrom Achilov's user avatar
1 vote
1 answer
1k views

how to get all accounts owned by a program deserialized?

I am using the JS sdk and I am trying to get all accounts owned by a program already deserialized. I can do it without Anchor but the result is not deserialized: const accounts = await connection....
rudy rhatal's user avatar
1 vote
4 answers
254 views

Using anchor_client with tokio

I'm trying to invoke a transaction with anchor_client from a tokio context. Here's how I'm doing it: let pid = Keypair::new().pubkey(); let payer = Rc::new(Keypair::new()); let client = ...
McBain's user avatar
  • 5,384
1 vote
1 answer
177 views

How do I build a transaction using `declare_program!` with anchor_client?

If I try to create a transaction using declare_program! for accounts and args and anchor_client for building the transaction: use anchor_lang::prelude::*; declare_program!(my_program); use my_program::...
McBain's user avatar
  • 5,384