Type alias Context<A>

Context<A>: {
    accounts?: A;
    instructions?: TransactionInstruction[];
    options?: ConfirmOptions;
    postInstructions?: TransactionInstruction[];
    preInstructions?: TransactionInstruction[];
    remainingAccounts?: AccountMeta[];
    signers?: Signer[];
}

Context provides all non-argument inputs for generating Anchor transactions.

Type Parameters

Type declaration

  • Optional accounts?: A

    Accounts used in the instruction context.

  • Optional instructions?: TransactionInstruction[]

    Deprecated

    use preInstructions instead. Instructions to run before a given method. Often this is used, for example to create accounts prior to executing a method.

  • Optional options?: ConfirmOptions

    Commitment parameters to use for a transaction.

  • Optional postInstructions?: TransactionInstruction[]

    Instructions to run after a given method. Often this is used, for example to close accounts after executing a method.

  • Optional preInstructions?: TransactionInstruction[]

    Instructions to run before a given method. Often this is used, for example to create accounts prior to executing a method.

  • Optional remainingAccounts?: AccountMeta[]

    All accounts to pass into an instruction after the main accounts. This can be used for optional or otherwise unknown accounts.

  • Optional signers?: Signer[]

    Accounts that must sign a given transaction.