Browser Test Client
Try a payment with the 1.0.1 SDK on Testnet-10. Your browser signs and broadcasts the payment; a successful payment unlocks the protected report. Retrying reuses the same payment. Use a throwaway key and Testnet funds only. See the gateway guide.
Safety Boundary
- The network is fixed to
kaspa:testnet-10; there is no mainnet selector. - Generated or imported private keys stay in browser memory. The page does not write key material to local storage, cookies, query strings, or the server.
- Reset clears the in-memory key, visible fields, and RPC connection state.
- Hash-chain payments send signed grant claims and payment proofs to the demo gateway. Private wallet keys stay in the browser.
- The apex domain hosts static files only. The hosted gateway and its paid test resources run on the separate
demo.kaspa-x402.orgsubdomain.
Runtime Status
Public HTTPS pages must use the listed wss:// endpoints. Local custom endpoints require a local preview opened with ?allow-custom-endpoints=1&endpoint=...; the field must match that local or private-network endpoint.
{}
Testnet Key
Hash-chain exact — live Testnet payment
Generate or import a throwaway key above, fund its Testnet-10 address, and connect to a node. Fetch a quote, then pay to receive the protected report. Retry returns the same payment without another charge. The gateway runs the 1.0.1 payment runtime.
One payment increases the merchant head by the quoted price. The target fee is 0.01 KAS; small change may be included in the fee, up to 0.1 KAS total. The result shows the actual fee. If someone abandons a claimed grant, the operator resets the head manually.
{}
x402 Offer Builder
Development Batch Requirements
Current Lane And Voucher
covenantId is the stable KIP-20 lineage; it does not locate the UTXO. The current outpoint and script must be persisted and advanced after every accepted claim or top-up.
The preview enforces 0 <= S <= A <= T and (T - S) + R <= V. A partial claim advances S and reduces V; A, T, the voucher signature, and covenantId stay unchanged.
{}
Mock Payment Retry
Use this to rehearse the selected 402 retry envelope. Exact uses a schema-only request authorization. Batch uses a schema-only voucher signature and shows the current lane plus a partial-claim successor. These placeholders are not valid settlement evidence.
{}
Offer Compatibility Debug
Paste a PaymentRequired JSON object to see which entries are supported by this Kaspa binding and which entries a client would skip during selection.
{}
Developer Notes
- Run locally with
npm run site:serveand open/demo/. The local preview binds to the LAN; use the host IP from another device. Add?allow-custom-endpoints=1&endpoint=...only when testing a local or private-network node endpoint. - Fund generated addresses with testnet funds only. The Kaspa testnet page lists a TN10 faucet at faucet-tn10.kaspanet.io; a local or private faucet is also suitable.
- The browser SDK is loaded from
/vendor/kaspa-wasm/2.0.0/kaspa-core/. The browser uses public WSS endpoints directly;npm run check:pnn-browserverifies resolver lookup from Node. Runtime spike metadata is available at/demo/pnn-spike.json. - The published TypeScript helpers remain Node-oriented. The hash-chain panel bundles the payment client with a small browser adapter; the mock header builders use browser-native encoding.
- Public Node Network endpoints are shared test infrastructure. Treat outages, latency, and endpoint rotation as expected development failures.