Skip to content

KeyAuthorization.toRpc

Converts an KeyAuthorization.KeyAuthorization to an KeyAuthorization.Rpc.

Imports

Named
import { KeyAuthorization } from 'ox/tempo'

Examples

import { KeyAuthorization } from 'ox/tempo'
import { Value } from 'ox'
 
const authorization = KeyAuthorization.toRpc({
  expiry: 1234567890,
  address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
  type: 'secp256k1',
  limits: [{
    token: '0x20c0000000000000000000000000000000000001',
    limit: Value.from('10', 6)
  }],
  signature: {
    type: 'secp256k1',
    signature: {
      r: 44944627813007772897391531230081695102703289123332187696115181104739239197517n,
      s: 36528503505192438307355164441104001310566505351980369085208178712678799181120n,
      yParity: 0,
    },
  },
})

Definition

function toRpc(
  authorization: Signed,
): Rpc

Source: src/tempo/KeyAuthorization.ts

Parameters

authorization

  • Type: Signed

A Key Authorization.

Return Type

An RPC-formatted Key Authorization.

Rpc