Channel
TIP-20 channel reserve descriptor, constants, and deterministic hashing utilities.
Channel descriptors are emitted by Channel.open and then reused to settle,
top up, close, request close, withdraw, or compute the channel ID. The channel
reserve precompile exposes helper methods for channel identifiers, voucher sign
payloads, and its EIP-712 domain separator. These utilities compute the same
values locally when the chain id and channel fields are known.
Examples
import { Channel } from 'ox/tempo'
const channel = Channel.from({
expiringNonceHash: '0x0000000000000000000000000000000000000000000000000000000000000000',
payee: '0x2222222222222222222222222222222222222222',
payer: '0x1111111111111111111111111111111111111111',
salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
token: 1n,
})
const channelId = Channel.computeId(channel, { chainId: 4217 })Functions
| Name | Description |
|---|---|
Channel.computeId | Computes the canonical TIP-20 channel id for a descriptor. |
Channel.domainSeparator | Computes the EIP-712 domain separator for the TIP-20 channel reserve. |
Channel.from | Instantiates a TIP-20 channel reserve descriptor. |
Channel.getVoucherSignPayload | Computes the EIP-712 sign payload for a TIP-20 channel voucher. |
Types
| Name | Description |
|---|---|
Channel.Channel | TIP-20 channel descriptor. |
Channel.Resolved | Hex-address-normalized Channel.Channel. |

