Imported from bellodox/rod-web-swap (
AGENTS.md). Install upstream withnpx skills add bellodox/rod-web-swap. Copyright stays with the author.
AGENTS.md
This file provides guidance to agents when working with code in this repository.
- This repo is a static browser wallet: there is no
package.jsonand no scripted build/lint/test entrypoint. Validate changes by loadingindex.htmlin a browser and exercising the affected flow. - Runtime depends on script-tag order in
index.html: crypto/libs load beforejs/coin.js, andjs/coin.jsloads beforejs/coinbin.js. Do not convert to deferred/reordered loading without rechecking all globals. - Network defaults are hard-coded for ROD in
js/coin.js: mainnet prefixes, Bech32 HRProd, and API basehttps://api.spacexpanse.org:1234. Wallet/explorer behavior assumes these defaults unless the Settings tab changes them at runtime. - The wallet is intentionally offline-first but not fully offline: address generation/signing are local, while balance, UTXO, tx lookup, broadcast, and API health depend on the ROD API wrappers in
coinjs.addressBalance(),coinjs.transaction().listUnspent(),coinjs.transaction().getTransaction(), andcoinjs.transaction().broadcast(). - Broadcast and lookup handlers expect JSON-RPC-style
{result,error}envelopes from the ROD API, not legacy Coinb.in/Chain.so payloads; preserve that normalization when editing API code. - Wallet login compatibility is deliberate: deterministic open-wallet derivation in
#openBtnmust remain stable for existing users, even though the flow is labeled less secure. - SegWit support is intentionally split: new-address tools expose SegWit/Bech32, but the wallet access flow hides those controls in
index.htmland forces legacy by default insyncWalletSegwitState()startup wiring for current API compatibility. - Fee guidance is local-only in this fork. Keep the relay-floor logic centered on
ensureWalletFeeMeetsRelayFloor()and the offline estimate infeeStats(); do not reintroduce remote fee estimators. - Developer donation is intentionally disabled by default:
coinjs.developeris empty and#developerDonationdefaults to0. Guard any donation-related change against emitting invalid outputs. - Be careful when changing scripts or assets used by the PWA shell: update the cache list in
sw.jsand keep CSP/connect restrictions aligned in_headers. - Existing project history in
CHANGELOG.mdis the best source for non-obvious compatibility constraints and previously verified wallet behavior.