@ninsei-labs/sdk 0.56.1 → 0.58.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 +29 -0
- package/LICENSE-POLICY.md +9 -2
- package/README.md +78 -28
- package/THIRD_PARTY_NOTICES.md +176 -2
- package/assets/vendors/MANIFEST.json +1 -13
- 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 +20 -46
- package/engine/core/deployments.generated.js +103 -0
- package/engine/core/rfqSource.js +6 -133
- package/engine/core/swap.js +8 -8
- 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 +5 -6
- package/engine/evm/session.js +48 -279
- package/engine/monero/address.js +15 -33
- package/engine/monero/keys.js +124 -0
- package/engine/monero/mnemonic.js +104 -0
- package/engine/monero/scan.js +121 -28
- package/engine/monero/wallet.js +31 -68
- package/engine/monero/wordlist.en.js +210 -0
- package/engine/recovery/restore.js +9 -9
- package/engine/sdk/bridge.js +9 -187
- package/engine/ui/walletModal.js +7 -27
- package/index.d.ts +234 -262
- package/package.json +7 -6
- package/src/actions.mjs +8 -5
- package/src/codes.mjs +17 -0
- package/src/config.mjs +17 -54
- package/src/engine.mjs +9 -6
- package/src/feeEstimate.mjs +11 -4
- package/src/http.mjs +4 -1
- package/src/index.mjs +24 -45
- package/src/legs/kyber.mjs +23 -0
- package/src/lock.mjs +1 -0
- package/src/order.mjs +110 -22
- 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/recovery.d.ts +17 -1
- package/src/public/recovery.mjs +1 -0
- package/src/public/xmr.mjs +1 -1
- package/src/quotePolicy.mjs +25 -0
- package/src/quotes.mjs +109 -765
- package/src/readyWindow.mjs +76 -0
- package/src/recovery-key.mjs +71 -16
- package/src/recovery.mjs +11 -28
- package/src/relayClaim.mjs +132 -0
- package/src/relayFeatures.mjs +25 -13
- package/src/relayFirmClient.mjs +36 -7
- package/src/relayQuote.mjs +92 -11
- package/src/relayView.mjs +3 -3
- package/src/swap-flow.mjs +146 -60
- package/src/swaps.mjs +521 -357
- package/src/sweep-action.mjs +73 -0
- package/src/sweep-restore.mjs +8 -4
- package/src/sweep.mjs +12 -2
- package/src/version.mjs +1 -1
- package/src/xmr-arrival.mjs +328 -29
- package/src/xmrAmountPolicy.mjs +35 -0
- package/assets/vendors/atomic/atomic-browser.js +0 -24
- package/assets/vendors/monero/monero-js-browser.js +0 -58
- package/assets/vendors/monero-js/LICENSE +0 -9
- package/assets/vendors/walletconnect/wc-browser.js +0 -6202
- 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,32 @@
|
|
|
1
|
+
## 0.58.0 — 2026-11-10
|
|
2
|
+
|
|
3
|
+
- `swaps.verifyArrivalShadow` runs the exact arrival walk and the fixed-slice witness-v1 walk side by side. The witness request carries only `{version, network, grid, slice}` (20 blocks aligned to multiples of 20), never the start height, payout block, txid or order id; a node without `protocol: "witness-v1"` is refused rather than guessed. The exact verdict still decides, so this is the staging path before an independent operator serves the protocol.
|
|
4
|
+
- A quote is refused as `quote-too-short` when it arrives with less than the start margin left, instead of showing a confirmation that the lock would reject seconds later.
|
|
5
|
+
- Arrival refuses a view key or spend key that does not belong to the watched address, refuses a subaddress by name, skips a malformed transaction extra key instead of losing the whole walk, and treats an unsynchronized witness as unknown, not as absence.
|
|
6
|
+
- A pending funding is resumed only for the same quote nonce and salt; a reused nonce with different terms is a new order, and an id-only retry is refused instead of funding a second escrow.
|
|
7
|
+
- The release publish job receives the npm dist-tag as an environment value and validates it, so the build output cannot become shell code in the OIDC job.
|
|
8
|
+
- The quote defaults are public: `DEFAULT_ORDER_QUOTE_TTL_SEC` (60 s) is the firm quote lifetime a node signs when it has no override, and `LOCK_START_MARGIN_SEC` (30 s) is the margin `swaps.start` requires before opening a wallet. A node imports the lifetime instead of keeping its own copy.
|
|
9
|
+
- The node's signed ready window now drives a sale: `quotes.firmRelay` returns `readyWindow`, `startSell` stores it, and `sellWatch`, the late-arrival boundary and `refundIfXmrMissing` use `readyMinSeconds`/`readyMaxSeconds` instead of the retired local 1200 s and 20-minute constants. A record without the window is refused by name.
|
|
10
|
+
- `swaps.claimViaRelay` claims a sell through the relay that answered the quote without creating or using a wallet: the signed `claimTip` pays the sender, and the sender is a listed maker OTHER than the deal's maker, chosen by the client and stored by `startSell` (a request may supply it for an older record). A request or record naming the deal's maker is refused before the half leaves the client. Only a validated txid is a success; a lost answer is `claim-unknown`; `sellClaim` remains the own-wallet path.
|
|
11
|
+
- The retired direct-node paths are gone: `quotes.watch`, `quotes.snapshot`, `quotes.firm`, `quotes.sale`, `swaps.sync`, `DEFAULT_ROUTES`, `config.route`/`routes`, `apiBase` and `serverAuth`. `quotes.firmRelay` is the only quote path; `swaps.start` ends at the joint address, and `swaps.watch` requires the client-side `verify` inputs. The page bridge lost the matching quote-book, direct-quote and server-sync helpers.
|
|
12
|
+
- The engine's `rfqSource` mirror keeps only the executor's order quote and its shape check; the indicative quote book and its `sdkBook`/`sdkBookSnapshot` calls are gone.
|
|
13
|
+
- The SDK no longer ships or loads a WalletConnect browser bundle. `evmWallet(provider)` remains the only wallet seam, so a host page can keep using injected wallets or load `@walletconnect/ethereum-provider` itself and pass the resulting EIP-1193 provider. The SDK's browser engine now offers only the injected connector; the WalletConnect build package, manifest entry, CI workflow and checks are gone.
|
|
14
|
+
- `recovery.readEscrowEventsByTopic` reads `HalfRevealed`, `Ready` and `Declined` without an address filter, so a recovery page can scan by topic and filter by `escrow` locally. The existing `readEscrowEvents({ escrows, ... })` is unchanged.
|
|
15
|
+
|
|
16
|
+
## 0.57.2 — 2026-11-06
|
|
17
|
+
|
|
18
|
+
- Monero mnemonic, key and subaddress derivation now comes from the package's own `engine/monero/mnemonic.js` and `engine/monero/keys.js` over `@noble/curves`; the vendored `monero-js` browser bundle and its licence copy are gone. Address building and checksum checks no longer load a vendor at runtime. The pinned mnemonic, spend/view key, subaddress and address vectors are unchanged.
|
|
19
|
+
- 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.
|
|
20
|
+
|
|
21
|
+
## 0.57.0 — 2026-11-06
|
|
22
|
+
|
|
23
|
+
- 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).
|
|
24
|
+
- 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.
|
|
25
|
+
- `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.
|
|
26
|
+
- 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.
|
|
27
|
+
- Accumulated quote, swap, refund, relay, factory and input-boundary fixes from the 0.56.1 line are included.
|
|
28
|
+
- **License:** the package is now `(MIT AND LGPL-3.0-only)` because of the go-dleq port; the browser bundle carries the attribution.
|
|
29
|
+
|
|
1
30
|
## 0.56.1 — 2026-11-03
|
|
2
31
|
|
|
3
32
|
- 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.58.0)
|
|
26
26
|
|
|
27
27
|
| Surface | State |
|
|
28
28
|
|---|---|
|
|
@@ -31,12 +31,12 @@ The supported versions, scope, response targets, safe-harbor rules and disclosur
|
|
|
31
31
|
| `preflight` — the engine's guards, answering with codes | works |
|
|
32
32
|
| `recovery.open` — parsing the recovery file | works |
|
|
33
33
|
| `sim` — sandbox scenarios and time | works (applying to a swap — stage 2) |
|
|
34
|
-
| `quotes.watch` | works: live indicative quotes, its own client; a snapshot carries the display fields (sides, networks, `why`, signature, age, maturity), and the size can be NAMED (`size`) |
|
|
35
|
-
| `quotes.firm` | works: a signed, binding quote with a TTL; a refusal is a named code |
|
|
36
34
|
| `quotes.firmRelay` | works: a firm quote through a relay, built from one recovery key; the node half is DLEQ-checked |
|
|
37
35
|
| `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 → **
|
|
39
|
-
| `swaps.watch` | waits for XMR
|
|
36
|
+
| `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"` |
|
|
37
|
+
| `swaps.watch` | waits for XMR at the joint address with the CLIENT's own check: `verify` carries the joint address, view secret, spend public key and witness nodes. Arrived — returns the fact (amount, confirmations, txid); did not wait — a refusal with `xmr-timeout`; funds barred by `unlock_time` — `xmr-locked`; the maker DECLINED — `SwapDeclinedWatch` (`declined: true`, `terminal: "declined"`), every action off; with expectations and a wallet, places the ready mark after the arrival |
|
|
38
|
+
| `swaps.verifyArrivalShadow` | the staging path for witness-v1: runs the exact walk and the fixed-slice walk side by side, without changing ready or refund. The slice request carries only the grid and slice; a node must name `protocol: "witness-v1"` |
|
|
39
|
+
| `swaps.startSell` / `swaps.sellClaim` / `swaps.claimViaRelay` | a sell is recorded from the verified relay offer; `sellClaim` claims from the claimer's own wallet, `claimViaRelay` claims with no wallet through the sender the client chose, paid by the signed `claimTip` |
|
|
40
40
|
| `wallet.balances` | works: the native coin and tokens, in minimal units |
|
|
41
41
|
|
|
42
42
|
What is not ready names itself with the code `not-implemented` with the fields `surface` and `stage`: an empty
|
|
@@ -81,7 +81,6 @@ import { createNinsei } from "@ninsei-labs/sdk";
|
|
|
81
81
|
const sdk = createNinsei({
|
|
82
82
|
settlement: { chain: "arbitrum-sepolia" }, // from sdk.config.chains; vm is taken from the registry
|
|
83
83
|
xmrNetwork: "stagenet",
|
|
84
|
-
// apiBase: "https://your-service", // only when you bring a backend; there is no default
|
|
85
84
|
assetsBase: "/sdk/",
|
|
86
85
|
mode: "live", // or "sim"
|
|
87
86
|
});
|
|
@@ -157,7 +156,8 @@ interface's: this package holds no user-facing string.
|
|
|
157
156
|
|
|
158
157
|
`not-implemented`, `bad-input`, `wallet-not-connected`, `wallet-rejected`, `wrong-chain`, `quote-unavailable`,
|
|
159
158
|
`quote-refused`, `address-denied`, `quote-stale`, `recovery-declined`, `recovery-failed`, `storage-unavailable`,
|
|
160
|
-
`server-unavailable`, `server-refused`, `xmr-timeout`, `xmr-locked`, `contract-reverted`,
|
|
159
|
+
`server-unavailable`, `server-refused`, `claim-unknown`, `xmr-timeout`, `xmr-locked`, `contract-reverted`,
|
|
160
|
+
`insufficient-funds`, `unknown`.
|
|
161
161
|
|
|
162
162
|
Three refusals that are easy to merge into one are named DIFFERENTLY, because the advice differs:
|
|
163
163
|
`server-unavailable` — the service did not answer (retry); `server-refused` — it answered and did not accept (its
|
|
@@ -171,26 +171,58 @@ interface shows its own neutral message.
|
|
|
171
171
|
|
|
172
172
|
## Quotes
|
|
173
173
|
|
|
174
|
+
The SDK has one quote path: a relay. `quotes.firmRelay` derives the client half and both view points from one
|
|
175
|
+
recovery key, sends one request, verifies the relay answer and the on-chain registry/factory binding, and returns
|
|
176
|
+
the signed `orderQuote` with its `startRequest`. There is no direct node client, no quote book and no route table
|
|
177
|
+
in the package; a host that needs an indicative book keeps it in the host.
|
|
178
|
+
|
|
179
|
+
```js
|
|
180
|
+
const offer = await sdk.quotes.firmRelay({ relayUrl, features, order, side: "ask", recoveryKey, xmrAmount });
|
|
181
|
+
offer.orderQuote; // the signed quote the factory takes
|
|
182
|
+
offer.startRequest; // quote, order, orderQuote, counterparty and recovery salt for swaps.start
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Selling and claiming
|
|
186
|
+
|
|
187
|
+
A bid is a sale of XMR. `quotes.firmRelay({ side: "bid", claimTip, ... })` returns the signed quote, the escrow,
|
|
188
|
+
the one-time address, the `relayUrl` that answered and the node's `readyWindow`. `swaps.startSell` stores all of
|
|
189
|
+
them, including the relay origin and the window, and sends nothing. The window's `readyMinSeconds` and
|
|
190
|
+
`readyMaxSeconds` drive the sale watch, the late-arrival boundary and the refund lead; a record without it is
|
|
191
|
+
refused by name when the watch or the refund needs it. The send-xmr gate still uses its confirmation lead
|
|
192
|
+
(`xmrConfirmations * xmrBlockTimeSec`, or `limits.sellReadyLeadSec` when set).
|
|
193
|
+
|
|
194
|
+
A seller who has their own EVM wallet uses the own-wallet path. It signs the claim from that wallet and therefore
|
|
195
|
+
needs ETH for gas:
|
|
196
|
+
|
|
197
|
+
```js
|
|
198
|
+
await sdk.swaps.sellClaim({ id }, wallet);
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
A seller who has XMR but no ETH uses the relay path. The escrow pays the signed `claimTip` to the sender, so the
|
|
202
|
+
relay submits the half and is paid from the claim itself. No wallet is created or used, and no chain transaction is
|
|
203
|
+
signed by the client:
|
|
204
|
+
|
|
174
205
|
```js
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
s.offers; // all offers for the size; s.refused - rows that did not become offers
|
|
181
|
-
s.best; // the best for the requested volume and side, AS THE SERVICE NAMED IT (pair and node)
|
|
182
|
-
stop(); // the last one to unsubscribe stops the polling
|
|
206
|
+
const sell = await sdk.swaps.startSell({ offer, claimSender }); // another listed maker
|
|
207
|
+
const claimed = await sdk.swaps.claimViaRelay({ id: sell.id });
|
|
208
|
+
claimed.txid; // the claim transaction
|
|
209
|
+
claimed.from; // the sender node's claim sender
|
|
210
|
+
claimed.tipWei; // the signed tip paid out of the claim
|
|
183
211
|
```
|
|
184
212
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
213
|
+
`claimSender` is chosen by the client from the relay's price answer: a listed maker OTHER than the deal's maker and
|
|
214
|
+
other than its quote key owner. `startSell` stores it with the record, so a reload claims through the same node; a
|
|
215
|
+
record made before the sender was stored may pass `claimSender` to `claimViaRelay` once; it is stored on the record
|
|
216
|
+
then. A sender naming the deal's maker or its quote key is refused before the half leaves the client.
|
|
217
|
+
|
|
218
|
+
`claimViaRelay` reads the sell record made by `startSell` and requires a positive `claimTip`, the sender, the
|
|
219
|
+
escrow and the half. It posts to the relay origin stored with the record; an optional `relayUrl` may repeat that
|
|
220
|
+
origin but a different one is refused. A node refusal is `quote-refused` with the sender's own code in
|
|
221
|
+
`params.code`. A timeout or a body without a real transaction hash is `claim-unknown`: the claim may have been
|
|
222
|
+
sent, so read the escrow before trying anything else. Only a validated txid is returned as a claim.
|
|
189
223
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
range is not aligned: it is the provider's refusal, and it arrives as a code. Indicative quotes commit to nothing;
|
|
193
|
-
`quotes.firm` and `quotes.firmRelay` commit, and the relay path carries the maker's signed terms and its view half.
|
|
224
|
+
`actions.claim` is unchanged: it still sends only from the claimer's own wallet, because the half is revealed by
|
|
225
|
+
whoever sends the claim.
|
|
194
226
|
|
|
195
227
|
## Found orders and the paying token
|
|
196
228
|
|
|
@@ -200,6 +232,10 @@ another device or at another factory produce a different half and no number is r
|
|
|
200
232
|
`derivation: "salt-v2"` and has no index. There is no range scan and no `max-index` result: every order in the logs is
|
|
201
233
|
read once, and an unreadable log request is a refusal, not a partial answer.
|
|
202
234
|
|
|
235
|
+
`readEscrowEventsByTopic` reads the same three settlement events (`HalfRevealed`, `Ready` and `Declined`) without
|
|
236
|
+
an address filter: the caller receives every event in the block range and filters by `escrow`. This is the
|
|
237
|
+
privacy-preserving path for a recovery page, because the RPC does not learn which escrows belong to the visitor.
|
|
238
|
+
|
|
203
239
|
- `amount` — the escrow's **native** amount in wei;
|
|
204
240
|
- `settlementToken: "native"` — what the escrow receives;
|
|
205
241
|
- `xmrAmount` — the XMR side, read from the clone's condition word 18 when an `evmCode` reader is passed;
|
|
@@ -248,6 +284,11 @@ total unknown.
|
|
|
248
284
|
A failed settlement block-time read keeps the matched order: `findSwaps` returns `blockTime: null` with
|
|
249
285
|
`startHeightReason: "block-time-read"` instead of throwing away every row.
|
|
250
286
|
|
|
287
|
+
Pass `evmBlockTimes` to read the timestamps for every distinct matched block in one request. It receives the block
|
|
288
|
+
numbers in first-seen order and returns a map; a `null` or missing entry is `no-block-time`, while an `Error` entry
|
|
289
|
+
is `block-time-read`. When the batch seam is supplied it is the only timestamp reader: `evmBlockTime` is not called,
|
|
290
|
+
even after a failed batch. Without the seam, the older `evmBlockTime` path stays in use.
|
|
291
|
+
|
|
251
292
|
The retired backend no longer decides a swap: its watch row may observe money, but it cannot declare readiness or
|
|
252
293
|
a decline; the client's two-node check and the escrow's own `Declined` event do.
|
|
253
294
|
|
|
@@ -255,13 +296,16 @@ Storage is a refusal, not a silent empty state: a failed read, corrupt JSON, a f
|
|
|
255
296
|
`storage-unavailable` with a step. Every SDK instance gets its own store over the adapter it was given, so two
|
|
256
297
|
clients with different adapters keep separate records and neither takes over the other's.
|
|
257
298
|
|
|
258
|
-
Every body route the SDK sends carries `sdkVersion` from the package (`quotes.firm`, `quotes.sale` and the funding
|
|
259
|
-
mark). The caller cannot override it with a different line.
|
|
260
|
-
|
|
261
299
|
Funding is reported from the receipt, not from the send. A status-0 receipt is `contract-reverted`; a missing
|
|
262
300
|
receipt, a receipt without `OrderCreated`, or an event from another factory is `funding-pending` with the transaction
|
|
263
301
|
hash, and `swaps.start` does not save an escrow or retire a recovery number in that state.
|
|
264
302
|
|
|
303
|
+
The predicted escrow and its salt are written to the pending record before the funding transaction is sent. A retry
|
|
304
|
+
after a late receipt or a process restart finds that record by quote id or salt and reads the same transaction; it
|
|
305
|
+
does not build a second side or send a second deposit. An explicit wallet rejection clears the pending mark so the
|
|
306
|
+
person can sign again. A transaction that was already mined is stopped by the escrow state guard; one still in the
|
|
307
|
+
mempool can make the resend revert and cost gas, but cannot create a second deposit.
|
|
308
|
+
|
|
265
309
|
The wallet adapter accepts the standard Monero network names (`mainnet`, `stagenet`, `testnet`, `fakechain`) and
|
|
266
310
|
still checks the address shape, so a mainnet withdrawal is not refused because the demo registry lists only
|
|
267
311
|
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 +352,13 @@ core is reused in that case: quotes, the Monero leg, states and recovery do not
|
|
|
308
352
|
The check codes tied to EVM are named plainly: `allowance` (token allowances) and `gas` (the network-fee margin)
|
|
309
353
|
trigger where those exist; on another VM they simply do not appear, rather than turning into "all good".
|
|
310
354
|
|
|
355
|
+
## Pull requests
|
|
356
|
+
|
|
357
|
+
Open a pull request as a draft. The CI battery, license check, house-rules check and dependency scan stay skipped
|
|
358
|
+
while the pull request is a draft, so an intermediate push does not spend runner minutes. Run the local checks
|
|
359
|
+
while you work. Mark the pull request ready only when the branch is final; that starts the full battery. A push
|
|
360
|
+
after that runs it again, so keep the work in draft until the last commit.
|
|
361
|
+
|
|
311
362
|
## Rules
|
|
312
363
|
|
|
313
364
|
1. **No DOM.** There is exactly one exception, and it is named: the `src/adapters` directory (the `localStorage`
|
|
@@ -323,8 +374,7 @@ trigger where those exist; on another VM they simply do not appear, rather than
|
|
|
323
374
|
3. **The wallet is outside.** The SDK opens no windows and does not look for injected providers itself.
|
|
324
375
|
4. **The step order and the guards are inside `swaps.start`** (stage 2): funds are not locked until the interface
|
|
325
376
|
has confirmed the recovery file is saved; retrying after an error or a reload is safe.
|
|
326
|
-
5. **
|
|
327
|
-
touch them: `atomic/order-worker.js`, the Monero bundles.
|
|
377
|
+
5. **WalletConnect is the host's connector.** The SDK ships no vendor bundle and loads no connector at runtime; a page that wants mobile wallets loads `@walletconnect/ethereum-provider` itself (from its own lock or a pinned CDN asset), draws the QR, and passes the resulting EIP-1193 provider to `evmWallet(provider)`. A page without it works with injected wallets only. Monero mnemonic, key and address code is part of the package core: it needs no separate file and no vendored browser bundle.
|
|
328
378
|
6. **Strict CSP.** The package is designed for a policy without `eval` and inline.
|
|
329
379
|
7. **Few dependencies, all permissive.** Every production dependency is checked in CI against an allowlist: MIT, MIT-0,
|
|
330
380
|
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
|
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
37
37
|
SOFTWARE.
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
## @hpke/common 1.10.1
|
|
40
|
+
## @hpke/common 1.10.1, 1.11.0
|
|
41
41
|
|
|
42
42
|
License: MIT
|
|
43
43
|
Source: git+https://github.com/dajiaji/hpke-js.git
|
|
@@ -68,7 +68,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
68
68
|
SOFTWARE.
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
## @hpke/core 1.
|
|
71
|
+
## @hpke/core 1.10.0
|
|
72
72
|
|
|
73
73
|
License: MIT
|
|
74
74
|
Source: git+https://github.com/dajiaji/hpke-js.git
|
|
@@ -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,21 +2,9 @@
|
|
|
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
|
-
"monero/monero-js-browser.js": {
|
|
10
|
-
"sha256": "05c682ea514db089b3f872e4e8eee3d526e7131079bdb3871dad57d201db7e89",
|
|
11
|
-
"source": "monero-js"
|
|
12
|
-
},
|
|
13
5
|
"sdk/sdk-browser.js": {
|
|
14
|
-
"sha256": "
|
|
6
|
+
"sha256": "61b3a75c36457b4485144be3c328c00938d1c164b9f2bd3a1c28207d9af7d681",
|
|
15
7
|
"source": "sdk/src (facade, adapters, recovery)"
|
|
16
|
-
},
|
|
17
|
-
"walletconnect/wc-browser.js": {
|
|
18
|
-
"sha256": "fb64f27c1ec026811fe72bfff06da1f997bbf720569ea73be87818e2c5847eec",
|
|
19
|
-
"source": "@walletconnect"
|
|
20
8
|
}
|
|
21
9
|
}
|
|
22
10
|
}
|