All Fiber operations are available through connection.keyway. Wait for connection before calling them.

Activate a channel

A Fiber channel locks CKB on-chain and makes that capacity available for off-chain payments. Amounts use shannons: 1 CKB = 100,000,000 shannons.

Confirm the funding transaction

confirmFunding is an optional KeyWayProvider callback for approving the on-chain transaction that opens a Fiber channel:
The callback runs after KeyWay has built and validated the exact funding transaction, but before it requests the Lit-authorized signature. Return true to approve signing or false to abort. Most applications should omit this prop. KeyWay will display its styled funding confirmation modal, showing the channel amount, network fee, and testnet network. It uses the same rounded panel, theme, typography, and backdrop as the email login modal. Supply confirmFunding only when the application needs to render its own confirmation interface:
confirmFunding only approves channel-opening transactions on CKB. Ordinary Fiber invoice payments use the application’s payment confirmation flow instead.

Read channels and balances

local_balance is the spendable capacity on the user’s side. remote_balance is capacity on the peer’s side. Their sum is the channel’s total capacity.

Create an invoice

Pay an invoice

The sender does not need a direct channel to the receiver. Fiber uses its public channel graph to find a multi-hop route whose channels have enough outbound liquidity.
A newly opened public channel may need time to propagate through Fiber gossip before other nodes can route through it.

Stop the browser node

Call disconnect() from useKeyWay when your application intentionally wants to stop Fiber. This stops the browser node; it does not close or settle channels on-chain.