Skip to content

Frame

Utilities for constructing, validating, and encoding EIP-8141 call frames.

A Frame.Frame describes a call with an execution mode, approval flags, and separate execution and state gas limits.

Examples

Creating Frames

Use Frame.from to construct a frame with named mode and flags.

import { Frame } from 'ox'
 
const frame = Frame.from({
  executionGas: 50_000n,
  flags: 'approveExecutionAndPayment',
  mode: 'verify'
})

Functions

NameDescription
Frame.assertAsserts that a Frame.Frame satisfies frame-local constraints.
Frame.fromCoerces a frame object into a Frame.Frame.
Frame.fromRpcConverts an RPC frame to a frame.
Frame.fromTupleConverts a Frame.Tuple to a Frame.Frame.
Frame.toRpcConverts a frame to its JSON-RPC representation.
Frame.toTupleConverts a Frame.Frame to its RLP-ready Frame.Tuple.
Frame.validateReturns whether a Frame.Frame satisfies frame-local constraints.

Errors

NameDescription
Frame.InvalidErrorThrown when an EIP-8141 frame is structurally invalid.

Types

NameDescription
Frame.FlagsNumeric approval and batching bits, or a named flag value.
Frame.FrameAn EIP-8141 call frame.
Frame.ModeA numeric or named frame execution mode.
Frame.RpcJSON-RPC representation of a frame.
Frame.TupleRLP-ready frame tuple. Empty target bytes refer to the transaction sender.