Crate anchor_client

source ·
Expand description

anchor_client provides an RPC client to send transactions and fetch deserialized accounts from Solana programs written in anchor_lang.



  • Client defines the base configuration for building RPC clients to communicate with Anchor programs running on a Solana cluster. It’s primary use is to build a Program client via the program method.
  • Auxiliary data structure to align the types of the Solana CLI utils with Anchor client. Client implementation requires <C: Clone + Deref<Target = impl Signer>> which does not comply with Box that’s used when loaded Signer from keypair file. This struct is used to wrap the usage.
  • Program is the primary client handle to be used to build and send requests.
  • Iterator with items of type (Pubkey, T). Used to lazily deserialize account structs. Wrapper type hides the inner type from usages so the implementation can be changed.
  • RequestBuilder provides a builder interface to create and send transactions to a cluster.