Skip to content

KeyAuthorization.toTuple

Converts an KeyAuthorization.KeyAuthorization to an KeyAuthorization.Tuple.

Imports

Named
import { KeyAuthorization } from 'ox/tempo'

Examples

import { KeyAuthorization } from 'ox/tempo'
import { Value } from 'ox'
 
const authorization = KeyAuthorization.from({
  expiry: 1234567890,
  address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
  type: 'secp256k1',
  limits: [{
    token: '0x20c0000000000000000000000000000000000001',
    limit: Value.from('10', 6)
  }],
})
 
const tuple = KeyAuthorization.toTuple(authorization)
[
'0x174876e800',
[['0x20c0000000000000000000000000000000000001', '0xf4240']],
'0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
'secp256k1',
]

Definition

function toTuple<authorization>(
  authorization: authorization,
): toTuple.ReturnType<authorization>

Source: src/tempo/KeyAuthorization.ts

Parameters

authorization

  • Type: authorization

The KeyAuthorization.KeyAuthorization.

Return Type

A Tempo Key Authorization tuple.

toTuple.ReturnType<authorization>