Skip to content

Frame.fromTuple

Converts a Frame.Tuple to a Frame.Frame.

Returns numeric mode and flags. An empty target becomes an omitted to. Integer fields must use minimal whole-byte encodings, with empty bytes for zero.

Imports

Named
import { Frame } from 'ox'

Examples

Basic Usage

Decode a frame tuple with separate execution and state gas limits.

import { Frame } from 'ox'
 
const frame = Frame.fromTuple([
  '0x01',
  '0x03',
  '0x',
  ['0xc350', '0x'],
  '0x',
  '0x'
])
{
data: '0x',
executionGas: 50000n,
flags: 3,
mode: 1,
stateGas: 0n,
value: 0n
}

Definition

function fromTuple(
  tuple: Tuple,
): Frame

Source: src/core/Frame.ts

Parameters

tuple

  • Type: Tuple

The frame tuple to convert.

Return Type

The decoded frame.

Frame