Repository navigation
Conversation
Add nano as an opt-in rail, reached only with --chain nano. It is never
auto-selected, not part of the default wallet set, and never priced in USD.
- src/chains/nano.ts: ed25519-blake2b keys, SLIP-10 m/44'/165'/0' for
mnemonics, checksummed nano_/xrb_ addresses, exact raw <-> XNO, balance
read, and a signed state send block published through an injectable RPC
(work_generate + process). NANO_RPC_URL overrides the endpoint.
- src/chains/nano-x402.ts: ExactNanoScheme, registered on nano:mainnet in
payViaX402 next to Base; payload is { blockHash }. A retry within one
invocation re-presents the published block instead of paying again.
- pay --chain nano requires --max-spend-xno (limit_required otherwise),
aborts over the cap before any block is built, and records price_xno
instead of price_usd, so USD limits and history totals are unchanged.
- wallet create/import/address/list/export/remove accept --chain nano.
- quotes lists x402 exact on nano:mainnet as supported, without a USD price.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A merchant whose 402 offers only x402
exactonnano:mainnetcan't be paid with pay today: there's no Nano keystore, no scheme registered for that network, andquoteslists the rail as unsupported.Change
src/chains/nano.ts: ed25519-blake2b keys, SLIP-10 m/44'/165'/0' for mnemonics, checksummednano_/xrb_addresses, exact raw/XNO conversion with bigint, a balance read, and a signed state send block published through a swappable RPC (work_generate+process);NANO_RPC_URLoverrides the endpoint.src/chains/nano-x402.ts:ExactNanoScheme, registered onnano:mainnetinpayViaX402next to Base. Payload{ blockHash }. A retry within one invocation re-sends the block already published instead of paying again.--chain nano; never auto-selected, not in the defaultwallet create, never priced in USD.pay --chain nanorequires--max-spend-xno(elselimit_required), aborts over the cap before any block is built, and recordsprice_xno, neverprice_usd, so USD limits and history totals are unchanged.wallet create/import/address/list/export/removeaccept--chain nano;quoteslistsnano:mainnetexact as supported with no USD price. README updated.Tests
Published Nano key->address vectors (zero seed and the BIP-39 path), signature and block-hash checks, and end-to-end
payagainst a local 402 merchant and mock node: settle, dry-run, missing cap, over cap, node error ->network_error, bad payTo checksum,xrb_payTo, mainnet-only, retry without double pay, and Base still selected with--chain basewhen both rails are offered.Ran:
bun install --frozen-lockfile && bun run lint && bun run typecheck && bun run knip && bun run test -- --coverage && bun run buildLimits: Nano is not under the global USD limits (only the per-call
--max-spend-xno);check,discover,balance,fund,senddo not take nano yet; an unopened account reads as insufficient balance.