• 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

    • TFeePayerAddress extends string
    • TTransactionMessage extends Partial<TransactionMessageWithFeePayer<string>> & TransactionMessage

    Parameters

    Returns ExcludeTransactionMessageFeePayer<TTransactionMessage> & TransactionMessageWithFeePayer<TFeePayerAddress>

    import { address } from '@solana/addresses';
    import { setTransactionMessageFeePayer } from '@solana/transaction-messages';

    const myAddress = address('mpngsFd4tmbUfzDYJayjKZwZcaR7aWb2793J6grLsGu');
    const txPaidByMe = setTransactionMessageFeePayer(myAddress, tx);