Type alias TransactionNamespace<IDL, I>

TransactionNamespace<IDL, I>: MakeInstructionsNamespace<IDL, I, Transaction>

The namespace provides functions to build [[Transaction]] objects for each method of a program.

Usage

program.transaction.<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 create an instruction for the increment method above,

const tx = await program.transaction.increment({
accounts: {
counter,
},
});

Type Parameters

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