Skip to content

Channel.computeId

Computes the canonical TIP-20 channel id for a descriptor.

Mirrors computeChannelId on the TIP-20 channel reserve precompile without performing an RPC call.

Imports

Named
import { Channel } from 'ox/tempo'

Examples

import { Channel } from 'ox/tempo'
 
const channelId = Channel.computeId({
  authorizedSigner: '0x0000000000000000000000000000000000000000',
  expiringNonceHash: '0x0000000000000000000000000000000000000000000000000000000000000000',
  operator: '0x0000000000000000000000000000000000000000',
  payee: '0x2222222222222222222222222222222222222222',
  payer: '0x1111111111111111111111111111111111111111',
  salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
  token: 1n,
}, {
  chainId: 4217,
})

Definition

function computeId(
  channel: computeId.Channel,
  options: computeId.Options,
): Hex.Hex

Source: src/tempo/Channel.ts

Parameters

channel

  • Type: computeId.Channel

Channel descriptor.

options

  • Type: computeId.Options

Options.

options.chainId

  • Type: number | bigint

Chain ID used by the channel reserve precompile.

Return Type

The channel id.

Hex.Hex