@awarizon/web3 1.3.2 → 1.3.4
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/dist/index.d.mts +396 -8
- package/dist/index.d.ts +396 -8
- package/dist/index.js +3448 -116
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3408 -42
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -14
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,3254 @@
|
|
|
1
|
-
import { erc20Abi,
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { TransactionEngine } from '@awarizon/tx-engine';
|
|
5
|
-
export { ContractExecutionError, GasEstimationError, SimulationError, TransactionEngine, TransactionTimeoutError } from '@awarizon/tx-engine';
|
|
1
|
+
import { erc20Abi, createWalletClient, custom, createPublicClient, http, fallback } from 'viem';
|
|
2
|
+
import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
|
|
3
|
+
import * as nc from 'crypto';
|
|
6
4
|
import { moonbeam, fantom, gnosis, celo, mantle, scroll, linea, zora, sepolia, avalanche, bsc, optimismSepolia, optimism, arbitrumSepolia, arbitrum, polygonAmoy, polygon, baseSepolia, base, mainnet } from 'viem/chains';
|
|
7
|
-
import { parseABI } from '@awarizon/abi-engine';
|
|
8
|
-
export { DuplicateFunctionError, InvalidABIError, UnsupportedABIItemError, generateAllMethodSignatures, generateMethodSignature, isPayableFunction, isWriteFunction, parseABI } from '@awarizon/abi-engine';
|
|
9
5
|
|
|
10
6
|
// src/sdk.ts
|
|
7
|
+
var crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && "randomBytes" in nc ? nc : void 0;
|
|
8
|
+
|
|
9
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js
|
|
10
|
+
function isBytes(a) {
|
|
11
|
+
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
12
|
+
}
|
|
13
|
+
function anumber(n) {
|
|
14
|
+
if (!Number.isSafeInteger(n) || n < 0)
|
|
15
|
+
throw new Error("positive integer expected, got " + n);
|
|
16
|
+
}
|
|
17
|
+
function abytes(b, ...lengths) {
|
|
18
|
+
if (!isBytes(b))
|
|
19
|
+
throw new Error("Uint8Array expected");
|
|
20
|
+
if (lengths.length > 0 && !lengths.includes(b.length))
|
|
21
|
+
throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
|
|
22
|
+
}
|
|
23
|
+
function aexists(instance, checkFinished = true) {
|
|
24
|
+
if (instance.destroyed)
|
|
25
|
+
throw new Error("Hash instance has been destroyed");
|
|
26
|
+
if (checkFinished && instance.finished)
|
|
27
|
+
throw new Error("Hash#digest() has already been called");
|
|
28
|
+
}
|
|
29
|
+
function aoutput(out, instance) {
|
|
30
|
+
abytes(out);
|
|
31
|
+
const min = instance.outputLen;
|
|
32
|
+
if (out.length < min) {
|
|
33
|
+
throw new Error("digestInto() expects output buffer of length at least " + min);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function clean(...arrays) {
|
|
37
|
+
for (let i = 0; i < arrays.length; i++) {
|
|
38
|
+
arrays[i].fill(0);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function createView(arr) {
|
|
42
|
+
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
43
|
+
}
|
|
44
|
+
function rotr(word, shift) {
|
|
45
|
+
return word << 32 - shift | word >>> shift;
|
|
46
|
+
}
|
|
47
|
+
function utf8ToBytes(str) {
|
|
48
|
+
if (typeof str !== "string")
|
|
49
|
+
throw new Error("string expected");
|
|
50
|
+
return new Uint8Array(new TextEncoder().encode(str));
|
|
51
|
+
}
|
|
52
|
+
function toBytes(data) {
|
|
53
|
+
if (typeof data === "string")
|
|
54
|
+
data = utf8ToBytes(data);
|
|
55
|
+
abytes(data);
|
|
56
|
+
return data;
|
|
57
|
+
}
|
|
58
|
+
var Hash = class {
|
|
59
|
+
};
|
|
60
|
+
function createHasher(hashCons) {
|
|
61
|
+
const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
|
|
62
|
+
const tmp = hashCons();
|
|
63
|
+
hashC.outputLen = tmp.outputLen;
|
|
64
|
+
hashC.blockLen = tmp.blockLen;
|
|
65
|
+
hashC.create = () => hashCons();
|
|
66
|
+
return hashC;
|
|
67
|
+
}
|
|
68
|
+
function randomBytes(bytesLength = 32) {
|
|
69
|
+
if (crypto && typeof crypto.getRandomValues === "function") {
|
|
70
|
+
return crypto.getRandomValues(new Uint8Array(bytesLength));
|
|
71
|
+
}
|
|
72
|
+
if (crypto && typeof crypto.randomBytes === "function") {
|
|
73
|
+
return Uint8Array.from(crypto.randomBytes(bytesLength));
|
|
74
|
+
}
|
|
75
|
+
throw new Error("crypto.getRandomValues must be defined");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js
|
|
79
|
+
function setBigUint64(view, byteOffset, value, isLE) {
|
|
80
|
+
if (typeof view.setBigUint64 === "function")
|
|
81
|
+
return view.setBigUint64(byteOffset, value, isLE);
|
|
82
|
+
const _32n = BigInt(32);
|
|
83
|
+
const _u32_max = BigInt(4294967295);
|
|
84
|
+
const wh = Number(value >> _32n & _u32_max);
|
|
85
|
+
const wl = Number(value & _u32_max);
|
|
86
|
+
const h = isLE ? 4 : 0;
|
|
87
|
+
const l = isLE ? 0 : 4;
|
|
88
|
+
view.setUint32(byteOffset + h, wh, isLE);
|
|
89
|
+
view.setUint32(byteOffset + l, wl, isLE);
|
|
90
|
+
}
|
|
91
|
+
function Chi(a, b, c) {
|
|
92
|
+
return a & b ^ ~a & c;
|
|
93
|
+
}
|
|
94
|
+
function Maj(a, b, c) {
|
|
95
|
+
return a & b ^ a & c ^ b & c;
|
|
96
|
+
}
|
|
97
|
+
var HashMD = class extends Hash {
|
|
98
|
+
constructor(blockLen, outputLen, padOffset, isLE) {
|
|
99
|
+
super();
|
|
100
|
+
this.finished = false;
|
|
101
|
+
this.length = 0;
|
|
102
|
+
this.pos = 0;
|
|
103
|
+
this.destroyed = false;
|
|
104
|
+
this.blockLen = blockLen;
|
|
105
|
+
this.outputLen = outputLen;
|
|
106
|
+
this.padOffset = padOffset;
|
|
107
|
+
this.isLE = isLE;
|
|
108
|
+
this.buffer = new Uint8Array(blockLen);
|
|
109
|
+
this.view = createView(this.buffer);
|
|
110
|
+
}
|
|
111
|
+
update(data) {
|
|
112
|
+
aexists(this);
|
|
113
|
+
data = toBytes(data);
|
|
114
|
+
abytes(data);
|
|
115
|
+
const { view, buffer, blockLen } = this;
|
|
116
|
+
const len = data.length;
|
|
117
|
+
for (let pos = 0; pos < len; ) {
|
|
118
|
+
const take = Math.min(blockLen - this.pos, len - pos);
|
|
119
|
+
if (take === blockLen) {
|
|
120
|
+
const dataView = createView(data);
|
|
121
|
+
for (; blockLen <= len - pos; pos += blockLen)
|
|
122
|
+
this.process(dataView, pos);
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
buffer.set(data.subarray(pos, pos + take), this.pos);
|
|
126
|
+
this.pos += take;
|
|
127
|
+
pos += take;
|
|
128
|
+
if (this.pos === blockLen) {
|
|
129
|
+
this.process(view, 0);
|
|
130
|
+
this.pos = 0;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
this.length += data.length;
|
|
134
|
+
this.roundClean();
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
digestInto(out) {
|
|
138
|
+
aexists(this);
|
|
139
|
+
aoutput(out, this);
|
|
140
|
+
this.finished = true;
|
|
141
|
+
const { buffer, view, blockLen, isLE } = this;
|
|
142
|
+
let { pos } = this;
|
|
143
|
+
buffer[pos++] = 128;
|
|
144
|
+
clean(this.buffer.subarray(pos));
|
|
145
|
+
if (this.padOffset > blockLen - pos) {
|
|
146
|
+
this.process(view, 0);
|
|
147
|
+
pos = 0;
|
|
148
|
+
}
|
|
149
|
+
for (let i = pos; i < blockLen; i++)
|
|
150
|
+
buffer[i] = 0;
|
|
151
|
+
setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);
|
|
152
|
+
this.process(view, 0);
|
|
153
|
+
const oview = createView(out);
|
|
154
|
+
const len = this.outputLen;
|
|
155
|
+
if (len % 4)
|
|
156
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
157
|
+
const outLen = len / 4;
|
|
158
|
+
const state = this.get();
|
|
159
|
+
if (outLen > state.length)
|
|
160
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
161
|
+
for (let i = 0; i < outLen; i++)
|
|
162
|
+
oview.setUint32(4 * i, state[i], isLE);
|
|
163
|
+
}
|
|
164
|
+
digest() {
|
|
165
|
+
const { buffer, outputLen } = this;
|
|
166
|
+
this.digestInto(buffer);
|
|
167
|
+
const res = buffer.slice(0, outputLen);
|
|
168
|
+
this.destroy();
|
|
169
|
+
return res;
|
|
170
|
+
}
|
|
171
|
+
_cloneInto(to) {
|
|
172
|
+
to || (to = new this.constructor());
|
|
173
|
+
to.set(...this.get());
|
|
174
|
+
const { blockLen, buffer, length, finished, destroyed, pos } = this;
|
|
175
|
+
to.destroyed = destroyed;
|
|
176
|
+
to.finished = finished;
|
|
177
|
+
to.length = length;
|
|
178
|
+
to.pos = pos;
|
|
179
|
+
if (length % blockLen)
|
|
180
|
+
to.buffer.set(buffer);
|
|
181
|
+
return to;
|
|
182
|
+
}
|
|
183
|
+
clone() {
|
|
184
|
+
return this._cloneInto();
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
var SHA256_IV = /* @__PURE__ */ Uint32Array.from([
|
|
188
|
+
1779033703,
|
|
189
|
+
3144134277,
|
|
190
|
+
1013904242,
|
|
191
|
+
2773480762,
|
|
192
|
+
1359893119,
|
|
193
|
+
2600822924,
|
|
194
|
+
528734635,
|
|
195
|
+
1541459225
|
|
196
|
+
]);
|
|
197
|
+
|
|
198
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js
|
|
199
|
+
var SHA256_K = /* @__PURE__ */ Uint32Array.from([
|
|
200
|
+
1116352408,
|
|
201
|
+
1899447441,
|
|
202
|
+
3049323471,
|
|
203
|
+
3921009573,
|
|
204
|
+
961987163,
|
|
205
|
+
1508970993,
|
|
206
|
+
2453635748,
|
|
207
|
+
2870763221,
|
|
208
|
+
3624381080,
|
|
209
|
+
310598401,
|
|
210
|
+
607225278,
|
|
211
|
+
1426881987,
|
|
212
|
+
1925078388,
|
|
213
|
+
2162078206,
|
|
214
|
+
2614888103,
|
|
215
|
+
3248222580,
|
|
216
|
+
3835390401,
|
|
217
|
+
4022224774,
|
|
218
|
+
264347078,
|
|
219
|
+
604807628,
|
|
220
|
+
770255983,
|
|
221
|
+
1249150122,
|
|
222
|
+
1555081692,
|
|
223
|
+
1996064986,
|
|
224
|
+
2554220882,
|
|
225
|
+
2821834349,
|
|
226
|
+
2952996808,
|
|
227
|
+
3210313671,
|
|
228
|
+
3336571891,
|
|
229
|
+
3584528711,
|
|
230
|
+
113926993,
|
|
231
|
+
338241895,
|
|
232
|
+
666307205,
|
|
233
|
+
773529912,
|
|
234
|
+
1294757372,
|
|
235
|
+
1396182291,
|
|
236
|
+
1695183700,
|
|
237
|
+
1986661051,
|
|
238
|
+
2177026350,
|
|
239
|
+
2456956037,
|
|
240
|
+
2730485921,
|
|
241
|
+
2820302411,
|
|
242
|
+
3259730800,
|
|
243
|
+
3345764771,
|
|
244
|
+
3516065817,
|
|
245
|
+
3600352804,
|
|
246
|
+
4094571909,
|
|
247
|
+
275423344,
|
|
248
|
+
430227734,
|
|
249
|
+
506948616,
|
|
250
|
+
659060556,
|
|
251
|
+
883997877,
|
|
252
|
+
958139571,
|
|
253
|
+
1322822218,
|
|
254
|
+
1537002063,
|
|
255
|
+
1747873779,
|
|
256
|
+
1955562222,
|
|
257
|
+
2024104815,
|
|
258
|
+
2227730452,
|
|
259
|
+
2361852424,
|
|
260
|
+
2428436474,
|
|
261
|
+
2756734187,
|
|
262
|
+
3204031479,
|
|
263
|
+
3329325298
|
|
264
|
+
]);
|
|
265
|
+
var SHA256_W = /* @__PURE__ */ new Uint32Array(64);
|
|
266
|
+
var SHA256 = class extends HashMD {
|
|
267
|
+
constructor(outputLen = 32) {
|
|
268
|
+
super(64, outputLen, 8, false);
|
|
269
|
+
this.A = SHA256_IV[0] | 0;
|
|
270
|
+
this.B = SHA256_IV[1] | 0;
|
|
271
|
+
this.C = SHA256_IV[2] | 0;
|
|
272
|
+
this.D = SHA256_IV[3] | 0;
|
|
273
|
+
this.E = SHA256_IV[4] | 0;
|
|
274
|
+
this.F = SHA256_IV[5] | 0;
|
|
275
|
+
this.G = SHA256_IV[6] | 0;
|
|
276
|
+
this.H = SHA256_IV[7] | 0;
|
|
277
|
+
}
|
|
278
|
+
get() {
|
|
279
|
+
const { A, B, C, D, E, F, G, H } = this;
|
|
280
|
+
return [A, B, C, D, E, F, G, H];
|
|
281
|
+
}
|
|
282
|
+
// prettier-ignore
|
|
283
|
+
set(A, B, C, D, E, F, G, H) {
|
|
284
|
+
this.A = A | 0;
|
|
285
|
+
this.B = B | 0;
|
|
286
|
+
this.C = C | 0;
|
|
287
|
+
this.D = D | 0;
|
|
288
|
+
this.E = E | 0;
|
|
289
|
+
this.F = F | 0;
|
|
290
|
+
this.G = G | 0;
|
|
291
|
+
this.H = H | 0;
|
|
292
|
+
}
|
|
293
|
+
process(view, offset) {
|
|
294
|
+
for (let i = 0; i < 16; i++, offset += 4)
|
|
295
|
+
SHA256_W[i] = view.getUint32(offset, false);
|
|
296
|
+
for (let i = 16; i < 64; i++) {
|
|
297
|
+
const W15 = SHA256_W[i - 15];
|
|
298
|
+
const W2 = SHA256_W[i - 2];
|
|
299
|
+
const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
|
|
300
|
+
const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
|
|
301
|
+
SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
|
|
302
|
+
}
|
|
303
|
+
let { A, B, C, D, E, F, G, H } = this;
|
|
304
|
+
for (let i = 0; i < 64; i++) {
|
|
305
|
+
const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
|
|
306
|
+
const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
|
|
307
|
+
const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);
|
|
308
|
+
const T2 = sigma0 + Maj(A, B, C) | 0;
|
|
309
|
+
H = G;
|
|
310
|
+
G = F;
|
|
311
|
+
F = E;
|
|
312
|
+
E = D + T1 | 0;
|
|
313
|
+
D = C;
|
|
314
|
+
C = B;
|
|
315
|
+
B = A;
|
|
316
|
+
A = T1 + T2 | 0;
|
|
317
|
+
}
|
|
318
|
+
A = A + this.A | 0;
|
|
319
|
+
B = B + this.B | 0;
|
|
320
|
+
C = C + this.C | 0;
|
|
321
|
+
D = D + this.D | 0;
|
|
322
|
+
E = E + this.E | 0;
|
|
323
|
+
F = F + this.F | 0;
|
|
324
|
+
G = G + this.G | 0;
|
|
325
|
+
H = H + this.H | 0;
|
|
326
|
+
this.set(A, B, C, D, E, F, G, H);
|
|
327
|
+
}
|
|
328
|
+
roundClean() {
|
|
329
|
+
clean(SHA256_W);
|
|
330
|
+
}
|
|
331
|
+
destroy() {
|
|
332
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
|
333
|
+
clean(this.buffer);
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
var sha256 = /* @__PURE__ */ createHasher(() => new SHA256());
|
|
337
|
+
|
|
338
|
+
// ../../node_modules/.pnpm/@scure+base@1.2.6/node_modules/@scure/base/lib/esm/index.js
|
|
339
|
+
function isBytes2(a) {
|
|
340
|
+
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
341
|
+
}
|
|
342
|
+
function isArrayOf(isString, arr) {
|
|
343
|
+
if (!Array.isArray(arr))
|
|
344
|
+
return false;
|
|
345
|
+
if (arr.length === 0)
|
|
346
|
+
return true;
|
|
347
|
+
if (isString) {
|
|
348
|
+
return arr.every((item) => typeof item === "string");
|
|
349
|
+
} else {
|
|
350
|
+
return arr.every((item) => Number.isSafeInteger(item));
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function afn(input) {
|
|
354
|
+
if (typeof input !== "function")
|
|
355
|
+
throw new Error("function expected");
|
|
356
|
+
return true;
|
|
357
|
+
}
|
|
358
|
+
function astr(label, input) {
|
|
359
|
+
if (typeof input !== "string")
|
|
360
|
+
throw new Error(`${label}: string expected`);
|
|
361
|
+
return true;
|
|
362
|
+
}
|
|
363
|
+
function anumber2(n) {
|
|
364
|
+
if (!Number.isSafeInteger(n))
|
|
365
|
+
throw new Error(`invalid integer: ${n}`);
|
|
366
|
+
}
|
|
367
|
+
function aArr(input) {
|
|
368
|
+
if (!Array.isArray(input))
|
|
369
|
+
throw new Error("array expected");
|
|
370
|
+
}
|
|
371
|
+
function astrArr(label, input) {
|
|
372
|
+
if (!isArrayOf(true, input))
|
|
373
|
+
throw new Error(`${label}: array of strings expected`);
|
|
374
|
+
}
|
|
375
|
+
function anumArr(label, input) {
|
|
376
|
+
if (!isArrayOf(false, input))
|
|
377
|
+
throw new Error(`${label}: array of numbers expected`);
|
|
378
|
+
}
|
|
379
|
+
// @__NO_SIDE_EFFECTS__
|
|
380
|
+
function chain(...args) {
|
|
381
|
+
const id = (a) => a;
|
|
382
|
+
const wrap = (a, b) => (c) => a(b(c));
|
|
383
|
+
const encode = args.map((x) => x.encode).reduceRight(wrap, id);
|
|
384
|
+
const decode = args.map((x) => x.decode).reduce(wrap, id);
|
|
385
|
+
return { encode, decode };
|
|
386
|
+
}
|
|
387
|
+
// @__NO_SIDE_EFFECTS__
|
|
388
|
+
function alphabet(letters) {
|
|
389
|
+
const lettersA = typeof letters === "string" ? letters.split("") : letters;
|
|
390
|
+
const len = lettersA.length;
|
|
391
|
+
astrArr("alphabet", lettersA);
|
|
392
|
+
const indexes = new Map(lettersA.map((l, i) => [l, i]));
|
|
393
|
+
return {
|
|
394
|
+
encode: (digits) => {
|
|
395
|
+
aArr(digits);
|
|
396
|
+
return digits.map((i) => {
|
|
397
|
+
if (!Number.isSafeInteger(i) || i < 0 || i >= len)
|
|
398
|
+
throw new Error(`alphabet.encode: digit index outside alphabet "${i}". Allowed: ${letters}`);
|
|
399
|
+
return lettersA[i];
|
|
400
|
+
});
|
|
401
|
+
},
|
|
402
|
+
decode: (input) => {
|
|
403
|
+
aArr(input);
|
|
404
|
+
return input.map((letter) => {
|
|
405
|
+
astr("alphabet.decode", letter);
|
|
406
|
+
const i = indexes.get(letter);
|
|
407
|
+
if (i === void 0)
|
|
408
|
+
throw new Error(`Unknown letter: "${letter}". Allowed: ${letters}`);
|
|
409
|
+
return i;
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
// @__NO_SIDE_EFFECTS__
|
|
415
|
+
function join(separator = "") {
|
|
416
|
+
astr("join", separator);
|
|
417
|
+
return {
|
|
418
|
+
encode: (from) => {
|
|
419
|
+
astrArr("join.decode", from);
|
|
420
|
+
return from.join(separator);
|
|
421
|
+
},
|
|
422
|
+
decode: (to) => {
|
|
423
|
+
astr("join.decode", to);
|
|
424
|
+
return to.split(separator);
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
// @__NO_SIDE_EFFECTS__
|
|
429
|
+
function padding(bits, chr = "=") {
|
|
430
|
+
anumber2(bits);
|
|
431
|
+
astr("padding", chr);
|
|
432
|
+
return {
|
|
433
|
+
encode(data) {
|
|
434
|
+
astrArr("padding.encode", data);
|
|
435
|
+
while (data.length * bits % 8)
|
|
436
|
+
data.push(chr);
|
|
437
|
+
return data;
|
|
438
|
+
},
|
|
439
|
+
decode(input) {
|
|
440
|
+
astrArr("padding.decode", input);
|
|
441
|
+
let end = input.length;
|
|
442
|
+
if (end * bits % 8)
|
|
443
|
+
throw new Error("padding: invalid, string should have whole number of bytes");
|
|
444
|
+
for (; end > 0 && input[end - 1] === chr; end--) {
|
|
445
|
+
const last = end - 1;
|
|
446
|
+
const byte = last * bits;
|
|
447
|
+
if (byte % 8 === 0)
|
|
448
|
+
throw new Error("padding: invalid, string has too much padding");
|
|
449
|
+
}
|
|
450
|
+
return input.slice(0, end);
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
function convertRadix(data, from, to) {
|
|
455
|
+
if (from < 2)
|
|
456
|
+
throw new Error(`convertRadix: invalid from=${from}, base cannot be less than 2`);
|
|
457
|
+
if (to < 2)
|
|
458
|
+
throw new Error(`convertRadix: invalid to=${to}, base cannot be less than 2`);
|
|
459
|
+
aArr(data);
|
|
460
|
+
if (!data.length)
|
|
461
|
+
return [];
|
|
462
|
+
let pos = 0;
|
|
463
|
+
const res = [];
|
|
464
|
+
const digits = Array.from(data, (d) => {
|
|
465
|
+
anumber2(d);
|
|
466
|
+
if (d < 0 || d >= from)
|
|
467
|
+
throw new Error(`invalid integer: ${d}`);
|
|
468
|
+
return d;
|
|
469
|
+
});
|
|
470
|
+
const dlen = digits.length;
|
|
471
|
+
while (true) {
|
|
472
|
+
let carry = 0;
|
|
473
|
+
let done = true;
|
|
474
|
+
for (let i = pos; i < dlen; i++) {
|
|
475
|
+
const digit = digits[i];
|
|
476
|
+
const fromCarry = from * carry;
|
|
477
|
+
const digitBase = fromCarry + digit;
|
|
478
|
+
if (!Number.isSafeInteger(digitBase) || fromCarry / from !== carry || digitBase - digit !== fromCarry) {
|
|
479
|
+
throw new Error("convertRadix: carry overflow");
|
|
480
|
+
}
|
|
481
|
+
const div = digitBase / to;
|
|
482
|
+
carry = digitBase % to;
|
|
483
|
+
const rounded = Math.floor(div);
|
|
484
|
+
digits[i] = rounded;
|
|
485
|
+
if (!Number.isSafeInteger(rounded) || rounded * to + carry !== digitBase)
|
|
486
|
+
throw new Error("convertRadix: carry overflow");
|
|
487
|
+
if (!done)
|
|
488
|
+
continue;
|
|
489
|
+
else if (!rounded)
|
|
490
|
+
pos = i;
|
|
491
|
+
else
|
|
492
|
+
done = false;
|
|
493
|
+
}
|
|
494
|
+
res.push(carry);
|
|
495
|
+
if (done)
|
|
496
|
+
break;
|
|
497
|
+
}
|
|
498
|
+
for (let i = 0; i < data.length - 1 && data[i] === 0; i++)
|
|
499
|
+
res.push(0);
|
|
500
|
+
return res.reverse();
|
|
501
|
+
}
|
|
502
|
+
var gcd = (a, b) => b === 0 ? a : gcd(b, a % b);
|
|
503
|
+
var radix2carry = /* @__NO_SIDE_EFFECTS__ */ (from, to) => from + (to - gcd(from, to));
|
|
504
|
+
var powers = /* @__PURE__ */ (() => {
|
|
505
|
+
let res = [];
|
|
506
|
+
for (let i = 0; i < 40; i++)
|
|
507
|
+
res.push(2 ** i);
|
|
508
|
+
return res;
|
|
509
|
+
})();
|
|
510
|
+
function convertRadix2(data, from, to, padding2) {
|
|
511
|
+
aArr(data);
|
|
512
|
+
if (from <= 0 || from > 32)
|
|
513
|
+
throw new Error(`convertRadix2: wrong from=${from}`);
|
|
514
|
+
if (to <= 0 || to > 32)
|
|
515
|
+
throw new Error(`convertRadix2: wrong to=${to}`);
|
|
516
|
+
if (/* @__PURE__ */ radix2carry(from, to) > 32) {
|
|
517
|
+
throw new Error(`convertRadix2: carry overflow from=${from} to=${to} carryBits=${/* @__PURE__ */ radix2carry(from, to)}`);
|
|
518
|
+
}
|
|
519
|
+
let carry = 0;
|
|
520
|
+
let pos = 0;
|
|
521
|
+
const max = powers[from];
|
|
522
|
+
const mask = powers[to] - 1;
|
|
523
|
+
const res = [];
|
|
524
|
+
for (const n of data) {
|
|
525
|
+
anumber2(n);
|
|
526
|
+
if (n >= max)
|
|
527
|
+
throw new Error(`convertRadix2: invalid data word=${n} from=${from}`);
|
|
528
|
+
carry = carry << from | n;
|
|
529
|
+
if (pos + from > 32)
|
|
530
|
+
throw new Error(`convertRadix2: carry overflow pos=${pos} from=${from}`);
|
|
531
|
+
pos += from;
|
|
532
|
+
for (; pos >= to; pos -= to)
|
|
533
|
+
res.push((carry >> pos - to & mask) >>> 0);
|
|
534
|
+
const pow = powers[pos];
|
|
535
|
+
if (pow === void 0)
|
|
536
|
+
throw new Error("invalid carry");
|
|
537
|
+
carry &= pow - 1;
|
|
538
|
+
}
|
|
539
|
+
carry = carry << to - pos & mask;
|
|
540
|
+
if (!padding2 && pos >= from)
|
|
541
|
+
throw new Error("Excess padding");
|
|
542
|
+
if (!padding2 && carry > 0)
|
|
543
|
+
throw new Error(`Non-zero padding: ${carry}`);
|
|
544
|
+
if (padding2 && pos > 0)
|
|
545
|
+
res.push(carry >>> 0);
|
|
546
|
+
return res;
|
|
547
|
+
}
|
|
548
|
+
// @__NO_SIDE_EFFECTS__
|
|
549
|
+
function radix(num) {
|
|
550
|
+
anumber2(num);
|
|
551
|
+
const _256 = 2 ** 8;
|
|
552
|
+
return {
|
|
553
|
+
encode: (bytes) => {
|
|
554
|
+
if (!isBytes2(bytes))
|
|
555
|
+
throw new Error("radix.encode input should be Uint8Array");
|
|
556
|
+
return convertRadix(Array.from(bytes), _256, num);
|
|
557
|
+
},
|
|
558
|
+
decode: (digits) => {
|
|
559
|
+
anumArr("radix.decode", digits);
|
|
560
|
+
return Uint8Array.from(convertRadix(digits, num, _256));
|
|
561
|
+
}
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
// @__NO_SIDE_EFFECTS__
|
|
565
|
+
function radix2(bits, revPadding = false) {
|
|
566
|
+
anumber2(bits);
|
|
567
|
+
if (bits <= 0 || bits > 32)
|
|
568
|
+
throw new Error("radix2: bits should be in (0..32]");
|
|
569
|
+
if (/* @__PURE__ */ radix2carry(8, bits) > 32 || /* @__PURE__ */ radix2carry(bits, 8) > 32)
|
|
570
|
+
throw new Error("radix2: carry overflow");
|
|
571
|
+
return {
|
|
572
|
+
encode: (bytes) => {
|
|
573
|
+
if (!isBytes2(bytes))
|
|
574
|
+
throw new Error("radix2.encode input should be Uint8Array");
|
|
575
|
+
return convertRadix2(Array.from(bytes), 8, bits, !revPadding);
|
|
576
|
+
},
|
|
577
|
+
decode: (digits) => {
|
|
578
|
+
anumArr("radix2.decode", digits);
|
|
579
|
+
return Uint8Array.from(convertRadix2(digits, bits, 8, revPadding));
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
function checksum(len, fn) {
|
|
584
|
+
anumber2(len);
|
|
585
|
+
afn(fn);
|
|
586
|
+
return {
|
|
587
|
+
encode(data) {
|
|
588
|
+
if (!isBytes2(data))
|
|
589
|
+
throw new Error("checksum.encode: input should be Uint8Array");
|
|
590
|
+
const sum = fn(data).slice(0, len);
|
|
591
|
+
const res = new Uint8Array(data.length + len);
|
|
592
|
+
res.set(data);
|
|
593
|
+
res.set(sum, data.length);
|
|
594
|
+
return res;
|
|
595
|
+
},
|
|
596
|
+
decode(data) {
|
|
597
|
+
if (!isBytes2(data))
|
|
598
|
+
throw new Error("checksum.decode: input should be Uint8Array");
|
|
599
|
+
const payload = data.slice(0, -len);
|
|
600
|
+
const oldChecksum = data.slice(-len);
|
|
601
|
+
const newChecksum = fn(payload).slice(0, len);
|
|
602
|
+
for (let i = 0; i < len; i++)
|
|
603
|
+
if (newChecksum[i] !== oldChecksum[i])
|
|
604
|
+
throw new Error("Invalid checksum");
|
|
605
|
+
return payload;
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
var utils = {
|
|
610
|
+
alphabet,
|
|
611
|
+
chain,
|
|
612
|
+
checksum,
|
|
613
|
+
convertRadix,
|
|
614
|
+
convertRadix2,
|
|
615
|
+
radix,
|
|
616
|
+
radix2,
|
|
617
|
+
join,
|
|
618
|
+
padding
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
// ../../node_modules/.pnpm/@scure+bip39@1.6.0/node_modules/@scure/bip39/esm/index.js
|
|
622
|
+
var isJapanese = (wordlist2) => wordlist2[0] === "\u3042\u3044\u3053\u304F\u3057\u3093";
|
|
623
|
+
function nfkd(str) {
|
|
624
|
+
if (typeof str !== "string")
|
|
625
|
+
throw new TypeError("invalid mnemonic type: " + typeof str);
|
|
626
|
+
return str.normalize("NFKD");
|
|
627
|
+
}
|
|
628
|
+
function normalize(str) {
|
|
629
|
+
const norm = nfkd(str);
|
|
630
|
+
const words = norm.split(" ");
|
|
631
|
+
if (![12, 15, 18, 21, 24].includes(words.length))
|
|
632
|
+
throw new Error("Invalid mnemonic");
|
|
633
|
+
return { nfkd: norm, words };
|
|
634
|
+
}
|
|
635
|
+
function aentropy(ent) {
|
|
636
|
+
abytes(ent, 16, 20, 24, 28, 32);
|
|
637
|
+
}
|
|
638
|
+
function generateMnemonic(wordlist2, strength = 128) {
|
|
639
|
+
anumber(strength);
|
|
640
|
+
if (strength % 32 !== 0 || strength > 256)
|
|
641
|
+
throw new TypeError("Invalid entropy");
|
|
642
|
+
return entropyToMnemonic(randomBytes(strength / 8), wordlist2);
|
|
643
|
+
}
|
|
644
|
+
var calcChecksum = (entropy) => {
|
|
645
|
+
const bitsLeft = 8 - entropy.length / 4;
|
|
646
|
+
return new Uint8Array([sha256(entropy)[0] >> bitsLeft << bitsLeft]);
|
|
647
|
+
};
|
|
648
|
+
function getCoder(wordlist2) {
|
|
649
|
+
if (!Array.isArray(wordlist2) || wordlist2.length !== 2048 || typeof wordlist2[0] !== "string")
|
|
650
|
+
throw new Error("Wordlist: expected array of 2048 strings");
|
|
651
|
+
wordlist2.forEach((i) => {
|
|
652
|
+
if (typeof i !== "string")
|
|
653
|
+
throw new Error("wordlist: non-string element: " + i);
|
|
654
|
+
});
|
|
655
|
+
return utils.chain(utils.checksum(1, calcChecksum), utils.radix2(11, true), utils.alphabet(wordlist2));
|
|
656
|
+
}
|
|
657
|
+
function mnemonicToEntropy(mnemonic, wordlist2) {
|
|
658
|
+
const { words } = normalize(mnemonic);
|
|
659
|
+
const entropy = getCoder(wordlist2).decode(words);
|
|
660
|
+
aentropy(entropy);
|
|
661
|
+
return entropy;
|
|
662
|
+
}
|
|
663
|
+
function entropyToMnemonic(entropy, wordlist2) {
|
|
664
|
+
aentropy(entropy);
|
|
665
|
+
const words = getCoder(wordlist2).encode(entropy);
|
|
666
|
+
return words.join(isJapanese(wordlist2) ? "\u3000" : " ");
|
|
667
|
+
}
|
|
668
|
+
function validateMnemonic(mnemonic, wordlist2) {
|
|
669
|
+
try {
|
|
670
|
+
mnemonicToEntropy(mnemonic, wordlist2);
|
|
671
|
+
} catch (e) {
|
|
672
|
+
return false;
|
|
673
|
+
}
|
|
674
|
+
return true;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
// ../../node_modules/.pnpm/@scure+bip39@1.6.0/node_modules/@scure/bip39/esm/wordlists/english.js
|
|
678
|
+
var wordlist = `abandon
|
|
679
|
+
ability
|
|
680
|
+
able
|
|
681
|
+
about
|
|
682
|
+
above
|
|
683
|
+
absent
|
|
684
|
+
absorb
|
|
685
|
+
abstract
|
|
686
|
+
absurd
|
|
687
|
+
abuse
|
|
688
|
+
access
|
|
689
|
+
accident
|
|
690
|
+
account
|
|
691
|
+
accuse
|
|
692
|
+
achieve
|
|
693
|
+
acid
|
|
694
|
+
acoustic
|
|
695
|
+
acquire
|
|
696
|
+
across
|
|
697
|
+
act
|
|
698
|
+
action
|
|
699
|
+
actor
|
|
700
|
+
actress
|
|
701
|
+
actual
|
|
702
|
+
adapt
|
|
703
|
+
add
|
|
704
|
+
addict
|
|
705
|
+
address
|
|
706
|
+
adjust
|
|
707
|
+
admit
|
|
708
|
+
adult
|
|
709
|
+
advance
|
|
710
|
+
advice
|
|
711
|
+
aerobic
|
|
712
|
+
affair
|
|
713
|
+
afford
|
|
714
|
+
afraid
|
|
715
|
+
again
|
|
716
|
+
age
|
|
717
|
+
agent
|
|
718
|
+
agree
|
|
719
|
+
ahead
|
|
720
|
+
aim
|
|
721
|
+
air
|
|
722
|
+
airport
|
|
723
|
+
aisle
|
|
724
|
+
alarm
|
|
725
|
+
album
|
|
726
|
+
alcohol
|
|
727
|
+
alert
|
|
728
|
+
alien
|
|
729
|
+
all
|
|
730
|
+
alley
|
|
731
|
+
allow
|
|
732
|
+
almost
|
|
733
|
+
alone
|
|
734
|
+
alpha
|
|
735
|
+
already
|
|
736
|
+
also
|
|
737
|
+
alter
|
|
738
|
+
always
|
|
739
|
+
amateur
|
|
740
|
+
amazing
|
|
741
|
+
among
|
|
742
|
+
amount
|
|
743
|
+
amused
|
|
744
|
+
analyst
|
|
745
|
+
anchor
|
|
746
|
+
ancient
|
|
747
|
+
anger
|
|
748
|
+
angle
|
|
749
|
+
angry
|
|
750
|
+
animal
|
|
751
|
+
ankle
|
|
752
|
+
announce
|
|
753
|
+
annual
|
|
754
|
+
another
|
|
755
|
+
answer
|
|
756
|
+
antenna
|
|
757
|
+
antique
|
|
758
|
+
anxiety
|
|
759
|
+
any
|
|
760
|
+
apart
|
|
761
|
+
apology
|
|
762
|
+
appear
|
|
763
|
+
apple
|
|
764
|
+
approve
|
|
765
|
+
april
|
|
766
|
+
arch
|
|
767
|
+
arctic
|
|
768
|
+
area
|
|
769
|
+
arena
|
|
770
|
+
argue
|
|
771
|
+
arm
|
|
772
|
+
armed
|
|
773
|
+
armor
|
|
774
|
+
army
|
|
775
|
+
around
|
|
776
|
+
arrange
|
|
777
|
+
arrest
|
|
778
|
+
arrive
|
|
779
|
+
arrow
|
|
780
|
+
art
|
|
781
|
+
artefact
|
|
782
|
+
artist
|
|
783
|
+
artwork
|
|
784
|
+
ask
|
|
785
|
+
aspect
|
|
786
|
+
assault
|
|
787
|
+
asset
|
|
788
|
+
assist
|
|
789
|
+
assume
|
|
790
|
+
asthma
|
|
791
|
+
athlete
|
|
792
|
+
atom
|
|
793
|
+
attack
|
|
794
|
+
attend
|
|
795
|
+
attitude
|
|
796
|
+
attract
|
|
797
|
+
auction
|
|
798
|
+
audit
|
|
799
|
+
august
|
|
800
|
+
aunt
|
|
801
|
+
author
|
|
802
|
+
auto
|
|
803
|
+
autumn
|
|
804
|
+
average
|
|
805
|
+
avocado
|
|
806
|
+
avoid
|
|
807
|
+
awake
|
|
808
|
+
aware
|
|
809
|
+
away
|
|
810
|
+
awesome
|
|
811
|
+
awful
|
|
812
|
+
awkward
|
|
813
|
+
axis
|
|
814
|
+
baby
|
|
815
|
+
bachelor
|
|
816
|
+
bacon
|
|
817
|
+
badge
|
|
818
|
+
bag
|
|
819
|
+
balance
|
|
820
|
+
balcony
|
|
821
|
+
ball
|
|
822
|
+
bamboo
|
|
823
|
+
banana
|
|
824
|
+
banner
|
|
825
|
+
bar
|
|
826
|
+
barely
|
|
827
|
+
bargain
|
|
828
|
+
barrel
|
|
829
|
+
base
|
|
830
|
+
basic
|
|
831
|
+
basket
|
|
832
|
+
battle
|
|
833
|
+
beach
|
|
834
|
+
bean
|
|
835
|
+
beauty
|
|
836
|
+
because
|
|
837
|
+
become
|
|
838
|
+
beef
|
|
839
|
+
before
|
|
840
|
+
begin
|
|
841
|
+
behave
|
|
842
|
+
behind
|
|
843
|
+
believe
|
|
844
|
+
below
|
|
845
|
+
belt
|
|
846
|
+
bench
|
|
847
|
+
benefit
|
|
848
|
+
best
|
|
849
|
+
betray
|
|
850
|
+
better
|
|
851
|
+
between
|
|
852
|
+
beyond
|
|
853
|
+
bicycle
|
|
854
|
+
bid
|
|
855
|
+
bike
|
|
856
|
+
bind
|
|
857
|
+
biology
|
|
858
|
+
bird
|
|
859
|
+
birth
|
|
860
|
+
bitter
|
|
861
|
+
black
|
|
862
|
+
blade
|
|
863
|
+
blame
|
|
864
|
+
blanket
|
|
865
|
+
blast
|
|
866
|
+
bleak
|
|
867
|
+
bless
|
|
868
|
+
blind
|
|
869
|
+
blood
|
|
870
|
+
blossom
|
|
871
|
+
blouse
|
|
872
|
+
blue
|
|
873
|
+
blur
|
|
874
|
+
blush
|
|
875
|
+
board
|
|
876
|
+
boat
|
|
877
|
+
body
|
|
878
|
+
boil
|
|
879
|
+
bomb
|
|
880
|
+
bone
|
|
881
|
+
bonus
|
|
882
|
+
book
|
|
883
|
+
boost
|
|
884
|
+
border
|
|
885
|
+
boring
|
|
886
|
+
borrow
|
|
887
|
+
boss
|
|
888
|
+
bottom
|
|
889
|
+
bounce
|
|
890
|
+
box
|
|
891
|
+
boy
|
|
892
|
+
bracket
|
|
893
|
+
brain
|
|
894
|
+
brand
|
|
895
|
+
brass
|
|
896
|
+
brave
|
|
897
|
+
bread
|
|
898
|
+
breeze
|
|
899
|
+
brick
|
|
900
|
+
bridge
|
|
901
|
+
brief
|
|
902
|
+
bright
|
|
903
|
+
bring
|
|
904
|
+
brisk
|
|
905
|
+
broccoli
|
|
906
|
+
broken
|
|
907
|
+
bronze
|
|
908
|
+
broom
|
|
909
|
+
brother
|
|
910
|
+
brown
|
|
911
|
+
brush
|
|
912
|
+
bubble
|
|
913
|
+
buddy
|
|
914
|
+
budget
|
|
915
|
+
buffalo
|
|
916
|
+
build
|
|
917
|
+
bulb
|
|
918
|
+
bulk
|
|
919
|
+
bullet
|
|
920
|
+
bundle
|
|
921
|
+
bunker
|
|
922
|
+
burden
|
|
923
|
+
burger
|
|
924
|
+
burst
|
|
925
|
+
bus
|
|
926
|
+
business
|
|
927
|
+
busy
|
|
928
|
+
butter
|
|
929
|
+
buyer
|
|
930
|
+
buzz
|
|
931
|
+
cabbage
|
|
932
|
+
cabin
|
|
933
|
+
cable
|
|
934
|
+
cactus
|
|
935
|
+
cage
|
|
936
|
+
cake
|
|
937
|
+
call
|
|
938
|
+
calm
|
|
939
|
+
camera
|
|
940
|
+
camp
|
|
941
|
+
can
|
|
942
|
+
canal
|
|
943
|
+
cancel
|
|
944
|
+
candy
|
|
945
|
+
cannon
|
|
946
|
+
canoe
|
|
947
|
+
canvas
|
|
948
|
+
canyon
|
|
949
|
+
capable
|
|
950
|
+
capital
|
|
951
|
+
captain
|
|
952
|
+
car
|
|
953
|
+
carbon
|
|
954
|
+
card
|
|
955
|
+
cargo
|
|
956
|
+
carpet
|
|
957
|
+
carry
|
|
958
|
+
cart
|
|
959
|
+
case
|
|
960
|
+
cash
|
|
961
|
+
casino
|
|
962
|
+
castle
|
|
963
|
+
casual
|
|
964
|
+
cat
|
|
965
|
+
catalog
|
|
966
|
+
catch
|
|
967
|
+
category
|
|
968
|
+
cattle
|
|
969
|
+
caught
|
|
970
|
+
cause
|
|
971
|
+
caution
|
|
972
|
+
cave
|
|
973
|
+
ceiling
|
|
974
|
+
celery
|
|
975
|
+
cement
|
|
976
|
+
census
|
|
977
|
+
century
|
|
978
|
+
cereal
|
|
979
|
+
certain
|
|
980
|
+
chair
|
|
981
|
+
chalk
|
|
982
|
+
champion
|
|
983
|
+
change
|
|
984
|
+
chaos
|
|
985
|
+
chapter
|
|
986
|
+
charge
|
|
987
|
+
chase
|
|
988
|
+
chat
|
|
989
|
+
cheap
|
|
990
|
+
check
|
|
991
|
+
cheese
|
|
992
|
+
chef
|
|
993
|
+
cherry
|
|
994
|
+
chest
|
|
995
|
+
chicken
|
|
996
|
+
chief
|
|
997
|
+
child
|
|
998
|
+
chimney
|
|
999
|
+
choice
|
|
1000
|
+
choose
|
|
1001
|
+
chronic
|
|
1002
|
+
chuckle
|
|
1003
|
+
chunk
|
|
1004
|
+
churn
|
|
1005
|
+
cigar
|
|
1006
|
+
cinnamon
|
|
1007
|
+
circle
|
|
1008
|
+
citizen
|
|
1009
|
+
city
|
|
1010
|
+
civil
|
|
1011
|
+
claim
|
|
1012
|
+
clap
|
|
1013
|
+
clarify
|
|
1014
|
+
claw
|
|
1015
|
+
clay
|
|
1016
|
+
clean
|
|
1017
|
+
clerk
|
|
1018
|
+
clever
|
|
1019
|
+
click
|
|
1020
|
+
client
|
|
1021
|
+
cliff
|
|
1022
|
+
climb
|
|
1023
|
+
clinic
|
|
1024
|
+
clip
|
|
1025
|
+
clock
|
|
1026
|
+
clog
|
|
1027
|
+
close
|
|
1028
|
+
cloth
|
|
1029
|
+
cloud
|
|
1030
|
+
clown
|
|
1031
|
+
club
|
|
1032
|
+
clump
|
|
1033
|
+
cluster
|
|
1034
|
+
clutch
|
|
1035
|
+
coach
|
|
1036
|
+
coast
|
|
1037
|
+
coconut
|
|
1038
|
+
code
|
|
1039
|
+
coffee
|
|
1040
|
+
coil
|
|
1041
|
+
coin
|
|
1042
|
+
collect
|
|
1043
|
+
color
|
|
1044
|
+
column
|
|
1045
|
+
combine
|
|
1046
|
+
come
|
|
1047
|
+
comfort
|
|
1048
|
+
comic
|
|
1049
|
+
common
|
|
1050
|
+
company
|
|
1051
|
+
concert
|
|
1052
|
+
conduct
|
|
1053
|
+
confirm
|
|
1054
|
+
congress
|
|
1055
|
+
connect
|
|
1056
|
+
consider
|
|
1057
|
+
control
|
|
1058
|
+
convince
|
|
1059
|
+
cook
|
|
1060
|
+
cool
|
|
1061
|
+
copper
|
|
1062
|
+
copy
|
|
1063
|
+
coral
|
|
1064
|
+
core
|
|
1065
|
+
corn
|
|
1066
|
+
correct
|
|
1067
|
+
cost
|
|
1068
|
+
cotton
|
|
1069
|
+
couch
|
|
1070
|
+
country
|
|
1071
|
+
couple
|
|
1072
|
+
course
|
|
1073
|
+
cousin
|
|
1074
|
+
cover
|
|
1075
|
+
coyote
|
|
1076
|
+
crack
|
|
1077
|
+
cradle
|
|
1078
|
+
craft
|
|
1079
|
+
cram
|
|
1080
|
+
crane
|
|
1081
|
+
crash
|
|
1082
|
+
crater
|
|
1083
|
+
crawl
|
|
1084
|
+
crazy
|
|
1085
|
+
cream
|
|
1086
|
+
credit
|
|
1087
|
+
creek
|
|
1088
|
+
crew
|
|
1089
|
+
cricket
|
|
1090
|
+
crime
|
|
1091
|
+
crisp
|
|
1092
|
+
critic
|
|
1093
|
+
crop
|
|
1094
|
+
cross
|
|
1095
|
+
crouch
|
|
1096
|
+
crowd
|
|
1097
|
+
crucial
|
|
1098
|
+
cruel
|
|
1099
|
+
cruise
|
|
1100
|
+
crumble
|
|
1101
|
+
crunch
|
|
1102
|
+
crush
|
|
1103
|
+
cry
|
|
1104
|
+
crystal
|
|
1105
|
+
cube
|
|
1106
|
+
culture
|
|
1107
|
+
cup
|
|
1108
|
+
cupboard
|
|
1109
|
+
curious
|
|
1110
|
+
current
|
|
1111
|
+
curtain
|
|
1112
|
+
curve
|
|
1113
|
+
cushion
|
|
1114
|
+
custom
|
|
1115
|
+
cute
|
|
1116
|
+
cycle
|
|
1117
|
+
dad
|
|
1118
|
+
damage
|
|
1119
|
+
damp
|
|
1120
|
+
dance
|
|
1121
|
+
danger
|
|
1122
|
+
daring
|
|
1123
|
+
dash
|
|
1124
|
+
daughter
|
|
1125
|
+
dawn
|
|
1126
|
+
day
|
|
1127
|
+
deal
|
|
1128
|
+
debate
|
|
1129
|
+
debris
|
|
1130
|
+
decade
|
|
1131
|
+
december
|
|
1132
|
+
decide
|
|
1133
|
+
decline
|
|
1134
|
+
decorate
|
|
1135
|
+
decrease
|
|
1136
|
+
deer
|
|
1137
|
+
defense
|
|
1138
|
+
define
|
|
1139
|
+
defy
|
|
1140
|
+
degree
|
|
1141
|
+
delay
|
|
1142
|
+
deliver
|
|
1143
|
+
demand
|
|
1144
|
+
demise
|
|
1145
|
+
denial
|
|
1146
|
+
dentist
|
|
1147
|
+
deny
|
|
1148
|
+
depart
|
|
1149
|
+
depend
|
|
1150
|
+
deposit
|
|
1151
|
+
depth
|
|
1152
|
+
deputy
|
|
1153
|
+
derive
|
|
1154
|
+
describe
|
|
1155
|
+
desert
|
|
1156
|
+
design
|
|
1157
|
+
desk
|
|
1158
|
+
despair
|
|
1159
|
+
destroy
|
|
1160
|
+
detail
|
|
1161
|
+
detect
|
|
1162
|
+
develop
|
|
1163
|
+
device
|
|
1164
|
+
devote
|
|
1165
|
+
diagram
|
|
1166
|
+
dial
|
|
1167
|
+
diamond
|
|
1168
|
+
diary
|
|
1169
|
+
dice
|
|
1170
|
+
diesel
|
|
1171
|
+
diet
|
|
1172
|
+
differ
|
|
1173
|
+
digital
|
|
1174
|
+
dignity
|
|
1175
|
+
dilemma
|
|
1176
|
+
dinner
|
|
1177
|
+
dinosaur
|
|
1178
|
+
direct
|
|
1179
|
+
dirt
|
|
1180
|
+
disagree
|
|
1181
|
+
discover
|
|
1182
|
+
disease
|
|
1183
|
+
dish
|
|
1184
|
+
dismiss
|
|
1185
|
+
disorder
|
|
1186
|
+
display
|
|
1187
|
+
distance
|
|
1188
|
+
divert
|
|
1189
|
+
divide
|
|
1190
|
+
divorce
|
|
1191
|
+
dizzy
|
|
1192
|
+
doctor
|
|
1193
|
+
document
|
|
1194
|
+
dog
|
|
1195
|
+
doll
|
|
1196
|
+
dolphin
|
|
1197
|
+
domain
|
|
1198
|
+
donate
|
|
1199
|
+
donkey
|
|
1200
|
+
donor
|
|
1201
|
+
door
|
|
1202
|
+
dose
|
|
1203
|
+
double
|
|
1204
|
+
dove
|
|
1205
|
+
draft
|
|
1206
|
+
dragon
|
|
1207
|
+
drama
|
|
1208
|
+
drastic
|
|
1209
|
+
draw
|
|
1210
|
+
dream
|
|
1211
|
+
dress
|
|
1212
|
+
drift
|
|
1213
|
+
drill
|
|
1214
|
+
drink
|
|
1215
|
+
drip
|
|
1216
|
+
drive
|
|
1217
|
+
drop
|
|
1218
|
+
drum
|
|
1219
|
+
dry
|
|
1220
|
+
duck
|
|
1221
|
+
dumb
|
|
1222
|
+
dune
|
|
1223
|
+
during
|
|
1224
|
+
dust
|
|
1225
|
+
dutch
|
|
1226
|
+
duty
|
|
1227
|
+
dwarf
|
|
1228
|
+
dynamic
|
|
1229
|
+
eager
|
|
1230
|
+
eagle
|
|
1231
|
+
early
|
|
1232
|
+
earn
|
|
1233
|
+
earth
|
|
1234
|
+
easily
|
|
1235
|
+
east
|
|
1236
|
+
easy
|
|
1237
|
+
echo
|
|
1238
|
+
ecology
|
|
1239
|
+
economy
|
|
1240
|
+
edge
|
|
1241
|
+
edit
|
|
1242
|
+
educate
|
|
1243
|
+
effort
|
|
1244
|
+
egg
|
|
1245
|
+
eight
|
|
1246
|
+
either
|
|
1247
|
+
elbow
|
|
1248
|
+
elder
|
|
1249
|
+
electric
|
|
1250
|
+
elegant
|
|
1251
|
+
element
|
|
1252
|
+
elephant
|
|
1253
|
+
elevator
|
|
1254
|
+
elite
|
|
1255
|
+
else
|
|
1256
|
+
embark
|
|
1257
|
+
embody
|
|
1258
|
+
embrace
|
|
1259
|
+
emerge
|
|
1260
|
+
emotion
|
|
1261
|
+
employ
|
|
1262
|
+
empower
|
|
1263
|
+
empty
|
|
1264
|
+
enable
|
|
1265
|
+
enact
|
|
1266
|
+
end
|
|
1267
|
+
endless
|
|
1268
|
+
endorse
|
|
1269
|
+
enemy
|
|
1270
|
+
energy
|
|
1271
|
+
enforce
|
|
1272
|
+
engage
|
|
1273
|
+
engine
|
|
1274
|
+
enhance
|
|
1275
|
+
enjoy
|
|
1276
|
+
enlist
|
|
1277
|
+
enough
|
|
1278
|
+
enrich
|
|
1279
|
+
enroll
|
|
1280
|
+
ensure
|
|
1281
|
+
enter
|
|
1282
|
+
entire
|
|
1283
|
+
entry
|
|
1284
|
+
envelope
|
|
1285
|
+
episode
|
|
1286
|
+
equal
|
|
1287
|
+
equip
|
|
1288
|
+
era
|
|
1289
|
+
erase
|
|
1290
|
+
erode
|
|
1291
|
+
erosion
|
|
1292
|
+
error
|
|
1293
|
+
erupt
|
|
1294
|
+
escape
|
|
1295
|
+
essay
|
|
1296
|
+
essence
|
|
1297
|
+
estate
|
|
1298
|
+
eternal
|
|
1299
|
+
ethics
|
|
1300
|
+
evidence
|
|
1301
|
+
evil
|
|
1302
|
+
evoke
|
|
1303
|
+
evolve
|
|
1304
|
+
exact
|
|
1305
|
+
example
|
|
1306
|
+
excess
|
|
1307
|
+
exchange
|
|
1308
|
+
excite
|
|
1309
|
+
exclude
|
|
1310
|
+
excuse
|
|
1311
|
+
execute
|
|
1312
|
+
exercise
|
|
1313
|
+
exhaust
|
|
1314
|
+
exhibit
|
|
1315
|
+
exile
|
|
1316
|
+
exist
|
|
1317
|
+
exit
|
|
1318
|
+
exotic
|
|
1319
|
+
expand
|
|
1320
|
+
expect
|
|
1321
|
+
expire
|
|
1322
|
+
explain
|
|
1323
|
+
expose
|
|
1324
|
+
express
|
|
1325
|
+
extend
|
|
1326
|
+
extra
|
|
1327
|
+
eye
|
|
1328
|
+
eyebrow
|
|
1329
|
+
fabric
|
|
1330
|
+
face
|
|
1331
|
+
faculty
|
|
1332
|
+
fade
|
|
1333
|
+
faint
|
|
1334
|
+
faith
|
|
1335
|
+
fall
|
|
1336
|
+
false
|
|
1337
|
+
fame
|
|
1338
|
+
family
|
|
1339
|
+
famous
|
|
1340
|
+
fan
|
|
1341
|
+
fancy
|
|
1342
|
+
fantasy
|
|
1343
|
+
farm
|
|
1344
|
+
fashion
|
|
1345
|
+
fat
|
|
1346
|
+
fatal
|
|
1347
|
+
father
|
|
1348
|
+
fatigue
|
|
1349
|
+
fault
|
|
1350
|
+
favorite
|
|
1351
|
+
feature
|
|
1352
|
+
february
|
|
1353
|
+
federal
|
|
1354
|
+
fee
|
|
1355
|
+
feed
|
|
1356
|
+
feel
|
|
1357
|
+
female
|
|
1358
|
+
fence
|
|
1359
|
+
festival
|
|
1360
|
+
fetch
|
|
1361
|
+
fever
|
|
1362
|
+
few
|
|
1363
|
+
fiber
|
|
1364
|
+
fiction
|
|
1365
|
+
field
|
|
1366
|
+
figure
|
|
1367
|
+
file
|
|
1368
|
+
film
|
|
1369
|
+
filter
|
|
1370
|
+
final
|
|
1371
|
+
find
|
|
1372
|
+
fine
|
|
1373
|
+
finger
|
|
1374
|
+
finish
|
|
1375
|
+
fire
|
|
1376
|
+
firm
|
|
1377
|
+
first
|
|
1378
|
+
fiscal
|
|
1379
|
+
fish
|
|
1380
|
+
fit
|
|
1381
|
+
fitness
|
|
1382
|
+
fix
|
|
1383
|
+
flag
|
|
1384
|
+
flame
|
|
1385
|
+
flash
|
|
1386
|
+
flat
|
|
1387
|
+
flavor
|
|
1388
|
+
flee
|
|
1389
|
+
flight
|
|
1390
|
+
flip
|
|
1391
|
+
float
|
|
1392
|
+
flock
|
|
1393
|
+
floor
|
|
1394
|
+
flower
|
|
1395
|
+
fluid
|
|
1396
|
+
flush
|
|
1397
|
+
fly
|
|
1398
|
+
foam
|
|
1399
|
+
focus
|
|
1400
|
+
fog
|
|
1401
|
+
foil
|
|
1402
|
+
fold
|
|
1403
|
+
follow
|
|
1404
|
+
food
|
|
1405
|
+
foot
|
|
1406
|
+
force
|
|
1407
|
+
forest
|
|
1408
|
+
forget
|
|
1409
|
+
fork
|
|
1410
|
+
fortune
|
|
1411
|
+
forum
|
|
1412
|
+
forward
|
|
1413
|
+
fossil
|
|
1414
|
+
foster
|
|
1415
|
+
found
|
|
1416
|
+
fox
|
|
1417
|
+
fragile
|
|
1418
|
+
frame
|
|
1419
|
+
frequent
|
|
1420
|
+
fresh
|
|
1421
|
+
friend
|
|
1422
|
+
fringe
|
|
1423
|
+
frog
|
|
1424
|
+
front
|
|
1425
|
+
frost
|
|
1426
|
+
frown
|
|
1427
|
+
frozen
|
|
1428
|
+
fruit
|
|
1429
|
+
fuel
|
|
1430
|
+
fun
|
|
1431
|
+
funny
|
|
1432
|
+
furnace
|
|
1433
|
+
fury
|
|
1434
|
+
future
|
|
1435
|
+
gadget
|
|
1436
|
+
gain
|
|
1437
|
+
galaxy
|
|
1438
|
+
gallery
|
|
1439
|
+
game
|
|
1440
|
+
gap
|
|
1441
|
+
garage
|
|
1442
|
+
garbage
|
|
1443
|
+
garden
|
|
1444
|
+
garlic
|
|
1445
|
+
garment
|
|
1446
|
+
gas
|
|
1447
|
+
gasp
|
|
1448
|
+
gate
|
|
1449
|
+
gather
|
|
1450
|
+
gauge
|
|
1451
|
+
gaze
|
|
1452
|
+
general
|
|
1453
|
+
genius
|
|
1454
|
+
genre
|
|
1455
|
+
gentle
|
|
1456
|
+
genuine
|
|
1457
|
+
gesture
|
|
1458
|
+
ghost
|
|
1459
|
+
giant
|
|
1460
|
+
gift
|
|
1461
|
+
giggle
|
|
1462
|
+
ginger
|
|
1463
|
+
giraffe
|
|
1464
|
+
girl
|
|
1465
|
+
give
|
|
1466
|
+
glad
|
|
1467
|
+
glance
|
|
1468
|
+
glare
|
|
1469
|
+
glass
|
|
1470
|
+
glide
|
|
1471
|
+
glimpse
|
|
1472
|
+
globe
|
|
1473
|
+
gloom
|
|
1474
|
+
glory
|
|
1475
|
+
glove
|
|
1476
|
+
glow
|
|
1477
|
+
glue
|
|
1478
|
+
goat
|
|
1479
|
+
goddess
|
|
1480
|
+
gold
|
|
1481
|
+
good
|
|
1482
|
+
goose
|
|
1483
|
+
gorilla
|
|
1484
|
+
gospel
|
|
1485
|
+
gossip
|
|
1486
|
+
govern
|
|
1487
|
+
gown
|
|
1488
|
+
grab
|
|
1489
|
+
grace
|
|
1490
|
+
grain
|
|
1491
|
+
grant
|
|
1492
|
+
grape
|
|
1493
|
+
grass
|
|
1494
|
+
gravity
|
|
1495
|
+
great
|
|
1496
|
+
green
|
|
1497
|
+
grid
|
|
1498
|
+
grief
|
|
1499
|
+
grit
|
|
1500
|
+
grocery
|
|
1501
|
+
group
|
|
1502
|
+
grow
|
|
1503
|
+
grunt
|
|
1504
|
+
guard
|
|
1505
|
+
guess
|
|
1506
|
+
guide
|
|
1507
|
+
guilt
|
|
1508
|
+
guitar
|
|
1509
|
+
gun
|
|
1510
|
+
gym
|
|
1511
|
+
habit
|
|
1512
|
+
hair
|
|
1513
|
+
half
|
|
1514
|
+
hammer
|
|
1515
|
+
hamster
|
|
1516
|
+
hand
|
|
1517
|
+
happy
|
|
1518
|
+
harbor
|
|
1519
|
+
hard
|
|
1520
|
+
harsh
|
|
1521
|
+
harvest
|
|
1522
|
+
hat
|
|
1523
|
+
have
|
|
1524
|
+
hawk
|
|
1525
|
+
hazard
|
|
1526
|
+
head
|
|
1527
|
+
health
|
|
1528
|
+
heart
|
|
1529
|
+
heavy
|
|
1530
|
+
hedgehog
|
|
1531
|
+
height
|
|
1532
|
+
hello
|
|
1533
|
+
helmet
|
|
1534
|
+
help
|
|
1535
|
+
hen
|
|
1536
|
+
hero
|
|
1537
|
+
hidden
|
|
1538
|
+
high
|
|
1539
|
+
hill
|
|
1540
|
+
hint
|
|
1541
|
+
hip
|
|
1542
|
+
hire
|
|
1543
|
+
history
|
|
1544
|
+
hobby
|
|
1545
|
+
hockey
|
|
1546
|
+
hold
|
|
1547
|
+
hole
|
|
1548
|
+
holiday
|
|
1549
|
+
hollow
|
|
1550
|
+
home
|
|
1551
|
+
honey
|
|
1552
|
+
hood
|
|
1553
|
+
hope
|
|
1554
|
+
horn
|
|
1555
|
+
horror
|
|
1556
|
+
horse
|
|
1557
|
+
hospital
|
|
1558
|
+
host
|
|
1559
|
+
hotel
|
|
1560
|
+
hour
|
|
1561
|
+
hover
|
|
1562
|
+
hub
|
|
1563
|
+
huge
|
|
1564
|
+
human
|
|
1565
|
+
humble
|
|
1566
|
+
humor
|
|
1567
|
+
hundred
|
|
1568
|
+
hungry
|
|
1569
|
+
hunt
|
|
1570
|
+
hurdle
|
|
1571
|
+
hurry
|
|
1572
|
+
hurt
|
|
1573
|
+
husband
|
|
1574
|
+
hybrid
|
|
1575
|
+
ice
|
|
1576
|
+
icon
|
|
1577
|
+
idea
|
|
1578
|
+
identify
|
|
1579
|
+
idle
|
|
1580
|
+
ignore
|
|
1581
|
+
ill
|
|
1582
|
+
illegal
|
|
1583
|
+
illness
|
|
1584
|
+
image
|
|
1585
|
+
imitate
|
|
1586
|
+
immense
|
|
1587
|
+
immune
|
|
1588
|
+
impact
|
|
1589
|
+
impose
|
|
1590
|
+
improve
|
|
1591
|
+
impulse
|
|
1592
|
+
inch
|
|
1593
|
+
include
|
|
1594
|
+
income
|
|
1595
|
+
increase
|
|
1596
|
+
index
|
|
1597
|
+
indicate
|
|
1598
|
+
indoor
|
|
1599
|
+
industry
|
|
1600
|
+
infant
|
|
1601
|
+
inflict
|
|
1602
|
+
inform
|
|
1603
|
+
inhale
|
|
1604
|
+
inherit
|
|
1605
|
+
initial
|
|
1606
|
+
inject
|
|
1607
|
+
injury
|
|
1608
|
+
inmate
|
|
1609
|
+
inner
|
|
1610
|
+
innocent
|
|
1611
|
+
input
|
|
1612
|
+
inquiry
|
|
1613
|
+
insane
|
|
1614
|
+
insect
|
|
1615
|
+
inside
|
|
1616
|
+
inspire
|
|
1617
|
+
install
|
|
1618
|
+
intact
|
|
1619
|
+
interest
|
|
1620
|
+
into
|
|
1621
|
+
invest
|
|
1622
|
+
invite
|
|
1623
|
+
involve
|
|
1624
|
+
iron
|
|
1625
|
+
island
|
|
1626
|
+
isolate
|
|
1627
|
+
issue
|
|
1628
|
+
item
|
|
1629
|
+
ivory
|
|
1630
|
+
jacket
|
|
1631
|
+
jaguar
|
|
1632
|
+
jar
|
|
1633
|
+
jazz
|
|
1634
|
+
jealous
|
|
1635
|
+
jeans
|
|
1636
|
+
jelly
|
|
1637
|
+
jewel
|
|
1638
|
+
job
|
|
1639
|
+
join
|
|
1640
|
+
joke
|
|
1641
|
+
journey
|
|
1642
|
+
joy
|
|
1643
|
+
judge
|
|
1644
|
+
juice
|
|
1645
|
+
jump
|
|
1646
|
+
jungle
|
|
1647
|
+
junior
|
|
1648
|
+
junk
|
|
1649
|
+
just
|
|
1650
|
+
kangaroo
|
|
1651
|
+
keen
|
|
1652
|
+
keep
|
|
1653
|
+
ketchup
|
|
1654
|
+
key
|
|
1655
|
+
kick
|
|
1656
|
+
kid
|
|
1657
|
+
kidney
|
|
1658
|
+
kind
|
|
1659
|
+
kingdom
|
|
1660
|
+
kiss
|
|
1661
|
+
kit
|
|
1662
|
+
kitchen
|
|
1663
|
+
kite
|
|
1664
|
+
kitten
|
|
1665
|
+
kiwi
|
|
1666
|
+
knee
|
|
1667
|
+
knife
|
|
1668
|
+
knock
|
|
1669
|
+
know
|
|
1670
|
+
lab
|
|
1671
|
+
label
|
|
1672
|
+
labor
|
|
1673
|
+
ladder
|
|
1674
|
+
lady
|
|
1675
|
+
lake
|
|
1676
|
+
lamp
|
|
1677
|
+
language
|
|
1678
|
+
laptop
|
|
1679
|
+
large
|
|
1680
|
+
later
|
|
1681
|
+
latin
|
|
1682
|
+
laugh
|
|
1683
|
+
laundry
|
|
1684
|
+
lava
|
|
1685
|
+
law
|
|
1686
|
+
lawn
|
|
1687
|
+
lawsuit
|
|
1688
|
+
layer
|
|
1689
|
+
lazy
|
|
1690
|
+
leader
|
|
1691
|
+
leaf
|
|
1692
|
+
learn
|
|
1693
|
+
leave
|
|
1694
|
+
lecture
|
|
1695
|
+
left
|
|
1696
|
+
leg
|
|
1697
|
+
legal
|
|
1698
|
+
legend
|
|
1699
|
+
leisure
|
|
1700
|
+
lemon
|
|
1701
|
+
lend
|
|
1702
|
+
length
|
|
1703
|
+
lens
|
|
1704
|
+
leopard
|
|
1705
|
+
lesson
|
|
1706
|
+
letter
|
|
1707
|
+
level
|
|
1708
|
+
liar
|
|
1709
|
+
liberty
|
|
1710
|
+
library
|
|
1711
|
+
license
|
|
1712
|
+
life
|
|
1713
|
+
lift
|
|
1714
|
+
light
|
|
1715
|
+
like
|
|
1716
|
+
limb
|
|
1717
|
+
limit
|
|
1718
|
+
link
|
|
1719
|
+
lion
|
|
1720
|
+
liquid
|
|
1721
|
+
list
|
|
1722
|
+
little
|
|
1723
|
+
live
|
|
1724
|
+
lizard
|
|
1725
|
+
load
|
|
1726
|
+
loan
|
|
1727
|
+
lobster
|
|
1728
|
+
local
|
|
1729
|
+
lock
|
|
1730
|
+
logic
|
|
1731
|
+
lonely
|
|
1732
|
+
long
|
|
1733
|
+
loop
|
|
1734
|
+
lottery
|
|
1735
|
+
loud
|
|
1736
|
+
lounge
|
|
1737
|
+
love
|
|
1738
|
+
loyal
|
|
1739
|
+
lucky
|
|
1740
|
+
luggage
|
|
1741
|
+
lumber
|
|
1742
|
+
lunar
|
|
1743
|
+
lunch
|
|
1744
|
+
luxury
|
|
1745
|
+
lyrics
|
|
1746
|
+
machine
|
|
1747
|
+
mad
|
|
1748
|
+
magic
|
|
1749
|
+
magnet
|
|
1750
|
+
maid
|
|
1751
|
+
mail
|
|
1752
|
+
main
|
|
1753
|
+
major
|
|
1754
|
+
make
|
|
1755
|
+
mammal
|
|
1756
|
+
man
|
|
1757
|
+
manage
|
|
1758
|
+
mandate
|
|
1759
|
+
mango
|
|
1760
|
+
mansion
|
|
1761
|
+
manual
|
|
1762
|
+
maple
|
|
1763
|
+
marble
|
|
1764
|
+
march
|
|
1765
|
+
margin
|
|
1766
|
+
marine
|
|
1767
|
+
market
|
|
1768
|
+
marriage
|
|
1769
|
+
mask
|
|
1770
|
+
mass
|
|
1771
|
+
master
|
|
1772
|
+
match
|
|
1773
|
+
material
|
|
1774
|
+
math
|
|
1775
|
+
matrix
|
|
1776
|
+
matter
|
|
1777
|
+
maximum
|
|
1778
|
+
maze
|
|
1779
|
+
meadow
|
|
1780
|
+
mean
|
|
1781
|
+
measure
|
|
1782
|
+
meat
|
|
1783
|
+
mechanic
|
|
1784
|
+
medal
|
|
1785
|
+
media
|
|
1786
|
+
melody
|
|
1787
|
+
melt
|
|
1788
|
+
member
|
|
1789
|
+
memory
|
|
1790
|
+
mention
|
|
1791
|
+
menu
|
|
1792
|
+
mercy
|
|
1793
|
+
merge
|
|
1794
|
+
merit
|
|
1795
|
+
merry
|
|
1796
|
+
mesh
|
|
1797
|
+
message
|
|
1798
|
+
metal
|
|
1799
|
+
method
|
|
1800
|
+
middle
|
|
1801
|
+
midnight
|
|
1802
|
+
milk
|
|
1803
|
+
million
|
|
1804
|
+
mimic
|
|
1805
|
+
mind
|
|
1806
|
+
minimum
|
|
1807
|
+
minor
|
|
1808
|
+
minute
|
|
1809
|
+
miracle
|
|
1810
|
+
mirror
|
|
1811
|
+
misery
|
|
1812
|
+
miss
|
|
1813
|
+
mistake
|
|
1814
|
+
mix
|
|
1815
|
+
mixed
|
|
1816
|
+
mixture
|
|
1817
|
+
mobile
|
|
1818
|
+
model
|
|
1819
|
+
modify
|
|
1820
|
+
mom
|
|
1821
|
+
moment
|
|
1822
|
+
monitor
|
|
1823
|
+
monkey
|
|
1824
|
+
monster
|
|
1825
|
+
month
|
|
1826
|
+
moon
|
|
1827
|
+
moral
|
|
1828
|
+
more
|
|
1829
|
+
morning
|
|
1830
|
+
mosquito
|
|
1831
|
+
mother
|
|
1832
|
+
motion
|
|
1833
|
+
motor
|
|
1834
|
+
mountain
|
|
1835
|
+
mouse
|
|
1836
|
+
move
|
|
1837
|
+
movie
|
|
1838
|
+
much
|
|
1839
|
+
muffin
|
|
1840
|
+
mule
|
|
1841
|
+
multiply
|
|
1842
|
+
muscle
|
|
1843
|
+
museum
|
|
1844
|
+
mushroom
|
|
1845
|
+
music
|
|
1846
|
+
must
|
|
1847
|
+
mutual
|
|
1848
|
+
myself
|
|
1849
|
+
mystery
|
|
1850
|
+
myth
|
|
1851
|
+
naive
|
|
1852
|
+
name
|
|
1853
|
+
napkin
|
|
1854
|
+
narrow
|
|
1855
|
+
nasty
|
|
1856
|
+
nation
|
|
1857
|
+
nature
|
|
1858
|
+
near
|
|
1859
|
+
neck
|
|
1860
|
+
need
|
|
1861
|
+
negative
|
|
1862
|
+
neglect
|
|
1863
|
+
neither
|
|
1864
|
+
nephew
|
|
1865
|
+
nerve
|
|
1866
|
+
nest
|
|
1867
|
+
net
|
|
1868
|
+
network
|
|
1869
|
+
neutral
|
|
1870
|
+
never
|
|
1871
|
+
news
|
|
1872
|
+
next
|
|
1873
|
+
nice
|
|
1874
|
+
night
|
|
1875
|
+
noble
|
|
1876
|
+
noise
|
|
1877
|
+
nominee
|
|
1878
|
+
noodle
|
|
1879
|
+
normal
|
|
1880
|
+
north
|
|
1881
|
+
nose
|
|
1882
|
+
notable
|
|
1883
|
+
note
|
|
1884
|
+
nothing
|
|
1885
|
+
notice
|
|
1886
|
+
novel
|
|
1887
|
+
now
|
|
1888
|
+
nuclear
|
|
1889
|
+
number
|
|
1890
|
+
nurse
|
|
1891
|
+
nut
|
|
1892
|
+
oak
|
|
1893
|
+
obey
|
|
1894
|
+
object
|
|
1895
|
+
oblige
|
|
1896
|
+
obscure
|
|
1897
|
+
observe
|
|
1898
|
+
obtain
|
|
1899
|
+
obvious
|
|
1900
|
+
occur
|
|
1901
|
+
ocean
|
|
1902
|
+
october
|
|
1903
|
+
odor
|
|
1904
|
+
off
|
|
1905
|
+
offer
|
|
1906
|
+
office
|
|
1907
|
+
often
|
|
1908
|
+
oil
|
|
1909
|
+
okay
|
|
1910
|
+
old
|
|
1911
|
+
olive
|
|
1912
|
+
olympic
|
|
1913
|
+
omit
|
|
1914
|
+
once
|
|
1915
|
+
one
|
|
1916
|
+
onion
|
|
1917
|
+
online
|
|
1918
|
+
only
|
|
1919
|
+
open
|
|
1920
|
+
opera
|
|
1921
|
+
opinion
|
|
1922
|
+
oppose
|
|
1923
|
+
option
|
|
1924
|
+
orange
|
|
1925
|
+
orbit
|
|
1926
|
+
orchard
|
|
1927
|
+
order
|
|
1928
|
+
ordinary
|
|
1929
|
+
organ
|
|
1930
|
+
orient
|
|
1931
|
+
original
|
|
1932
|
+
orphan
|
|
1933
|
+
ostrich
|
|
1934
|
+
other
|
|
1935
|
+
outdoor
|
|
1936
|
+
outer
|
|
1937
|
+
output
|
|
1938
|
+
outside
|
|
1939
|
+
oval
|
|
1940
|
+
oven
|
|
1941
|
+
over
|
|
1942
|
+
own
|
|
1943
|
+
owner
|
|
1944
|
+
oxygen
|
|
1945
|
+
oyster
|
|
1946
|
+
ozone
|
|
1947
|
+
pact
|
|
1948
|
+
paddle
|
|
1949
|
+
page
|
|
1950
|
+
pair
|
|
1951
|
+
palace
|
|
1952
|
+
palm
|
|
1953
|
+
panda
|
|
1954
|
+
panel
|
|
1955
|
+
panic
|
|
1956
|
+
panther
|
|
1957
|
+
paper
|
|
1958
|
+
parade
|
|
1959
|
+
parent
|
|
1960
|
+
park
|
|
1961
|
+
parrot
|
|
1962
|
+
party
|
|
1963
|
+
pass
|
|
1964
|
+
patch
|
|
1965
|
+
path
|
|
1966
|
+
patient
|
|
1967
|
+
patrol
|
|
1968
|
+
pattern
|
|
1969
|
+
pause
|
|
1970
|
+
pave
|
|
1971
|
+
payment
|
|
1972
|
+
peace
|
|
1973
|
+
peanut
|
|
1974
|
+
pear
|
|
1975
|
+
peasant
|
|
1976
|
+
pelican
|
|
1977
|
+
pen
|
|
1978
|
+
penalty
|
|
1979
|
+
pencil
|
|
1980
|
+
people
|
|
1981
|
+
pepper
|
|
1982
|
+
perfect
|
|
1983
|
+
permit
|
|
1984
|
+
person
|
|
1985
|
+
pet
|
|
1986
|
+
phone
|
|
1987
|
+
photo
|
|
1988
|
+
phrase
|
|
1989
|
+
physical
|
|
1990
|
+
piano
|
|
1991
|
+
picnic
|
|
1992
|
+
picture
|
|
1993
|
+
piece
|
|
1994
|
+
pig
|
|
1995
|
+
pigeon
|
|
1996
|
+
pill
|
|
1997
|
+
pilot
|
|
1998
|
+
pink
|
|
1999
|
+
pioneer
|
|
2000
|
+
pipe
|
|
2001
|
+
pistol
|
|
2002
|
+
pitch
|
|
2003
|
+
pizza
|
|
2004
|
+
place
|
|
2005
|
+
planet
|
|
2006
|
+
plastic
|
|
2007
|
+
plate
|
|
2008
|
+
play
|
|
2009
|
+
please
|
|
2010
|
+
pledge
|
|
2011
|
+
pluck
|
|
2012
|
+
plug
|
|
2013
|
+
plunge
|
|
2014
|
+
poem
|
|
2015
|
+
poet
|
|
2016
|
+
point
|
|
2017
|
+
polar
|
|
2018
|
+
pole
|
|
2019
|
+
police
|
|
2020
|
+
pond
|
|
2021
|
+
pony
|
|
2022
|
+
pool
|
|
2023
|
+
popular
|
|
2024
|
+
portion
|
|
2025
|
+
position
|
|
2026
|
+
possible
|
|
2027
|
+
post
|
|
2028
|
+
potato
|
|
2029
|
+
pottery
|
|
2030
|
+
poverty
|
|
2031
|
+
powder
|
|
2032
|
+
power
|
|
2033
|
+
practice
|
|
2034
|
+
praise
|
|
2035
|
+
predict
|
|
2036
|
+
prefer
|
|
2037
|
+
prepare
|
|
2038
|
+
present
|
|
2039
|
+
pretty
|
|
2040
|
+
prevent
|
|
2041
|
+
price
|
|
2042
|
+
pride
|
|
2043
|
+
primary
|
|
2044
|
+
print
|
|
2045
|
+
priority
|
|
2046
|
+
prison
|
|
2047
|
+
private
|
|
2048
|
+
prize
|
|
2049
|
+
problem
|
|
2050
|
+
process
|
|
2051
|
+
produce
|
|
2052
|
+
profit
|
|
2053
|
+
program
|
|
2054
|
+
project
|
|
2055
|
+
promote
|
|
2056
|
+
proof
|
|
2057
|
+
property
|
|
2058
|
+
prosper
|
|
2059
|
+
protect
|
|
2060
|
+
proud
|
|
2061
|
+
provide
|
|
2062
|
+
public
|
|
2063
|
+
pudding
|
|
2064
|
+
pull
|
|
2065
|
+
pulp
|
|
2066
|
+
pulse
|
|
2067
|
+
pumpkin
|
|
2068
|
+
punch
|
|
2069
|
+
pupil
|
|
2070
|
+
puppy
|
|
2071
|
+
purchase
|
|
2072
|
+
purity
|
|
2073
|
+
purpose
|
|
2074
|
+
purse
|
|
2075
|
+
push
|
|
2076
|
+
put
|
|
2077
|
+
puzzle
|
|
2078
|
+
pyramid
|
|
2079
|
+
quality
|
|
2080
|
+
quantum
|
|
2081
|
+
quarter
|
|
2082
|
+
question
|
|
2083
|
+
quick
|
|
2084
|
+
quit
|
|
2085
|
+
quiz
|
|
2086
|
+
quote
|
|
2087
|
+
rabbit
|
|
2088
|
+
raccoon
|
|
2089
|
+
race
|
|
2090
|
+
rack
|
|
2091
|
+
radar
|
|
2092
|
+
radio
|
|
2093
|
+
rail
|
|
2094
|
+
rain
|
|
2095
|
+
raise
|
|
2096
|
+
rally
|
|
2097
|
+
ramp
|
|
2098
|
+
ranch
|
|
2099
|
+
random
|
|
2100
|
+
range
|
|
2101
|
+
rapid
|
|
2102
|
+
rare
|
|
2103
|
+
rate
|
|
2104
|
+
rather
|
|
2105
|
+
raven
|
|
2106
|
+
raw
|
|
2107
|
+
razor
|
|
2108
|
+
ready
|
|
2109
|
+
real
|
|
2110
|
+
reason
|
|
2111
|
+
rebel
|
|
2112
|
+
rebuild
|
|
2113
|
+
recall
|
|
2114
|
+
receive
|
|
2115
|
+
recipe
|
|
2116
|
+
record
|
|
2117
|
+
recycle
|
|
2118
|
+
reduce
|
|
2119
|
+
reflect
|
|
2120
|
+
reform
|
|
2121
|
+
refuse
|
|
2122
|
+
region
|
|
2123
|
+
regret
|
|
2124
|
+
regular
|
|
2125
|
+
reject
|
|
2126
|
+
relax
|
|
2127
|
+
release
|
|
2128
|
+
relief
|
|
2129
|
+
rely
|
|
2130
|
+
remain
|
|
2131
|
+
remember
|
|
2132
|
+
remind
|
|
2133
|
+
remove
|
|
2134
|
+
render
|
|
2135
|
+
renew
|
|
2136
|
+
rent
|
|
2137
|
+
reopen
|
|
2138
|
+
repair
|
|
2139
|
+
repeat
|
|
2140
|
+
replace
|
|
2141
|
+
report
|
|
2142
|
+
require
|
|
2143
|
+
rescue
|
|
2144
|
+
resemble
|
|
2145
|
+
resist
|
|
2146
|
+
resource
|
|
2147
|
+
response
|
|
2148
|
+
result
|
|
2149
|
+
retire
|
|
2150
|
+
retreat
|
|
2151
|
+
return
|
|
2152
|
+
reunion
|
|
2153
|
+
reveal
|
|
2154
|
+
review
|
|
2155
|
+
reward
|
|
2156
|
+
rhythm
|
|
2157
|
+
rib
|
|
2158
|
+
ribbon
|
|
2159
|
+
rice
|
|
2160
|
+
rich
|
|
2161
|
+
ride
|
|
2162
|
+
ridge
|
|
2163
|
+
rifle
|
|
2164
|
+
right
|
|
2165
|
+
rigid
|
|
2166
|
+
ring
|
|
2167
|
+
riot
|
|
2168
|
+
ripple
|
|
2169
|
+
risk
|
|
2170
|
+
ritual
|
|
2171
|
+
rival
|
|
2172
|
+
river
|
|
2173
|
+
road
|
|
2174
|
+
roast
|
|
2175
|
+
robot
|
|
2176
|
+
robust
|
|
2177
|
+
rocket
|
|
2178
|
+
romance
|
|
2179
|
+
roof
|
|
2180
|
+
rookie
|
|
2181
|
+
room
|
|
2182
|
+
rose
|
|
2183
|
+
rotate
|
|
2184
|
+
rough
|
|
2185
|
+
round
|
|
2186
|
+
route
|
|
2187
|
+
royal
|
|
2188
|
+
rubber
|
|
2189
|
+
rude
|
|
2190
|
+
rug
|
|
2191
|
+
rule
|
|
2192
|
+
run
|
|
2193
|
+
runway
|
|
2194
|
+
rural
|
|
2195
|
+
sad
|
|
2196
|
+
saddle
|
|
2197
|
+
sadness
|
|
2198
|
+
safe
|
|
2199
|
+
sail
|
|
2200
|
+
salad
|
|
2201
|
+
salmon
|
|
2202
|
+
salon
|
|
2203
|
+
salt
|
|
2204
|
+
salute
|
|
2205
|
+
same
|
|
2206
|
+
sample
|
|
2207
|
+
sand
|
|
2208
|
+
satisfy
|
|
2209
|
+
satoshi
|
|
2210
|
+
sauce
|
|
2211
|
+
sausage
|
|
2212
|
+
save
|
|
2213
|
+
say
|
|
2214
|
+
scale
|
|
2215
|
+
scan
|
|
2216
|
+
scare
|
|
2217
|
+
scatter
|
|
2218
|
+
scene
|
|
2219
|
+
scheme
|
|
2220
|
+
school
|
|
2221
|
+
science
|
|
2222
|
+
scissors
|
|
2223
|
+
scorpion
|
|
2224
|
+
scout
|
|
2225
|
+
scrap
|
|
2226
|
+
screen
|
|
2227
|
+
script
|
|
2228
|
+
scrub
|
|
2229
|
+
sea
|
|
2230
|
+
search
|
|
2231
|
+
season
|
|
2232
|
+
seat
|
|
2233
|
+
second
|
|
2234
|
+
secret
|
|
2235
|
+
section
|
|
2236
|
+
security
|
|
2237
|
+
seed
|
|
2238
|
+
seek
|
|
2239
|
+
segment
|
|
2240
|
+
select
|
|
2241
|
+
sell
|
|
2242
|
+
seminar
|
|
2243
|
+
senior
|
|
2244
|
+
sense
|
|
2245
|
+
sentence
|
|
2246
|
+
series
|
|
2247
|
+
service
|
|
2248
|
+
session
|
|
2249
|
+
settle
|
|
2250
|
+
setup
|
|
2251
|
+
seven
|
|
2252
|
+
shadow
|
|
2253
|
+
shaft
|
|
2254
|
+
shallow
|
|
2255
|
+
share
|
|
2256
|
+
shed
|
|
2257
|
+
shell
|
|
2258
|
+
sheriff
|
|
2259
|
+
shield
|
|
2260
|
+
shift
|
|
2261
|
+
shine
|
|
2262
|
+
ship
|
|
2263
|
+
shiver
|
|
2264
|
+
shock
|
|
2265
|
+
shoe
|
|
2266
|
+
shoot
|
|
2267
|
+
shop
|
|
2268
|
+
short
|
|
2269
|
+
shoulder
|
|
2270
|
+
shove
|
|
2271
|
+
shrimp
|
|
2272
|
+
shrug
|
|
2273
|
+
shuffle
|
|
2274
|
+
shy
|
|
2275
|
+
sibling
|
|
2276
|
+
sick
|
|
2277
|
+
side
|
|
2278
|
+
siege
|
|
2279
|
+
sight
|
|
2280
|
+
sign
|
|
2281
|
+
silent
|
|
2282
|
+
silk
|
|
2283
|
+
silly
|
|
2284
|
+
silver
|
|
2285
|
+
similar
|
|
2286
|
+
simple
|
|
2287
|
+
since
|
|
2288
|
+
sing
|
|
2289
|
+
siren
|
|
2290
|
+
sister
|
|
2291
|
+
situate
|
|
2292
|
+
six
|
|
2293
|
+
size
|
|
2294
|
+
skate
|
|
2295
|
+
sketch
|
|
2296
|
+
ski
|
|
2297
|
+
skill
|
|
2298
|
+
skin
|
|
2299
|
+
skirt
|
|
2300
|
+
skull
|
|
2301
|
+
slab
|
|
2302
|
+
slam
|
|
2303
|
+
sleep
|
|
2304
|
+
slender
|
|
2305
|
+
slice
|
|
2306
|
+
slide
|
|
2307
|
+
slight
|
|
2308
|
+
slim
|
|
2309
|
+
slogan
|
|
2310
|
+
slot
|
|
2311
|
+
slow
|
|
2312
|
+
slush
|
|
2313
|
+
small
|
|
2314
|
+
smart
|
|
2315
|
+
smile
|
|
2316
|
+
smoke
|
|
2317
|
+
smooth
|
|
2318
|
+
snack
|
|
2319
|
+
snake
|
|
2320
|
+
snap
|
|
2321
|
+
sniff
|
|
2322
|
+
snow
|
|
2323
|
+
soap
|
|
2324
|
+
soccer
|
|
2325
|
+
social
|
|
2326
|
+
sock
|
|
2327
|
+
soda
|
|
2328
|
+
soft
|
|
2329
|
+
solar
|
|
2330
|
+
soldier
|
|
2331
|
+
solid
|
|
2332
|
+
solution
|
|
2333
|
+
solve
|
|
2334
|
+
someone
|
|
2335
|
+
song
|
|
2336
|
+
soon
|
|
2337
|
+
sorry
|
|
2338
|
+
sort
|
|
2339
|
+
soul
|
|
2340
|
+
sound
|
|
2341
|
+
soup
|
|
2342
|
+
source
|
|
2343
|
+
south
|
|
2344
|
+
space
|
|
2345
|
+
spare
|
|
2346
|
+
spatial
|
|
2347
|
+
spawn
|
|
2348
|
+
speak
|
|
2349
|
+
special
|
|
2350
|
+
speed
|
|
2351
|
+
spell
|
|
2352
|
+
spend
|
|
2353
|
+
sphere
|
|
2354
|
+
spice
|
|
2355
|
+
spider
|
|
2356
|
+
spike
|
|
2357
|
+
spin
|
|
2358
|
+
spirit
|
|
2359
|
+
split
|
|
2360
|
+
spoil
|
|
2361
|
+
sponsor
|
|
2362
|
+
spoon
|
|
2363
|
+
sport
|
|
2364
|
+
spot
|
|
2365
|
+
spray
|
|
2366
|
+
spread
|
|
2367
|
+
spring
|
|
2368
|
+
spy
|
|
2369
|
+
square
|
|
2370
|
+
squeeze
|
|
2371
|
+
squirrel
|
|
2372
|
+
stable
|
|
2373
|
+
stadium
|
|
2374
|
+
staff
|
|
2375
|
+
stage
|
|
2376
|
+
stairs
|
|
2377
|
+
stamp
|
|
2378
|
+
stand
|
|
2379
|
+
start
|
|
2380
|
+
state
|
|
2381
|
+
stay
|
|
2382
|
+
steak
|
|
2383
|
+
steel
|
|
2384
|
+
stem
|
|
2385
|
+
step
|
|
2386
|
+
stereo
|
|
2387
|
+
stick
|
|
2388
|
+
still
|
|
2389
|
+
sting
|
|
2390
|
+
stock
|
|
2391
|
+
stomach
|
|
2392
|
+
stone
|
|
2393
|
+
stool
|
|
2394
|
+
story
|
|
2395
|
+
stove
|
|
2396
|
+
strategy
|
|
2397
|
+
street
|
|
2398
|
+
strike
|
|
2399
|
+
strong
|
|
2400
|
+
struggle
|
|
2401
|
+
student
|
|
2402
|
+
stuff
|
|
2403
|
+
stumble
|
|
2404
|
+
style
|
|
2405
|
+
subject
|
|
2406
|
+
submit
|
|
2407
|
+
subway
|
|
2408
|
+
success
|
|
2409
|
+
such
|
|
2410
|
+
sudden
|
|
2411
|
+
suffer
|
|
2412
|
+
sugar
|
|
2413
|
+
suggest
|
|
2414
|
+
suit
|
|
2415
|
+
summer
|
|
2416
|
+
sun
|
|
2417
|
+
sunny
|
|
2418
|
+
sunset
|
|
2419
|
+
super
|
|
2420
|
+
supply
|
|
2421
|
+
supreme
|
|
2422
|
+
sure
|
|
2423
|
+
surface
|
|
2424
|
+
surge
|
|
2425
|
+
surprise
|
|
2426
|
+
surround
|
|
2427
|
+
survey
|
|
2428
|
+
suspect
|
|
2429
|
+
sustain
|
|
2430
|
+
swallow
|
|
2431
|
+
swamp
|
|
2432
|
+
swap
|
|
2433
|
+
swarm
|
|
2434
|
+
swear
|
|
2435
|
+
sweet
|
|
2436
|
+
swift
|
|
2437
|
+
swim
|
|
2438
|
+
swing
|
|
2439
|
+
switch
|
|
2440
|
+
sword
|
|
2441
|
+
symbol
|
|
2442
|
+
symptom
|
|
2443
|
+
syrup
|
|
2444
|
+
system
|
|
2445
|
+
table
|
|
2446
|
+
tackle
|
|
2447
|
+
tag
|
|
2448
|
+
tail
|
|
2449
|
+
talent
|
|
2450
|
+
talk
|
|
2451
|
+
tank
|
|
2452
|
+
tape
|
|
2453
|
+
target
|
|
2454
|
+
task
|
|
2455
|
+
taste
|
|
2456
|
+
tattoo
|
|
2457
|
+
taxi
|
|
2458
|
+
teach
|
|
2459
|
+
team
|
|
2460
|
+
tell
|
|
2461
|
+
ten
|
|
2462
|
+
tenant
|
|
2463
|
+
tennis
|
|
2464
|
+
tent
|
|
2465
|
+
term
|
|
2466
|
+
test
|
|
2467
|
+
text
|
|
2468
|
+
thank
|
|
2469
|
+
that
|
|
2470
|
+
theme
|
|
2471
|
+
then
|
|
2472
|
+
theory
|
|
2473
|
+
there
|
|
2474
|
+
they
|
|
2475
|
+
thing
|
|
2476
|
+
this
|
|
2477
|
+
thought
|
|
2478
|
+
three
|
|
2479
|
+
thrive
|
|
2480
|
+
throw
|
|
2481
|
+
thumb
|
|
2482
|
+
thunder
|
|
2483
|
+
ticket
|
|
2484
|
+
tide
|
|
2485
|
+
tiger
|
|
2486
|
+
tilt
|
|
2487
|
+
timber
|
|
2488
|
+
time
|
|
2489
|
+
tiny
|
|
2490
|
+
tip
|
|
2491
|
+
tired
|
|
2492
|
+
tissue
|
|
2493
|
+
title
|
|
2494
|
+
toast
|
|
2495
|
+
tobacco
|
|
2496
|
+
today
|
|
2497
|
+
toddler
|
|
2498
|
+
toe
|
|
2499
|
+
together
|
|
2500
|
+
toilet
|
|
2501
|
+
token
|
|
2502
|
+
tomato
|
|
2503
|
+
tomorrow
|
|
2504
|
+
tone
|
|
2505
|
+
tongue
|
|
2506
|
+
tonight
|
|
2507
|
+
tool
|
|
2508
|
+
tooth
|
|
2509
|
+
top
|
|
2510
|
+
topic
|
|
2511
|
+
topple
|
|
2512
|
+
torch
|
|
2513
|
+
tornado
|
|
2514
|
+
tortoise
|
|
2515
|
+
toss
|
|
2516
|
+
total
|
|
2517
|
+
tourist
|
|
2518
|
+
toward
|
|
2519
|
+
tower
|
|
2520
|
+
town
|
|
2521
|
+
toy
|
|
2522
|
+
track
|
|
2523
|
+
trade
|
|
2524
|
+
traffic
|
|
2525
|
+
tragic
|
|
2526
|
+
train
|
|
2527
|
+
transfer
|
|
2528
|
+
trap
|
|
2529
|
+
trash
|
|
2530
|
+
travel
|
|
2531
|
+
tray
|
|
2532
|
+
treat
|
|
2533
|
+
tree
|
|
2534
|
+
trend
|
|
2535
|
+
trial
|
|
2536
|
+
tribe
|
|
2537
|
+
trick
|
|
2538
|
+
trigger
|
|
2539
|
+
trim
|
|
2540
|
+
trip
|
|
2541
|
+
trophy
|
|
2542
|
+
trouble
|
|
2543
|
+
truck
|
|
2544
|
+
true
|
|
2545
|
+
truly
|
|
2546
|
+
trumpet
|
|
2547
|
+
trust
|
|
2548
|
+
truth
|
|
2549
|
+
try
|
|
2550
|
+
tube
|
|
2551
|
+
tuition
|
|
2552
|
+
tumble
|
|
2553
|
+
tuna
|
|
2554
|
+
tunnel
|
|
2555
|
+
turkey
|
|
2556
|
+
turn
|
|
2557
|
+
turtle
|
|
2558
|
+
twelve
|
|
2559
|
+
twenty
|
|
2560
|
+
twice
|
|
2561
|
+
twin
|
|
2562
|
+
twist
|
|
2563
|
+
two
|
|
2564
|
+
type
|
|
2565
|
+
typical
|
|
2566
|
+
ugly
|
|
2567
|
+
umbrella
|
|
2568
|
+
unable
|
|
2569
|
+
unaware
|
|
2570
|
+
uncle
|
|
2571
|
+
uncover
|
|
2572
|
+
under
|
|
2573
|
+
undo
|
|
2574
|
+
unfair
|
|
2575
|
+
unfold
|
|
2576
|
+
unhappy
|
|
2577
|
+
uniform
|
|
2578
|
+
unique
|
|
2579
|
+
unit
|
|
2580
|
+
universe
|
|
2581
|
+
unknown
|
|
2582
|
+
unlock
|
|
2583
|
+
until
|
|
2584
|
+
unusual
|
|
2585
|
+
unveil
|
|
2586
|
+
update
|
|
2587
|
+
upgrade
|
|
2588
|
+
uphold
|
|
2589
|
+
upon
|
|
2590
|
+
upper
|
|
2591
|
+
upset
|
|
2592
|
+
urban
|
|
2593
|
+
urge
|
|
2594
|
+
usage
|
|
2595
|
+
use
|
|
2596
|
+
used
|
|
2597
|
+
useful
|
|
2598
|
+
useless
|
|
2599
|
+
usual
|
|
2600
|
+
utility
|
|
2601
|
+
vacant
|
|
2602
|
+
vacuum
|
|
2603
|
+
vague
|
|
2604
|
+
valid
|
|
2605
|
+
valley
|
|
2606
|
+
valve
|
|
2607
|
+
van
|
|
2608
|
+
vanish
|
|
2609
|
+
vapor
|
|
2610
|
+
various
|
|
2611
|
+
vast
|
|
2612
|
+
vault
|
|
2613
|
+
vehicle
|
|
2614
|
+
velvet
|
|
2615
|
+
vendor
|
|
2616
|
+
venture
|
|
2617
|
+
venue
|
|
2618
|
+
verb
|
|
2619
|
+
verify
|
|
2620
|
+
version
|
|
2621
|
+
very
|
|
2622
|
+
vessel
|
|
2623
|
+
veteran
|
|
2624
|
+
viable
|
|
2625
|
+
vibrant
|
|
2626
|
+
vicious
|
|
2627
|
+
victory
|
|
2628
|
+
video
|
|
2629
|
+
view
|
|
2630
|
+
village
|
|
2631
|
+
vintage
|
|
2632
|
+
violin
|
|
2633
|
+
virtual
|
|
2634
|
+
virus
|
|
2635
|
+
visa
|
|
2636
|
+
visit
|
|
2637
|
+
visual
|
|
2638
|
+
vital
|
|
2639
|
+
vivid
|
|
2640
|
+
vocal
|
|
2641
|
+
voice
|
|
2642
|
+
void
|
|
2643
|
+
volcano
|
|
2644
|
+
volume
|
|
2645
|
+
vote
|
|
2646
|
+
voyage
|
|
2647
|
+
wage
|
|
2648
|
+
wagon
|
|
2649
|
+
wait
|
|
2650
|
+
walk
|
|
2651
|
+
wall
|
|
2652
|
+
walnut
|
|
2653
|
+
want
|
|
2654
|
+
warfare
|
|
2655
|
+
warm
|
|
2656
|
+
warrior
|
|
2657
|
+
wash
|
|
2658
|
+
wasp
|
|
2659
|
+
waste
|
|
2660
|
+
water
|
|
2661
|
+
wave
|
|
2662
|
+
way
|
|
2663
|
+
wealth
|
|
2664
|
+
weapon
|
|
2665
|
+
wear
|
|
2666
|
+
weasel
|
|
2667
|
+
weather
|
|
2668
|
+
web
|
|
2669
|
+
wedding
|
|
2670
|
+
weekend
|
|
2671
|
+
weird
|
|
2672
|
+
welcome
|
|
2673
|
+
west
|
|
2674
|
+
wet
|
|
2675
|
+
whale
|
|
2676
|
+
what
|
|
2677
|
+
wheat
|
|
2678
|
+
wheel
|
|
2679
|
+
when
|
|
2680
|
+
where
|
|
2681
|
+
whip
|
|
2682
|
+
whisper
|
|
2683
|
+
wide
|
|
2684
|
+
width
|
|
2685
|
+
wife
|
|
2686
|
+
wild
|
|
2687
|
+
will
|
|
2688
|
+
win
|
|
2689
|
+
window
|
|
2690
|
+
wine
|
|
2691
|
+
wing
|
|
2692
|
+
wink
|
|
2693
|
+
winner
|
|
2694
|
+
winter
|
|
2695
|
+
wire
|
|
2696
|
+
wisdom
|
|
2697
|
+
wise
|
|
2698
|
+
wish
|
|
2699
|
+
witness
|
|
2700
|
+
wolf
|
|
2701
|
+
woman
|
|
2702
|
+
wonder
|
|
2703
|
+
wood
|
|
2704
|
+
wool
|
|
2705
|
+
word
|
|
2706
|
+
work
|
|
2707
|
+
world
|
|
2708
|
+
worry
|
|
2709
|
+
worth
|
|
2710
|
+
wrap
|
|
2711
|
+
wreck
|
|
2712
|
+
wrestle
|
|
2713
|
+
wrist
|
|
2714
|
+
write
|
|
2715
|
+
wrong
|
|
2716
|
+
yard
|
|
2717
|
+
year
|
|
2718
|
+
yellow
|
|
2719
|
+
you
|
|
2720
|
+
young
|
|
2721
|
+
youth
|
|
2722
|
+
zebra
|
|
2723
|
+
zero
|
|
2724
|
+
zone
|
|
2725
|
+
zoo`.split("\n");
|
|
2726
|
+
|
|
2727
|
+
// ../wallet-engine/src/errors.ts
|
|
2728
|
+
var WalletNotConnectedError = class extends Error {
|
|
2729
|
+
constructor(message = "No wallet connected. Call awarizon.wallet.create(), awarizon.wallet.importPrivateKey(), awarizon.wallet.importMnemonic(), or awarizon.connectWallet(walletClient).") {
|
|
2730
|
+
super(`[wallet-engine] ${message}`);
|
|
2731
|
+
this.code = "WALLET_NOT_CONNECTED";
|
|
2732
|
+
this.name = "WalletNotConnectedError";
|
|
2733
|
+
}
|
|
2734
|
+
};
|
|
2735
|
+
var InvalidMnemonicError = class extends Error {
|
|
2736
|
+
constructor(message = "The provided mnemonic phrase is invalid.") {
|
|
2737
|
+
super(`[wallet-engine] ${message}`);
|
|
2738
|
+
this.code = "INVALID_MNEMONIC";
|
|
2739
|
+
this.name = "InvalidMnemonicError";
|
|
2740
|
+
}
|
|
2741
|
+
};
|
|
2742
|
+
var InvalidPrivateKeyError = class extends Error {
|
|
2743
|
+
constructor(message = "The provided private key is invalid.") {
|
|
2744
|
+
super(`[wallet-engine] ${message}`);
|
|
2745
|
+
this.code = "INVALID_PRIVATE_KEY";
|
|
2746
|
+
this.name = "InvalidPrivateKeyError";
|
|
2747
|
+
}
|
|
2748
|
+
};
|
|
2749
|
+
var ChainSwitchError = class extends Error {
|
|
2750
|
+
constructor(message) {
|
|
2751
|
+
super(`[wallet-engine] ${message}`);
|
|
2752
|
+
this.code = "CHAIN_SWITCH_ERROR";
|
|
2753
|
+
this.name = "ChainSwitchError";
|
|
2754
|
+
}
|
|
2755
|
+
};
|
|
2756
|
+
var ChainMismatchError = class extends Error {
|
|
2757
|
+
constructor(walletChainId, expectedChainId) {
|
|
2758
|
+
super(
|
|
2759
|
+
`[wallet-engine] Chain mismatch: wallet is on chain ${walletChainId}, SDK is configured for chain ${expectedChainId}. Switch networks in your wallet or call awarizon.switchChain().`
|
|
2760
|
+
);
|
|
2761
|
+
this.code = "CHAIN_MISMATCH";
|
|
2762
|
+
this.name = "ChainMismatchError";
|
|
2763
|
+
this.walletChainId = walletChainId;
|
|
2764
|
+
this.expectedChainId = expectedChainId;
|
|
2765
|
+
}
|
|
2766
|
+
};
|
|
2767
|
+
|
|
2768
|
+
// ../wallet-engine/src/wallet.ts
|
|
2769
|
+
var ETH_PATH = (addressIndex) => `m/44'/60'/0'/0/${addressIndex}`;
|
|
2770
|
+
var WalletEngine = class {
|
|
2771
|
+
constructor(config) {
|
|
2772
|
+
this.internalClient = null;
|
|
2773
|
+
this.externalClient = null;
|
|
2774
|
+
this._connectorInfo = null;
|
|
2775
|
+
this._walletListeners = /* @__PURE__ */ new Set();
|
|
2776
|
+
this._chainListeners = /* @__PURE__ */ new Set();
|
|
2777
|
+
this.config = config;
|
|
2778
|
+
}
|
|
2779
|
+
// ─── Internal wallet creation ──────────────────────────────────────────────
|
|
2780
|
+
async create() {
|
|
2781
|
+
const mnemonic = generateMnemonic(wordlist, 128);
|
|
2782
|
+
const path = ETH_PATH(0);
|
|
2783
|
+
const account = mnemonicToAccount(mnemonic, { accountIndex: 0, addressIndex: 0 });
|
|
2784
|
+
this.internalClient = this._buildInternalClient(account);
|
|
2785
|
+
this._connectorInfo = { type: "internal" };
|
|
2786
|
+
this._emitWalletChange();
|
|
2787
|
+
return { address: account.address, mnemonic, derivationPath: path };
|
|
2788
|
+
}
|
|
2789
|
+
/**
|
|
2790
|
+
* Import a wallet from a BIP-39 mnemonic phrase.
|
|
2791
|
+
*
|
|
2792
|
+
* `addressIndex` maps to MetaMask's account switcher:
|
|
2793
|
+
* 0 → Account 1 (m/44'/60'/0'/0/0)
|
|
2794
|
+
* 1 → Account 2 (m/44'/60'/0'/0/1)
|
|
2795
|
+
* N → Account N+1
|
|
2796
|
+
*/
|
|
2797
|
+
async importMnemonic(mnemonic, addressIndex = 0) {
|
|
2798
|
+
if (!mnemonic || typeof mnemonic !== "string") throw new InvalidMnemonicError();
|
|
2799
|
+
if (!validateMnemonic(mnemonic, wordlist)) {
|
|
2800
|
+
throw new InvalidMnemonicError(
|
|
2801
|
+
`Invalid BIP-39 mnemonic: ${mnemonic.split(" ").slice(0, 2).join(" ")}\u2026`
|
|
2802
|
+
);
|
|
2803
|
+
}
|
|
2804
|
+
let account;
|
|
2805
|
+
try {
|
|
2806
|
+
account = mnemonicToAccount(mnemonic, { accountIndex: 0, addressIndex });
|
|
2807
|
+
} catch {
|
|
2808
|
+
throw new InvalidMnemonicError(
|
|
2809
|
+
`Could not derive account from mnemonic: ${mnemonic.slice(0, 8)}\u2026`
|
|
2810
|
+
);
|
|
2811
|
+
}
|
|
2812
|
+
this.internalClient = this._buildInternalClient(account);
|
|
2813
|
+
this._connectorInfo = { type: "internal" };
|
|
2814
|
+
this._emitWalletChange();
|
|
2815
|
+
const path = ETH_PATH(addressIndex);
|
|
2816
|
+
return { address: account.address, mnemonic, derivationPath: path };
|
|
2817
|
+
}
|
|
2818
|
+
async importPrivateKey(privateKey) {
|
|
2819
|
+
if (!privateKey || !privateKey.startsWith("0x")) {
|
|
2820
|
+
throw new InvalidPrivateKeyError("Private key must be a 0x-prefixed hex string.");
|
|
2821
|
+
}
|
|
2822
|
+
let account;
|
|
2823
|
+
try {
|
|
2824
|
+
account = privateKeyToAccount(privateKey);
|
|
2825
|
+
} catch {
|
|
2826
|
+
throw new InvalidPrivateKeyError();
|
|
2827
|
+
}
|
|
2828
|
+
this.internalClient = this._buildInternalClient(account);
|
|
2829
|
+
this._connectorInfo = { type: "internal" };
|
|
2830
|
+
this._emitWalletChange();
|
|
2831
|
+
return { address: account.address };
|
|
2832
|
+
}
|
|
2833
|
+
// ─── External wallet integration ───────────────────────────────────────────
|
|
2834
|
+
/**
|
|
2835
|
+
* Connect any viem WalletClient (wagmi, RainbowKit, custom).
|
|
2836
|
+
* Optionally pass connector metadata to display in the UI.
|
|
2837
|
+
*
|
|
2838
|
+
* External wallets always take priority over internal wallets.
|
|
2839
|
+
*/
|
|
2840
|
+
connectExternal(walletClient, info) {
|
|
2841
|
+
if (!walletClient || typeof walletClient !== "object") {
|
|
2842
|
+
throw new TypeError("[wallet-engine] connectExternal: expected a viem WalletClient");
|
|
2843
|
+
}
|
|
2844
|
+
this.externalClient = walletClient;
|
|
2845
|
+
this._connectorInfo = { type: "external", ...info };
|
|
2846
|
+
this._emitWalletChange();
|
|
2847
|
+
}
|
|
2848
|
+
/**
|
|
2849
|
+
* Connect directly from a raw EIP-1193 provider (window.ethereum, WalletConnect, etc.)
|
|
2850
|
+
* without needing wagmi or any wrapper. Calls eth_requestAccounts internally.
|
|
2851
|
+
*
|
|
2852
|
+
* @param provider - Any object implementing the EIP-1193 interface
|
|
2853
|
+
* @param info - Optional connector metadata (name, icon)
|
|
2854
|
+
*/
|
|
2855
|
+
async connectEIP1193(provider, info) {
|
|
2856
|
+
const accounts = await provider.request({
|
|
2857
|
+
method: "eth_requestAccounts"
|
|
2858
|
+
});
|
|
2859
|
+
const account = accounts[0];
|
|
2860
|
+
if (!account) {
|
|
2861
|
+
throw new WalletNotConnectedError(
|
|
2862
|
+
"No accounts returned by EIP-1193 provider. The user may have rejected the connection request."
|
|
2863
|
+
);
|
|
2864
|
+
}
|
|
2865
|
+
const walletClient = createWalletClient({
|
|
2866
|
+
account,
|
|
2867
|
+
chain: this.config.chain,
|
|
2868
|
+
transport: custom(provider)
|
|
2869
|
+
});
|
|
2870
|
+
this.connectExternal(walletClient, info);
|
|
2871
|
+
provider.on?.("accountsChanged", (...args) => {
|
|
2872
|
+
const newAccounts = args[0];
|
|
2873
|
+
if (!newAccounts || newAccounts.length === 0) {
|
|
2874
|
+
this.disconnectExternal();
|
|
2875
|
+
return;
|
|
2876
|
+
}
|
|
2877
|
+
const updated = createWalletClient({
|
|
2878
|
+
account: newAccounts[0],
|
|
2879
|
+
chain: this.config.chain,
|
|
2880
|
+
transport: custom(provider)
|
|
2881
|
+
});
|
|
2882
|
+
this.connectExternal(updated, info);
|
|
2883
|
+
});
|
|
2884
|
+
provider.on?.("chainChanged", (..._args) => {
|
|
2885
|
+
this._emitChainChange();
|
|
2886
|
+
});
|
|
2887
|
+
provider.on?.("disconnect", (..._args) => {
|
|
2888
|
+
this.disconnectExternal();
|
|
2889
|
+
});
|
|
2890
|
+
}
|
|
2891
|
+
/** Remove the external wallet. Falls back to internal wallet if one is loaded. */
|
|
2892
|
+
disconnectExternal() {
|
|
2893
|
+
this.externalClient = null;
|
|
2894
|
+
this._connectorInfo = this.internalClient ? { type: "internal" } : null;
|
|
2895
|
+
this._emitWalletChange();
|
|
2896
|
+
}
|
|
2897
|
+
/** Remove all wallet state — both internal and external. */
|
|
2898
|
+
disconnect() {
|
|
2899
|
+
this.internalClient = null;
|
|
2900
|
+
this.externalClient = null;
|
|
2901
|
+
this._connectorInfo = null;
|
|
2902
|
+
this._emitWalletChange();
|
|
2903
|
+
}
|
|
2904
|
+
// ─── Chain management ──────────────────────────────────────────────────────
|
|
2905
|
+
async switchChain(chain2) {
|
|
2906
|
+
this.config.chain = chain2;
|
|
2907
|
+
this.config.publicClient = createPublicClient({
|
|
2908
|
+
chain: chain2,
|
|
2909
|
+
transport: this._resolveTransport(chain2)
|
|
2910
|
+
});
|
|
2911
|
+
if (this.internalClient?.account) {
|
|
2912
|
+
this.internalClient = this._buildInternalClient(this.internalClient.account);
|
|
2913
|
+
}
|
|
2914
|
+
this._emitChainChange();
|
|
2915
|
+
}
|
|
2916
|
+
// ─── Signing ───────────────────────────────────────────────────────────────
|
|
2917
|
+
/**
|
|
2918
|
+
* Sign a plain text or raw-bytes message with the active wallet.
|
|
2919
|
+
* Supports Sign-In with Ethereum (SIWE) and off-chain auth flows.
|
|
2920
|
+
*
|
|
2921
|
+
* @param message - A UTF-8 string or `{ raw: Hex | Uint8Array }` for raw bytes
|
|
2922
|
+
*/
|
|
2923
|
+
async signMessage(message) {
|
|
2924
|
+
const client = this.externalClient ?? this.internalClient;
|
|
2925
|
+
if (!client) throw new WalletNotConnectedError();
|
|
2926
|
+
const account = client.account;
|
|
2927
|
+
if (!account) {
|
|
2928
|
+
throw new WalletNotConnectedError(
|
|
2929
|
+
"No account set on wallet client. The wallet may need to be unlocked or reconnected."
|
|
2930
|
+
);
|
|
2931
|
+
}
|
|
2932
|
+
return client.signMessage({
|
|
2933
|
+
account,
|
|
2934
|
+
message
|
|
2935
|
+
});
|
|
2936
|
+
}
|
|
2937
|
+
/**
|
|
2938
|
+
* Sign EIP-712 typed structured data (permit2, SIWE, Seaport, etc.).
|
|
2939
|
+
*
|
|
2940
|
+
* @param params - domain, types, primaryType, and message fields per EIP-712
|
|
2941
|
+
*/
|
|
2942
|
+
async signTypedData(params) {
|
|
2943
|
+
const client = this.externalClient ?? this.internalClient;
|
|
2944
|
+
if (!client) throw new WalletNotConnectedError();
|
|
2945
|
+
const account = client.account;
|
|
2946
|
+
if (!account) {
|
|
2947
|
+
throw new WalletNotConnectedError(
|
|
2948
|
+
"No account set on wallet client. The wallet may need to be unlocked or reconnected."
|
|
2949
|
+
);
|
|
2950
|
+
}
|
|
2951
|
+
return client.signTypedData({
|
|
2952
|
+
account,
|
|
2953
|
+
...params
|
|
2954
|
+
});
|
|
2955
|
+
}
|
|
2956
|
+
// ─── Chain awareness ───────────────────────────────────────────────────────
|
|
2957
|
+
/**
|
|
2958
|
+
* Returns the chain ID the active wallet is currently on.
|
|
2959
|
+
* For external wallets this queries the wallet directly (may differ from SDK config).
|
|
2960
|
+
* For internal wallets this always returns the SDK-configured chain ID.
|
|
2961
|
+
*/
|
|
2962
|
+
async getChainId() {
|
|
2963
|
+
if (this.externalClient) {
|
|
2964
|
+
try {
|
|
2965
|
+
return await this.externalClient.getChainId();
|
|
2966
|
+
} catch {
|
|
2967
|
+
return this.config.chain.id;
|
|
2968
|
+
}
|
|
2969
|
+
}
|
|
2970
|
+
return this.config.chain.id;
|
|
2971
|
+
}
|
|
2972
|
+
/**
|
|
2973
|
+
* Returns true if the external wallet is on a different chain than the SDK.
|
|
2974
|
+
* Always false for internal wallets (they follow the SDK chain automatically).
|
|
2975
|
+
*/
|
|
2976
|
+
async isChainMismatch() {
|
|
2977
|
+
if (!this.externalClient) return false;
|
|
2978
|
+
const activeChainId = await this.getChainId();
|
|
2979
|
+
return activeChainId !== this.config.chain.id;
|
|
2980
|
+
}
|
|
2981
|
+
// ─── Event listeners ───────────────────────────────────────────────────────
|
|
2982
|
+
/**
|
|
2983
|
+
* Subscribe to wallet changes (connect, disconnect, account switch).
|
|
2984
|
+
* Returns an unsubscribe function — call it to stop listening.
|
|
2985
|
+
*
|
|
2986
|
+
* @example
|
|
2987
|
+
* const unsub = engine.onWalletChange(({ address, type }) => {
|
|
2988
|
+
* console.log('wallet changed:', address, type)
|
|
2989
|
+
* })
|
|
2990
|
+
* unsub() // stop listening
|
|
2991
|
+
*/
|
|
2992
|
+
onWalletChange(cb) {
|
|
2993
|
+
this._walletListeners.add(cb);
|
|
2994
|
+
return () => this._walletListeners.delete(cb);
|
|
2995
|
+
}
|
|
2996
|
+
/**
|
|
2997
|
+
* Subscribe to chain changes (switchChain calls).
|
|
2998
|
+
* Returns an unsubscribe function — call it to stop listening.
|
|
2999
|
+
*/
|
|
3000
|
+
onChainChange(cb) {
|
|
3001
|
+
this._chainListeners.add(cb);
|
|
3002
|
+
return () => this._chainListeners.delete(cb);
|
|
3003
|
+
}
|
|
3004
|
+
// ─── Accessors ─────────────────────────────────────────────────────────────
|
|
3005
|
+
getWalletClient() {
|
|
3006
|
+
const client = this.externalClient ?? this.internalClient;
|
|
3007
|
+
if (!client) throw new WalletNotConnectedError();
|
|
3008
|
+
return client;
|
|
3009
|
+
}
|
|
3010
|
+
getSigner() {
|
|
3011
|
+
return this.getWalletClient();
|
|
3012
|
+
}
|
|
3013
|
+
address() {
|
|
3014
|
+
const client = this.externalClient ?? this.internalClient;
|
|
3015
|
+
const addr = client?.account?.address;
|
|
3016
|
+
if (!addr) throw new WalletNotConnectedError();
|
|
3017
|
+
return addr;
|
|
3018
|
+
}
|
|
3019
|
+
getChain() {
|
|
3020
|
+
return this.config.chain;
|
|
3021
|
+
}
|
|
3022
|
+
getPublicClient() {
|
|
3023
|
+
return this.config.publicClient;
|
|
3024
|
+
}
|
|
3025
|
+
isConnected() {
|
|
3026
|
+
return !!(this.externalClient ?? this.internalClient);
|
|
3027
|
+
}
|
|
3028
|
+
hasExternalWallet() {
|
|
3029
|
+
return this.externalClient !== null;
|
|
3030
|
+
}
|
|
3031
|
+
hasInternalWallet() {
|
|
3032
|
+
return this.internalClient !== null;
|
|
3033
|
+
}
|
|
3034
|
+
/**
|
|
3035
|
+
* Returns metadata about the currently active connector.
|
|
3036
|
+
* Useful for displaying "Connected via MetaMask" in the UI.
|
|
3037
|
+
*/
|
|
3038
|
+
getConnectorInfo() {
|
|
3039
|
+
if (this._connectorInfo) return this._connectorInfo;
|
|
3040
|
+
if (this.externalClient) return { type: "external" };
|
|
3041
|
+
if (this.internalClient) return { type: "internal" };
|
|
3042
|
+
return { type: "none" };
|
|
3043
|
+
}
|
|
3044
|
+
// ─── Private helpers ───────────────────────────────────────────────────────
|
|
3045
|
+
_resolveTransport(chain2) {
|
|
3046
|
+
return this.config.getTransport ? this.config.getTransport(chain2) : http(this.config.rpcUrl);
|
|
3047
|
+
}
|
|
3048
|
+
_buildInternalClient(account) {
|
|
3049
|
+
return createWalletClient({
|
|
3050
|
+
account,
|
|
3051
|
+
chain: this.config.chain,
|
|
3052
|
+
transport: this._resolveTransport(this.config.chain)
|
|
3053
|
+
});
|
|
3054
|
+
}
|
|
3055
|
+
_emitWalletChange() {
|
|
3056
|
+
let addr = null;
|
|
3057
|
+
try {
|
|
3058
|
+
addr = this.address();
|
|
3059
|
+
} catch {
|
|
3060
|
+
}
|
|
3061
|
+
const event = {
|
|
3062
|
+
address: addr,
|
|
3063
|
+
type: this.externalClient ? "external" : this.internalClient ? "internal" : "none",
|
|
3064
|
+
name: this._connectorInfo?.name
|
|
3065
|
+
};
|
|
3066
|
+
this._walletListeners.forEach((cb) => {
|
|
3067
|
+
try {
|
|
3068
|
+
cb(event);
|
|
3069
|
+
} catch {
|
|
3070
|
+
}
|
|
3071
|
+
});
|
|
3072
|
+
}
|
|
3073
|
+
_emitChainChange() {
|
|
3074
|
+
const event = {
|
|
3075
|
+
chainId: this.config.chain.id,
|
|
3076
|
+
chain: this.config.chain
|
|
3077
|
+
};
|
|
3078
|
+
this._chainListeners.forEach((cb) => {
|
|
3079
|
+
try {
|
|
3080
|
+
cb(event);
|
|
3081
|
+
} catch {
|
|
3082
|
+
}
|
|
3083
|
+
});
|
|
3084
|
+
}
|
|
3085
|
+
};
|
|
3086
|
+
|
|
3087
|
+
// ../tx-engine/src/errors.ts
|
|
3088
|
+
var ContractExecutionError = class extends Error {
|
|
3089
|
+
constructor(message, options) {
|
|
3090
|
+
super(`[tx-engine] ${message}`);
|
|
3091
|
+
this.code = "CONTRACT_EXECUTION_ERROR";
|
|
3092
|
+
this.name = "ContractExecutionError";
|
|
3093
|
+
this.functionName = options?.functionName;
|
|
3094
|
+
this.cause = options?.cause;
|
|
3095
|
+
}
|
|
3096
|
+
};
|
|
3097
|
+
var SimulationError = class extends Error {
|
|
3098
|
+
constructor(message, options) {
|
|
3099
|
+
super(`[tx-engine] Simulation failed: ${message}`);
|
|
3100
|
+
this.code = "SIMULATION_ERROR";
|
|
3101
|
+
this.name = "SimulationError";
|
|
3102
|
+
this.functionName = options?.functionName;
|
|
3103
|
+
this.cause = options?.cause;
|
|
3104
|
+
}
|
|
3105
|
+
};
|
|
3106
|
+
var GasEstimationError = class extends Error {
|
|
3107
|
+
constructor(message, cause) {
|
|
3108
|
+
super(`[tx-engine] Gas estimation failed: ${message}`);
|
|
3109
|
+
this.code = "GAS_ESTIMATION_ERROR";
|
|
3110
|
+
this.name = "GasEstimationError";
|
|
3111
|
+
this.cause = cause;
|
|
3112
|
+
}
|
|
3113
|
+
};
|
|
3114
|
+
var TransactionTimeoutError = class extends Error {
|
|
3115
|
+
constructor(hash) {
|
|
3116
|
+
super(`[tx-engine] Transaction confirmation timed out${hash ? ` (hash: ${hash})` : ""}`);
|
|
3117
|
+
this.code = "TRANSACTION_TIMEOUT";
|
|
3118
|
+
this.name = "TransactionTimeoutError";
|
|
3119
|
+
this.hash = hash;
|
|
3120
|
+
}
|
|
3121
|
+
};
|
|
3122
|
+
|
|
3123
|
+
// ../tx-engine/src/transaction.ts
|
|
3124
|
+
function extractRevertReason(error) {
|
|
3125
|
+
if (!error || typeof error !== "object") return String(error);
|
|
3126
|
+
const e = error;
|
|
3127
|
+
if (typeof e["reason"] === "string" && e["reason"]) return e["reason"];
|
|
3128
|
+
if (e["data"] && typeof e["data"] === "object") {
|
|
3129
|
+
const data = e["data"];
|
|
3130
|
+
if (typeof data["errorName"] === "string" && data["errorName"]) {
|
|
3131
|
+
const args = Array.isArray(data["args"]) && data["args"].length ? `(${data["args"].join(", ")})` : "";
|
|
3132
|
+
return `${data["errorName"]}${args}`;
|
|
3133
|
+
}
|
|
3134
|
+
}
|
|
3135
|
+
if (typeof e["shortMessage"] === "string" && e["shortMessage"]) return e["shortMessage"];
|
|
3136
|
+
if (e["cause"]) return extractRevertReason(e["cause"]);
|
|
3137
|
+
return error.message ?? String(error);
|
|
3138
|
+
}
|
|
3139
|
+
var TransactionEngine = class {
|
|
3140
|
+
constructor(publicClient, getWalletClient) {
|
|
3141
|
+
this.publicClient = publicClient;
|
|
3142
|
+
this.getWalletClient = getWalletClient;
|
|
3143
|
+
}
|
|
3144
|
+
// ─── Read ─────────────────────────────────────────────────────────────────
|
|
3145
|
+
/**
|
|
3146
|
+
* Execute a read-only contract call (view / pure functions).
|
|
3147
|
+
* Returns the decoded output — single values or tuples.
|
|
3148
|
+
*/
|
|
3149
|
+
async read(params) {
|
|
3150
|
+
try {
|
|
3151
|
+
return await this.publicClient.readContract({
|
|
3152
|
+
address: params.address,
|
|
3153
|
+
abi: params.abi,
|
|
3154
|
+
functionName: params.functionName,
|
|
3155
|
+
args: params.args
|
|
3156
|
+
});
|
|
3157
|
+
} catch (error) {
|
|
3158
|
+
throw new ContractExecutionError(
|
|
3159
|
+
`read(${params.functionName}) failed: ${extractRevertReason(error)}`,
|
|
3160
|
+
{ functionName: params.functionName, cause: error }
|
|
3161
|
+
);
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
// ─── Write ────────────────────────────────────────────────────────────────
|
|
3165
|
+
/**
|
|
3166
|
+
* Execute a state-mutating contract call:
|
|
3167
|
+
* 1. Simulate the transaction (surfaces revert reasons before spending gas)
|
|
3168
|
+
* 2. Broadcast the signed transaction
|
|
3169
|
+
* 3. Wait for on-chain confirmation
|
|
3170
|
+
*
|
|
3171
|
+
* @returns { hash, receipt } — the tx hash and on-chain receipt
|
|
3172
|
+
*/
|
|
3173
|
+
async write(params) {
|
|
3174
|
+
const walletClient = this.getWalletClient();
|
|
3175
|
+
const account = walletClient.account;
|
|
3176
|
+
if (!account) {
|
|
3177
|
+
throw new ContractExecutionError(
|
|
3178
|
+
`write(${params.functionName}): wallet client has no account attached`,
|
|
3179
|
+
{ functionName: params.functionName }
|
|
3180
|
+
);
|
|
3181
|
+
}
|
|
3182
|
+
let request;
|
|
3183
|
+
try {
|
|
3184
|
+
const simulation = await this.publicClient.simulateContract({
|
|
3185
|
+
address: params.address,
|
|
3186
|
+
abi: params.abi,
|
|
3187
|
+
functionName: params.functionName,
|
|
3188
|
+
args: params.args,
|
|
3189
|
+
account,
|
|
3190
|
+
value: params.value,
|
|
3191
|
+
gas: params.gas
|
|
3192
|
+
});
|
|
3193
|
+
request = simulation.request;
|
|
3194
|
+
} catch (error) {
|
|
3195
|
+
throw new SimulationError(
|
|
3196
|
+
`${params.functionName}: ${extractRevertReason(error)}`,
|
|
3197
|
+
{ functionName: params.functionName, cause: error }
|
|
3198
|
+
);
|
|
3199
|
+
}
|
|
3200
|
+
let hash;
|
|
3201
|
+
try {
|
|
3202
|
+
hash = await walletClient.writeContract(request);
|
|
3203
|
+
} catch (error) {
|
|
3204
|
+
throw new ContractExecutionError(
|
|
3205
|
+
`write(${params.functionName}) broadcast failed: ${error.message}`,
|
|
3206
|
+
{ functionName: params.functionName, cause: error }
|
|
3207
|
+
);
|
|
3208
|
+
}
|
|
3209
|
+
let receipt;
|
|
3210
|
+
try {
|
|
3211
|
+
receipt = await this.publicClient.waitForTransactionReceipt({ hash });
|
|
3212
|
+
} catch (error) {
|
|
3213
|
+
throw new ContractExecutionError(
|
|
3214
|
+
`write(${params.functionName}) receipt wait failed: ${error.message}`,
|
|
3215
|
+
{ functionName: params.functionName, cause: error }
|
|
3216
|
+
);
|
|
3217
|
+
}
|
|
3218
|
+
return { hash, receipt };
|
|
3219
|
+
}
|
|
3220
|
+
// ─── Gas estimation ───────────────────────────────────────────────────────
|
|
3221
|
+
/**
|
|
3222
|
+
* Estimate gas for a write transaction.
|
|
3223
|
+
* Useful for displaying fee previews before the user confirms.
|
|
3224
|
+
*/
|
|
3225
|
+
async estimateGas(params) {
|
|
3226
|
+
const walletClient = this.getWalletClient();
|
|
3227
|
+
const account = walletClient.account;
|
|
3228
|
+
if (!account) {
|
|
3229
|
+
throw new GasEstimationError("Wallet client has no account attached");
|
|
3230
|
+
}
|
|
3231
|
+
try {
|
|
3232
|
+
const gas = await this.publicClient.estimateContractGas({
|
|
3233
|
+
address: params.address,
|
|
3234
|
+
abi: params.abi,
|
|
3235
|
+
functionName: params.functionName,
|
|
3236
|
+
args: params.args,
|
|
3237
|
+
account,
|
|
3238
|
+
value: params.value
|
|
3239
|
+
});
|
|
3240
|
+
let gasCost;
|
|
3241
|
+
try {
|
|
3242
|
+
const gasPrice = await this.publicClient.getGasPrice();
|
|
3243
|
+
gasCost = gas * gasPrice;
|
|
3244
|
+
} catch {
|
|
3245
|
+
}
|
|
3246
|
+
return { gas, gasCost };
|
|
3247
|
+
} catch (error) {
|
|
3248
|
+
throw new GasEstimationError(extractRevertReason(error), error);
|
|
3249
|
+
}
|
|
3250
|
+
}
|
|
3251
|
+
};
|
|
11
3252
|
var CHAINS = {
|
|
12
3253
|
// Mainnet
|
|
13
3254
|
mainnet,
|
|
@@ -59,21 +3300,21 @@ var CHAINS = {
|
|
|
59
3300
|
moonbeam
|
|
60
3301
|
};
|
|
61
3302
|
var _chainAliases = Object.keys(CHAINS).sort().join(", ");
|
|
62
|
-
function resolveChain(
|
|
63
|
-
if (typeof
|
|
64
|
-
return
|
|
3303
|
+
function resolveChain(chain2) {
|
|
3304
|
+
if (typeof chain2 === "object" && "id" in chain2) {
|
|
3305
|
+
return chain2;
|
|
65
3306
|
}
|
|
66
|
-
if (typeof
|
|
67
|
-
const resolved = CHAINS[
|
|
3307
|
+
if (typeof chain2 === "string") {
|
|
3308
|
+
const resolved = CHAINS[chain2.toLowerCase()] ?? CHAINS[chain2];
|
|
68
3309
|
if (!resolved) {
|
|
69
3310
|
throw new Error(
|
|
70
|
-
`[awarizon/web3] Unsupported chain: "${
|
|
3311
|
+
`[awarizon/web3] Unsupported chain: "${chain2}".
|
|
71
3312
|
Available chains: ${_chainAliases}`
|
|
72
3313
|
);
|
|
73
3314
|
}
|
|
74
3315
|
return resolved;
|
|
75
3316
|
}
|
|
76
|
-
throw new TypeError(`[awarizon/web3] chain must be a string or Chain object, got: ${typeof
|
|
3317
|
+
throw new TypeError(`[awarizon/web3] chain must be a string or Chain object, got: ${typeof chain2}`);
|
|
77
3318
|
}
|
|
78
3319
|
function getSupportedChainIds() {
|
|
79
3320
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -95,27 +3336,139 @@ var FALLBACK_RPCS = {
|
|
|
95
3336
|
1284: "https://moonbeam.drpc.org"
|
|
96
3337
|
// moonbeam
|
|
97
3338
|
};
|
|
98
|
-
function getChainTransport(
|
|
3339
|
+
function getChainTransport(chain2, rpcUrlOverride) {
|
|
99
3340
|
if (rpcUrlOverride) return http(rpcUrlOverride);
|
|
100
|
-
const fallbackUrl = FALLBACK_RPCS[
|
|
3341
|
+
const fallbackUrl = FALLBACK_RPCS[chain2.id];
|
|
101
3342
|
if (fallbackUrl) {
|
|
102
|
-
const primaryUrl =
|
|
3343
|
+
const primaryUrl = chain2.rpcUrls.default.http[0];
|
|
103
3344
|
return fallback([http(primaryUrl), http(fallbackUrl)]);
|
|
104
3345
|
}
|
|
105
3346
|
return http();
|
|
106
3347
|
}
|
|
107
|
-
|
|
3348
|
+
|
|
3349
|
+
// ../abi-engine/src/errors.ts
|
|
3350
|
+
var InvalidABIError = class extends Error {
|
|
3351
|
+
constructor(message) {
|
|
3352
|
+
super(`[abi-engine] ${message}`);
|
|
3353
|
+
this.code = "INVALID_ABI";
|
|
3354
|
+
this.name = "InvalidABIError";
|
|
3355
|
+
}
|
|
3356
|
+
};
|
|
3357
|
+
var UnsupportedABIItemError = class extends Error {
|
|
3358
|
+
constructor(itemType) {
|
|
3359
|
+
super(`[abi-engine] Unsupported ABI item type: "${itemType}"`);
|
|
3360
|
+
this.code = "UNSUPPORTED_ABI_ITEM";
|
|
3361
|
+
this.name = "UnsupportedABIItemError";
|
|
3362
|
+
this.itemType = itemType;
|
|
3363
|
+
}
|
|
3364
|
+
};
|
|
3365
|
+
var DuplicateFunctionError = class extends Error {
|
|
3366
|
+
constructor(name) {
|
|
3367
|
+
super(`[abi-engine] Duplicate function name detected: "${name}". Function overloads are not yet supported.`);
|
|
3368
|
+
this.code = "DUPLICATE_FUNCTION";
|
|
3369
|
+
this.name = "DuplicateFunctionError";
|
|
3370
|
+
this.functionName = name;
|
|
3371
|
+
}
|
|
3372
|
+
};
|
|
3373
|
+
|
|
3374
|
+
// ../abi-engine/src/parser.ts
|
|
3375
|
+
var _parseCache = /* @__PURE__ */ new WeakMap();
|
|
3376
|
+
function parseABI(abi) {
|
|
3377
|
+
const hit = _parseCache.get(abi);
|
|
3378
|
+
if (hit) return hit;
|
|
3379
|
+
if (!Array.isArray(abi) || abi.length === 0) {
|
|
3380
|
+
throw new InvalidABIError("ABI must be a non-empty array");
|
|
3381
|
+
}
|
|
3382
|
+
const readFunctions = [];
|
|
3383
|
+
const writeFunctions = [];
|
|
3384
|
+
const payableFunctions = [];
|
|
3385
|
+
const events = [];
|
|
3386
|
+
let constructor;
|
|
3387
|
+
for (const item of abi) {
|
|
3388
|
+
if (!item || typeof item !== "object" || !("type" in item)) {
|
|
3389
|
+
throw new InvalidABIError(`Invalid ABI item: ${JSON.stringify(item)}`);
|
|
3390
|
+
}
|
|
3391
|
+
switch (item.type) {
|
|
3392
|
+
case "function": {
|
|
3393
|
+
const fn = item;
|
|
3394
|
+
const sm = fn.stateMutability;
|
|
3395
|
+
if (sm === "view" || sm === "pure") {
|
|
3396
|
+
readFunctions.push(fn);
|
|
3397
|
+
} else if (sm === "payable") {
|
|
3398
|
+
payableFunctions.push(fn);
|
|
3399
|
+
writeFunctions.push(fn);
|
|
3400
|
+
} else {
|
|
3401
|
+
writeFunctions.push(fn);
|
|
3402
|
+
}
|
|
3403
|
+
break;
|
|
3404
|
+
}
|
|
3405
|
+
case "event":
|
|
3406
|
+
events.push(item);
|
|
3407
|
+
break;
|
|
3408
|
+
case "constructor":
|
|
3409
|
+
constructor = item;
|
|
3410
|
+
break;
|
|
3411
|
+
}
|
|
3412
|
+
}
|
|
3413
|
+
const result = { readFunctions, writeFunctions, payableFunctions, events, constructor };
|
|
3414
|
+
_parseCache.set(abi, result);
|
|
3415
|
+
return result;
|
|
3416
|
+
}
|
|
3417
|
+
function isWriteFunction(fn) {
|
|
3418
|
+
return fn.stateMutability !== "view" && fn.stateMutability !== "pure";
|
|
3419
|
+
}
|
|
3420
|
+
function isPayableFunction(fn) {
|
|
3421
|
+
return fn.stateMutability === "payable";
|
|
3422
|
+
}
|
|
3423
|
+
function solidityTypeToTS(abiType) {
|
|
3424
|
+
if (abiType.endsWith("[]")) return `${solidityTypeToTS(abiType.slice(0, -2))}[]`;
|
|
3425
|
+
if (abiType.startsWith("uint") || abiType.startsWith("int")) return "bigint";
|
|
3426
|
+
if (abiType === "address") return "`0x${string}`";
|
|
3427
|
+
if (abiType === "bool") return "boolean";
|
|
3428
|
+
if (abiType.startsWith("bytes")) return "`0x${string}`";
|
|
3429
|
+
if (abiType === "string") return "string";
|
|
3430
|
+
if (abiType === "tuple") return "Record<string, unknown>";
|
|
3431
|
+
return "unknown";
|
|
3432
|
+
}
|
|
3433
|
+
function generateMethodSignature(fn) {
|
|
3434
|
+
const sm = fn.stateMutability;
|
|
3435
|
+
const kind = sm === "view" || sm === "pure" ? "read" : sm === "payable" ? "payable" : "write";
|
|
3436
|
+
const params = (fn.inputs ?? []).map((p, i) => ({
|
|
3437
|
+
name: p.name || `arg${i}`,
|
|
3438
|
+
type: solidityTypeToTS(p.type)
|
|
3439
|
+
}));
|
|
3440
|
+
const paramStr = params.map((p) => `${p.name}: ${p.type}`).join(", ");
|
|
3441
|
+
let returnType;
|
|
3442
|
+
const outputs = fn.outputs ?? [];
|
|
3443
|
+
if (outputs.length === 0) {
|
|
3444
|
+
returnType = kind === "read" ? "void" : "TransactionResult";
|
|
3445
|
+
} else if (outputs.length === 1) {
|
|
3446
|
+
returnType = solidityTypeToTS(outputs[0].type);
|
|
3447
|
+
} else {
|
|
3448
|
+
returnType = `[${outputs.map((o) => solidityTypeToTS(o.type)).join(", ")}]`;
|
|
3449
|
+
}
|
|
3450
|
+
const asyncReturn = kind === "read" ? `Promise<${returnType}>` : "Promise<TransactionResult>";
|
|
3451
|
+
const signature = `${fn.name}(${paramStr}): ${asyncReturn}`;
|
|
3452
|
+
return { name: fn.name, kind, signature, params };
|
|
3453
|
+
}
|
|
3454
|
+
function generateAllMethodSignatures(parsed) {
|
|
3455
|
+
const all = [...parsed.readFunctions, ...parsed.writeFunctions];
|
|
3456
|
+
return all.map(generateMethodSignature);
|
|
3457
|
+
}
|
|
3458
|
+
|
|
3459
|
+
// src/contract.ts
|
|
3460
|
+
function trackEvent(telemetry, type, chain2, functionName, success, start) {
|
|
108
3461
|
telemetry?.track({
|
|
109
3462
|
type,
|
|
110
|
-
chain:
|
|
111
|
-
chainId:
|
|
3463
|
+
chain: chain2?.name ?? "unknown",
|
|
3464
|
+
chainId: chain2?.id ?? 0,
|
|
112
3465
|
functionName,
|
|
113
3466
|
success,
|
|
114
3467
|
durationMs: Date.now() - start,
|
|
115
3468
|
ts: Date.now()
|
|
116
3469
|
});
|
|
117
3470
|
}
|
|
118
|
-
function buildContractInstance(address, abi, publicClient, txEngine, telemetry,
|
|
3471
|
+
function buildContractInstance(address, abi, publicClient, txEngine, telemetry, chain2) {
|
|
119
3472
|
const parsed = parseABI(abi);
|
|
120
3473
|
const eventsMap = new Map(parsed.events.map((e) => [e.name, e]));
|
|
121
3474
|
const instance = {
|
|
@@ -123,39 +3476,39 @@ function buildContractInstance(address, abi, publicClient, txEngine, telemetry,
|
|
|
123
3476
|
_abi: abi
|
|
124
3477
|
};
|
|
125
3478
|
for (const fn of parsed.readFunctions) {
|
|
126
|
-
instance[fn.name] = buildReadMethod(fn, address, abi, txEngine, telemetry,
|
|
3479
|
+
instance[fn.name] = buildReadMethod(fn, address, abi, txEngine, telemetry, chain2);
|
|
127
3480
|
}
|
|
128
3481
|
for (const fn of parsed.writeFunctions) {
|
|
129
|
-
instance[fn.name] = buildWriteMethod(fn, address, abi, txEngine, telemetry,
|
|
3482
|
+
instance[fn.name] = buildWriteMethod(fn, address, abi, txEngine, telemetry, chain2);
|
|
130
3483
|
}
|
|
131
3484
|
instance["on"] = buildEventSubscription(address, abi, eventsMap, publicClient);
|
|
132
3485
|
instance["estimateGas"] = async (method, ...args) => {
|
|
133
3486
|
const start = Date.now();
|
|
134
3487
|
try {
|
|
135
3488
|
const estimate = await txEngine.estimateGas({ address, abi, functionName: method, args });
|
|
136
|
-
trackEvent(telemetry, "contract.gas_estimate",
|
|
3489
|
+
trackEvent(telemetry, "contract.gas_estimate", chain2, method, true, start);
|
|
137
3490
|
return estimate.gas;
|
|
138
3491
|
} catch (error) {
|
|
139
|
-
trackEvent(telemetry, "contract.gas_estimate",
|
|
3492
|
+
trackEvent(telemetry, "contract.gas_estimate", chain2, method, false, start);
|
|
140
3493
|
throw error;
|
|
141
3494
|
}
|
|
142
3495
|
};
|
|
143
3496
|
return instance;
|
|
144
3497
|
}
|
|
145
|
-
function buildReadMethod(fn, address, abi, txEngine, telemetry,
|
|
3498
|
+
function buildReadMethod(fn, address, abi, txEngine, telemetry, chain2) {
|
|
146
3499
|
return async (...args) => {
|
|
147
3500
|
const start = Date.now();
|
|
148
3501
|
try {
|
|
149
3502
|
const result = await txEngine.read({ address, abi, functionName: fn.name, args });
|
|
150
|
-
trackEvent(telemetry, "contract.read",
|
|
3503
|
+
trackEvent(telemetry, "contract.read", chain2, fn.name, true, start);
|
|
151
3504
|
return result;
|
|
152
3505
|
} catch (error) {
|
|
153
|
-
trackEvent(telemetry, "contract.read",
|
|
3506
|
+
trackEvent(telemetry, "contract.read", chain2, fn.name, false, start);
|
|
154
3507
|
throw error;
|
|
155
3508
|
}
|
|
156
3509
|
};
|
|
157
3510
|
}
|
|
158
|
-
function buildWriteMethod(fn, address, abi, txEngine, telemetry,
|
|
3511
|
+
function buildWriteMethod(fn, address, abi, txEngine, telemetry, chain2) {
|
|
159
3512
|
const isPayable = fn.stateMutability === "payable";
|
|
160
3513
|
return async (...args) => {
|
|
161
3514
|
let callArgs = args;
|
|
@@ -179,10 +3532,10 @@ function buildWriteMethod(fn, address, abi, txEngine, telemetry, chain) {
|
|
|
179
3532
|
value,
|
|
180
3533
|
gas
|
|
181
3534
|
});
|
|
182
|
-
trackEvent(telemetry, "contract.write",
|
|
3535
|
+
trackEvent(telemetry, "contract.write", chain2, fn.name, true, start);
|
|
183
3536
|
return result;
|
|
184
3537
|
} catch (error) {
|
|
185
|
-
trackEvent(telemetry, "contract.write",
|
|
3538
|
+
trackEvent(telemetry, "contract.write", chain2, fn.name, false, start);
|
|
186
3539
|
throw error;
|
|
187
3540
|
}
|
|
188
3541
|
};
|
|
@@ -241,11 +3594,11 @@ var ContractNotLoadedError = class extends Error {
|
|
|
241
3594
|
}
|
|
242
3595
|
};
|
|
243
3596
|
var UnsupportedChainError = class extends Error {
|
|
244
|
-
constructor(
|
|
245
|
-
super(`[awarizon/web3] Unsupported chain: "${
|
|
3597
|
+
constructor(chain2) {
|
|
3598
|
+
super(`[awarizon/web3] Unsupported chain: "${chain2}". Pass a valid chain name or viem Chain object.`);
|
|
246
3599
|
this.code = "UNSUPPORTED_CHAIN";
|
|
247
3600
|
this.name = "UnsupportedChainError";
|
|
248
|
-
this.chain =
|
|
3601
|
+
this.chain = chain2;
|
|
249
3602
|
}
|
|
250
3603
|
};
|
|
251
3604
|
var ApiKeyRequiredError = class extends Error {
|
|
@@ -716,6 +4069,8 @@ var ERC1155_ABI = [
|
|
|
716
4069
|
{ type: "event", name: "TransferBatch", inputs: [{ indexed: true, name: "operator", type: "address" }, { indexed: true, name: "from", type: "address" }, { indexed: true, name: "to", type: "address" }, { name: "ids", type: "uint256[]" }, { name: "values", type: "uint256[]" }] },
|
|
717
4070
|
{ type: "event", name: "ApprovalForAll", inputs: [{ indexed: true, name: "account", type: "address" }, { indexed: true, name: "operator", type: "address" }, { name: "approved", type: "bool" }] }
|
|
718
4071
|
];
|
|
4072
|
+
|
|
4073
|
+
// src/sdk.ts
|
|
719
4074
|
var WalletProxy = class {
|
|
720
4075
|
constructor(engine, ensureReady) {
|
|
721
4076
|
this.engine = engine;
|
|
@@ -726,9 +4081,9 @@ var WalletProxy = class {
|
|
|
726
4081
|
await this.ensureReady();
|
|
727
4082
|
return this.engine.create();
|
|
728
4083
|
}
|
|
729
|
-
async importMnemonic(mnemonic,
|
|
4084
|
+
async importMnemonic(mnemonic, addressIndex) {
|
|
730
4085
|
await this.ensureReady();
|
|
731
|
-
return this.engine.importMnemonic(mnemonic,
|
|
4086
|
+
return this.engine.importMnemonic(mnemonic, addressIndex);
|
|
732
4087
|
}
|
|
733
4088
|
async importPrivateKey(privateKey) {
|
|
734
4089
|
await this.ensureReady();
|
|
@@ -765,8 +4120,8 @@ var WalletProxy = class {
|
|
|
765
4120
|
disconnect() {
|
|
766
4121
|
this.engine.disconnect();
|
|
767
4122
|
}
|
|
768
|
-
async switchChain(
|
|
769
|
-
return this.engine.switchChain(
|
|
4123
|
+
async switchChain(chain2) {
|
|
4124
|
+
return this.engine.switchChain(chain2);
|
|
770
4125
|
}
|
|
771
4126
|
// ── Gated async — EIP-1193, signing, chain awareness ───────────────────────
|
|
772
4127
|
async connectEIP1193(provider, info) {
|
|
@@ -812,7 +4167,7 @@ var AwarizonWeb3 = class {
|
|
|
812
4167
|
chain: this.chain,
|
|
813
4168
|
publicClient: this.publicClient,
|
|
814
4169
|
rpcUrl: config.rpcUrl,
|
|
815
|
-
getTransport: (
|
|
4170
|
+
getTransport: (chain2) => getChainTransport(chain2, config.rpcUrl)
|
|
816
4171
|
});
|
|
817
4172
|
this._txEngine = new TransactionEngine(
|
|
818
4173
|
this.publicClient,
|
|
@@ -925,9 +4280,9 @@ var AwarizonWeb3 = class {
|
|
|
925
4280
|
this._engine.disconnectExternal();
|
|
926
4281
|
return this;
|
|
927
4282
|
}
|
|
928
|
-
async switchChain(
|
|
4283
|
+
async switchChain(chain2) {
|
|
929
4284
|
await this._telemetry.ensureValidated();
|
|
930
|
-
const resolved = resolveChain(
|
|
4285
|
+
const resolved = resolveChain(chain2);
|
|
931
4286
|
await this._engine.switchChain(resolved);
|
|
932
4287
|
this._contractCache.clear();
|
|
933
4288
|
return this;
|
|
@@ -1302,7 +4657,18 @@ Currently registered: ${registered}`
|
|
|
1302
4657
|
await this._telemetry.destroy();
|
|
1303
4658
|
}
|
|
1304
4659
|
};
|
|
4660
|
+
/*! Bundled license information:
|
|
4661
|
+
|
|
4662
|
+
@noble/hashes/esm/utils.js:
|
|
4663
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
4664
|
+
|
|
4665
|
+
@scure/base/lib/esm/index.js:
|
|
4666
|
+
(*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
4667
|
+
|
|
4668
|
+
@scure/bip39/esm/index.js:
|
|
4669
|
+
(*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
|
|
4670
|
+
*/
|
|
1305
4671
|
|
|
1306
|
-
export { ApiKeyRequiredError, AwarizonWeb3, CHAINLINK_FEEDS, CHAINS, COINGECKO_IDS, ContractNotLoadedError, ERC1155_ABI, ERC20_ABI, ERC721_ABI, InvalidApiKeyError, NetworkMismatchError, PriceEngine, ProviderError, TelemetryClient, UnsupportedChainError, getChainTransport, getSupportedChainIds, resolveChain };
|
|
4672
|
+
export { ApiKeyRequiredError, AwarizonWeb3, CHAINLINK_FEEDS, CHAINS, COINGECKO_IDS, ChainMismatchError, ChainSwitchError, ContractExecutionError, ContractNotLoadedError, DuplicateFunctionError, ERC1155_ABI, ERC20_ABI, ERC721_ABI, GasEstimationError, InvalidABIError, InvalidApiKeyError, InvalidMnemonicError, InvalidPrivateKeyError, NetworkMismatchError, PriceEngine, ProviderError, SimulationError, TelemetryClient, TransactionEngine, TransactionTimeoutError, UnsupportedABIItemError, UnsupportedChainError, WalletEngine, WalletNotConnectedError, generateAllMethodSignatures, generateMethodSignature, getChainTransport, getSupportedChainIds, isPayableFunction, isWriteFunction, parseABI, resolveChain };
|
|
1307
4673
|
//# sourceMappingURL=index.mjs.map
|
|
1308
4674
|
//# sourceMappingURL=index.mjs.map
|