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:
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
A newly opened public channel may need time to propagate through Fiber gossip before other nodes can route through it.
Stop the browser node
Calldisconnect() from useKeyWay when your application intentionally wants to stop Fiber. This stops the browser node; it does not close or settle channels on-chain.