Skip to content

TxEnvelopeTempo.getFeePayerSignPayload

Returns the fee payer payload to sign for a TxEnvelopeTempo.TxEnvelopeTempo.

Fee sponsorship uses a dual-signature scheme: the sender signs the transaction, then a fee payer signs over the transaction with the sender's address to commit to paying fees. The fee payer's signature includes the feeToken and sender_address, using magic byte 0x78 for domain separation.

Fee Payer Signature Fee Sponsorship Guide

Imports

Named
import { TxEnvelopeTempo } from 'ox/tempo'

Examples

import { Secp256k1 } from 'ox'
import { TxEnvelopeTempo } from 'ox/tempo'
 
const envelope = TxEnvelopeTempo.from({
  chainId: 1,
  calls: [{
    data: '0xdeadbeef',
    to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
  }],
  nonce: 0n,
  maxFeePerGas: 1000000000n,
  gas: 21000n,
})
 
const payload = TxEnvelopeTempo.getFeePayerSignPayload(envelope, {
  sender: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045'
})
'0x...'
const signature = Secp256k1.sign({ payload, privateKey: '0x...' })

Definition

function getFeePayerSignPayload(
  envelope: TxEnvelopeTempo.TxEnvelopeTempo,
  options: getFeePayerSignPayload.Options,
): getFeePayerSignPayload.ReturnValue

Source: src/tempo/TxEnvelopeTempo.ts

Parameters

envelope

The transaction envelope to get the fee payer sign payload for.

envelope.accessList

  • Type: readonly { address: abitype_Address; storageKeys: readonly 0x${string}[]; }[]
  • Optional

EIP-2930 Access List.

envelope.authorizationList

  • Type: readonly { address: abitype_Address; chainId: numberType; nonce: bigintType; signature: SignatureEnvelope; }[]
  • Optional

EIP-7702 (Tempo) Authorization list for the transaction.

envelope.calls

  • Type: readonly Call[]

Array of calls to execute.

envelope.chainId

  • Type: numberType

EIP-155 Chain ID.

envelope.feePayerSignature

  • Type: { r: bigintType; s: bigintType; yParity: numberType; }
  • Optional

Fee payer signature.

envelope.feeToken

  • Type: TokenId.TokenIdOrAddress | undefined
  • Optional

Fee token preference. Address or ID of the TIP-20 token.

envelope.from

  • Type: Address.Address | undefined
  • Optional

Sender of the transaction.

envelope.gas

  • Type: bigintType
  • Optional

Gas provided for transaction execution

envelope.keyAuthorization

  • Type: Signed
  • Optional

Key authorization for provisioning a new access key.

When present, this transaction will add the specified key to the AccountKeychain precompile, before verifying the transaction signature. The authorization must be signed with the root key, the tx can be signed by the Keychain signature.

envelope.maxFeePerGas

  • Type: bigintType
  • Optional

Total fee per gas in wei (gasPrice/baseFeePerGas + maxPriorityFeePerGas).

envelope.maxPriorityFeePerGas

  • Type: bigintType
  • Optional

Max priority fee per gas (in wei).

envelope.nonce

  • Type: bigintType
  • Optional

Unique number identifying this transaction

envelope.nonceKey

  • Type: bigintType
  • Optional

Nonce key for 2D nonce system (192 bits).

envelope.signature

  • Type: SignatureEnvelope
  • Optional

envelope.type

  • Type: type

Transaction type

envelope.validAfter

  • Type: numberType
  • Optional

Transaction can only be included in a block after this timestamp.

envelope.validBefore

  • Type: numberType
  • Optional

Transaction can only be included in a block before this timestamp.

options

  • Type: getFeePayerSignPayload.Options

Options.

options.sender

  • Type: abitype_Address

Sender address to cover the fee of.

Return Type

The fee payer sign payload.

getFeePayerSignPayload.ReturnValue