@ninsei-labs/sdk 0.56.1 → 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.
- package/CHANGELOG.md +13 -0
- package/LICENSE-POLICY.md +9 -2
- package/README.md +17 -4
- package/THIRD_PARTY_NOTICES.md +174 -0
- package/assets/vendors/MANIFEST.json +1 -5
- package/assets/vendors/sdk/sdk-browser.js +5 -4
- package/engine/atomic/dleq2.js +116 -15
- package/engine/atomic/order.js +21 -3
- package/engine/core/config.js +17 -24
- package/engine/core/deployments.generated.js +103 -0
- package/engine/core/swap.js +7 -7
- package/engine/evm/asyncRoute.js +1 -1
- package/engine/evm/claimGas.js +2 -1
- package/engine/evm/escrow.js +13 -8
- package/engine/evm/factory.js +11 -6
- package/engine/evm/funding.js +8 -3
- package/engine/evm/index.js +2 -4
- package/engine/evm/session.js +3 -3
- package/engine/monero/scan.js +101 -22
- package/engine/recovery/restore.js +8 -8
- package/engine/sdk/bridge.js +2 -5
- package/index.d.ts +48 -11
- package/package.json +4 -2
- package/src/actions.mjs +8 -5
- package/src/codes.mjs +5 -0
- package/src/config.mjs +1 -0
- package/src/engine.mjs +6 -6
- package/src/feeEstimate.mjs +11 -4
- package/src/http.mjs +4 -1
- package/src/index.mjs +1 -1
- package/src/legs/kyber.mjs +23 -0
- package/src/lock.mjs +1 -0
- package/src/order.mjs +108 -20
- package/src/primitives.mjs +4 -5
- package/src/probes.mjs +9 -3
- package/src/public/networks.d.ts +45 -0
- package/src/public/networks.mjs +10 -1
- package/src/public/xmr.mjs +1 -1
- package/src/quotes.mjs +97 -23
- package/src/recovery-key.mjs +32 -14
- package/src/relayFeatures.mjs +25 -13
- package/src/relayFirmClient.mjs +33 -7
- package/src/relayQuote.mjs +87 -10
- package/src/relayView.mjs +3 -3
- package/src/swap-flow.mjs +100 -58
- package/src/swaps.mjs +234 -64
- package/src/sweep-restore.mjs +8 -4
- package/src/sweep.mjs +5 -1
- package/src/version.mjs +1 -1
- package/src/xmr-arrival.mjs +55 -24
- package/assets/vendors/atomic/atomic-browser.js +0 -24
- package/engine/atomic/order-client.js +0 -56
- package/engine/atomic/order-worker.js +0 -156
- package/engine/evm/asyncExec.js +0 -577
- package/engine/evm/asyncLegs.js +0 -308
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
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
|
+
|
|
1
14
|
## 0.56.1 — 2026-11-03
|
|
2
15
|
|
|
3
16
|
- The provider settings search now includes the documented `rfq/` layout and has no duplicate candidates; the local file still outranks the production one.
|
package/LICENSE-POLICY.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Dependency license policy
|
|
2
2
|
|
|
3
|
-
The SDK is published
|
|
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
|
@@ -22,7 +22,7 @@ Report suspected vulnerabilities through GitHub's private **Report a vulnerabili
|
|
|
22
22
|
The supported versions, scope, response targets, safe-harbor rules and disclosure process are in
|
|
23
23
|
[`SECURITY.md`](SECURITY.md).
|
|
24
24
|
|
|
25
|
-
## State (0.
|
|
25
|
+
## State (0.57.2)
|
|
26
26
|
|
|
27
27
|
| Surface | State |
|
|
28
28
|
|---|---|
|
|
@@ -35,7 +35,7 @@ The supported versions, scope, response targets, safe-harbor rules and disclosur
|
|
|
35
35
|
| `quotes.firm` | works: a signed, binding quote with a TTL; a refusal is a named code |
|
|
36
36
|
| `quotes.firmRelay` | works: a firm quote through a relay, built from one recovery key; the node half is DLEQ-checked |
|
|
37
37
|
| `swaps.list` / `swaps.get` | read state from storage (and after a page reload) |
|
|
38
|
-
| `swaps.start` | holds the order: guards → recovery file and the person's confirmation → order → locking funds → **
|
|
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"` |
|
|
39
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 |
|
|
40
40
|
| `wallet.balances` | works: the native coin and tokens, in minimal units |
|
|
41
41
|
|
|
@@ -262,6 +262,12 @@ Funding is reported from the receipt, not from the send. A status-0 receipt is `
|
|
|
262
262
|
receipt, a receipt without `OrderCreated`, or an event from another factory is `funding-pending` with the transaction
|
|
263
263
|
hash, and `swaps.start` does not save an escrow or retire a recovery number in that state.
|
|
264
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
|
+
|
|
265
271
|
The wallet adapter accepts the standard Monero network names (`mainnet`, `stagenet`, `testnet`, `fakechain`) and
|
|
266
272
|
still checks the address shape, so a mainnet withdrawal is not refused because the demo registry lists only
|
|
267
273
|
stagenet. The withdrawal window retries a `429`, a timeout or a `5xx` before it gives up. If the window still cannot be read,
|
|
@@ -308,6 +314,13 @@ core is reused in that case: quotes, the Monero leg, states and recovery do not
|
|
|
308
314
|
The check codes tied to EVM are named plainly: `allowance` (token allowances) and `gas` (the network-fee margin)
|
|
309
315
|
trigger where those exist; on another VM they simply do not appear, rather than turning into "all good".
|
|
310
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
|
+
|
|
311
324
|
## Rules
|
|
312
325
|
|
|
313
326
|
1. **No DOM.** There is exactly one exception, and it is named: the `src/adapters` directory (the `localStorage`
|
|
@@ -323,8 +336,8 @@ trigger where those exist; on another VM they simply do not appear, rather than
|
|
|
323
336
|
3. **The wallet is outside.** The SDK opens no windows and does not look for injected providers itself.
|
|
324
337
|
4. **The step order and the guards are inside `swaps.start`** (stage 2): funds are not locked until the interface
|
|
325
338
|
has confirmed the recovery file is saved; retrying after an error or a reload is safe.
|
|
326
|
-
5. **
|
|
327
|
-
touch them
|
|
339
|
+
5. **WASM and the Monero bundles are separate files** from `assetsBase`, so the interface's bundler (Astro/Vite)
|
|
340
|
+
does not touch them.
|
|
328
341
|
6. **Strict CSP.** The package is designed for a policy without `eval` and inline.
|
|
329
342
|
7. **Few dependencies, all permissive.** Every production dependency is checked in CI against an allowlist: MIT, MIT-0,
|
|
330
343
|
ISC, Apache-2.0, BSD-2-Clause, BSD-3-Clause, Unlicense, 0BSD, CC0-1.0 and BlueOak-1.0.0. Copyleft,
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -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
|
|
@@ -2,16 +2,12 @@
|
|
|
2
2
|
"version": 1,
|
|
3
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
4
|
"bundles": {
|
|
5
|
-
"atomic/atomic-browser.js": {
|
|
6
|
-
"sha256": "2c038c56d94d63a6445b2496dfd7ba77508965f8c4fe608c9d6610b6dc30501c",
|
|
7
|
-
"source": "www/js/atomic + @noble/curves + @noble/hashes"
|
|
8
|
-
},
|
|
9
5
|
"monero/monero-js-browser.js": {
|
|
10
6
|
"sha256": "05c682ea514db089b3f872e4e8eee3d526e7131079bdb3871dad57d201db7e89",
|
|
11
7
|
"source": "monero-js"
|
|
12
8
|
},
|
|
13
9
|
"sdk/sdk-browser.js": {
|
|
14
|
-
"sha256": "
|
|
10
|
+
"sha256": "5ea90250943fca3e98a542ee2b2b7f16c22b7c59416ed358d73aa3868137b1df",
|
|
15
11
|
"source": "sdk/src (facade, adapters, recovery)"
|
|
16
12
|
},
|
|
17
13
|
"walletconnect/wc-browser.js": {
|