@ninsei-labs/sdk 0.49.0 → 0.51.0
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 +30 -0
- package/README.md +18 -0
- package/assets/vendors/atomic/atomic-browser.js +24 -0
- package/assets/vendors/monero/monero-js-browser.js +58 -0
- package/assets/vendors/monero-js/LICENSE +9 -0
- package/assets/vendors/sdk/sdk-browser.js +14 -0
- package/assets/vendors/walletconnect/wc-browser.js +6202 -0
- package/engine/atomic/order-worker.js +129 -0
- package/engine/core/config.js +3 -1
- package/engine/sdk/bridge.js +3 -3
- package/index.d.ts +74 -2
- package/package.json +4 -2
- package/src/actions.mjs +15 -0
- package/src/adapters/monero-wallet.mjs +26 -0
- package/src/config.mjs +9 -0
- package/src/index.mjs +2 -0
- package/src/public/networks.d.ts +2 -0
- package/src/public/recovery.d.ts +16 -0
- package/src/quotes.mjs +100 -3
- package/src/recovery-key.mjs +101 -13
- package/src/swaps.mjs +17 -4
- package/src/sweep-half.mjs +14 -0
- package/src/sweep-restore.mjs +4 -1
- package/src/sweep.mjs +85 -5
- package/src/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
## 0.51.0 — 2026-10-22
|
|
2
|
+
|
|
3
|
+
THE WITHDRAWAL AND THE ON-CHAIN SEARCH NOW CARRY EVERYTHING THE KEY CAN KNOW.
|
|
4
|
+
|
|
5
|
+
- `sweep` keeps all 32 bytes of the revealed half; the old slice to 20 bytes made every real withdrawal fail.
|
|
6
|
+
- The Monero node readers return the top block (`height - 1`) and accept the genesis timestamp, so `findSwaps` can
|
|
7
|
+
derive a start height instead of asking for a block that does not exist.
|
|
8
|
+
- `quotes.firm` sends the taker's maker view half and requires the quote to echo it; without it a buy from the one
|
|
9
|
+
key could not be restored from the twelve words.
|
|
10
|
+
- `quotes.sale` checks the signed claim tip with base plus priority fee, and `rankOffers` ranks a sale by
|
|
11
|
+
`amount × rate − claimTip`.
|
|
12
|
+
- `sweep.restore` reports `window.fallback`; `findSwaps` returns `blockTime`, reads `xmrAmount` from the clone with
|
|
13
|
+
an `evmCode` reader, uses the factory's `deploymentBlock`, and names the native settlement while leaving the
|
|
14
|
+
paying token off-chain (`payToken: null`, `payTokenReason: "not-on-chain"`).
|
|
15
|
+
- `sweep.fromOrder({ mnemonic, order })` builds the payload without a recovery file, and one wallet adapter now
|
|
16
|
+
serves both `sweep.restore` and `sweep.sign`.
|
|
17
|
+
- The npm package ships the assets and `order-worker.js` its own code imports; Node floor is `>=24.22.1`.
|
|
18
|
+
|
|
19
|
+
## 0.50.0 — 2026-10-21
|
|
20
|
+
|
|
21
|
+
A CLAIM IS SENT BY ITS CLAIMER, AND A SALE IS RANKED AFTER THE TIP.
|
|
22
|
+
|
|
23
|
+
- `actions.claim` compares the wallet's address with `request.claimer` or `expect.claimer` before it signs. A
|
|
24
|
+
third-party wallet, a missing claimer or a wallet without an address is a named `bad-input`; `claimSenderVerdict`
|
|
25
|
+
exposes the same rule. This is a deliberate tightening: a claim reveals the half to its sender.
|
|
26
|
+
- `readQuote` keeps the signed `claimTip`, and `rankOffers` selects a sale by `amount × rate − claimTip`, not by
|
|
27
|
+
the headline rate. A buy, or a request without an amount, still ranks by rate.
|
|
28
|
+
- `quotes.watch` uses that ranking for the chosen offer, so moving margin from the price into the tip no longer
|
|
29
|
+
wins a sale.
|
|
30
|
+
|
|
1
31
|
## 0.49.0 — 2026-10-21
|
|
2
32
|
|
|
3
33
|
A ONE-KEY RECOVERY CAN WITHDRAW WITHOUT A FULL SCAN, AND A CLAIM TIP IS CHECKED.
|
package/README.md
CHANGED
|
@@ -155,6 +155,24 @@ the size is computed from the person's amount and is snapped to the node's grid
|
|
|
155
155
|
range is not aligned: it is the provider's refusal, and it arrives as a code. Indicative quotes commit to nothing;
|
|
156
156
|
`quotes.firm` commits (stage 2).
|
|
157
157
|
|
|
158
|
+
## Found orders and the paying token
|
|
159
|
+
|
|
160
|
+
`findSwaps` returns the orders whose commitment came from the recovery key. Each found order reports:
|
|
161
|
+
|
|
162
|
+
- `amount` — the escrow's **native** amount in wei;
|
|
163
|
+
- `settlementToken: "native"` — what the escrow receives;
|
|
164
|
+
- `xmrAmount` — the XMR side, read from the clone's condition word 18 when an `evmCode` reader is passed;
|
|
165
|
+
- `payToken: null` and `payTokenReason: "not-on-chain"` — the asset the person actually paid before the DEX leg.
|
|
166
|
+
|
|
167
|
+
The reason is structural, not an omission. `OrderCreated` and the clone carry no token field, and the current escrow is
|
|
168
|
+
native-only. A user may have paid USDC, USDT or DAI, but that happened in the DEX leg and lives in the quote/order
|
|
169
|
+
record, not in the settlement contract. Inventing a token from the pair or the UI would be a claim the chain cannot
|
|
170
|
+
support.
|
|
171
|
+
|
|
172
|
+
When a token is needed, the order can be joined with an off-chain quote record by the caller. A future ERC-20 escrow
|
|
173
|
+
would have to put the token into the signed quote and the clone (and therefore a new order format and factory); only
|
|
174
|
+
then can `findSwaps` return it from the chain and set `payTokenReason` to something other than `not-on-chain`.
|
|
175
|
+
|
|
158
176
|
## Extending to other networks (Tron, Solana and beyond)
|
|
159
177
|
|
|
160
178
|
The package name is deliberately common: the shared part — the quote client, the Monero leg, the state machine,
|