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]].
rpc.<method>(...args, ctx); Copy
rpc.<method>(...args, ctx);
args
ctx
## ExampleTo send a transaction invoking the `increment` method above,```javascriptconst txSignature = await program.rpc.increment({ accounts: { counter, authority, },}); Copy
## ExampleTo send a transaction invoking the `increment` method above,```javascriptconst txSignature = await program.rpc.increment({ accounts: { counter, authority, },});
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
Parameters
args- The positional arguments for the program. The type and number of these arguments depend on the program being used.ctx- [[Context]] non-argument parameters to pass to the method. Always the last parameter in the method call.