Skip to content

Channel.from

Instantiates a TIP-20 channel reserve descriptor.

Accepts a TIP-20 token ID or address, and defaults operator and authorizedSigner to the zero address.

Imports

Named
import { Channel } from 'ox/tempo'

Examples

import { Channel } from 'ox/tempo'
 
const channel = Channel.from({
  expiringNonceHash: '0x0000000000000000000000000000000000000000000000000000000000000002',
  payee: '0x2222222222222222222222222222222222222222',
  payer: '0x1111111111111111111111111111111111111111',
  salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
  token: 1n,
})

Definition

function from(
  value: from.Value,
): from.ReturnType

Source: src/tempo/Channel.ts

Parameters

value

  • Type: from.Value

The channel descriptor input.

value.authorizedSigner

  • Type: Address.Address | undefined
  • Optional

Optional signer for vouchers. Zero means payer signs.

value.expiringNonceHash

  • Type: 0x${string}

Transaction-derived hash assigned when the channel was opened.

value.operator

  • Type: Address.Address | undefined
  • Optional

Optional relayer allowed to submit settle for the payee.

value.payee

  • Type: abitype_Address

Account that receives settled voucher payments.

value.payer

  • Type: abitype_Address

Account that funded the channel and receives refunds.

value.salt

  • Type: 0x${string}

User-supplied salt to distinguish otherwise identical channels.

value.token

  • Type: TokenId.TokenIdOrAddress

TIP-20 token address or ID held by the channel.

Return Type

The normalized channel descriptor.

from.ReturnType