@ninsei-labs/sdk 0.57.2 → 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.
Files changed (46) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +64 -27
  3. package/THIRD_PARTY_NOTICES.md +2 -2
  4. package/assets/vendors/MANIFEST.json +1 -9
  5. package/assets/vendors/sdk/sdk-browser.js +4 -4
  6. package/engine/core/config.js +3 -22
  7. package/engine/core/rfqSource.js +6 -133
  8. package/engine/core/swap.js +1 -1
  9. package/engine/evm/index.js +3 -2
  10. package/engine/evm/session.js +46 -277
  11. package/engine/monero/address.js +15 -33
  12. package/engine/monero/keys.js +124 -0
  13. package/engine/monero/mnemonic.js +104 -0
  14. package/engine/monero/scan.js +23 -9
  15. package/engine/monero/wallet.js +31 -68
  16. package/engine/monero/wordlist.en.js +210 -0
  17. package/engine/recovery/restore.js +1 -1
  18. package/engine/sdk/bridge.js +7 -182
  19. package/engine/ui/walletModal.js +7 -27
  20. package/index.d.ts +187 -252
  21. package/package.json +4 -5
  22. package/src/codes.mjs +12 -0
  23. package/src/config.mjs +16 -54
  24. package/src/engine.mjs +3 -0
  25. package/src/index.mjs +24 -45
  26. package/src/order.mjs +2 -2
  27. package/src/public/recovery.d.ts +17 -1
  28. package/src/public/recovery.mjs +1 -0
  29. package/src/quotePolicy.mjs +25 -0
  30. package/src/quotes.mjs +21 -751
  31. package/src/readyWindow.mjs +76 -0
  32. package/src/recovery-key.mjs +39 -2
  33. package/src/recovery.mjs +11 -28
  34. package/src/relayClaim.mjs +132 -0
  35. package/src/relayFirmClient.mjs +3 -0
  36. package/src/relayQuote.mjs +5 -1
  37. package/src/swap-flow.mjs +49 -5
  38. package/src/swaps.mjs +301 -307
  39. package/src/sweep-action.mjs +73 -0
  40. package/src/sweep.mjs +7 -1
  41. package/src/version.mjs +1 -1
  42. package/src/xmr-arrival.mjs +275 -7
  43. package/src/xmrAmountPolicy.mjs +35 -0
  44. package/assets/vendors/monero/monero-js-browser.js +0 -58
  45. package/assets/vendors/monero-js/LICENSE +0 -9
  46. package/assets/vendors/walletconnect/wc-browser.js +0 -6202
@@ -0,0 +1,104 @@
1
+ // MONERO MNEMONIC, WITHOUT A VENDORED LIBRARY.
2
+ //
3
+ // Monero uses its own 1626-word list and a checksum over the first three letters of the 24 payload words. The
4
+ // algorithm is fixed and small; `@noble` primitives are not involved. Keeping it here removes the old monero-js
5
+ // bundle from the package and leaves one wordlist, one encoder and one decoder.
6
+ import { randomBytes } from "../../src/primitives.mjs";
7
+ import { WORDLIST } from "./wordlist.en.js";
8
+
9
+ const WORD_COUNT = 24;
10
+ const CHECKSUM_WORD_COUNT = 25;
11
+ const ENTROPY_BYTES = 32;
12
+ const PREFIX = 3;
13
+ const WORD_INDEX = new Map(WORDLIST.map((word, index) => [word, index]));
14
+
15
+ const CRC_TABLE = (() => {
16
+ const table = new Uint32Array(256);
17
+ for (let n = 0; n < 256; n += 1) {
18
+ let c = n;
19
+ for (let k = 0; k < 8; k += 1) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
20
+ table[n] = c >>> 0;
21
+ }
22
+ return table;
23
+ })();
24
+
25
+ function crc32(bytes) {
26
+ let c = 0xffffffff;
27
+ for (const byte of bytes) c = CRC_TABLE[(c ^ byte) & 0xff] ^ (c >>> 8);
28
+ return (c ^ 0xffffffff) >>> 0;
29
+ }
30
+
31
+ function wordsToChunk(one, two, three) {
32
+ const n = WORDLIST.length;
33
+ const a = WORD_INDEX.get(one);
34
+ const b = WORD_INDEX.get(two);
35
+ const c = WORD_INDEX.get(three);
36
+ if (a === undefined || b === undefined || c === undefined) throw new Error("invalid mnemonic word");
37
+ // The word order encodes a value in a mixed radix; the inverse is in chunkToWords.
38
+ return a + n * (((b - a) % n + n) % n) + n * n * (((c - b) % n + n) % n);
39
+ }
40
+
41
+ function chunkToWords(value) {
42
+ const n = WORDLIST.length;
43
+ const one = value % n;
44
+ const two = (Math.floor(value / n) + one) % n;
45
+ const three = (Math.floor(Math.floor(value / n) / n) + two) % n;
46
+ return [WORDLIST[one], WORDLIST[two], WORDLIST[three]];
47
+ }
48
+
49
+ function checksumWord(words) {
50
+ const prefix = words.map((word) => word.slice(0, PREFIX)).join("");
51
+ return words[crc32(new TextEncoder().encode(prefix)) % words.length];
52
+ }
53
+
54
+ function validateWords(words) {
55
+ return (words.length === WORD_COUNT || words.length === CHECKSUM_WORD_COUNT)
56
+ && words.every((word) => WORD_INDEX.has(word));
57
+ }
58
+
59
+ export function encode(entropy) {
60
+ const bytes = entropy instanceof Uint8Array ? entropy : Uint8Array.from(entropy);
61
+ if (bytes.length !== ENTROPY_BYTES) throw new Error("invalid entropy length");
62
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
63
+ const words = [];
64
+ for (let i = 0; i < bytes.length; i += 4) words.push(...chunkToWords(view.getUint32(i, true)));
65
+ return words.join(" ");
66
+ }
67
+
68
+ export function encodeWithChecksum(entropy) {
69
+ const words = encode(entropy).split(" ");
70
+ words.push(checksumWord(words));
71
+ return words.join(" ");
72
+ }
73
+
74
+ export function generate() {
75
+ return encode(randomBytes(ENTROPY_BYTES));
76
+ }
77
+
78
+ export function generateWithChecksum() {
79
+ return encodeWithChecksum(randomBytes(ENTROPY_BYTES));
80
+ }
81
+
82
+ export function decode(mnemonic) {
83
+ const words = String(mnemonic || "").trim().split(/\s+/).filter(Boolean);
84
+ if (!validateWords(words)) throw new Error("invalid mnemonic phrase (length or words)");
85
+ if (words.length === CHECKSUM_WORD_COUNT) {
86
+ const payload = words.slice(0, WORD_COUNT);
87
+ if (words[WORD_COUNT] !== checksumWord(payload)) throw new Error("invalid mnemonic checksum");
88
+ }
89
+ const entropy = new Uint8Array(ENTROPY_BYTES);
90
+ const view = new DataView(entropy.buffer);
91
+ const count = Math.min(words.length, WORD_COUNT);
92
+ for (let i = 0; i < count / 3; i += 1) {
93
+ view.setUint32(i * 4, wordsToChunk(words[i * 3], words[i * 3 + 1], words[i * 3 + 2]), true);
94
+ }
95
+ return entropy;
96
+ }
97
+
98
+ export function isValid(mnemonic) {
99
+ try { decode(mnemonic); return true; } catch { return false; }
100
+ }
101
+
102
+ export function toSeed(mnemonic) {
103
+ return decode(mnemonic);
104
+ }
@@ -272,12 +272,22 @@ export function findOurOutputs({ txPublicKey = null, txPublicKeys = null, additi
272
272
  const usable = viewSecretCandidates(viewSecretHex).filter(([, v]) => v !== null);
273
273
  const first = usable[0] || ["unparsed", null];
274
274
  for (const [form, secret] of usable) {
275
- const primaryDerivations = primaryKeys.map((key) => keyDerivation(key, secret));
275
+ // A MALFORMED EXTRA KEY IS NOT A REASON TO STOP LOOKING AT THE OTHER KEYS. Monero's wallet skips a key that is
276
+ // not a curve point and keeps scanning; a transaction with one bad tag-0x01 key otherwise blinds every arrival
277
+ // whose range includes its block.
278
+ const primaryDerivations = [];
279
+ for (const key of primaryKeys) {
280
+ try { primaryDerivations.push(keyDerivation(key, secret)); }
281
+ catch { /* skip this candidate; the other keys may still be ours */ }
282
+ }
276
283
  const found = [];
277
284
  for (const o of outputs) {
278
285
  // The main keys first, then only THIS output's additional key.
279
286
  const candidates = primaryDerivations.slice();
280
- if (additional[o.index]) candidates.push(keyDerivation(additional[o.index], secret));
287
+ if (additional[o.index]) {
288
+ try { candidates.push(keyDerivation(additional[o.index], secret)); }
289
+ catch { /* a malformed per-output key is skipped, like the primary list */ }
290
+ }
281
291
  for (const derivation of candidates) {
282
292
  const scalar = hashToScalar(derivation, varint(o.index));
283
293
  const derived = derivedOutputKey(derivation, o.index, spendPubHex);
@@ -302,13 +312,17 @@ export function findOurOutputs({ txPublicKey = null, txPublicKeys = null, additi
302
312
  }
303
313
  }
304
314
  if (found.length) return { derivation: found[0].derivation, outputs: found, viewKeyForm: form };
305
- }
306
- return {
307
- derivation: first[1] === null || !primaryKeys.length ? null : bytesToHex(keyDerivation(primaryKeys[0], first[1])),
308
- outputs: [],
309
- viewKeyForm: first[0],
310
- };
311
- }
315
+ }
316
+ let fallback = null;
317
+ if (first[1] !== null && primaryKeys.length) {
318
+ try { fallback = bytesToHex(keyDerivation(primaryKeys[0], first[1])); } catch { fallback = null; }
319
+ }
320
+ return {
321
+ derivation: fallback,
322
+ outputs: [],
323
+ viewKeyForm: first[0],
324
+ };
325
+ }
312
326
 
313
327
  // ============================================================================================
314
328
  // SCANNING A HEIGHT RANGE. This is the indexing itself: read blocks in order, take their transaction hashes
@@ -1,13 +1,11 @@
1
- // GENERATED FILE - a byte-for-byte copy of the engine module www/js/monero/wallet.js for the SDK package.
2
- // Edit the source under www/js and regenerate the mirror; a drift guard reddens on any difference.
3
- // Everything below this header is identical to the source.
1
+ // SDK ENGINE MODULE - the demo's sdk/ mirror copies this file byte for byte (tools/build-sdk-engine.mjs).
2
+ // The page's own www/js module is a separate copy; edit this package source and regenerate the mirror.
4
3
 
5
4
  // The one-shot Monero wallet of a swap.
6
5
  //
7
- // Keys are computed by monero-js (ebellocchia/monero-js, MIT, vendored under www/assets/vendors/monero-js):
8
- // a mnemonic and keys in pure JS, real and instant. The library only knows mainnet address prefixes, so the
9
- // address string is built by our encoder (monero/address.js) for the network from the config - which is how
10
- // stagenet (24/36) also works.
6
+ // Keys are derived by the package's own Monero module (engine/monero/keys.js) from @noble/curves; the 25-word
7
+ // mnemonic is encoded/decoded by engine/monero/mnemonic.js. The old vendored monero-js bundle is gone. The address
8
+ // string is built by our encoder (monero/address.js), which knows mainnet, stagenet and testnet prefixes.
11
9
  //
12
10
  // Keys NEVER leave the browser: only the view key goes out (to the backend, for a watch-only wallet), and a
13
11
  // separate explicit function does it - recovery/restore.js::watchOnlyShareFromWallet. The wallet is one-shot,
@@ -15,81 +13,51 @@
15
13
 
16
14
  import { MONERO } from "../core/config.js";
17
15
  import { randomHex, toHex } from "../core/format.js";
16
+ import { keccak256 } from "../../src/primitives.mjs";
18
17
  import { addressFromKeys } from "./address.js";
19
-
20
- const B58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
21
-
22
- function base58(bytes) {
23
- let num = 0n;
24
- for (const b of bytes) num = num * 256n + BigInt(b);
25
- let out = "";
26
- while (num > 0n) {
27
- out = B58[Number(num % 58n)] + out;
28
- num /= 58n;
29
- }
30
- return out;
31
- }
18
+ import * as moneroMnemonic from "./mnemonic.js";
19
+ import * as moneroKeys from "./keys.js";
32
20
 
33
21
  // A pseudo-address for mock mode: the right length (95) and network prefix, but WITHOUT a checksum.
34
22
  // The UI always marks it as mock, so nobody sends XMR there.
35
23
 
36
24
  // ---------------------------------------------------------------------------
37
- // monero-js (mnemonic + keys + addresses, pure JS)
25
+ // Monero mnemonic + keys + addresses (the package's own implementation)
38
26
  // ---------------------------------------------------------------------------
39
27
 
40
- let moneroJsModule = null;
41
- let moneroJsError = null;
42
-
43
- export async function loadMoneroJs() {
44
- if (moneroJsModule) return moneroJsModule;
45
- if (moneroJsError) throw new Error(moneroJsError);
46
- try {
47
- const mod = await import("../../assets/vendors/monero/monero-js-browser.js?v=05c682ea");
48
- moneroJsModule = mod.default || mod;
49
- return moneroJsModule;
50
- } catch (e) {
51
- // The reason is not replaced: "bundle not built", "not uploaded" and "blocked by CSP" are different problems
52
- moneroJsError = "monero-js unavailable: " + e.message +
53
- " (run npm run build:vendor; for CSP see the deploy notes)";
54
- throw new Error(moneroJsError);
55
- }
56
- }
57
-
58
- async function withMoneroJs({ mnemonic: phrase, network = MONERO.networkType } = {}) {
59
- const lib = await loadMoneroJs();
60
- await lib.wallet.initEcc();
61
-
62
- // A supplied phrase must be valid. An invalid phrase used to be silently replaced by a fresh one, so
63
- // recovering from a corrupt file gave a DIFFERENT wallet: the error looked like success and the funds stayed
64
- // out of reach. Generation happens only when there is no phrase at all.
28
+ // A supplied phrase must be valid. An invalid phrase used to be silently replaced by a fresh one, so recovering
29
+ // from a corrupt file gave a DIFFERENT wallet: the error looked like success and the funds stayed out of reach.
30
+ // Generation happens only when there is no phrase at all.
31
+ async function withMoneroKeys({ mnemonic: phrase, network = MONERO.networkType } = {}) {
32
+ await moneroKeys.initEcc();
65
33
  let words;
66
34
  if (phrase) {
67
- if (!lib.mnemonic.isValid(phrase)) {
35
+ if (!moneroMnemonic.isValid(phrase)) {
68
36
  throw new Error("the mnemonic failed its checksum check (file or form corrupted?)");
69
37
  }
70
38
  words = String(phrase).trim();
71
39
  } else {
72
- words = lib.mnemonic.generateWithChecksum();
40
+ words = moneroMnemonic.generateWithChecksum();
73
41
  }
74
- const seed = lib.mnemonic.toSeed(words); // 32 bytes: for Monero the seed == the decoded mnemonic
75
- const w = lib.wallet.fromSeed(seed);
42
+ const seed = moneroMnemonic.toSeed(words); // 32 bytes: for Monero the seed == the decoded mnemonic
43
+ const w = moneroKeys.fromSeed(seed);
76
44
 
77
45
  const net = network || "mainnet";
78
- const deps = { keccak256: lib.keccak256, Buffer: lib.Buffer };
46
+ const deps = { keccak256 };
79
47
  const spendPub = toHex(w.publicSpendKey);
80
48
  const viewPub = toHex(w.publicViewKey);
81
49
  const sub = w.subaddress(1, 0);
82
- // the address of our own network is built here (the library only knows mainnet);
83
- // addressMainnet is kept for cross-checking: on mainnet the two must match
50
+ // The address of our own network is built here; mainnet is kept for cross-checking.
84
51
  const address = addressFromKeys({ network: net, kind: "primary", spendPub, viewPub }, deps);
85
52
  const subaddress = addressFromKeys(
86
53
  { network: net, kind: "subaddress", spendPub: toHex(sub.publicSpendKey), viewPub: toHex(sub.publicViewKey) },
87
54
  deps
88
55
  );
56
+ const addressMainnet = addressFromKeys({ network: "mainnet", kind: "primary", spendPub, viewPub }, deps);
89
57
 
90
58
  return {
91
- source: "monero-js",
92
- library: "ebellocchia/monero-js (MIT)",
59
+ source: "ninsei-monero-keys",
60
+ library: "Ninsei Monero keys (@noble/curves + @noble/hashes)",
93
61
  network: net,
94
62
  mnemonic: words,
95
63
  mnemonicWords: words.split(" ").length,
@@ -100,31 +68,26 @@ async function withMoneroJs({ mnemonic: phrase, network = MONERO.networkType } =
100
68
  publicViewKey: viewPub,
101
69
  address,
102
70
  subaddress,
103
- addressMainnet: w.primaryAddress().encode(),
71
+ addressMainnet,
104
72
  createdAt: Date.now(),
105
73
  };
106
74
  }
107
75
 
108
76
  // ---------------------------------------------------------------------------
109
- // monero-ts removed
110
- // ---------------------------------------------------------------------------
111
- // A second wallet mode lived here - a WebAssembly wallet2 (woodser/monero-ts) built into the vendors. It was
112
- // removed for two reasons: the WASM wallet needs SharedArrayBuffer, i.e. COOP/COEP, which on the demo domain
113
- // would block third-party resources; and the bundle moved to the sweep app, which has its own COOP/COEP domain.
114
- // While the branch of code stayed, it pulled an import along a path that no longer existed - dead, yet looking
115
- // alive. Keys in the demo are computed by monero-js, and that is the only path.
116
-
77
+ // The old monero-js / monero-ts browser paths are gone.
117
78
  // ---------------------------------------------------------------------------
79
+ // Keys are derived by engine/monero/keys.js from @noble/curves. The monero-ts WASM wallet was removed earlier:
80
+ // it needs SharedArrayBuffer, i.e. COOP/COEP, which on the demo domain would block third-party resources; the
81
+ // sweep app has its own domain and wallet adapter.
118
82
 
119
83
  export async function createSwapWallet({ network = MONERO.networkType, seed } = {}) {
120
- return withMoneroJs({ mnemonic: seed, network });
84
+ return withMoneroKeys({ mnemonic: seed, network });
121
85
  }
122
86
 
123
- // Whether the key library is available (the Demo controls panel shows this as one line).
87
+ // Whether the key module is available (the Demo controls panel shows this as one line).
124
88
  export async function probeMode() {
125
89
  try {
126
- const lib = await loadMoneroJs();
127
- await lib.wallet.initEcc();
90
+ await moneroKeys.initEcc();
128
91
  return { available: true, info: "mnemonic + keys + addresses (" + MONERO.networkType + ")" };
129
92
  } catch (e) {
130
93
  return { available: false, reason: e.message };
@@ -0,0 +1,210 @@
1
+ // THE MONERO ENGLISH WORDLIST.
2
+ //
3
+ // Copied from the Monero mnemonic specification (1626 words). The list is data, not code: no dependency is
4
+ // involved in loading it.
5
+ export const WORDLIST = [
6
+ "abbey", "abducts", "ability", "ablaze", "abnormal", "abort", "abrasive", "absorb",
7
+ "abyss", "academy", "aces", "aching", "acidic", "acoustic", "acquire", "across",
8
+ "actress", "acumen", "adapt", "addicted", "adept", "adhesive", "adjust", "adopt",
9
+ "adrenalin", "adult", "adventure", "aerial", "afar", "affair", "afield", "afloat",
10
+ "afoot", "afraid", "after", "against", "agenda", "aggravate", "agile", "aglow",
11
+ "agnostic", "agony", "agreed", "ahead", "aided", "ailments", "aimless", "airport",
12
+ "aisle", "ajar", "akin", "alarms", "album", "alchemy", "alerts", "algebra",
13
+ "alkaline", "alley", "almost", "aloof", "alpine", "already", "also", "altitude",
14
+ "alumni", "always", "amaze", "ambush", "amended", "amidst", "ammo", "amnesty",
15
+ "among", "amply", "amused", "anchor", "android", "anecdote", "angled", "ankle",
16
+ "annoyed", "answers", "antics", "anvil", "anxiety", "anybody", "apart", "apex",
17
+ "aphid", "aplomb", "apology", "apply", "apricot", "aptitude", "aquarium", "arbitrary",
18
+ "archer", "ardent", "arena", "argue", "arises", "army", "around", "arrow",
19
+ "arsenic", "artistic", "ascend", "ashtray", "aside", "asked", "asleep", "aspire",
20
+ "assorted", "asylum", "athlete", "atlas", "atom", "atrium", "attire", "auburn",
21
+ "auctions", "audio", "august", "aunt", "austere", "autumn", "avatar", "avidly",
22
+ "avoid", "awakened", "awesome", "awful", "awkward", "awning", "awoken", "axes",
23
+ "axis", "axle", "aztec", "azure", "baby", "bacon", "badge", "baffles",
24
+ "bagpipe", "bailed", "bakery", "balding", "bamboo", "banjo", "baptism", "basin",
25
+ "batch", "bawled", "bays", "because", "beer", "befit", "begun", "behind",
26
+ "being", "below", "bemused", "benches", "berries", "bested", "betting", "bevel",
27
+ "beware", "beyond", "bias", "bicycle", "bids", "bifocals", "biggest", "bikini",
28
+ "bimonthly", "binocular", "biology", "biplane", "birth", "biscuit", "bite", "biweekly",
29
+ "blender", "blip", "bluntly", "boat", "bobsled", "bodies", "bogeys", "boil",
30
+ "boldly", "bomb", "border", "boss", "both", "bounced", "bovine", "bowling",
31
+ "boxes", "boyfriend", "broken", "brunt", "bubble", "buckets", "budget", "buffet",
32
+ "bugs", "building", "bulb", "bumper", "bunch", "business", "butter", "buying",
33
+ "buzzer", "bygones", "byline", "bypass", "cabin", "cactus", "cadets", "cafe",
34
+ "cage", "cajun", "cake", "calamity", "camp", "candy", "casket", "catch",
35
+ "cause", "cavernous", "cease", "cedar", "ceiling", "cell", "cement", "cent",
36
+ "certain", "chlorine", "chrome", "cider", "cigar", "cinema", "circle", "cistern",
37
+ "citadel", "civilian", "claim", "click", "clue", "coal", "cobra", "cocoa",
38
+ "code", "coexist", "coffee", "cogs", "cohesive", "coils", "colony", "comb",
39
+ "cool", "copy", "corrode", "costume", "cottage", "cousin", "cowl", "criminal",
40
+ "cube", "cucumber", "cuddled", "cuffs", "cuisine", "cunning", "cupcake", "custom",
41
+ "cycling", "cylinder", "cynical", "dabbing", "dads", "daft", "dagger", "daily",
42
+ "damp", "dangerous", "dapper", "darted", "dash", "dating", "dauntless", "dawn",
43
+ "daytime", "dazed", "debut", "decay", "dedicated", "deepest", "deftly", "degrees",
44
+ "dehydrate", "deity", "dejected", "delayed", "demonstrate", "dented", "deodorant", "depth",
45
+ "desk", "devoid", "dewdrop", "dexterity", "dialect", "dice", "diet", "different",
46
+ "digit", "dilute", "dime", "dinner", "diode", "diplomat", "directed", "distance",
47
+ "ditch", "divers", "dizzy", "doctor", "dodge", "does", "dogs", "doing",
48
+ "dolphin", "domestic", "donuts", "doorway", "dormant", "dosage", "dotted", "double",
49
+ "dove", "down", "dozen", "dreams", "drinks", "drowning", "drunk", "drying",
50
+ "dual", "dubbed", "duckling", "dude", "duets", "duke", "dullness", "dummy",
51
+ "dunes", "duplex", "duration", "dusted", "duties", "dwarf", "dwelt", "dwindling",
52
+ "dying", "dynamite", "dyslexic", "each", "eagle", "earth", "easy", "eating",
53
+ "eavesdrop", "eccentric", "echo", "eclipse", "economics", "ecstatic", "eden", "edgy",
54
+ "edited", "educated", "eels", "efficient", "eggs", "egotistic", "eight", "either",
55
+ "eject", "elapse", "elbow", "eldest", "eleven", "elite", "elope", "else",
56
+ "eluded", "emails", "ember", "emerge", "emit", "emotion", "empty", "emulate",
57
+ "energy", "enforce", "enhanced", "enigma", "enjoy", "enlist", "enmity", "enough",
58
+ "enraged", "ensign", "entrance", "envy", "epoxy", "equip", "erase", "erected",
59
+ "erosion", "error", "eskimos", "espionage", "essential", "estate", "etched", "eternal",
60
+ "ethics", "etiquette", "evaluate", "evenings", "evicted", "evolved", "examine", "excess",
61
+ "exhale", "exit", "exotic", "exquisite", "extra", "exult", "fabrics", "factual",
62
+ "fading", "fainted", "faked", "fall", "family", "fancy", "farming", "fatal",
63
+ "faulty", "fawns", "faxed", "fazed", "feast", "february", "federal", "feel",
64
+ "feline", "females", "fences", "ferry", "festival", "fetches", "fever", "fewest",
65
+ "fiat", "fibula", "fictional", "fidget", "fierce", "fifteen", "fight", "films",
66
+ "firm", "fishing", "fitting", "five", "fixate", "fizzle", "fleet", "flippant",
67
+ "flying", "foamy", "focus", "foes", "foggy", "foiled", "folding", "fonts",
68
+ "foolish", "fossil", "fountain", "fowls", "foxes", "foyer", "framed", "friendly",
69
+ "frown", "fruit", "frying", "fudge", "fuel", "fugitive", "fully", "fuming",
70
+ "fungal", "furnished", "fuselage", "future", "fuzzy", "gables", "gadget", "gags",
71
+ "gained", "galaxy", "gambit", "gang", "gasp", "gather", "gauze", "gave",
72
+ "gawk", "gaze", "gearbox", "gecko", "geek", "gels", "gemstone", "general",
73
+ "geometry", "germs", "gesture", "getting", "geyser", "ghetto", "ghost", "giant",
74
+ "giddy", "gifts", "gigantic", "gills", "gimmick", "ginger", "girth", "giving",
75
+ "glass", "gleeful", "glide", "gnaw", "gnome", "goat", "goblet", "godfather",
76
+ "goes", "goggles", "going", "goldfish", "gone", "goodbye", "gopher", "gorilla",
77
+ "gossip", "gotten", "gourmet", "governing", "gown", "greater", "grunt", "guarded",
78
+ "guest", "guide", "gulp", "gumball", "guru", "gusts", "gutter", "guys",
79
+ "gymnast", "gypsy", "gyrate", "habitat", "hacksaw", "haggled", "hairy", "hamburger",
80
+ "happens", "hashing", "hatchet", "haunted", "having", "hawk", "haystack", "hazard",
81
+ "hectare", "hedgehog", "heels", "hefty", "height", "hemlock", "hence", "heron",
82
+ "hesitate", "hexagon", "hickory", "hiding", "highway", "hijack", "hiker", "hills",
83
+ "himself", "hinder", "hippo", "hire", "history", "hitched", "hive", "hoax",
84
+ "hobby", "hockey", "hoisting", "hold", "honked", "hookup", "hope", "hornet",
85
+ "hospital", "hotel", "hounded", "hover", "howls", "hubcaps", "huddle", "huge",
86
+ "hull", "humid", "hunter", "hurried", "husband", "huts", "hybrid", "hydrogen",
87
+ "hyper", "iceberg", "icing", "icon", "identity", "idiom", "idled", "idols",
88
+ "igloo", "ignore", "iguana", "illness", "imagine", "imbalance", "imitate", "impel",
89
+ "inactive", "inbound", "incur", "industrial", "inexact", "inflamed", "ingested", "initiate",
90
+ "injury", "inkling", "inline", "inmate", "innocent", "inorganic", "input", "inquest",
91
+ "inroads", "insult", "intended", "inundate", "invoke", "inwardly", "ionic", "irate",
92
+ "iris", "irony", "irritate", "island", "isolated", "issued", "italics", "itches",
93
+ "items", "itinerary", "itself", "ivory", "jabbed", "jackets", "jaded", "jagged",
94
+ "jailed", "jamming", "january", "jargon", "jaunt", "javelin", "jaws", "jazz",
95
+ "jeans", "jeers", "jellyfish", "jeopardy", "jerseys", "jester", "jetting", "jewels",
96
+ "jigsaw", "jingle", "jittery", "jive", "jobs", "jockey", "jogger", "joining",
97
+ "joking", "jolted", "jostle", "journal", "joyous", "jubilee", "judge", "juggled",
98
+ "juicy", "jukebox", "july", "jump", "junk", "jury", "justice", "juvenile",
99
+ "kangaroo", "karate", "keep", "kennel", "kept", "kernels", "kettle", "keyboard",
100
+ "kickoff", "kidneys", "king", "kiosk", "kisses", "kitchens", "kiwi", "knapsack",
101
+ "knee", "knife", "knowledge", "knuckle", "koala", "laboratory", "ladder", "lagoon",
102
+ "lair", "lakes", "lamb", "language", "laptop", "large", "last", "later",
103
+ "launching", "lava", "lawsuit", "layout", "lazy", "lectures", "ledge", "leech",
104
+ "left", "legion", "leisure", "lemon", "lending", "leopard", "lesson", "lettuce",
105
+ "lexicon", "liar", "library", "licks", "lids", "lied", "lifestyle", "light",
106
+ "likewise", "lilac", "limits", "linen", "lion", "lipstick", "liquid", "listen",
107
+ "lively", "loaded", "lobster", "locker", "lodge", "lofty", "logic", "loincloth",
108
+ "long", "looking", "lopped", "lordship", "losing", "lottery", "loudly", "love",
109
+ "lower", "loyal", "lucky", "luggage", "lukewarm", "lullaby", "lumber", "lunar",
110
+ "lurk", "lush", "luxury", "lymph", "lynx", "lyrics", "macro", "madness",
111
+ "magically", "mailed", "major", "makeup", "malady", "mammal", "maps", "masterful",
112
+ "match", "maul", "maverick", "maximum", "mayor", "maze", "meant", "mechanic",
113
+ "medicate", "meeting", "megabyte", "melting", "memoir", "menu", "merger", "mesh",
114
+ "metro", "mews", "mice", "midst", "mighty", "mime", "mirror", "misery",
115
+ "mittens", "mixture", "moat", "mobile", "mocked", "mohawk", "moisture", "molten",
116
+ "moment", "money", "moon", "mops", "morsel", "mostly", "motherly", "mouth",
117
+ "movement", "mowing", "much", "muddy", "muffin", "mugged", "mullet", "mumble",
118
+ "mundane", "muppet", "mural", "musical", "muzzle", "myriad", "mystery", "myth",
119
+ "nabbing", "nagged", "nail", "names", "nanny", "napkin", "narrate", "nasty",
120
+ "natural", "nautical", "navy", "nearby", "necklace", "needed", "negative", "neither",
121
+ "neon", "nephew", "nerves", "nestle", "network", "neutral", "never", "newt",
122
+ "nexus", "nibs", "niche", "niece", "nifty", "nightly", "nimbly", "nineteen",
123
+ "nirvana", "nitrogen", "nobody", "nocturnal", "nodes", "noises", "nomad", "noodles",
124
+ "northern", "nostril", "noted", "nouns", "novelty", "nowhere", "nozzle", "nuance",
125
+ "nucleus", "nudged", "nugget", "nuisance", "null", "number", "nuns", "nurse",
126
+ "nutshell", "nylon", "oaks", "oars", "oasis", "oatmeal", "obedient", "object",
127
+ "obliged", "obnoxious", "observant", "obtains", "obvious", "occur", "ocean", "october",
128
+ "odds", "odometer", "offend", "often", "oilfield", "ointment", "okay", "older",
129
+ "olive", "olympics", "omega", "omission", "omnibus", "onboard", "oncoming", "oneself",
130
+ "ongoing", "onion", "online", "onslaught", "onto", "onward", "oozed", "opacity",
131
+ "opened", "opposite", "optical", "opus", "orange", "orbit", "orchid", "orders",
132
+ "organs", "origin", "ornament", "orphans", "oscar", "ostrich", "otherwise", "otter",
133
+ "ouch", "ought", "ounce", "ourselves", "oust", "outbreak", "oval", "oven",
134
+ "owed", "owls", "owner", "oxidant", "oxygen", "oyster", "ozone", "pact",
135
+ "paddles", "pager", "pairing", "palace", "pamphlet", "pancakes", "paper", "paradise",
136
+ "pastry", "patio", "pause", "pavements", "pawnshop", "payment", "peaches", "pebbles",
137
+ "peculiar", "pedantic", "peeled", "pegs", "pelican", "pencil", "people", "pepper",
138
+ "perfect", "pests", "petals", "phase", "pheasants", "phone", "phrases", "physics",
139
+ "piano", "picked", "pierce", "pigment", "piloted", "pimple", "pinched", "pioneer",
140
+ "pipeline", "pirate", "pistons", "pitched", "pivot", "pixels", "pizza", "playful",
141
+ "pledge", "pliers", "plotting", "plus", "plywood", "poaching", "pockets", "podcast",
142
+ "poetry", "point", "poker", "polar", "ponies", "pool", "popular", "portents",
143
+ "possible", "potato", "pouch", "poverty", "powder", "pram", "present", "pride",
144
+ "problems", "pruned", "prying", "psychic", "public", "puck", "puddle", "puffin",
145
+ "pulp", "pumpkins", "punch", "puppy", "purged", "push", "putty", "puzzled",
146
+ "pylons", "pyramid", "python", "queen", "quick", "quote", "rabbits", "racetrack",
147
+ "radar", "rafts", "rage", "railway", "raking", "rally", "ramped", "randomly",
148
+ "rapid", "rarest", "rash", "rated", "ravine", "rays", "razor", "react",
149
+ "rebel", "recipe", "reduce", "reef", "refer", "regular", "reheat", "reinvest",
150
+ "rejoices", "rekindle", "relic", "remedy", "renting", "reorder", "repent", "request",
151
+ "reruns", "rest", "return", "reunion", "revamp", "rewind", "rhino", "rhythm",
152
+ "ribbon", "richly", "ridges", "rift", "rigid", "rims", "ringing", "riots",
153
+ "ripped", "rising", "ritual", "river", "roared", "robot", "rockets", "rodent",
154
+ "rogue", "roles", "romance", "roomy", "roped", "roster", "rotate", "rounded",
155
+ "rover", "rowboat", "royal", "ruby", "rudely", "ruffled", "rugged", "ruined",
156
+ "ruling", "rumble", "runway", "rural", "rustled", "ruthless", "sabotage", "sack",
157
+ "sadness", "safety", "saga", "sailor", "sake", "salads", "sample", "sanity",
158
+ "sapling", "sarcasm", "sash", "satin", "saucepan", "saved", "sawmill", "saxophone",
159
+ "sayings", "scamper", "scenic", "school", "science", "scoop", "scrub", "scuba",
160
+ "seasons", "second", "sedan", "seeded", "segments", "seismic", "selfish", "semifinal",
161
+ "sensible", "september", "sequence", "serving", "session", "setup", "seventh", "sewage",
162
+ "shackles", "shelter", "shipped", "shocking", "shrugged", "shuffled", "shyness", "siblings",
163
+ "sickness", "sidekick", "sieve", "sifting", "sighting", "silk", "simplest", "sincerely",
164
+ "sipped", "siren", "situated", "sixteen", "sizes", "skater", "skew", "skirting",
165
+ "skulls", "skydive", "slackens", "sleepless", "slid", "slower", "slug", "smash",
166
+ "smelting", "smidgen", "smog", "smuggled", "snake", "sneeze", "sniff", "snout",
167
+ "snug", "soapy", "sober", "soccer", "soda", "software", "soggy", "soil",
168
+ "solved", "somewhere", "sonic", "soothe", "soprano", "sorry", "southern", "sovereign",
169
+ "sowed", "soya", "space", "speedy", "sphere", "spiders", "splendid", "spout",
170
+ "sprig", "spud", "spying", "square", "stacking", "stellar", "stick", "stockpile",
171
+ "strained", "stunning", "stylishly", "subtly", "succeed", "suddenly", "suede", "suffice",
172
+ "sugar", "suitcase", "sulking", "summon", "sunken", "superior", "surfer", "sushi",
173
+ "suture", "swagger", "swept", "swiftly", "sword", "swung", "syllabus", "symptoms",
174
+ "syndrome", "syringe", "system", "taboo", "tacit", "tadpoles", "tagged", "tail",
175
+ "taken", "talent", "tamper", "tanks", "tapestry", "tarnished", "tasked", "tattoo",
176
+ "taunts", "tavern", "tawny", "taxi", "teardrop", "technical", "tedious", "teeming",
177
+ "tell", "template", "tender", "tepid", "tequila", "terminal", "testing", "tether",
178
+ "textbook", "thaw", "theatrics", "thirsty", "thorn", "threaten", "thumbs", "thwart",
179
+ "ticket", "tidy", "tiers", "tiger", "tilt", "timber", "tinted", "tipsy",
180
+ "tirade", "tissue", "titans", "toaster", "tobacco", "today", "toenail", "toffee",
181
+ "together", "toilet", "token", "tolerant", "tomorrow", "tonic", "toolbox", "topic",
182
+ "torch", "tossed", "total", "touchy", "towel", "toxic", "toyed", "trash",
183
+ "trendy", "tribal", "trolling", "truth", "trying", "tsunami", "tubes", "tucks",
184
+ "tudor", "tuesday", "tufts", "tugs", "tuition", "tulips", "tumbling", "tunnel",
185
+ "turnip", "tusks", "tutor", "tuxedo", "twang", "tweezers", "twice", "twofold",
186
+ "tycoon", "typist", "tyrant", "ugly", "ulcers", "ultimate", "umbrella", "umpire",
187
+ "unafraid", "unbending", "uncle", "under", "uneven", "unfit", "ungainly", "unhappy",
188
+ "union", "unjustly", "unknown", "unlikely", "unmask", "unnoticed", "unopened", "unplugs",
189
+ "unquoted", "unrest", "unsafe", "until", "unusual", "unveil", "unwind", "unzip",
190
+ "upbeat", "upcoming", "update", "upgrade", "uphill", "upkeep", "upload", "upon",
191
+ "upper", "upright", "upstairs", "uptight", "upwards", "urban", "urchins", "urgent",
192
+ "usage", "useful", "usher", "using", "usual", "utensils", "utility", "utmost",
193
+ "utopia", "uttered", "vacation", "vague", "vain", "value", "vampire", "vane",
194
+ "vapidly", "vary", "vastness", "vats", "vaults", "vector", "veered", "vegan",
195
+ "vehicle", "vein", "velvet", "venomous", "verification", "vessel", "veteran", "vexed",
196
+ "vials", "vibrate", "victim", "video", "viewpoint", "vigilant", "viking", "village",
197
+ "vinegar", "violin", "vipers", "virtual", "visited", "vitals", "vivid", "vixen",
198
+ "vocal", "vogue", "voice", "volcano", "vortex", "voted", "voucher", "vowels",
199
+ "voyage", "vulture", "wade", "waffle", "wagtail", "waist", "waking", "wallets",
200
+ "wanted", "warped", "washing", "water", "waveform", "waxing", "wayside", "weavers",
201
+ "website", "wedge", "weekday", "weird", "welders", "went", "wept", "were",
202
+ "western", "wetsuit", "whale", "when", "whipped", "whole", "wickets", "width",
203
+ "wield", "wife", "wiggle", "wildly", "winter", "wipeout", "wiring", "wise",
204
+ "withdrawn", "wives", "wizard", "wobbly", "woes", "woken", "wolf", "womanly",
205
+ "wonders", "woozy", "worry", "wounded", "woven", "wrap", "wrist", "wrong",
206
+ "yacht", "yahoo", "yanks", "yard", "yawning", "yearbook", "yellow", "yesterday",
207
+ "yeti", "yields", "yodel", "yoga", "younger", "yoyo", "zapped", "zeal",
208
+ "zebra", "zero", "zesty", "zigzags", "zinger", "zippers", "zodiac", "zombie",
209
+ "zones", "zoom",
210
+ ];
@@ -28,7 +28,7 @@ export async function restoreWalletFromPayload(payload, deps = {}) {
28
28
  const network = m.network || payload.moneroNetwork;
29
29
  if (payload.version >= 3) return await restoreFromHalves(payload, warnings, deps);
30
30
 
31
- // The mnemonic is passed explicitly: monero-js checks its checksum and refuses a broken phrase
31
+ // The mnemonic is passed explicitly: engine/monero/mnemonic.js checks its checksum and refuses a broken phrase
32
32
  // (in wallet.js this is now an error, not a silent new-wallet generation).
33
33
  const wallet = await createSwapWallet({ seed: m.mnemonic, network });
34
34