Skip to main content

New answers tagged

0 votes
Accepted

Using `onAccountChange` in Rust

Figured it out: let listener_client = PubsubClient::new(<WSS URL>).await.unwrap(); // Can add a config instead of None here, but None for simplicity let (stream, shutdown_handle) = ...
Ahri's user avatar
  • 3,920
0 votes
Accepted

Error Message: A seeds constraint was violated. The ts client does not correspond to the pda of the Solana program

Everything looks good and works as expected on my machine. Some things to debug, Could you check that you are using the correct programId, maybe you updated it and forgot to update the IDL Try ...
Jimii's user avatar
  • 3,120
0 votes

How do I resolve the anchor build error: Failed to obtain package metadata

I had the same problem, the error suggests that there is an invalid file path or character in the Cargo.toml file. I resolve it in changing: [workspace] members = [ "programs/*" ] [...
Fulum's user avatar
  • 11
0 votes

Anchor build not working

This looks like a bug in the typenum crate that you're using. You're using Windows, which doesn't allow for / in the paths, but the code is trying to include a file directly at https://github.com/...
Jon C's user avatar
  • 15.3k
1 vote
Accepted

Fetching an account declared in `declare_program!` using anchor_client

Figured it out. We can do: declare_program!(my_program); use my_program::{ID, accounts::MyAccount}; let cl = Client::new_with_options( cluster, fee_payer, CommitmentConfig::confirmed(), );...
Ahri's user avatar
  • 3,920
1 vote

Using anchor_client with tokio

We kinda fight with this as well. Despite we do not have the same way of working with tokio these are my observations: First, I assume you work with solana_client::nonblocking as it's an async example....
chalda's user avatar
  • 1,082
2 votes
Accepted

How can I initialize an SPL token mint using anchor_client?

I believe, or as I understand, there is no reason to construct the instructions via anchor_client. The Anchor client generates the client abstractions for the Anchor program so that instruction-...
chalda's user avatar
  • 1,082
2 votes
Accepted

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

Turns out I was just using two different versions of anchor_client and anchor_lang. Made sure both are the same version, and it works perfectly now.
Ahri's user avatar
  • 3,920
2 votes
Accepted

What is the difference between @coral-xyz/anchor and @project-serum/anchor?

use @coral-xyz/anchor, which is the current version
john's user avatar
  • 7,445
0 votes

Facing issue with account creation with bubblegum, Error: Transaction <some signature> failed ({"err":{"InstructionError":[0,{"Custom":1}]}})

Since this seems to just be calling the system program, and returning an error code of 1, https://github.com/anza-xyz/agave/blob/9a7bada2284e06e421db6186b6d9c715d9eb56cb/sdk/program/src/...
Jon C's user avatar
  • 15.3k

Top 50 recent answers are included