Kit
Functions

setTransactionMessageFeePayer

setTransactionMessageFeePayer<TFeePayerAddress, TTransactionMessage>(feePayer, transactionMessage): ExcludeTransactionMessageFeePayer<TTransactionMessage> & TransactionMessageWithFeePayer<TFeePayerAddress>

Given a base58-encoded address of a system account, this method will return a new transaction message having the same type as the one supplied plus the TransactionMessageWithFeePayer type.

Type Parameters

Type Parameter
TFeePayerAddress extends string
TTransactionMessage extends Readonly<{ instructions: readonly Instruction<string, readonly (AccountLookupMeta<string, string> | AccountMeta<string>)[]>[]; version: TransactionVersion; }> & Partial<TransactionMessageWithFeePayer<string>>

Parameters

ParameterType
feePayerAddress<TFeePayerAddress>
transactionMessageTTransactionMessage

Returns

ExcludeTransactionMessageFeePayer<TTransactionMessage> & TransactionMessageWithFeePayer<TFeePayerAddress>

Example

import { address } from '@solana/addresses';
import { setTransactionMessageFeePayer } from '@solana/transaction-messages';
 
const myAddress = address('mpngsFd4tmbUfzDYJayjKZwZcaR7aWb2793J6grLsGu');
const txPaidByMe = setTransactionMessageFeePayer(myAddress, tx);

On this page