FFiber WebLN
API / Provider / provider.listChannels

provider.listChannels

Optional

List the channels visible to the provider and expose normalized balance and state information.

Signature

function listChannels(): Promise<ListChannelsResult>
PERMISSION

Requires enable(). No additional confirmation in the reference providers.

Parameters

This method accepts no parameters.

Response

NameTypeDescription
channelsrequiredChannelInfo[]

Normalized channel records.

channelIdrequiredstring

Fiber channel identifier.

staterequiredstring

Current channel lifecycle state.

localBalance / remoteBalancerequiredHex

Channel-side balances in the funded asset.

Example

if (fiber.listChannels) {
  const { channels } = await fiber.listChannels();
  const ready = channels.filter(channel => channel.state === "ChannelReady");
}

Provider behavior

W

WASM node

Normalizes the result of fiber-js listChannels({}).

R

Remote fnn

Normalizes fnn list_channels output into the same ChannelInfo shape.

Errors