Pay with RUSD over Fiber
Fund a Fiber channel with Testnet RUSD, inspect token balances, and send a stablecoin payment to Bottle.
A Fiber UDT is defined by its type script
CKB and RUSD use the same channel APIs, but an RUSD request includes the Testnet RUSD type script. The script—not a ticker string—identifies the asset.
lib/rusd.ts · lines 1–12Provide both CKB capacity and Testnet RUSD
CKB pays for cells and transaction fees. RUSD supplies channel liquidity. The demo queries matching UDT cells and decodes each little-endian amount.
Use the Nervos faucet for CKB and the Stable++ Testnet faucet for RUSD.
Pass the asset type script when funding
The 20 RUSD amount is expressed in its smallest unit and paired with funding_udt_type_script. The browser reuses an existing compatible channel after refresh.
Keep the same asset on the payment
The payment includes udt_type_script so routing selects RUSD liquidity rather than a CKB channel.
Show wallet and channel liquidity separately
On-chain RUSD decreases when it enters the channel; the channel local balance decreases as payments are sent. The interface keeps both layers visible.
app/rusd/page.tsx · lines 4–20