Skip to content

AuthorizationTempo.fromTuple

Converts an AuthorizationTempo.Tuple to an AuthorizationTempo.AuthorizationTempo.

Imports

Named
import { AuthorizationTempo } from 'ox/tempo'

Examples

import { AuthorizationTempo } from 'ox/tempo'
 
const authorization = AuthorizationTempo.fromTuple([
  '0x1',
  '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
  '0x3'
])
{
address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
chainId: 1,
nonce: 3n
}

It is also possible to append a serialized SignatureEnvelope to the end of an AA Authorization tuple.

import { AuthorizationTempo } from 'ox/tempo'
 
const authorization = AuthorizationTempo.fromTuple([
  '0x1',
  '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
  '0x3',
  '0x01a068a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b907e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064',
])
{
address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
chainId: 1,
nonce: 3n
signature: {
r: BigInt('0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90'),
s: BigInt('0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'),
yParity: 0,
},
}

Definition

function fromTuple<tuple>(
  tuple: tuple,
): fromTuple.ReturnType<tuple>

Source: src/tempo/AuthorizationTempo.ts

Parameters

tuple

  • Type: tuple

The EIP-7702 AA Authorization tuple.

Return Type

The AuthorizationTempo.AuthorizationTempo.

fromTuple.ReturnType<tuple>