Kit
Type aliases

TransactionMessageWithSigners

TransactionMessageWithSigners<TAddress, TSigner, TAccounts> = Partial<TransactionMessageWithFeePayer<TAddress> | TransactionMessageWithFeePayerSigner<TAddress, TSigner>> & Pick<BaseTransactionMessage<TransactionVersion, Instruction & InstructionWithSigners<TSigner, TAccounts>>, "instructions">

A BaseTransactionMessage type extension that accept TransactionSigners.

Namely, it allows:

Type Parameters

Type ParameterDefault typeDescription
TAddress extends stringstringSupply a string literal to define an account having a particular address.
TSigner extends TransactionSigner<TAddress>TransactionSigner<TAddress>Optionally provide a narrower type for TransactionSigners.
TAccounts extends readonly AccountMetaWithSigner<TSigner>[]readonly AccountMetaWithSigner<TSigner>[]Optionally provide a narrower type for the account metas.

Example

import { Instruction } from '@solana/instructions';
import { BaseTransactionMessage } from '@solana/transaction-messages';
import { generateKeyPairSigner, InstructionWithSigners, TransactionMessageWithSigners } from '@solana/signers';
 
const signer = await generateKeyPairSigner();
const firstInstruction: Instruction = { ... };
const secondInstruction: InstructionWithSigners = { ... };
const transactionMessage: BaseTransactionMessage & TransactionMessageWithSigners = {
    feePayer: signer,
    instructions: [firstInstruction, secondInstruction],
}

On this page