Kit
Interfaces

IInstructionWithSigners

Composable type that allows AccountSignerMetas to be used inside the instruction's accounts array

Deprecated

Use InstructionWithSigners instead. It was only renamed.

Example

import { AccountRole, Instruction } from '@solana/instructions';
import { generateKeyPairSigner, IInstructionWithSigners } from '@solana/signers';
 
const [authority, buffer] = await Promise.all([
    generateKeyPairSigner(),
    generateKeyPairSigner(),
]);
const instruction: Instruction & IInstructionWithSigners = {
    programAddress: address('1234..5678'),
    accounts: [
        // The authority is a signer account.
        {
            address: authority.address,
            role: AccountRole.READONLY_SIGNER,
            signer: authority,
        },
        // The buffer is a writable account.
        { address: buffer.address, role: AccountRole.WRITABLE },
    ],
};

Type Parameters

Type ParameterDefault typeDescription
TSigner extends TransactionSignerTransactionSignerOptionally provide a narrower type for TransactionSigners.
TAccounts extends readonly AccountMetaWithSigner<TSigner>[]readonly AccountMetaWithSigner<TSigner>[]Optionally provide a narrower type for the account metas.

Properties

PropertyModifierType
accounts?readonlyTAccounts

On this page