Type alias RpcNamespace<IDL, I>

RpcNamespace<IDL, I>: MakeInstructionsNamespace<IDL, I, Promise<TransactionSignature>>

The namespace provides async methods to send signed transactions for each non-state method on Anchor program.

Keys are method names, values are RPC functions returning a [[TransactionInstruction]].

Usage

rpc.<method>(...args, ctx);

Parameters

  1. args - The positional arguments for the program. The type and number of these arguments depend on the program being used.
  2. ctx - [[Context]] non-argument parameters to pass to the method. Always the last parameter in the method call.

## Example

To send a transaction invoking the `increment` method above,

```javascript
const txSignature = await program.rpc.increment({
accounts: {
counter,
authority,
},
});

Type Parameters

  • IDL extends Idl = Idl
  • I extends AllInstructions<IDL> = AllInstructions<IDL>