@ninsei-labs/sdk 0.55.4 → 0.57.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/LICENSE-POLICY.md +9 -2
  3. package/README.md +51 -24
  4. package/THIRD_PARTY_NOTICES.md +174 -0
  5. package/assets/vendors/MANIFEST.json +18 -0
  6. package/assets/vendors/sdk/sdk-browser.js +2059 -2
  7. package/engine/atomic/dleq2.js +187 -22
  8. package/engine/atomic/order.js +21 -3
  9. package/engine/core/config.js +17 -24
  10. package/engine/core/deployments.generated.js +103 -0
  11. package/engine/core/store.js +25 -4
  12. package/engine/core/swap.js +54 -52
  13. package/engine/evm/asyncRoute.js +1 -1
  14. package/engine/evm/claimGas.js +2 -1
  15. package/engine/evm/escrow.js +13 -8
  16. package/engine/evm/factory.js +24 -26
  17. package/engine/evm/funding.js +8 -3
  18. package/engine/evm/index.js +2 -4
  19. package/engine/evm/session.js +3 -3
  20. package/engine/monero/scan.js +101 -22
  21. package/engine/recovery/restore.js +8 -8
  22. package/engine/sdk/bridge.js +3 -6
  23. package/index.d.ts +57 -27
  24. package/package.json +25 -8
  25. package/src/actions.mjs +52 -9
  26. package/src/adapters/evm-wallet.mjs +24 -5
  27. package/src/adapters/index.d.ts +66 -0
  28. package/src/adapters/index.mjs +0 -6
  29. package/src/codes.mjs +14 -0
  30. package/src/config.mjs +1 -0
  31. package/src/engine.mjs +6 -6
  32. package/src/feeEstimate.mjs +11 -4
  33. package/src/http.mjs +4 -1
  34. package/src/index.mjs +4 -3
  35. package/src/legs/kyber.mjs +23 -0
  36. package/src/lock.mjs +2 -1
  37. package/src/order.mjs +108 -20
  38. package/src/primitives.mjs +4 -5
  39. package/src/probes.mjs +9 -3
  40. package/src/provider/envFile.mjs +11 -1
  41. package/src/public/networks.d.ts +45 -0
  42. package/src/public/networks.mjs +10 -1
  43. package/src/public/order.d.ts +4 -0
  44. package/src/public/recovery.d.ts +40 -54
  45. package/src/public/recovery.mjs +2 -8
  46. package/src/public/xmr.d.ts +14 -3
  47. package/src/public/xmr.mjs +1 -1
  48. package/src/quoteEip712Spec.mjs +9 -1
  49. package/src/quotes.mjs +118 -49
  50. package/src/record.mjs +3 -3
  51. package/src/recovery-key.mjs +161 -237
  52. package/src/relayFeatures.mjs +25 -13
  53. package/src/relayFirmClient.mjs +69 -6
  54. package/src/relayQuote.mjs +87 -10
  55. package/src/relayRequest.mjs +12 -3
  56. package/src/relayView.mjs +3 -3
  57. package/src/swap-flow.mjs +153 -67
  58. package/src/swaps.mjs +346 -174
  59. package/src/sweep-restore.mjs +14 -6
  60. package/src/sweep.mjs +34 -11
  61. package/src/version.mjs +1 -1
  62. package/src/xmr-arrival.mjs +55 -24
  63. package/assets/vendors/atomic/atomic-browser.js +0 -24
  64. package/engine/atomic/order-client.js +0 -56
  65. package/engine/atomic/order-worker.js +0 -156
  66. package/engine/evm/asyncExec.js +0 -577
  67. package/engine/evm/asyncLegs.js +0 -308
  68. package/src/adapters/node-test-evm-wallet.mjs +0 -357
package/CHANGELOG.md CHANGED
@@ -1,3 +1,63 @@
1
+ ## 0.57.2 — 2026-11-06
2
+
3
+ - Re-release of 0.57.0 after the publish job rejected the local tarball path. `0.57.1` was tagged but not published; there are no API changes from 0.57.0, and the package content and generated deployment pins are unchanged.
4
+
5
+ ## 0.57.0 — 2026-11-06
6
+
7
+ - Deployment pins are generated from `deployments/<vm>/<network>.json` into `engine/core/deployments.generated.js`; `CHAINS` and `KNOWN_FACTORY_CODES` read them. The SDK exports `DEPLOYMENTS`, `DEPLOYMENT_CHAINS`, `DEPLOYMENT_VMS` and `deploymentFor` (network id, CAIP-2 or EVM chain id, with no fallback to another network).
8
+ - The Monero scanner reads tagged `tx_extra` (`0x01`–`0x04`) and per-output additional public keys (`0x04`), so a payment to a subaddress is not missed. DLEQ refuses an identity Edwards subject point and verification runs in yielding chunks.
9
+ - `swaps.start` / `startSell` reuse the already-verified side instead of proving it a second time. Sweep sends key images only when the caller explicitly marks the node trusted (`window.trustedNode`), because key images are linkable.
10
+ - Relay fixtures carry real DLEQ knowledge proofs, including a broken `pokB` refusal; the fixture generator is committed and byte-checked. Unknown swap amounts are `null`, not zero.
11
+ - Accumulated quote, swap, refund, relay, factory and input-boundary fixes from the 0.56.1 line are included.
12
+ - **License:** the package is now `(MIT AND LGPL-3.0-only)` because of the go-dleq port; the browser bundle carries the attribution.
13
+
14
+ ## 0.56.1 — 2026-11-03
15
+
16
+ - The provider settings search now includes the documented `rfq/` layout and has no duplicate candidates; the local file still outranks the production one.
17
+
18
+ - Every teeth script now runs against a throwaway copy of the tree, so a hard interruption cannot leave a mutated source file in the checkout. The coverage command enforces committed floors for the critical money-path modules and refuses a new never-loaded critical file.
19
+
20
+ - `arbitrum-sepolia` moves to the `contracts-testnet-2026.11.03-fix` deployment: factory
21
+ `0x6ab0ef3aa67b022d4007550e7556108537debb55` (block `325677796`), cashier
22
+ `0x6c6c6da6392a92b8b9c69b3ec234d524cdcfcb57`, registry
23
+ `0xf06ec2b1de69ff5b528ed917edffbee7be6dccc9` and implementation code hash
24
+ `0x334d6802099fccaef87b9569618ab3c46f6a2f075c2934c0cdbc8d4e4042944b`. The factory code pin moves to
25
+ `0x9246f3b981311c4ed988d77bb2177ef45d78182e47d77a2077d0afe3f3377cb8`.
26
+
27
+ ## 0.56.0 — 2026-11-02
28
+
29
+ - Hardened test evidence: the V8 coverage merger now combines equal ranges across processes instead of keeping the first zero count, lists never-loaded source files, and has a regression check for both behaviours; the DLEQ oracle can require Rust in CI; the quote-TTL check drives direct and sale with the same edge table and a named post-expiry sentinel; the packed consumer compiles the TypeScript declarations from the installed tarball; and the claim sender seam is exercised end to end.
30
+ - Added local SDK lifecycle scenarios for a sell record: a restarted facade resumes the same record, a changed offer is refused, an unreadable store is a named refusal before a record is reported, and a failed escrow gate removes the premature record. The check also records the read trace of a sell start. These are fast in-process checks; the scheduled end-to-end contour runs separately.
31
+ - Added a machine-checked security-invariant map and a baseline V8 line-coverage command. The map ties sender/chain binding, quote policy and TTL, DLEQ knowledge proofs, recovery, storage, relay, terminal state, arrival and the adapter surface to executable checks; the coverage command runs the normal battery with `NODE_V8_COVERAGE` and writes `coverage/coverage-summary.json`.
32
+ - Rebuilt the committed browser bundle after the adapter and instance-scope changes, and pinned its new SHA-256 in `assets/vendors/MANIFEST.json`. CI now reports a stale bundle with a stat line instead of dumping the minified diff to the job log.
33
+ - Every `createNinsei` instance now owns its storage store; the engine's swap-record helpers accept that store, so two clients with different adapters list, read and forget separate records. Action guards read the chain and the latest block through the provider of the wallet adapter they were given, not through the process-wide engine provider. The legacy `bindStorage` remains only for the demo/test setup.
34
+ - `./adapters` now carries TypeScript declarations for the five production adapters; the TypeScript consumer imports `evmWallet`, the storage adapters and both Monero wallet roles from the packed subpath. The test-only Node EVM wallet moved to `tools/` and is no longer exported from the production adapter barrel.
35
+ - Recovery and CI comments now describe the v2 binding (the factory is part of it) and the current TypeScript consumer; the README export inventory lists every published subpath.
36
+ - Added a test-only DLEQ oracle pair under `test/dleq-oracle`: a Go fork that generates `ninsei-dleq-vector/2` proofs in SDK mode (right-aligned secp256k1 reduction, 253 bits, `pokA`/`pokB`) and an independently written Rust verifier. CI builds both and cross-checks Go → SDK/Rust, SDK → Go/Rust and the committed JS fixtures; a wrong context, point, low-order point or witness and a corrupted knowledge proof are refused by every verifier. The reference R-REF-1 reduction is not used by the SDK oracle.
37
+ - Direct and sale quotes require `validUntil` to be a safe integer strictly after the quote's clock. A zero, fractional, non-numeric or unsafe expiry is refused as `quote-expired`; a direct quote can no longer behave as a non-expiring quote while the relay path requires a future integer.
38
+ - **Security:** the EVM wallet adapter re-reads `eth_accounts` at the `send` boundary and refuses an account other than the one captured by the action (`wrong-account`). Funding passes the order's locker; mark-ready, claim and refund pass the wallet account read at the start of the action. A wallet switch between the guard and the transaction can no longer publish a claim half from a foreign account.
39
+ - The swap record takes its Monero network from the SDK instance's `xmrNetwork` (or an explicit `moneroNetwork` on the request), not from the demo's stagenet constant. The recovery file copies that value, so a testnet instance no longer asks its nodes for stagenet.
40
+ - `openRecoveryKeyFile` returns the file's creation date: the plain file's header day at 00:00 UTC, and the password file's sealed full time. Opening a key no longer replaces its date with the time of opening.
41
+ - `runAtomicOrder` accepts an explicit `xmrNetwork`; without one it keeps the chain's Monero profile and then the demo fallback.
42
+ - The EVM wallet adapter reads `eth_chainId` again at the `send` boundary, refuses a mismatch with `wrong-chain`, and puts `chainId` into the transaction. Funding and the three order actions pass the expected chain, so a wallet that switches networks after the action guard cannot sign on the wrong chain.
43
+ - The release publish job runs in the `npm-publish` environment, so protection rules and required reviewers attach to the job that can publish; the trusted publisher must name the same environment.
44
+ - **Breaking:** the v1 index recovery derivation is gone. `findSwaps` no longer accepts `fromIndex`, `maxIndex`, `signal` or `onProgress`, and its result is `{ swaps, complete }`. `swaps.start` no longer accepts `recoveryIndex`; new swaps always use the order's public salt. A search no longer scans a number range and can no longer become `max-index` incomplete when another person's order shares the factory.
45
+ - Removed the public `takerHalves`, `reserveRecoveryIndex`, `releaseRecoveryIndex`, `commitRecoveryIndex`, `recoveryIndexTaken`, `recoveryBinding`, `RECOVERY_INDEX_MAX`, `RECOVERY_SCAN_DEFAULT` and `RECOVERY_KEY_DOMAIN` exports. The salt-based `takerHalvesV2`, `recoveryBindingV2` and `newRecoverySalt` remain.
46
+ - The scan start height is the OLDEST height among the good Monero witnesses, not the first answer; witnesses more than 100 blocks apart are refused as a disagreement.
47
+ - A withdrawal window whose spent status could not be read no longer reports a complete scan; it names `spent-status-unavailable`.
48
+ - The live refund state follows the escrow: between `readyBy` and `t1` without the mark it stays closed, and at `t1` it opens to anyone holding the depositor's half.
49
+ - Claim, refund and mark-ready read the order before signing: a closed or unfunded order is refused and a second mark is refused; the claim's ready/time rule stays with the contract.
50
+ - A start whose receipt is gone reads the predicted escrow's `status()` before it stays `funding-pending`; a funded escrow is resumed as `xmr-incoming`.
51
+ - Claim, refund and mark-ready read the latest block timestamp and the escrow deadlines; a claim before `readyBy` without the mark, a refund between `readyBy` and `t1`, and a mark after `readyBy` are refused before signing.
52
+ - `firmRelay` compares the signed fee recipient and, without a partner key, the fee rate with `GET /v1/relay`; a mismatch is refused. A timed-out quote request is retried once with the same bytes.
53
+ - `pnpm run build:sdk` rebuilds `assets/vendors/sdk/sdk-browser.js` with esbuild from `tools/sdk-browser-entry.mjs`; CI rebuilds it and refuses a diff, so the committed bundle cannot drift from `src/`.
54
+ - Browser vendor bundles are pinned by SHA-256 in `assets/vendors/MANIFEST.json`; the `vendor-bundles` check reddens when a file changes without a manifest update.
55
+ - `package.json` records `allowScripts` for `esbuild` and `keccak`; a clean npm install no longer warns about unreviewed install scripts.
56
+ - **Breaking:** the DLEQ proof carries `pokA` and `pokB`: a Schnorr proof of knowledge per curve. It proves the claimed point is a pure multiple of the generator, so an `X = x*G + rho*H` quote is refused instead of passing the bit proof and locking the order. `verify` requires both fields; `requireKnowledge: false` exists only for historical vectors.
57
+ - The firm request carries `pokA` and `pokB` through its proof normalisation. Point prefixes accept `0X` and `0x`, and unknown fields inside `sig` are ignored instead of being parsed as scalars.
58
+ - `tools/check-dleq-vectors.mjs` pins four positive vectors and one pure-multiple vector. The pure-multiple proof passes the old statement and is refused by the knowledge proofs; the check mutates a copy to prove that guard reddens.
59
+ - Release workflow: the checkout, setup-node and pnpm actions are pinned by commit, and npm is installed at an exact version.
60
+
1
61
  ## 0.55.4 — 2026-11-01
2
62
 
3
63
  - `createNinsei` now defaults the factory and escrow-implementation pins from the settlement network; a caller's
package/LICENSE-POLICY.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Dependency license policy
2
2
 
3
- The SDK is published as a public package under MIT. Its production dependency tree must stay compatible with
4
- that promise: a dependency with a copyleft, source-available, unknown or missing licence is a decision for a
3
+ The SDK is published under `(MIT AND LGPL-3.0-only)`: the package is MIT except the DLEQ port described below.
4
+ Its production dependency tree must stay compatible with that promise: a dependency with a copyleft, source-available, unknown or missing licence is a decision for a
5
5
  person, not something that enters a release by accident.
6
6
 
7
7
  ## Allowed licences
@@ -23,6 +23,13 @@ An SPDX expression is read as written: `MIT OR Apache-2.0` is allowed when one b
23
23
  `MIT AND ISC` is allowed when every branch is allowed. A `WITH` exception keeps the base licence's decision.
24
24
  `SEE LICENSE IN ...`, `UNLICENSED`, `UNKNOWN`, and every licence outside the list are refused.
25
25
 
26
+ ## The bundled go-dleq port
27
+
28
+ `engine/atomic/dleq2.js` is a port of `github.com/athanorlabs/go-dleq` and is distributed under
29
+ `LGPL-3.0-only`. It is not an npm dependency; `THIRD_PARTY_NOTICES.md` carries the upstream licence text and the
30
+ browser bundle points at it. The rest of the SDK remains MIT. A change that replaces or removes the port must move
31
+ the package licence expression, the notices and the bundle banner together.
32
+
26
33
  ## How the check runs
27
34
 
28
35
  `pnpm licenses list --prod --json` reads the installed production tree, including transitive packages. The
package/README.md CHANGED
@@ -7,7 +7,22 @@ agreement: there is nothing to lay out here, and nothing to compute there.
7
7
  The package **knows nothing about the DOM**: neither `document`, nor `window`, nor `localStorage` (checked by
8
8
  machine). The wallet arrives as an EIP-1193 provider, storage as an adapter, and the interface opens the windows.
9
9
 
10
- ## State (0.1.0)
10
+ ## Coverage
11
+
12
+ The security-invariant map and the V8 line-coverage command are described in [`docs/coverage.md`](docs/coverage.md).
13
+
14
+ ## Integration
15
+
16
+ The seam table, buy/sell/claim/recovery flows, retry and idempotency rules, cancellation semantics and the support
17
+ matrix are in [`docs/integration.md`](docs/integration.md). The declarations remain the source of truth for types.
18
+
19
+ ## Security
20
+
21
+ Report suspected vulnerabilities through GitHub's private **Report a vulnerability** flow, not a public issue.
22
+ The supported versions, scope, response targets, safe-harbor rules and disclosure process are in
23
+ [`SECURITY.md`](SECURITY.md).
24
+
25
+ ## State (0.57.2)
11
26
 
12
27
  | Surface | State |
13
28
  |---|---|
@@ -20,7 +35,7 @@ machine). The wallet arrives as an EIP-1193 provider, storage as an adapter, and
20
35
  | `quotes.firm` | works: a signed, binding quote with a TTL; a refusal is a named code |
21
36
  | `quotes.firmRelay` | works: a firm quote through a relay, built from one recovery key; the node half is DLEQ-checked |
22
37
  | `swaps.list` / `swaps.get` | read state from storage (and after a page reload) |
23
- | `swaps.start` | holds the order: guards → recovery file and the person's confirmation → order → locking funds → **recording with us and watching the Monero address**; returns the named state `step: "xmr-incoming"` |
38
+ | `swaps.start` | holds the order: guards → recovery file and the person's confirmation → order → locking funds → **watching the Monero address**; no backend is required; returns the named state `step: "xmr-incoming"` |
24
39
  | `swaps.watch` | waits for XMR to arrive at the joint address with the same request as the page (`GET /swaps/{id}`): arrived — returns the fact (amount, confirmations, txid); did not wait — a refusal with the code `xmr-timeout`; already on the address but barred by `unlock_time` — a refusal with the code `xmr-locked` (the boundary is in `params.until`), and NO ready mark; the maker DECLINED the order — returns `SwapDeclinedWatch` (`declined: true`, `terminal: "declined"`, the node's own `code`), with every action off; with expectations and a wallet, places the ready mark after the arrival |
25
40
  | `wallet.balances` | works: the native coin and tokens, in minimal units |
26
41
 
@@ -53,8 +68,9 @@ claim. A future driver adds its own settlement methods; the profile alone never
53
68
  compares the list of what the SDK returns with what is declared in the contract (both ways).
54
69
 
55
70
  EVERY PUBLISHED SUBPATH CARRIES ITS OWN DECLARATIONS: `.` (`index.d.ts`), `./xmr`, `./order`, `./evm`,
56
- `./core`, `./recovery` and `./provider` (`src/public/<entry>.d.ts`). Each of them declares exactly the symbols its barrel
57
- re-exports, so a typed consumer sees the same surface the runtime has, and nothing else.
71
+ `./core`, `./networks`, `./recovery`, `./provider`, `./relay` (`src/public/<entry>.d.ts`) and `./adapters`
72
+ (`src/adapters/index.d.ts`). Each of them declares exactly the symbols its barrel re-exports, so a typed consumer sees
73
+ the same surface the runtime has, and nothing else.
58
74
  `tools/check.mjs --only=types` keeps the two sides equal (a subpath without a `types` target, a declarations
59
75
  file that does not read as declarations, or a symbol declared on one side only is red), and
60
76
  `tools/check-types-teeth.mjs` is its breaking run.
@@ -178,17 +194,11 @@ range is not aligned: it is the provider's refusal, and it arrives as a code. In
178
194
 
179
195
  ## Found orders and the paying token
180
196
 
181
- `findSwaps` returns the orders whose commitment came from the recovery key. A salt-based order is found from the
182
- public `salt` in its own `OrderCreated`: the binding is `ninsei-taker-v2|<chain>|<factory>|taker|<salt>`, so the same
183
- words on another device or at another factory produce a different half and no number is reserved. The result says
184
- `derivation: "salt-v2"` and leaves `index` null. Existing v1 orders stay on `ninsei-taker-v1|<chain>|<index>` and are
185
- still found by the index path; a v2 result needs no range scan. For a v1 fallback, discovery does **not** stop after a
186
- run of empty numbers. One call scans at most `RECOVERY_SCAN_DEFAULT` (1000) indices; that keeps a shared factory from
187
- freezing the page. The result names where it stopped: `complete: false`, `searchedUpTo`, `incompleteReason: "max-index"`
188
- and `nextIndex`. A caller that needs more passes `nextIndex` back as `fromIndex`; the scan yields between chunks so the
189
- page stays responsive. `maxIndex` is the number of indices for this call, and `gap` is ignored. `onProgress` receives
190
- `{ scanned, index }` after each chunk and after the final index; `signal` stops between chunks and returns
191
- `incompleteReason: "aborted"` with the same resumable shape.
197
+ `findSwaps` returns the orders whose commitment came from the recovery key. An order is found from the public `salt`
198
+ in its own `OrderCreated`: the binding is `ninsei-taker-v2|<chain>|<factory>|taker|<salt>`, so the same words on
199
+ another device or at another factory produce a different half and no number is reserved. The result says
200
+ `derivation: "salt-v2"` and has no index. There is no range scan and no `max-index` result: every order in the logs is
201
+ read once, and an unreadable log request is a refusal, not a partial answer.
192
202
 
193
203
  - `amount` — the escrow's **native** amount in wei;
194
204
  - `settlementToken: "native"` — what the escrow receives;
@@ -211,8 +221,7 @@ touching the index allocator.
211
221
  The found order also carries the Monero start height and the reason it is absent. `no-block-time`,
212
222
  `monero-nodes-unreachable` and `monero-network-mismatch` are different answers: a missing settlement timestamp is not
213
223
  a dead node, and a node on another network is not an absent reader. A page that starts swaps without the SDK's start
214
- path can call `recoveryIndexTaken` from `./recovery` before using a number; it checks the factory's `OrderCreated`
215
- logs from the registry's deployment block.
224
+ path must use the order's own public salt; there is no number to reserve or check.
216
225
 
217
226
  A revealed half published as `h + n` (the alias the escrow accepts) is reduced modulo the secp256k1 order before the
218
227
  sweep key check, so it rebuilds the same key and remains withdrawable.
@@ -243,8 +252,8 @@ The retired backend no longer decides a swap: its watch row may observe money, b
243
252
  a decline; the client's two-node check and the escrow's own `Declined` event do.
244
253
 
245
254
  Storage is a refusal, not a silent empty state: a failed read, corrupt JSON, a failed write or remove is
246
- `storage-unavailable` with a step, and a second client with another adapter is refused rather than taking over the
247
- first client's records.
255
+ `storage-unavailable` with a step. Every SDK instance gets its own store over the adapter it was given, so two
256
+ clients with different adapters keep separate records and neither takes over the other's.
248
257
 
249
258
  Every body route the SDK sends carries `sdkVersion` from the package (`quotes.firm`, `quotes.sale` and the funding
250
259
  mark). The caller cannot override it with a different line.
@@ -253,6 +262,12 @@ Funding is reported from the receipt, not from the send. A status-0 receipt is `
253
262
  receipt, a receipt without `OrderCreated`, or an event from another factory is `funding-pending` with the transaction
254
263
  hash, and `swaps.start` does not save an escrow or retire a recovery number in that state.
255
264
 
265
+ The predicted escrow and its salt are written to the pending record before the funding transaction is sent. A retry
266
+ after a late receipt or a process restart finds that record by quote id or salt and reads the same transaction; it
267
+ does not build a second side or send a second deposit. An explicit wallet rejection clears the pending mark so the
268
+ person can sign again. A transaction that was already mined is stopped by the escrow state guard; one still in the
269
+ mempool can make the resend revert and cost gas, but cannot create a second deposit.
270
+
256
271
  The wallet adapter accepts the standard Monero network names (`mainnet`, `stagenet`, `testnet`, `fakechain`) and
257
272
  still checks the address shape, so a mainnet withdrawal is not refused because the demo registry lists only
258
273
  stagenet. The withdrawal window retries a `429`, a timeout or a `5xx` before it gives up. If the window still cannot be read,
@@ -299,6 +314,13 @@ core is reused in that case: quotes, the Monero leg, states and recovery do not
299
314
  The check codes tied to EVM are named plainly: `allowance` (token allowances) and `gas` (the network-fee margin)
300
315
  trigger where those exist; on another VM they simply do not appear, rather than turning into "all good".
301
316
 
317
+ ## Pull requests
318
+
319
+ Open a pull request as a draft. The CI battery, license check, house-rules check and dependency scan stay skipped
320
+ while the pull request is a draft, so an intermediate push does not spend runner minutes. Run the local checks
321
+ while you work. Mark the pull request ready only when the branch is final; that starts the full battery. A push
322
+ after that runs it again, so keep the work in draft until the last commit.
323
+
302
324
  ## Rules
303
325
 
304
326
  1. **No DOM.** There is exactly one exception, and it is named: the `src/adapters` directory (the `localStorage`
@@ -307,14 +329,15 @@ trigger where those exist; on another VM they simply do not appear, rather than
307
329
  Network -> virtual machine -> driver: the SDK takes networks from the engine's registry (`CHAINS`) rather than
308
330
  keeping its own list; a network without a driver is rejected by name (`not-implemented` with `vm` and the list
309
331
  of supported ones), rather than being assumed EVM.
310
- Storage arrives through the `storage` option and becomes the core's storage: the state of unfinished swaps and
311
- the agent session live where the interface decided. Without the option the core takes its default — web storage
312
- if it is present in the environment, otherwise process memory.
332
+ Storage arrives through the `storage` option and becomes THAT INSTANCE'S swap store: the state of unfinished
333
+ swaps lives where the interface decided. Without the option the instance takes the default — web storage if it
334
+ is present in the environment, otherwise process memory. Actions read the chain through the provider of the
335
+ wallet adapter they were given, not through a process-wide provider.
313
336
  3. **The wallet is outside.** The SDK opens no windows and does not look for injected providers itself.
314
337
  4. **The step order and the guards are inside `swaps.start`** (stage 2): funds are not locked until the interface
315
338
  has confirmed the recovery file is saved; retrying after an error or a reload is safe.
316
- 5. **Workers and WASM are separate files** from `assetsBase`, so the interface's bundler (Astro/Vite) does not
317
- touch them: `atomic/order-worker.js`, the Monero bundles.
339
+ 5. **WASM and the Monero bundles are separate files** from `assetsBase`, so the interface's bundler (Astro/Vite)
340
+ does not touch them.
318
341
  6. **Strict CSP.** The package is designed for a policy without `eval` and inline.
319
342
  7. **Few dependencies, all permissive.** Every production dependency is checked in CI against an allowlist: MIT, MIT-0,
320
343
  ISC, Apache-2.0, BSD-2-Clause, BSD-3-Clause, Unlicense, 0BSD, CC0-1.0 and BlueOak-1.0.0. Copyleft,
@@ -337,6 +360,10 @@ demo pin the **exact** version (`"@ninsei-labs/sdk": "0.40.0-develop.1"`) rather
337
360
  move, so `npm install @ninsei-labs/sdk` keeps serving the last real release. Shipping a release is then its own
338
361
  decision: a plain `X.Y.Z`, the only shape that publishes under `latest`.
339
362
 
363
+ Every publish, a prerelease too, comes from a commit on `main` whose CI run on the push to `main` passed. The release
364
+ workflow checks both before it builds, for a tag and for a manual run that publishes, and refuses any other commit; a
365
+ CI run still going is waited for, at most 20 minutes. A dry run builds any branch.
366
+
340
367
  The tag is passed to `npm publish` explicitly (`--tag <tag>`), and `tools/npm-tag.mjs` refuses the two ways this
341
368
  can go wrong **by name** - a prerelease that would take `latest`, and a plain version that would slide into a
342
369
  channel someone else owns. A manual run of the release workflow may override the tag with an input; when it does,
@@ -314,6 +314,180 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
314
314
  THE SOFTWARE.
315
315
  ```
316
316
 
317
+ ## go-dleq
318
+
319
+ License: LGPL-3.0-only
320
+ Source: https://github.com/athanorlabs/go-dleq/tree/d6fd7c03e213683cbb286d4d5bbba1c7e7e1cfe1
321
+
322
+ ### LICENSE
323
+
324
+ ```text
325
+ GNU LESSER GENERAL PUBLIC LICENSE
326
+ Version 3, 29 June 2007
327
+
328
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
329
+ Everyone is permitted to copy and distribute verbatim copies
330
+ of this license document, but changing it is not allowed.
331
+
332
+ This version of the GNU Lesser General Public License incorporates
333
+ the terms and conditions of version 3 of the GNU General Public
334
+ License, supplemented by the additional permissions listed below.
335
+
336
+ 0. Additional Definitions.
337
+
338
+ As used herein, "this License" refers to version 3 of the GNU Lesser
339
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
340
+ General Public License.
341
+
342
+ "The Library" refers to a covered work governed by this License,
343
+ other than an Application or a Combined Work as defined below.
344
+
345
+ An "Application" is any work that makes use of an interface provided
346
+ by the Library, but which is not otherwise based on the Library.
347
+ Defining a subclass of a class defined by the Library is deemed a mode
348
+ of using an interface provided by the Library.
349
+
350
+ A "Combined Work" is a work produced by combining or linking an
351
+ Application with the Library. The particular version of the Library
352
+ with which the Combined Work was made is also called the "Linked
353
+ Version".
354
+
355
+ The "Minimal Corresponding Source" for a Combined Work means the
356
+ Corresponding Source for the Combined Work, excluding any source code
357
+ for portions of the Combined Work that, considered in isolation, are
358
+ based on the Application, and not on the Linked Version.
359
+
360
+ The "Corresponding Application Code" for a Combined Work means the
361
+ object code and/or source code for the Application, including any data
362
+ and utility programs needed for reproducing the Combined Work from the
363
+ Application, but excluding the System Libraries of the Combined Work.
364
+
365
+ 1. Exception to Section 3 of the GNU GPL.
366
+
367
+ You may convey a covered work under sections 3 and 4 of this License
368
+ without being bound by section 3 of the GNU GPL.
369
+
370
+ 2. Conveying Modified Versions.
371
+
372
+ If you modify a copy of the Library, and, in your modifications, a
373
+ facility refers to a function or data to be supplied by an Application
374
+ that uses the facility (other than as an argument passed when the
375
+ facility is invoked), then you may convey a copy of the modified
376
+ version:
377
+
378
+ a) under this License, provided that you make a good faith effort to
379
+ ensure that, in the event an Application does not supply the
380
+ function or data, the facility still operates, and performs
381
+ whatever part of its purpose remains meaningful, or
382
+
383
+ b) under the GNU GPL, with none of the additional permissions of
384
+ this License applicable to that copy.
385
+
386
+ 3. Object Code Incorporating Material from Library Header Files.
387
+
388
+ The object code form of an Application may incorporate material from
389
+ a header file that is part of the Library. You may convey such object
390
+ code under terms of your choice, provided that, if the incorporated
391
+ material is not limited to numerical parameters, data structure
392
+ layouts and accessors, or small macros, inline functions and templates
393
+ (ten or fewer lines in length), you do both of the following:
394
+
395
+ a) Give prominent notice with each copy of the object code that the
396
+ Library is used in it and that the Library and its use are
397
+ covered by this License.
398
+
399
+ b) Accompany the object code with a copy of the GNU GPL and this license
400
+ document.
401
+
402
+ 4. Combined Works.
403
+
404
+ You may convey a Combined Work under terms of your choice that,
405
+ taken together, effectively do not restrict modification of the
406
+ portions of the Library contained in the Combined Work and reverse
407
+ engineering for debugging such modifications, if you also do each of
408
+ the following:
409
+
410
+ a) Give prominent notice with each copy of the Combined Work that
411
+ the Library is used in it and that the Library and its use are
412
+ covered by this License.
413
+
414
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
415
+ document.
416
+
417
+ c) For a Combined Work that displays copyright notices during
418
+ execution, include the copyright notice for the Library among
419
+ these notices, as well as a reference directing the user to the
420
+ copies of the GNU GPL and this license document.
421
+
422
+ d) Do one of the following:
423
+
424
+ 0) Convey the Minimal Corresponding Source under the terms of this
425
+ License, and the Corresponding Application Code in a form
426
+ suitable for, and under terms that permit, the user to
427
+ recombine or relink the Application with a modified version of
428
+ the Linked Version to produce a modified Combined Work, in the
429
+ manner specified by section 6 of the GNU GPL for conveying
430
+ Corresponding Source.
431
+
432
+ 1) Use a suitable shared library mechanism for linking with the
433
+ Library. A suitable mechanism is one that (a) uses at run time
434
+ a copy of the Library already present on the user's computer
435
+ system, and (b) will operate properly with a modified version
436
+ of the Library that is interface-compatible with the Linked
437
+ Version.
438
+
439
+ e) Provide Installation Information, but only if you would otherwise
440
+ be required to provide such information under section 6 of the
441
+ GNU GPL, and only to the extent that such information is
442
+ necessary to install and execute a modified version of the
443
+ Combined Work produced by recombining or relinking the
444
+ Application with a modified version of the Linked Version. (If
445
+ you use option 4d0, the Installation Information must accompany
446
+ the Minimal Corresponding Source and Corresponding Application
447
+ Code. If you use option 4d1, you must provide the Installation
448
+ Information in the manner specified by section 6 of the GNU GPL
449
+ for conveying Corresponding Source.)
450
+
451
+ 5. Combined Libraries.
452
+
453
+ You may place library facilities that are a work based on the
454
+ Library side by side in a single library together with other library
455
+ facilities that are not Applications and are not covered by this
456
+ License, and convey such a combined library under terms of your
457
+ choice, if you do both of the following:
458
+
459
+ a) Accompany the combined library with a copy of the same work based
460
+ on the Library, uncombined with any other library facilities,
461
+ conveyed under the terms of this License.
462
+
463
+ b) Give prominent notice with the combined library that part of it
464
+ is a work based on the Library, and explaining where to find the
465
+ accompanying uncombined form of the same work.
466
+
467
+ 6. Revised Versions of the GNU Lesser General Public License.
468
+
469
+ The Free Software Foundation may publish revised and/or new versions
470
+ of the GNU Lesser General Public License from time to time. Such new
471
+ versions will be similar in spirit to the present version, but may
472
+ differ in detail to address new problems or concerns.
473
+
474
+ Each version is given a distinguishing version number. If the
475
+ Library as you received it specifies that a certain numbered version
476
+ of the GNU Lesser General Public License "or any later version"
477
+ applies to it, you have the option of following the terms and
478
+ conditions either of that published version or of any later version
479
+ published by the Free Software Foundation. If the Library as you
480
+ received it does not specify a version number of the GNU Lesser
481
+ General Public License, you may choose any version of the GNU Lesser
482
+ General Public License ever published by the Free Software Foundation.
483
+
484
+ If the Library as you received it specifies that a proxy can decide
485
+ whether future versions of the GNU Lesser General Public License shall
486
+ apply, that proxy's public statement of acceptance of any version is
487
+ permanent authorization for you to choose that version for the
488
+ Library.
489
+ ```
490
+
317
491
  ## ieee754 1.2.1
318
492
 
319
493
  License: BSD-3-Clause
@@ -0,0 +1,18 @@
1
+ {
2
+ "version": 1,
3
+ "note": "Pinned browser bundles. A change to one of these files must be accompanied by a matching SHA-256 here and a rebuild of the page's asset registry.",
4
+ "bundles": {
5
+ "monero/monero-js-browser.js": {
6
+ "sha256": "05c682ea514db089b3f872e4e8eee3d526e7131079bdb3871dad57d201db7e89",
7
+ "source": "monero-js"
8
+ },
9
+ "sdk/sdk-browser.js": {
10
+ "sha256": "5ea90250943fca3e98a542ee2b2b7f16c22b7c59416ed358d73aa3868137b1df",
11
+ "source": "sdk/src (facade, adapters, recovery)"
12
+ },
13
+ "walletconnect/wc-browser.js": {
14
+ "sha256": "fb64f27c1ec026811fe72bfff06da1f997bbf720569ea73be87818e2c5847eec",
15
+ "source": "@walletconnect"
16
+ }
17
+ }
18
+ }