Kit
Functions

setTransactionMessageFeePayerSigner

setTransactionMessageFeePayerSigner<TFeePayerAddress, TTransactionMessage>(feePayer, transactionMessage): Omit<TTransactionMessage, "feePayer"> & TransactionMessageWithFeePayerSigner<TFeePayerAddress, TransactionSigner<TFeePayerAddress>>

Sets the fee payer of a BaseTransactionMessage | transaction message using a TransactionSigner.

Type Parameters

Type ParameterDescription
TFeePayerAddress extends stringSupply a string literal to define a fee payer having a particular address.
TTransactionMessage extends Readonly<{ instructions: readonly Instruction<string, readonly (AccountLookupMeta<string, string> | AccountMeta<string>)[]>[]; version: TransactionVersion; }> & Partial<TransactionMessageWithFeePayer<string> | TransactionMessageWithFeePayerSigner<string, TransactionSigner<string>>>The inferred type of the transaction message provided.

Parameters

ParameterType
feePayerTransactionSigner<TFeePayerAddress>
transactionMessageTTransactionMessage

Returns

Omit<TTransactionMessage, "feePayer"> & TransactionMessageWithFeePayerSigner<TFeePayerAddress, TransactionSigner<TFeePayerAddress>>

Example

import { pipe } from '@solana/functional';
import { generateKeyPairSigner, setTransactionMessageFeePayerSigner } from '@solana/signers';
import { createTransactionMessage } from '@solana/transaction-messages';
 
const feePayer = await generateKeyPairSigner();
const transactionMessage = pipe(
    createTransactionMessage({ version: 0 }),
    message => setTransactionMessageFeePayerSigner(signer, message),
);

On this page