TxEnvelopeTempo
Utilities for instantiating, serializing, and hashing Tempo transaction envelopes.
Create, sign, and serialize Tempo transactions with support for configurable fee tokens,
call batching, fee sponsorship, access keys, and scheduled execution via validAfter/validBefore.
Tempo Transaction Specification
Examples
import { Secp256k1, Value } from 'ox'
import { TxEnvelopeTempo } from 'ox/tempo'
const envelope = TxEnvelopeTempo.from({
chainId: 1,
calls: [{ to: '0x0000000000000000000000000000000000000000', data: '0xdeadbeef' }],
maxFeePerGas: Value.fromGwei('10'),
})
const payload = TxEnvelopeTempo.getSignPayload(envelope)
const signature = Secp256k1.sign({ payload, privateKey: '0x...' })
const envelope_signed = TxEnvelopeTempo.from(envelope, { signature })
const envelope_serialized = TxEnvelopeTempo.serialize(envelope_signed)Functions
| Name | Description |
|---|---|
TxEnvelopeTempo.assert | Asserts a TxEnvelopeTempo.TxEnvelopeTempo is valid. |
TxEnvelopeTempo.deserialize | Deserializes a TxEnvelopeTempo.TxEnvelopeTempo from its serialized form. |
TxEnvelopeTempo.from | Converts an arbitrary transaction object into a Tempo Transaction Envelope. |
TxEnvelopeTempo.getFeePayerSignPayload | Returns the fee payer payload to sign for a TxEnvelopeTempo.TxEnvelopeTempo. |
TxEnvelopeTempo.getSignPayload | Returns the payload to sign for a TxEnvelopeTempo.TxEnvelopeTempo. |
TxEnvelopeTempo.hash | Hashes a TxEnvelopeTempo.TxEnvelopeTempo. This is the "transaction hash". |
TxEnvelopeTempo.serialize | Serializes a TxEnvelopeTempo.TxEnvelopeTempo. |
TxEnvelopeTempo.validate | Validates a TxEnvelopeTempo.TxEnvelopeTempo. Returns true if the envelope is valid, false otherwise. |
Errors
| Name | Description |
|---|---|
TxEnvelopeTempo.CallsEmptyError | Thrown when a transaction's calls list is empty. |
TxEnvelopeTempo.InvalidValidityWindowError | Thrown when validBefore is not greater than validAfter. |
Types
| Name | Description |
|---|---|
TxEnvelopeTempo.Call | Represents a single call within a Tempo transaction. |
TxEnvelopeTempo.FeePayerMagic | |
TxEnvelopeTempo.Rpc | |
TxEnvelopeTempo.Serialized | |
TxEnvelopeTempo.SerializedType | |
TxEnvelopeTempo.Signed | |
TxEnvelopeTempo.TxEnvelopeTempo | Tempo transaction envelope (type 0x76). |
TxEnvelopeTempo.Type |

