hd-wallet-wasm 0.1.5 → 0.1.7

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.
@@ -0,0 +1,2183 @@
1
+ /**
2
+ * Auto-generated aligned buffer accessors for HD Wallet WASM
3
+ *
4
+ * DO NOT EDIT - Generated by scripts/generate-aligned.mjs
5
+ * Source: schemas/hd_wallet_aligned.fbs
6
+ */
7
+
8
+ /**
9
+ * Auto-generated aligned buffer accessors
10
+ * Use with WebAssembly.Memory for zero-copy access
11
+ */
12
+
13
+ const Curve = {
14
+ SECP256K1: 0,
15
+ ED25519: 1,
16
+ P256: 2,
17
+ P384: 3,
18
+ X25519: 4,
19
+ };
20
+
21
+ const Error = {
22
+ OK: 0,
23
+ UNKNOWN: 1,
24
+ INVALID_ARGUMENT: 2,
25
+ NOT_SUPPORTED: 3,
26
+ OUT_OF_MEMORY: 4,
27
+ INTERNAL: 5,
28
+ NO_ENTROPY: 100,
29
+ INSUFFICIENT_ENTROPY: 101,
30
+ INVALID_WORD: 200,
31
+ INVALID_CHECKSUM: 201,
32
+ INVALID_MNEMONIC_LENGTH: 202,
33
+ INVALID_ENTROPY_LENGTH: 203,
34
+ INVALID_SEED: 300,
35
+ INVALID_PATH: 301,
36
+ INVALID_CHILD_INDEX: 302,
37
+ HARDENED_FROM_PUBLIC: 303,
38
+ INVALID_EXTENDED_KEY: 304,
39
+ INVALID_PRIVATE_KEY: 400,
40
+ INVALID_PUBLIC_KEY: 401,
41
+ INVALID_SIGNATURE: 402,
42
+ VERIFICATION_FAILED: 403,
43
+ KEY_DERIVATION_FAILED: 404,
44
+ };
45
+
46
+ const AddressType = {
47
+ P2PKH: 0,
48
+ P2SH: 1,
49
+ P2WPKH: 2,
50
+ P2WSH: 3,
51
+ P2TR: 4,
52
+ };
53
+
54
+ const Network = {
55
+ MAINNET: 0,
56
+ TESTNET: 1,
57
+ };
58
+
59
+ const BYTES32_SIZE = 32;
60
+ const BYTES32_ALIGN = 1;
61
+
62
+ const Bytes32Offsets = {
63
+ data: 0,
64
+ };
65
+
66
+ class Bytes32View {
67
+ constructor(buffer, byteOffset = 0) {
68
+ this.view = new DataView(buffer, byteOffset, 32);
69
+ }
70
+
71
+ static fromMemory(memory, ptr) {
72
+ return new Bytes32View(memory.buffer, ptr);
73
+ }
74
+
75
+ static fromBytes(bytes, offset = 0) {
76
+ return new Bytes32View(bytes.buffer, bytes.byteOffset + offset);
77
+ }
78
+
79
+ get data() {
80
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 0, 32);
81
+ }
82
+
83
+ toObject() {
84
+ return {
85
+ data: Array.from(this.data),
86
+ };
87
+ }
88
+
89
+ copyFrom(obj) {
90
+ if (obj.data !== undefined) {
91
+ const arr = this.data;
92
+ const src = obj.data;
93
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
94
+ }
95
+ }
96
+
97
+ static allocate() {
98
+ return new Bytes32View(new ArrayBuffer(32));
99
+ }
100
+
101
+ copyTo(dest, offset = 0) {
102
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 32);
103
+ dest.set(src, offset);
104
+ }
105
+
106
+ getBytes() {
107
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 32);
108
+ }
109
+ }
110
+
111
+ class Bytes32ArrayView {
112
+ constructor(buffer, byteOffset, count) {
113
+ this.buffer = buffer;
114
+ this.baseOffset = byteOffset;
115
+ this.length = count;
116
+ }
117
+
118
+ static fromMemory(memory, ptr, count) {
119
+ return new Bytes32ArrayView(memory.buffer, ptr, count);
120
+ }
121
+
122
+ at(index) {
123
+ if (index < 0 || index >= this.length) {
124
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
125
+ }
126
+ return new Bytes32View(this.buffer, this.baseOffset + index * 32);
127
+ }
128
+
129
+ *[Symbol.iterator]() {
130
+ for (let i = 0; i < this.length; i++) {
131
+ yield this.at(i);
132
+ }
133
+ }
134
+ }
135
+
136
+ const BYTES33_SIZE = 33;
137
+ const BYTES33_ALIGN = 1;
138
+
139
+ const Bytes33Offsets = {
140
+ data: 0,
141
+ };
142
+
143
+ class Bytes33View {
144
+ constructor(buffer, byteOffset = 0) {
145
+ this.view = new DataView(buffer, byteOffset, 33);
146
+ }
147
+
148
+ static fromMemory(memory, ptr) {
149
+ return new Bytes33View(memory.buffer, ptr);
150
+ }
151
+
152
+ static fromBytes(bytes, offset = 0) {
153
+ return new Bytes33View(bytes.buffer, bytes.byteOffset + offset);
154
+ }
155
+
156
+ get data() {
157
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 0, 33);
158
+ }
159
+
160
+ toObject() {
161
+ return {
162
+ data: Array.from(this.data),
163
+ };
164
+ }
165
+
166
+ copyFrom(obj) {
167
+ if (obj.data !== undefined) {
168
+ const arr = this.data;
169
+ const src = obj.data;
170
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
171
+ }
172
+ }
173
+
174
+ static allocate() {
175
+ return new Bytes33View(new ArrayBuffer(33));
176
+ }
177
+
178
+ copyTo(dest, offset = 0) {
179
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 33);
180
+ dest.set(src, offset);
181
+ }
182
+
183
+ getBytes() {
184
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 33);
185
+ }
186
+ }
187
+
188
+ class Bytes33ArrayView {
189
+ constructor(buffer, byteOffset, count) {
190
+ this.buffer = buffer;
191
+ this.baseOffset = byteOffset;
192
+ this.length = count;
193
+ }
194
+
195
+ static fromMemory(memory, ptr, count) {
196
+ return new Bytes33ArrayView(memory.buffer, ptr, count);
197
+ }
198
+
199
+ at(index) {
200
+ if (index < 0 || index >= this.length) {
201
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
202
+ }
203
+ return new Bytes33View(this.buffer, this.baseOffset + index * 33);
204
+ }
205
+
206
+ *[Symbol.iterator]() {
207
+ for (let i = 0; i < this.length; i++) {
208
+ yield this.at(i);
209
+ }
210
+ }
211
+ }
212
+
213
+ const BYTES64_SIZE = 64;
214
+ const BYTES64_ALIGN = 1;
215
+
216
+ const Bytes64Offsets = {
217
+ data: 0,
218
+ };
219
+
220
+ class Bytes64View {
221
+ constructor(buffer, byteOffset = 0) {
222
+ this.view = new DataView(buffer, byteOffset, 64);
223
+ }
224
+
225
+ static fromMemory(memory, ptr) {
226
+ return new Bytes64View(memory.buffer, ptr);
227
+ }
228
+
229
+ static fromBytes(bytes, offset = 0) {
230
+ return new Bytes64View(bytes.buffer, bytes.byteOffset + offset);
231
+ }
232
+
233
+ get data() {
234
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 0, 64);
235
+ }
236
+
237
+ toObject() {
238
+ return {
239
+ data: Array.from(this.data),
240
+ };
241
+ }
242
+
243
+ copyFrom(obj) {
244
+ if (obj.data !== undefined) {
245
+ const arr = this.data;
246
+ const src = obj.data;
247
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
248
+ }
249
+ }
250
+
251
+ static allocate() {
252
+ return new Bytes64View(new ArrayBuffer(64));
253
+ }
254
+
255
+ copyTo(dest, offset = 0) {
256
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 64);
257
+ dest.set(src, offset);
258
+ }
259
+
260
+ getBytes() {
261
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 64);
262
+ }
263
+ }
264
+
265
+ class Bytes64ArrayView {
266
+ constructor(buffer, byteOffset, count) {
267
+ this.buffer = buffer;
268
+ this.baseOffset = byteOffset;
269
+ this.length = count;
270
+ }
271
+
272
+ static fromMemory(memory, ptr, count) {
273
+ return new Bytes64ArrayView(memory.buffer, ptr, count);
274
+ }
275
+
276
+ at(index) {
277
+ if (index < 0 || index >= this.length) {
278
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
279
+ }
280
+ return new Bytes64View(this.buffer, this.baseOffset + index * 64);
281
+ }
282
+
283
+ *[Symbol.iterator]() {
284
+ for (let i = 0; i < this.length; i++) {
285
+ yield this.at(i);
286
+ }
287
+ }
288
+ }
289
+
290
+ const EXTENDEDKEYDATA_SIZE = 116;
291
+ const EXTENDEDKEYDATA_ALIGN = 4;
292
+
293
+ const ExtendedKeyDataOffsets = {
294
+ curve: 0,
295
+ depth: 1,
296
+ _pad0: 2,
297
+ parent_fingerprint: 4,
298
+ child_index: 8,
299
+ chain_code_data: 12,
300
+ public_key_data: 44,
301
+ _pad1: 77,
302
+ private_key_data: 80,
303
+ has_private_key: 112,
304
+ _pad2: 113,
305
+ };
306
+
307
+ class ExtendedKeyDataView {
308
+ constructor(buffer, byteOffset = 0) {
309
+ this.view = new DataView(buffer, byteOffset, 116);
310
+ }
311
+
312
+ static fromMemory(memory, ptr) {
313
+ return new ExtendedKeyDataView(memory.buffer, ptr);
314
+ }
315
+
316
+ static fromBytes(bytes, offset = 0) {
317
+ return new ExtendedKeyDataView(bytes.buffer, bytes.byteOffset + offset);
318
+ }
319
+
320
+ get curve() {
321
+ return this.view.getUint8(0);
322
+ }
323
+ set curve(v) {
324
+ this.view.setUint8(0, v);
325
+ }
326
+
327
+ get depth() {
328
+ return this.view.getUint8(1);
329
+ }
330
+ set depth(v) {
331
+ this.view.setUint8(1, v);
332
+ }
333
+
334
+ get _pad0() {
335
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 2, 2);
336
+ }
337
+
338
+ get parent_fingerprint() {
339
+ return this.view.getUint32(4, true);
340
+ }
341
+ set parent_fingerprint(v) {
342
+ this.view.setUint32(4, v, true);
343
+ }
344
+
345
+ get child_index() {
346
+ return this.view.getUint32(8, true);
347
+ }
348
+ set child_index(v) {
349
+ this.view.setUint32(8, v, true);
350
+ }
351
+
352
+ get chain_code_data() {
353
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 12, 32);
354
+ }
355
+
356
+ get public_key_data() {
357
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 44, 33);
358
+ }
359
+
360
+ get _pad1() {
361
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 77, 3);
362
+ }
363
+
364
+ get private_key_data() {
365
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 80, 32);
366
+ }
367
+
368
+ get has_private_key() {
369
+ return this.view.getUint8(112);
370
+ }
371
+ set has_private_key(v) {
372
+ this.view.setUint8(112, v);
373
+ }
374
+
375
+ get _pad2() {
376
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 113, 3);
377
+ }
378
+
379
+ toObject() {
380
+ return {
381
+ curve: this.curve,
382
+ depth: this.depth,
383
+ _pad0: Array.from(this._pad0),
384
+ parent_fingerprint: this.parent_fingerprint,
385
+ child_index: this.child_index,
386
+ chain_code_data: Array.from(this.chain_code_data),
387
+ public_key_data: Array.from(this.public_key_data),
388
+ _pad1: Array.from(this._pad1),
389
+ private_key_data: Array.from(this.private_key_data),
390
+ has_private_key: this.has_private_key,
391
+ _pad2: Array.from(this._pad2),
392
+ };
393
+ }
394
+
395
+ copyFrom(obj) {
396
+ if (obj.curve !== undefined) this.curve = obj.curve;
397
+ if (obj.depth !== undefined) this.depth = obj.depth;
398
+ if (obj._pad0 !== undefined) {
399
+ const arr = this._pad0;
400
+ const src = obj._pad0;
401
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
402
+ }
403
+ if (obj.parent_fingerprint !== undefined) this.parent_fingerprint = obj.parent_fingerprint;
404
+ if (obj.child_index !== undefined) this.child_index = obj.child_index;
405
+ if (obj.chain_code_data !== undefined) {
406
+ const arr = this.chain_code_data;
407
+ const src = obj.chain_code_data;
408
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
409
+ }
410
+ if (obj.public_key_data !== undefined) {
411
+ const arr = this.public_key_data;
412
+ const src = obj.public_key_data;
413
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
414
+ }
415
+ if (obj._pad1 !== undefined) {
416
+ const arr = this._pad1;
417
+ const src = obj._pad1;
418
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
419
+ }
420
+ if (obj.private_key_data !== undefined) {
421
+ const arr = this.private_key_data;
422
+ const src = obj.private_key_data;
423
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
424
+ }
425
+ if (obj.has_private_key !== undefined) this.has_private_key = obj.has_private_key;
426
+ if (obj._pad2 !== undefined) {
427
+ const arr = this._pad2;
428
+ const src = obj._pad2;
429
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
430
+ }
431
+ }
432
+
433
+ static allocate() {
434
+ return new ExtendedKeyDataView(new ArrayBuffer(116));
435
+ }
436
+
437
+ copyTo(dest, offset = 0) {
438
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 116);
439
+ dest.set(src, offset);
440
+ }
441
+
442
+ getBytes() {
443
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 116);
444
+ }
445
+ }
446
+
447
+ class ExtendedKeyDataArrayView {
448
+ constructor(buffer, byteOffset, count) {
449
+ this.buffer = buffer;
450
+ this.baseOffset = byteOffset;
451
+ this.length = count;
452
+ }
453
+
454
+ static fromMemory(memory, ptr, count) {
455
+ return new ExtendedKeyDataArrayView(memory.buffer, ptr, count);
456
+ }
457
+
458
+ at(index) {
459
+ if (index < 0 || index >= this.length) {
460
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
461
+ }
462
+ return new ExtendedKeyDataView(this.buffer, this.baseOffset + index * 116);
463
+ }
464
+
465
+ *[Symbol.iterator]() {
466
+ for (let i = 0; i < this.length; i++) {
467
+ yield this.at(i);
468
+ }
469
+ }
470
+ }
471
+
472
+ const BATCHDERIVEREQUEST_SIZE = 132;
473
+ const BATCHDERIVEREQUEST_ALIGN = 4;
474
+
475
+ const BatchDeriveRequestOffsets = {
476
+ base_key_curve: 0,
477
+ base_key_depth: 1,
478
+ base_key__pad0: 2,
479
+ base_key_parent_fingerprint: 4,
480
+ base_key_child_index: 8,
481
+ base_key_chain_code_data: 12,
482
+ base_key_public_key_data: 44,
483
+ base_key__pad1: 77,
484
+ base_key_private_key_data: 80,
485
+ base_key_has_private_key: 112,
486
+ base_key__pad2: 113,
487
+ start_index: 116,
488
+ count: 120,
489
+ hardened: 124,
490
+ _pad: 125,
491
+ };
492
+
493
+ class BatchDeriveRequestView {
494
+ constructor(buffer, byteOffset = 0) {
495
+ this.view = new DataView(buffer, byteOffset, 132);
496
+ }
497
+
498
+ static fromMemory(memory, ptr) {
499
+ return new BatchDeriveRequestView(memory.buffer, ptr);
500
+ }
501
+
502
+ static fromBytes(bytes, offset = 0) {
503
+ return new BatchDeriveRequestView(bytes.buffer, bytes.byteOffset + offset);
504
+ }
505
+
506
+ get base_key_curve() {
507
+ return this.view.getUint8(0);
508
+ }
509
+ set base_key_curve(v) {
510
+ this.view.setUint8(0, v);
511
+ }
512
+
513
+ get base_key_depth() {
514
+ return this.view.getUint8(1);
515
+ }
516
+ set base_key_depth(v) {
517
+ this.view.setUint8(1, v);
518
+ }
519
+
520
+ get base_key__pad0() {
521
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 2, 2);
522
+ }
523
+
524
+ get base_key_parent_fingerprint() {
525
+ return this.view.getUint32(4, true);
526
+ }
527
+ set base_key_parent_fingerprint(v) {
528
+ this.view.setUint32(4, v, true);
529
+ }
530
+
531
+ get base_key_child_index() {
532
+ return this.view.getUint32(8, true);
533
+ }
534
+ set base_key_child_index(v) {
535
+ this.view.setUint32(8, v, true);
536
+ }
537
+
538
+ get base_key_chain_code_data() {
539
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 12, 32);
540
+ }
541
+
542
+ get base_key_public_key_data() {
543
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 44, 33);
544
+ }
545
+
546
+ get base_key__pad1() {
547
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 77, 3);
548
+ }
549
+
550
+ get base_key_private_key_data() {
551
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 80, 32);
552
+ }
553
+
554
+ get base_key_has_private_key() {
555
+ return this.view.getUint8(112);
556
+ }
557
+ set base_key_has_private_key(v) {
558
+ this.view.setUint8(112, v);
559
+ }
560
+
561
+ get base_key__pad2() {
562
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 113, 3);
563
+ }
564
+
565
+ get start_index() {
566
+ return this.view.getUint32(116, true);
567
+ }
568
+ set start_index(v) {
569
+ this.view.setUint32(116, v, true);
570
+ }
571
+
572
+ get count() {
573
+ return this.view.getUint32(120, true);
574
+ }
575
+ set count(v) {
576
+ this.view.setUint32(120, v, true);
577
+ }
578
+
579
+ get hardened() {
580
+ return this.view.getUint8(124);
581
+ }
582
+ set hardened(v) {
583
+ this.view.setUint8(124, v);
584
+ }
585
+
586
+ get _pad() {
587
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 125, 7);
588
+ }
589
+
590
+ toObject() {
591
+ return {
592
+ base_key_curve: this.base_key_curve,
593
+ base_key_depth: this.base_key_depth,
594
+ base_key__pad0: Array.from(this.base_key__pad0),
595
+ base_key_parent_fingerprint: this.base_key_parent_fingerprint,
596
+ base_key_child_index: this.base_key_child_index,
597
+ base_key_chain_code_data: Array.from(this.base_key_chain_code_data),
598
+ base_key_public_key_data: Array.from(this.base_key_public_key_data),
599
+ base_key__pad1: Array.from(this.base_key__pad1),
600
+ base_key_private_key_data: Array.from(this.base_key_private_key_data),
601
+ base_key_has_private_key: this.base_key_has_private_key,
602
+ base_key__pad2: Array.from(this.base_key__pad2),
603
+ start_index: this.start_index,
604
+ count: this.count,
605
+ hardened: this.hardened,
606
+ _pad: Array.from(this._pad),
607
+ };
608
+ }
609
+
610
+ copyFrom(obj) {
611
+ if (obj.base_key_curve !== undefined) this.base_key_curve = obj.base_key_curve;
612
+ if (obj.base_key_depth !== undefined) this.base_key_depth = obj.base_key_depth;
613
+ if (obj.base_key__pad0 !== undefined) {
614
+ const arr = this.base_key__pad0;
615
+ const src = obj.base_key__pad0;
616
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
617
+ }
618
+ if (obj.base_key_parent_fingerprint !== undefined) this.base_key_parent_fingerprint = obj.base_key_parent_fingerprint;
619
+ if (obj.base_key_child_index !== undefined) this.base_key_child_index = obj.base_key_child_index;
620
+ if (obj.base_key_chain_code_data !== undefined) {
621
+ const arr = this.base_key_chain_code_data;
622
+ const src = obj.base_key_chain_code_data;
623
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
624
+ }
625
+ if (obj.base_key_public_key_data !== undefined) {
626
+ const arr = this.base_key_public_key_data;
627
+ const src = obj.base_key_public_key_data;
628
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
629
+ }
630
+ if (obj.base_key__pad1 !== undefined) {
631
+ const arr = this.base_key__pad1;
632
+ const src = obj.base_key__pad1;
633
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
634
+ }
635
+ if (obj.base_key_private_key_data !== undefined) {
636
+ const arr = this.base_key_private_key_data;
637
+ const src = obj.base_key_private_key_data;
638
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
639
+ }
640
+ if (obj.base_key_has_private_key !== undefined) this.base_key_has_private_key = obj.base_key_has_private_key;
641
+ if (obj.base_key__pad2 !== undefined) {
642
+ const arr = this.base_key__pad2;
643
+ const src = obj.base_key__pad2;
644
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
645
+ }
646
+ if (obj.start_index !== undefined) this.start_index = obj.start_index;
647
+ if (obj.count !== undefined) this.count = obj.count;
648
+ if (obj.hardened !== undefined) this.hardened = obj.hardened;
649
+ if (obj._pad !== undefined) {
650
+ const arr = this._pad;
651
+ const src = obj._pad;
652
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
653
+ }
654
+ }
655
+
656
+ static allocate() {
657
+ return new BatchDeriveRequestView(new ArrayBuffer(132));
658
+ }
659
+
660
+ copyTo(dest, offset = 0) {
661
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 132);
662
+ dest.set(src, offset);
663
+ }
664
+
665
+ getBytes() {
666
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 132);
667
+ }
668
+ }
669
+
670
+ class BatchDeriveRequestArrayView {
671
+ constructor(buffer, byteOffset, count) {
672
+ this.buffer = buffer;
673
+ this.baseOffset = byteOffset;
674
+ this.length = count;
675
+ }
676
+
677
+ static fromMemory(memory, ptr, count) {
678
+ return new BatchDeriveRequestArrayView(memory.buffer, ptr, count);
679
+ }
680
+
681
+ at(index) {
682
+ if (index < 0 || index >= this.length) {
683
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
684
+ }
685
+ return new BatchDeriveRequestView(this.buffer, this.baseOffset + index * 132);
686
+ }
687
+
688
+ *[Symbol.iterator]() {
689
+ for (let i = 0; i < this.length; i++) {
690
+ yield this.at(i);
691
+ }
692
+ }
693
+ }
694
+
695
+ const DERIVEDKEYENTRY_SIZE = 76;
696
+ const DERIVEDKEYENTRY_ALIGN = 4;
697
+
698
+ const DerivedKeyEntryOffsets = {
699
+ index: 0,
700
+ error: 4,
701
+ public_key_data: 8,
702
+ _pad0: 41,
703
+ private_key_data: 44,
704
+ };
705
+
706
+ class DerivedKeyEntryView {
707
+ constructor(buffer, byteOffset = 0) {
708
+ this.view = new DataView(buffer, byteOffset, 76);
709
+ }
710
+
711
+ static fromMemory(memory, ptr) {
712
+ return new DerivedKeyEntryView(memory.buffer, ptr);
713
+ }
714
+
715
+ static fromBytes(bytes, offset = 0) {
716
+ return new DerivedKeyEntryView(bytes.buffer, bytes.byteOffset + offset);
717
+ }
718
+
719
+ get index() {
720
+ return this.view.getUint32(0, true);
721
+ }
722
+ set index(v) {
723
+ this.view.setUint32(0, v, true);
724
+ }
725
+
726
+ get error() {
727
+ return this.view.getInt32(4, true);
728
+ }
729
+ set error(v) {
730
+ this.view.setInt32(4, v, true);
731
+ }
732
+
733
+ get public_key_data() {
734
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 8, 33);
735
+ }
736
+
737
+ get _pad0() {
738
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 41, 3);
739
+ }
740
+
741
+ get private_key_data() {
742
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 44, 32);
743
+ }
744
+
745
+ toObject() {
746
+ return {
747
+ index: this.index,
748
+ error: this.error,
749
+ public_key_data: Array.from(this.public_key_data),
750
+ _pad0: Array.from(this._pad0),
751
+ private_key_data: Array.from(this.private_key_data),
752
+ };
753
+ }
754
+
755
+ copyFrom(obj) {
756
+ if (obj.index !== undefined) this.index = obj.index;
757
+ if (obj.error !== undefined) this.error = obj.error;
758
+ if (obj.public_key_data !== undefined) {
759
+ const arr = this.public_key_data;
760
+ const src = obj.public_key_data;
761
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
762
+ }
763
+ if (obj._pad0 !== undefined) {
764
+ const arr = this._pad0;
765
+ const src = obj._pad0;
766
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
767
+ }
768
+ if (obj.private_key_data !== undefined) {
769
+ const arr = this.private_key_data;
770
+ const src = obj.private_key_data;
771
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
772
+ }
773
+ }
774
+
775
+ static allocate() {
776
+ return new DerivedKeyEntryView(new ArrayBuffer(76));
777
+ }
778
+
779
+ copyTo(dest, offset = 0) {
780
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 76);
781
+ dest.set(src, offset);
782
+ }
783
+
784
+ getBytes() {
785
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 76);
786
+ }
787
+ }
788
+
789
+ class DerivedKeyEntryArrayView {
790
+ constructor(buffer, byteOffset, count) {
791
+ this.buffer = buffer;
792
+ this.baseOffset = byteOffset;
793
+ this.length = count;
794
+ }
795
+
796
+ static fromMemory(memory, ptr, count) {
797
+ return new DerivedKeyEntryArrayView(memory.buffer, ptr, count);
798
+ }
799
+
800
+ at(index) {
801
+ if (index < 0 || index >= this.length) {
802
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
803
+ }
804
+ return new DerivedKeyEntryView(this.buffer, this.baseOffset + index * 76);
805
+ }
806
+
807
+ *[Symbol.iterator]() {
808
+ for (let i = 0; i < this.length; i++) {
809
+ yield this.at(i);
810
+ }
811
+ }
812
+ }
813
+
814
+ const BATCHSIGNREQUEST_SIZE = 40;
815
+ const BATCHSIGNREQUEST_ALIGN = 4;
816
+
817
+ const BatchSignRequestOffsets = {
818
+ private_key_data: 0,
819
+ curve: 32,
820
+ _pad: 33,
821
+ count: 36,
822
+ };
823
+
824
+ class BatchSignRequestView {
825
+ constructor(buffer, byteOffset = 0) {
826
+ this.view = new DataView(buffer, byteOffset, 40);
827
+ }
828
+
829
+ static fromMemory(memory, ptr) {
830
+ return new BatchSignRequestView(memory.buffer, ptr);
831
+ }
832
+
833
+ static fromBytes(bytes, offset = 0) {
834
+ return new BatchSignRequestView(bytes.buffer, bytes.byteOffset + offset);
835
+ }
836
+
837
+ get private_key_data() {
838
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 0, 32);
839
+ }
840
+
841
+ get curve() {
842
+ return this.view.getUint8(32);
843
+ }
844
+ set curve(v) {
845
+ this.view.setUint8(32, v);
846
+ }
847
+
848
+ get _pad() {
849
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 33, 3);
850
+ }
851
+
852
+ get count() {
853
+ return this.view.getUint32(36, true);
854
+ }
855
+ set count(v) {
856
+ this.view.setUint32(36, v, true);
857
+ }
858
+
859
+ toObject() {
860
+ return {
861
+ private_key_data: Array.from(this.private_key_data),
862
+ curve: this.curve,
863
+ _pad: Array.from(this._pad),
864
+ count: this.count,
865
+ };
866
+ }
867
+
868
+ copyFrom(obj) {
869
+ if (obj.private_key_data !== undefined) {
870
+ const arr = this.private_key_data;
871
+ const src = obj.private_key_data;
872
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
873
+ }
874
+ if (obj.curve !== undefined) this.curve = obj.curve;
875
+ if (obj._pad !== undefined) {
876
+ const arr = this._pad;
877
+ const src = obj._pad;
878
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
879
+ }
880
+ if (obj.count !== undefined) this.count = obj.count;
881
+ }
882
+
883
+ static allocate() {
884
+ return new BatchSignRequestView(new ArrayBuffer(40));
885
+ }
886
+
887
+ copyTo(dest, offset = 0) {
888
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 40);
889
+ dest.set(src, offset);
890
+ }
891
+
892
+ getBytes() {
893
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 40);
894
+ }
895
+ }
896
+
897
+ class BatchSignRequestArrayView {
898
+ constructor(buffer, byteOffset, count) {
899
+ this.buffer = buffer;
900
+ this.baseOffset = byteOffset;
901
+ this.length = count;
902
+ }
903
+
904
+ static fromMemory(memory, ptr, count) {
905
+ return new BatchSignRequestArrayView(memory.buffer, ptr, count);
906
+ }
907
+
908
+ at(index) {
909
+ if (index < 0 || index >= this.length) {
910
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
911
+ }
912
+ return new BatchSignRequestView(this.buffer, this.baseOffset + index * 40);
913
+ }
914
+
915
+ *[Symbol.iterator]() {
916
+ for (let i = 0; i < this.length; i++) {
917
+ yield this.at(i);
918
+ }
919
+ }
920
+ }
921
+
922
+ const HASHENTRY_SIZE = 36;
923
+ const HASHENTRY_ALIGN = 4;
924
+
925
+ const HashEntryOffsets = {
926
+ index: 0,
927
+ hash_data: 4,
928
+ };
929
+
930
+ class HashEntryView {
931
+ constructor(buffer, byteOffset = 0) {
932
+ this.view = new DataView(buffer, byteOffset, 36);
933
+ }
934
+
935
+ static fromMemory(memory, ptr) {
936
+ return new HashEntryView(memory.buffer, ptr);
937
+ }
938
+
939
+ static fromBytes(bytes, offset = 0) {
940
+ return new HashEntryView(bytes.buffer, bytes.byteOffset + offset);
941
+ }
942
+
943
+ get index() {
944
+ return this.view.getUint32(0, true);
945
+ }
946
+ set index(v) {
947
+ this.view.setUint32(0, v, true);
948
+ }
949
+
950
+ get hash_data() {
951
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 4, 32);
952
+ }
953
+
954
+ toObject() {
955
+ return {
956
+ index: this.index,
957
+ hash_data: Array.from(this.hash_data),
958
+ };
959
+ }
960
+
961
+ copyFrom(obj) {
962
+ if (obj.index !== undefined) this.index = obj.index;
963
+ if (obj.hash_data !== undefined) {
964
+ const arr = this.hash_data;
965
+ const src = obj.hash_data;
966
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
967
+ }
968
+ }
969
+
970
+ static allocate() {
971
+ return new HashEntryView(new ArrayBuffer(36));
972
+ }
973
+
974
+ copyTo(dest, offset = 0) {
975
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 36);
976
+ dest.set(src, offset);
977
+ }
978
+
979
+ getBytes() {
980
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 36);
981
+ }
982
+ }
983
+
984
+ class HashEntryArrayView {
985
+ constructor(buffer, byteOffset, count) {
986
+ this.buffer = buffer;
987
+ this.baseOffset = byteOffset;
988
+ this.length = count;
989
+ }
990
+
991
+ static fromMemory(memory, ptr, count) {
992
+ return new HashEntryArrayView(memory.buffer, ptr, count);
993
+ }
994
+
995
+ at(index) {
996
+ if (index < 0 || index >= this.length) {
997
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
998
+ }
999
+ return new HashEntryView(this.buffer, this.baseOffset + index * 36);
1000
+ }
1001
+
1002
+ *[Symbol.iterator]() {
1003
+ for (let i = 0; i < this.length; i++) {
1004
+ yield this.at(i);
1005
+ }
1006
+ }
1007
+ }
1008
+
1009
+ const SIGNATUREENTRY_SIZE = 76;
1010
+ const SIGNATUREENTRY_ALIGN = 4;
1011
+
1012
+ const SignatureEntryOffsets = {
1013
+ index: 0,
1014
+ error: 4,
1015
+ signature_data: 8,
1016
+ recovery_id: 72,
1017
+ _pad: 73,
1018
+ };
1019
+
1020
+ class SignatureEntryView {
1021
+ constructor(buffer, byteOffset = 0) {
1022
+ this.view = new DataView(buffer, byteOffset, 76);
1023
+ }
1024
+
1025
+ static fromMemory(memory, ptr) {
1026
+ return new SignatureEntryView(memory.buffer, ptr);
1027
+ }
1028
+
1029
+ static fromBytes(bytes, offset = 0) {
1030
+ return new SignatureEntryView(bytes.buffer, bytes.byteOffset + offset);
1031
+ }
1032
+
1033
+ get index() {
1034
+ return this.view.getUint32(0, true);
1035
+ }
1036
+ set index(v) {
1037
+ this.view.setUint32(0, v, true);
1038
+ }
1039
+
1040
+ get error() {
1041
+ return this.view.getInt32(4, true);
1042
+ }
1043
+ set error(v) {
1044
+ this.view.setInt32(4, v, true);
1045
+ }
1046
+
1047
+ get signature_data() {
1048
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 8, 64);
1049
+ }
1050
+
1051
+ get recovery_id() {
1052
+ return this.view.getInt8(72);
1053
+ }
1054
+ set recovery_id(v) {
1055
+ this.view.setInt8(72, v);
1056
+ }
1057
+
1058
+ get _pad() {
1059
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 73, 3);
1060
+ }
1061
+
1062
+ toObject() {
1063
+ return {
1064
+ index: this.index,
1065
+ error: this.error,
1066
+ signature_data: Array.from(this.signature_data),
1067
+ recovery_id: this.recovery_id,
1068
+ _pad: Array.from(this._pad),
1069
+ };
1070
+ }
1071
+
1072
+ copyFrom(obj) {
1073
+ if (obj.index !== undefined) this.index = obj.index;
1074
+ if (obj.error !== undefined) this.error = obj.error;
1075
+ if (obj.signature_data !== undefined) {
1076
+ const arr = this.signature_data;
1077
+ const src = obj.signature_data;
1078
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1079
+ }
1080
+ if (obj.recovery_id !== undefined) this.recovery_id = obj.recovery_id;
1081
+ if (obj._pad !== undefined) {
1082
+ const arr = this._pad;
1083
+ const src = obj._pad;
1084
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1085
+ }
1086
+ }
1087
+
1088
+ static allocate() {
1089
+ return new SignatureEntryView(new ArrayBuffer(76));
1090
+ }
1091
+
1092
+ copyTo(dest, offset = 0) {
1093
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 76);
1094
+ dest.set(src, offset);
1095
+ }
1096
+
1097
+ getBytes() {
1098
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 76);
1099
+ }
1100
+ }
1101
+
1102
+ class SignatureEntryArrayView {
1103
+ constructor(buffer, byteOffset, count) {
1104
+ this.buffer = buffer;
1105
+ this.baseOffset = byteOffset;
1106
+ this.length = count;
1107
+ }
1108
+
1109
+ static fromMemory(memory, ptr, count) {
1110
+ return new SignatureEntryArrayView(memory.buffer, ptr, count);
1111
+ }
1112
+
1113
+ at(index) {
1114
+ if (index < 0 || index >= this.length) {
1115
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
1116
+ }
1117
+ return new SignatureEntryView(this.buffer, this.baseOffset + index * 76);
1118
+ }
1119
+
1120
+ *[Symbol.iterator]() {
1121
+ for (let i = 0; i < this.length; i++) {
1122
+ yield this.at(i);
1123
+ }
1124
+ }
1125
+ }
1126
+
1127
+ const BATCHVERIFYREQUEST_SIZE = 44;
1128
+ const BATCHVERIFYREQUEST_ALIGN = 4;
1129
+
1130
+ const BatchVerifyRequestOffsets = {
1131
+ public_key_data: 0,
1132
+ _pad0: 33,
1133
+ curve: 36,
1134
+ _pad1: 37,
1135
+ count: 40,
1136
+ };
1137
+
1138
+ class BatchVerifyRequestView {
1139
+ constructor(buffer, byteOffset = 0) {
1140
+ this.view = new DataView(buffer, byteOffset, 44);
1141
+ }
1142
+
1143
+ static fromMemory(memory, ptr) {
1144
+ return new BatchVerifyRequestView(memory.buffer, ptr);
1145
+ }
1146
+
1147
+ static fromBytes(bytes, offset = 0) {
1148
+ return new BatchVerifyRequestView(bytes.buffer, bytes.byteOffset + offset);
1149
+ }
1150
+
1151
+ get public_key_data() {
1152
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 0, 33);
1153
+ }
1154
+
1155
+ get _pad0() {
1156
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 33, 3);
1157
+ }
1158
+
1159
+ get curve() {
1160
+ return this.view.getUint8(36);
1161
+ }
1162
+ set curve(v) {
1163
+ this.view.setUint8(36, v);
1164
+ }
1165
+
1166
+ get _pad1() {
1167
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 37, 3);
1168
+ }
1169
+
1170
+ get count() {
1171
+ return this.view.getUint32(40, true);
1172
+ }
1173
+ set count(v) {
1174
+ this.view.setUint32(40, v, true);
1175
+ }
1176
+
1177
+ toObject() {
1178
+ return {
1179
+ public_key_data: Array.from(this.public_key_data),
1180
+ _pad0: Array.from(this._pad0),
1181
+ curve: this.curve,
1182
+ _pad1: Array.from(this._pad1),
1183
+ count: this.count,
1184
+ };
1185
+ }
1186
+
1187
+ copyFrom(obj) {
1188
+ if (obj.public_key_data !== undefined) {
1189
+ const arr = this.public_key_data;
1190
+ const src = obj.public_key_data;
1191
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1192
+ }
1193
+ if (obj._pad0 !== undefined) {
1194
+ const arr = this._pad0;
1195
+ const src = obj._pad0;
1196
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1197
+ }
1198
+ if (obj.curve !== undefined) this.curve = obj.curve;
1199
+ if (obj._pad1 !== undefined) {
1200
+ const arr = this._pad1;
1201
+ const src = obj._pad1;
1202
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1203
+ }
1204
+ if (obj.count !== undefined) this.count = obj.count;
1205
+ }
1206
+
1207
+ static allocate() {
1208
+ return new BatchVerifyRequestView(new ArrayBuffer(44));
1209
+ }
1210
+
1211
+ copyTo(dest, offset = 0) {
1212
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 44);
1213
+ dest.set(src, offset);
1214
+ }
1215
+
1216
+ getBytes() {
1217
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 44);
1218
+ }
1219
+ }
1220
+
1221
+ class BatchVerifyRequestArrayView {
1222
+ constructor(buffer, byteOffset, count) {
1223
+ this.buffer = buffer;
1224
+ this.baseOffset = byteOffset;
1225
+ this.length = count;
1226
+ }
1227
+
1228
+ static fromMemory(memory, ptr, count) {
1229
+ return new BatchVerifyRequestArrayView(memory.buffer, ptr, count);
1230
+ }
1231
+
1232
+ at(index) {
1233
+ if (index < 0 || index >= this.length) {
1234
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
1235
+ }
1236
+ return new BatchVerifyRequestView(this.buffer, this.baseOffset + index * 44);
1237
+ }
1238
+
1239
+ *[Symbol.iterator]() {
1240
+ for (let i = 0; i < this.length; i++) {
1241
+ yield this.at(i);
1242
+ }
1243
+ }
1244
+ }
1245
+
1246
+ const VERIFYENTRY_SIZE = 100;
1247
+ const VERIFYENTRY_ALIGN = 4;
1248
+
1249
+ const VerifyEntryOffsets = {
1250
+ index: 0,
1251
+ hash_data: 4,
1252
+ signature_data: 36,
1253
+ };
1254
+
1255
+ class VerifyEntryView {
1256
+ constructor(buffer, byteOffset = 0) {
1257
+ this.view = new DataView(buffer, byteOffset, 100);
1258
+ }
1259
+
1260
+ static fromMemory(memory, ptr) {
1261
+ return new VerifyEntryView(memory.buffer, ptr);
1262
+ }
1263
+
1264
+ static fromBytes(bytes, offset = 0) {
1265
+ return new VerifyEntryView(bytes.buffer, bytes.byteOffset + offset);
1266
+ }
1267
+
1268
+ get index() {
1269
+ return this.view.getUint32(0, true);
1270
+ }
1271
+ set index(v) {
1272
+ this.view.setUint32(0, v, true);
1273
+ }
1274
+
1275
+ get hash_data() {
1276
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 4, 32);
1277
+ }
1278
+
1279
+ get signature_data() {
1280
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 36, 64);
1281
+ }
1282
+
1283
+ toObject() {
1284
+ return {
1285
+ index: this.index,
1286
+ hash_data: Array.from(this.hash_data),
1287
+ signature_data: Array.from(this.signature_data),
1288
+ };
1289
+ }
1290
+
1291
+ copyFrom(obj) {
1292
+ if (obj.index !== undefined) this.index = obj.index;
1293
+ if (obj.hash_data !== undefined) {
1294
+ const arr = this.hash_data;
1295
+ const src = obj.hash_data;
1296
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1297
+ }
1298
+ if (obj.signature_data !== undefined) {
1299
+ const arr = this.signature_data;
1300
+ const src = obj.signature_data;
1301
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1302
+ }
1303
+ }
1304
+
1305
+ static allocate() {
1306
+ return new VerifyEntryView(new ArrayBuffer(100));
1307
+ }
1308
+
1309
+ copyTo(dest, offset = 0) {
1310
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 100);
1311
+ dest.set(src, offset);
1312
+ }
1313
+
1314
+ getBytes() {
1315
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 100);
1316
+ }
1317
+ }
1318
+
1319
+ class VerifyEntryArrayView {
1320
+ constructor(buffer, byteOffset, count) {
1321
+ this.buffer = buffer;
1322
+ this.baseOffset = byteOffset;
1323
+ this.length = count;
1324
+ }
1325
+
1326
+ static fromMemory(memory, ptr, count) {
1327
+ return new VerifyEntryArrayView(memory.buffer, ptr, count);
1328
+ }
1329
+
1330
+ at(index) {
1331
+ if (index < 0 || index >= this.length) {
1332
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
1333
+ }
1334
+ return new VerifyEntryView(this.buffer, this.baseOffset + index * 100);
1335
+ }
1336
+
1337
+ *[Symbol.iterator]() {
1338
+ for (let i = 0; i < this.length; i++) {
1339
+ yield this.at(i);
1340
+ }
1341
+ }
1342
+ }
1343
+
1344
+ const VERIFYRESULTENTRY_SIZE = 8;
1345
+ const VERIFYRESULTENTRY_ALIGN = 4;
1346
+
1347
+ const VerifyResultEntryOffsets = {
1348
+ index: 0,
1349
+ error: 4,
1350
+ };
1351
+
1352
+ class VerifyResultEntryView {
1353
+ constructor(buffer, byteOffset = 0) {
1354
+ this.view = new DataView(buffer, byteOffset, 8);
1355
+ }
1356
+
1357
+ static fromMemory(memory, ptr) {
1358
+ return new VerifyResultEntryView(memory.buffer, ptr);
1359
+ }
1360
+
1361
+ static fromBytes(bytes, offset = 0) {
1362
+ return new VerifyResultEntryView(bytes.buffer, bytes.byteOffset + offset);
1363
+ }
1364
+
1365
+ get index() {
1366
+ return this.view.getUint32(0, true);
1367
+ }
1368
+ set index(v) {
1369
+ this.view.setUint32(0, v, true);
1370
+ }
1371
+
1372
+ get error() {
1373
+ return this.view.getInt32(4, true);
1374
+ }
1375
+ set error(v) {
1376
+ this.view.setInt32(4, v, true);
1377
+ }
1378
+
1379
+ toObject() {
1380
+ return {
1381
+ index: this.index,
1382
+ error: this.error,
1383
+ };
1384
+ }
1385
+
1386
+ copyFrom(obj) {
1387
+ if (obj.index !== undefined) this.index = obj.index;
1388
+ if (obj.error !== undefined) this.error = obj.error;
1389
+ }
1390
+
1391
+ static allocate() {
1392
+ return new VerifyResultEntryView(new ArrayBuffer(8));
1393
+ }
1394
+
1395
+ copyTo(dest, offset = 0) {
1396
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 8);
1397
+ dest.set(src, offset);
1398
+ }
1399
+
1400
+ getBytes() {
1401
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 8);
1402
+ }
1403
+ }
1404
+
1405
+ class VerifyResultEntryArrayView {
1406
+ constructor(buffer, byteOffset, count) {
1407
+ this.buffer = buffer;
1408
+ this.baseOffset = byteOffset;
1409
+ this.length = count;
1410
+ }
1411
+
1412
+ static fromMemory(memory, ptr, count) {
1413
+ return new VerifyResultEntryArrayView(memory.buffer, ptr, count);
1414
+ }
1415
+
1416
+ at(index) {
1417
+ if (index < 0 || index >= this.length) {
1418
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
1419
+ }
1420
+ return new VerifyResultEntryView(this.buffer, this.baseOffset + index * 8);
1421
+ }
1422
+
1423
+ *[Symbol.iterator]() {
1424
+ for (let i = 0; i < this.length; i++) {
1425
+ yield this.at(i);
1426
+ }
1427
+ }
1428
+ }
1429
+
1430
+ const STREAMDERIVECONFIG_SIZE = 132;
1431
+ const STREAMDERIVECONFIG_ALIGN = 4;
1432
+
1433
+ const StreamDeriveConfigOffsets = {
1434
+ base_key_curve: 0,
1435
+ base_key_depth: 1,
1436
+ base_key__pad0: 2,
1437
+ base_key_parent_fingerprint: 4,
1438
+ base_key_child_index: 8,
1439
+ base_key_chain_code_data: 12,
1440
+ base_key_public_key_data: 44,
1441
+ base_key__pad1: 77,
1442
+ base_key_private_key_data: 80,
1443
+ base_key_has_private_key: 112,
1444
+ base_key__pad2: 113,
1445
+ start_index: 116,
1446
+ batch_size: 120,
1447
+ hardened: 124,
1448
+ _pad: 125,
1449
+ };
1450
+
1451
+ class StreamDeriveConfigView {
1452
+ constructor(buffer, byteOffset = 0) {
1453
+ this.view = new DataView(buffer, byteOffset, 132);
1454
+ }
1455
+
1456
+ static fromMemory(memory, ptr) {
1457
+ return new StreamDeriveConfigView(memory.buffer, ptr);
1458
+ }
1459
+
1460
+ static fromBytes(bytes, offset = 0) {
1461
+ return new StreamDeriveConfigView(bytes.buffer, bytes.byteOffset + offset);
1462
+ }
1463
+
1464
+ get base_key_curve() {
1465
+ return this.view.getUint8(0);
1466
+ }
1467
+ set base_key_curve(v) {
1468
+ this.view.setUint8(0, v);
1469
+ }
1470
+
1471
+ get base_key_depth() {
1472
+ return this.view.getUint8(1);
1473
+ }
1474
+ set base_key_depth(v) {
1475
+ this.view.setUint8(1, v);
1476
+ }
1477
+
1478
+ get base_key__pad0() {
1479
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 2, 2);
1480
+ }
1481
+
1482
+ get base_key_parent_fingerprint() {
1483
+ return this.view.getUint32(4, true);
1484
+ }
1485
+ set base_key_parent_fingerprint(v) {
1486
+ this.view.setUint32(4, v, true);
1487
+ }
1488
+
1489
+ get base_key_child_index() {
1490
+ return this.view.getUint32(8, true);
1491
+ }
1492
+ set base_key_child_index(v) {
1493
+ this.view.setUint32(8, v, true);
1494
+ }
1495
+
1496
+ get base_key_chain_code_data() {
1497
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 12, 32);
1498
+ }
1499
+
1500
+ get base_key_public_key_data() {
1501
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 44, 33);
1502
+ }
1503
+
1504
+ get base_key__pad1() {
1505
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 77, 3);
1506
+ }
1507
+
1508
+ get base_key_private_key_data() {
1509
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 80, 32);
1510
+ }
1511
+
1512
+ get base_key_has_private_key() {
1513
+ return this.view.getUint8(112);
1514
+ }
1515
+ set base_key_has_private_key(v) {
1516
+ this.view.setUint8(112, v);
1517
+ }
1518
+
1519
+ get base_key__pad2() {
1520
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 113, 3);
1521
+ }
1522
+
1523
+ get start_index() {
1524
+ return this.view.getUint32(116, true);
1525
+ }
1526
+ set start_index(v) {
1527
+ this.view.setUint32(116, v, true);
1528
+ }
1529
+
1530
+ get batch_size() {
1531
+ return this.view.getUint32(120, true);
1532
+ }
1533
+ set batch_size(v) {
1534
+ this.view.setUint32(120, v, true);
1535
+ }
1536
+
1537
+ get hardened() {
1538
+ return this.view.getUint8(124);
1539
+ }
1540
+ set hardened(v) {
1541
+ this.view.setUint8(124, v);
1542
+ }
1543
+
1544
+ get _pad() {
1545
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 125, 7);
1546
+ }
1547
+
1548
+ toObject() {
1549
+ return {
1550
+ base_key_curve: this.base_key_curve,
1551
+ base_key_depth: this.base_key_depth,
1552
+ base_key__pad0: Array.from(this.base_key__pad0),
1553
+ base_key_parent_fingerprint: this.base_key_parent_fingerprint,
1554
+ base_key_child_index: this.base_key_child_index,
1555
+ base_key_chain_code_data: Array.from(this.base_key_chain_code_data),
1556
+ base_key_public_key_data: Array.from(this.base_key_public_key_data),
1557
+ base_key__pad1: Array.from(this.base_key__pad1),
1558
+ base_key_private_key_data: Array.from(this.base_key_private_key_data),
1559
+ base_key_has_private_key: this.base_key_has_private_key,
1560
+ base_key__pad2: Array.from(this.base_key__pad2),
1561
+ start_index: this.start_index,
1562
+ batch_size: this.batch_size,
1563
+ hardened: this.hardened,
1564
+ _pad: Array.from(this._pad),
1565
+ };
1566
+ }
1567
+
1568
+ copyFrom(obj) {
1569
+ if (obj.base_key_curve !== undefined) this.base_key_curve = obj.base_key_curve;
1570
+ if (obj.base_key_depth !== undefined) this.base_key_depth = obj.base_key_depth;
1571
+ if (obj.base_key__pad0 !== undefined) {
1572
+ const arr = this.base_key__pad0;
1573
+ const src = obj.base_key__pad0;
1574
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1575
+ }
1576
+ if (obj.base_key_parent_fingerprint !== undefined) this.base_key_parent_fingerprint = obj.base_key_parent_fingerprint;
1577
+ if (obj.base_key_child_index !== undefined) this.base_key_child_index = obj.base_key_child_index;
1578
+ if (obj.base_key_chain_code_data !== undefined) {
1579
+ const arr = this.base_key_chain_code_data;
1580
+ const src = obj.base_key_chain_code_data;
1581
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1582
+ }
1583
+ if (obj.base_key_public_key_data !== undefined) {
1584
+ const arr = this.base_key_public_key_data;
1585
+ const src = obj.base_key_public_key_data;
1586
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1587
+ }
1588
+ if (obj.base_key__pad1 !== undefined) {
1589
+ const arr = this.base_key__pad1;
1590
+ const src = obj.base_key__pad1;
1591
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1592
+ }
1593
+ if (obj.base_key_private_key_data !== undefined) {
1594
+ const arr = this.base_key_private_key_data;
1595
+ const src = obj.base_key_private_key_data;
1596
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1597
+ }
1598
+ if (obj.base_key_has_private_key !== undefined) this.base_key_has_private_key = obj.base_key_has_private_key;
1599
+ if (obj.base_key__pad2 !== undefined) {
1600
+ const arr = this.base_key__pad2;
1601
+ const src = obj.base_key__pad2;
1602
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1603
+ }
1604
+ if (obj.start_index !== undefined) this.start_index = obj.start_index;
1605
+ if (obj.batch_size !== undefined) this.batch_size = obj.batch_size;
1606
+ if (obj.hardened !== undefined) this.hardened = obj.hardened;
1607
+ if (obj._pad !== undefined) {
1608
+ const arr = this._pad;
1609
+ const src = obj._pad;
1610
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1611
+ }
1612
+ }
1613
+
1614
+ static allocate() {
1615
+ return new StreamDeriveConfigView(new ArrayBuffer(132));
1616
+ }
1617
+
1618
+ copyTo(dest, offset = 0) {
1619
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 132);
1620
+ dest.set(src, offset);
1621
+ }
1622
+
1623
+ getBytes() {
1624
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 132);
1625
+ }
1626
+ }
1627
+
1628
+ class StreamDeriveConfigArrayView {
1629
+ constructor(buffer, byteOffset, count) {
1630
+ this.buffer = buffer;
1631
+ this.baseOffset = byteOffset;
1632
+ this.length = count;
1633
+ }
1634
+
1635
+ static fromMemory(memory, ptr, count) {
1636
+ return new StreamDeriveConfigArrayView(memory.buffer, ptr, count);
1637
+ }
1638
+
1639
+ at(index) {
1640
+ if (index < 0 || index >= this.length) {
1641
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
1642
+ }
1643
+ return new StreamDeriveConfigView(this.buffer, this.baseOffset + index * 132);
1644
+ }
1645
+
1646
+ *[Symbol.iterator]() {
1647
+ for (let i = 0; i < this.length; i++) {
1648
+ yield this.at(i);
1649
+ }
1650
+ }
1651
+ }
1652
+
1653
+ const STREAMSTATUS_SIZE = 16;
1654
+ const STREAMSTATUS_ALIGN = 4;
1655
+
1656
+ const StreamStatusOffsets = {
1657
+ derived_count: 0,
1658
+ current_index: 4,
1659
+ error: 8,
1660
+ complete: 12,
1661
+ _pad: 13,
1662
+ };
1663
+
1664
+ class StreamStatusView {
1665
+ constructor(buffer, byteOffset = 0) {
1666
+ this.view = new DataView(buffer, byteOffset, 16);
1667
+ }
1668
+
1669
+ static fromMemory(memory, ptr) {
1670
+ return new StreamStatusView(memory.buffer, ptr);
1671
+ }
1672
+
1673
+ static fromBytes(bytes, offset = 0) {
1674
+ return new StreamStatusView(bytes.buffer, bytes.byteOffset + offset);
1675
+ }
1676
+
1677
+ get derived_count() {
1678
+ return this.view.getUint32(0, true);
1679
+ }
1680
+ set derived_count(v) {
1681
+ this.view.setUint32(0, v, true);
1682
+ }
1683
+
1684
+ get current_index() {
1685
+ return this.view.getUint32(4, true);
1686
+ }
1687
+ set current_index(v) {
1688
+ this.view.setUint32(4, v, true);
1689
+ }
1690
+
1691
+ get error() {
1692
+ return this.view.getInt32(8, true);
1693
+ }
1694
+ set error(v) {
1695
+ this.view.setInt32(8, v, true);
1696
+ }
1697
+
1698
+ get complete() {
1699
+ return this.view.getUint8(12);
1700
+ }
1701
+ set complete(v) {
1702
+ this.view.setUint8(12, v);
1703
+ }
1704
+
1705
+ get _pad() {
1706
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 13, 3);
1707
+ }
1708
+
1709
+ toObject() {
1710
+ return {
1711
+ derived_count: this.derived_count,
1712
+ current_index: this.current_index,
1713
+ error: this.error,
1714
+ complete: this.complete,
1715
+ _pad: Array.from(this._pad),
1716
+ };
1717
+ }
1718
+
1719
+ copyFrom(obj) {
1720
+ if (obj.derived_count !== undefined) this.derived_count = obj.derived_count;
1721
+ if (obj.current_index !== undefined) this.current_index = obj.current_index;
1722
+ if (obj.error !== undefined) this.error = obj.error;
1723
+ if (obj.complete !== undefined) this.complete = obj.complete;
1724
+ if (obj._pad !== undefined) {
1725
+ const arr = this._pad;
1726
+ const src = obj._pad;
1727
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1728
+ }
1729
+ }
1730
+
1731
+ static allocate() {
1732
+ return new StreamStatusView(new ArrayBuffer(16));
1733
+ }
1734
+
1735
+ copyTo(dest, offset = 0) {
1736
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 16);
1737
+ dest.set(src, offset);
1738
+ }
1739
+
1740
+ getBytes() {
1741
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 16);
1742
+ }
1743
+ }
1744
+
1745
+ class StreamStatusArrayView {
1746
+ constructor(buffer, byteOffset, count) {
1747
+ this.buffer = buffer;
1748
+ this.baseOffset = byteOffset;
1749
+ this.length = count;
1750
+ }
1751
+
1752
+ static fromMemory(memory, ptr, count) {
1753
+ return new StreamStatusArrayView(memory.buffer, ptr, count);
1754
+ }
1755
+
1756
+ at(index) {
1757
+ if (index < 0 || index >= this.length) {
1758
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
1759
+ }
1760
+ return new StreamStatusView(this.buffer, this.baseOffset + index * 16);
1761
+ }
1762
+
1763
+ *[Symbol.iterator]() {
1764
+ for (let i = 0; i < this.length; i++) {
1765
+ yield this.at(i);
1766
+ }
1767
+ }
1768
+ }
1769
+
1770
+ const BATCHADDRESSREQUEST_SIZE = 8;
1771
+ const BATCHADDRESSREQUEST_ALIGN = 4;
1772
+
1773
+ const BatchAddressRequestOffsets = {
1774
+ address_type: 0,
1775
+ network: 1,
1776
+ _pad: 2,
1777
+ count: 4,
1778
+ };
1779
+
1780
+ class BatchAddressRequestView {
1781
+ constructor(buffer, byteOffset = 0) {
1782
+ this.view = new DataView(buffer, byteOffset, 8);
1783
+ }
1784
+
1785
+ static fromMemory(memory, ptr) {
1786
+ return new BatchAddressRequestView(memory.buffer, ptr);
1787
+ }
1788
+
1789
+ static fromBytes(bytes, offset = 0) {
1790
+ return new BatchAddressRequestView(bytes.buffer, bytes.byteOffset + offset);
1791
+ }
1792
+
1793
+ get address_type() {
1794
+ return this.view.getUint8(0);
1795
+ }
1796
+ set address_type(v) {
1797
+ this.view.setUint8(0, v);
1798
+ }
1799
+
1800
+ get network() {
1801
+ return this.view.getUint8(1);
1802
+ }
1803
+ set network(v) {
1804
+ this.view.setUint8(1, v);
1805
+ }
1806
+
1807
+ get _pad() {
1808
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 2, 2);
1809
+ }
1810
+
1811
+ get count() {
1812
+ return this.view.getUint32(4, true);
1813
+ }
1814
+ set count(v) {
1815
+ this.view.setUint32(4, v, true);
1816
+ }
1817
+
1818
+ toObject() {
1819
+ return {
1820
+ address_type: this.address_type,
1821
+ network: this.network,
1822
+ _pad: Array.from(this._pad),
1823
+ count: this.count,
1824
+ };
1825
+ }
1826
+
1827
+ copyFrom(obj) {
1828
+ if (obj.address_type !== undefined) this.address_type = obj.address_type;
1829
+ if (obj.network !== undefined) this.network = obj.network;
1830
+ if (obj._pad !== undefined) {
1831
+ const arr = this._pad;
1832
+ const src = obj._pad;
1833
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1834
+ }
1835
+ if (obj.count !== undefined) this.count = obj.count;
1836
+ }
1837
+
1838
+ static allocate() {
1839
+ return new BatchAddressRequestView(new ArrayBuffer(8));
1840
+ }
1841
+
1842
+ copyTo(dest, offset = 0) {
1843
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 8);
1844
+ dest.set(src, offset);
1845
+ }
1846
+
1847
+ getBytes() {
1848
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 8);
1849
+ }
1850
+ }
1851
+
1852
+ class BatchAddressRequestArrayView {
1853
+ constructor(buffer, byteOffset, count) {
1854
+ this.buffer = buffer;
1855
+ this.baseOffset = byteOffset;
1856
+ this.length = count;
1857
+ }
1858
+
1859
+ static fromMemory(memory, ptr, count) {
1860
+ return new BatchAddressRequestArrayView(memory.buffer, ptr, count);
1861
+ }
1862
+
1863
+ at(index) {
1864
+ if (index < 0 || index >= this.length) {
1865
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
1866
+ }
1867
+ return new BatchAddressRequestView(this.buffer, this.baseOffset + index * 8);
1868
+ }
1869
+
1870
+ *[Symbol.iterator]() {
1871
+ for (let i = 0; i < this.length; i++) {
1872
+ yield this.at(i);
1873
+ }
1874
+ }
1875
+ }
1876
+
1877
+ const ADDRESSINPUTENTRY_SIZE = 40;
1878
+ const ADDRESSINPUTENTRY_ALIGN = 4;
1879
+
1880
+ const AddressInputEntryOffsets = {
1881
+ index: 0,
1882
+ public_key_data: 4,
1883
+ _pad: 37,
1884
+ };
1885
+
1886
+ class AddressInputEntryView {
1887
+ constructor(buffer, byteOffset = 0) {
1888
+ this.view = new DataView(buffer, byteOffset, 40);
1889
+ }
1890
+
1891
+ static fromMemory(memory, ptr) {
1892
+ return new AddressInputEntryView(memory.buffer, ptr);
1893
+ }
1894
+
1895
+ static fromBytes(bytes, offset = 0) {
1896
+ return new AddressInputEntryView(bytes.buffer, bytes.byteOffset + offset);
1897
+ }
1898
+
1899
+ get index() {
1900
+ return this.view.getUint32(0, true);
1901
+ }
1902
+ set index(v) {
1903
+ this.view.setUint32(0, v, true);
1904
+ }
1905
+
1906
+ get public_key_data() {
1907
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 4, 33);
1908
+ }
1909
+
1910
+ get _pad() {
1911
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 37, 3);
1912
+ }
1913
+
1914
+ toObject() {
1915
+ return {
1916
+ index: this.index,
1917
+ public_key_data: Array.from(this.public_key_data),
1918
+ _pad: Array.from(this._pad),
1919
+ };
1920
+ }
1921
+
1922
+ copyFrom(obj) {
1923
+ if (obj.index !== undefined) this.index = obj.index;
1924
+ if (obj.public_key_data !== undefined) {
1925
+ const arr = this.public_key_data;
1926
+ const src = obj.public_key_data;
1927
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1928
+ }
1929
+ if (obj._pad !== undefined) {
1930
+ const arr = this._pad;
1931
+ const src = obj._pad;
1932
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
1933
+ }
1934
+ }
1935
+
1936
+ static allocate() {
1937
+ return new AddressInputEntryView(new ArrayBuffer(40));
1938
+ }
1939
+
1940
+ copyTo(dest, offset = 0) {
1941
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 40);
1942
+ dest.set(src, offset);
1943
+ }
1944
+
1945
+ getBytes() {
1946
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 40);
1947
+ }
1948
+ }
1949
+
1950
+ class AddressInputEntryArrayView {
1951
+ constructor(buffer, byteOffset, count) {
1952
+ this.buffer = buffer;
1953
+ this.baseOffset = byteOffset;
1954
+ this.length = count;
1955
+ }
1956
+
1957
+ static fromMemory(memory, ptr, count) {
1958
+ return new AddressInputEntryArrayView(memory.buffer, ptr, count);
1959
+ }
1960
+
1961
+ at(index) {
1962
+ if (index < 0 || index >= this.length) {
1963
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
1964
+ }
1965
+ return new AddressInputEntryView(this.buffer, this.baseOffset + index * 40);
1966
+ }
1967
+
1968
+ *[Symbol.iterator]() {
1969
+ for (let i = 0; i < this.length; i++) {
1970
+ yield this.at(i);
1971
+ }
1972
+ }
1973
+ }
1974
+
1975
+ const ADDRESSRESULTENTRY_SIZE = 72;
1976
+ const ADDRESSRESULTENTRY_ALIGN = 4;
1977
+
1978
+ const AddressResultEntryOffsets = {
1979
+ index: 0,
1980
+ error: 4,
1981
+ address: 8,
1982
+ _pad: 70,
1983
+ };
1984
+
1985
+ class AddressResultEntryView {
1986
+ constructor(buffer, byteOffset = 0) {
1987
+ this.view = new DataView(buffer, byteOffset, 72);
1988
+ }
1989
+
1990
+ static fromMemory(memory, ptr) {
1991
+ return new AddressResultEntryView(memory.buffer, ptr);
1992
+ }
1993
+
1994
+ static fromBytes(bytes, offset = 0) {
1995
+ return new AddressResultEntryView(bytes.buffer, bytes.byteOffset + offset);
1996
+ }
1997
+
1998
+ get index() {
1999
+ return this.view.getUint32(0, true);
2000
+ }
2001
+ set index(v) {
2002
+ this.view.setUint32(0, v, true);
2003
+ }
2004
+
2005
+ get error() {
2006
+ return this.view.getInt32(4, true);
2007
+ }
2008
+ set error(v) {
2009
+ this.view.setInt32(4, v, true);
2010
+ }
2011
+
2012
+ get address() {
2013
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 8, 62);
2014
+ }
2015
+
2016
+ get _pad() {
2017
+ return new Uint8Array(this.view.buffer, this.view.byteOffset + 70, 2);
2018
+ }
2019
+
2020
+ toObject() {
2021
+ return {
2022
+ index: this.index,
2023
+ error: this.error,
2024
+ address: Array.from(this.address),
2025
+ _pad: Array.from(this._pad),
2026
+ };
2027
+ }
2028
+
2029
+ copyFrom(obj) {
2030
+ if (obj.index !== undefined) this.index = obj.index;
2031
+ if (obj.error !== undefined) this.error = obj.error;
2032
+ if (obj.address !== undefined) {
2033
+ const arr = this.address;
2034
+ const src = obj.address;
2035
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
2036
+ }
2037
+ if (obj._pad !== undefined) {
2038
+ const arr = this._pad;
2039
+ const src = obj._pad;
2040
+ for (let i = 0; i < Math.min(arr.length, src.length); i++) arr[i] = src[i];
2041
+ }
2042
+ }
2043
+
2044
+ static allocate() {
2045
+ return new AddressResultEntryView(new ArrayBuffer(72));
2046
+ }
2047
+
2048
+ copyTo(dest, offset = 0) {
2049
+ const src = new Uint8Array(this.view.buffer, this.view.byteOffset, 72);
2050
+ dest.set(src, offset);
2051
+ }
2052
+
2053
+ getBytes() {
2054
+ return new Uint8Array(this.view.buffer, this.view.byteOffset, 72);
2055
+ }
2056
+ }
2057
+
2058
+ class AddressResultEntryArrayView {
2059
+ constructor(buffer, byteOffset, count) {
2060
+ this.buffer = buffer;
2061
+ this.baseOffset = byteOffset;
2062
+ this.length = count;
2063
+ }
2064
+
2065
+ static fromMemory(memory, ptr, count) {
2066
+ return new AddressResultEntryArrayView(memory.buffer, ptr, count);
2067
+ }
2068
+
2069
+ at(index) {
2070
+ if (index < 0 || index >= this.length) {
2071
+ throw new RangeError(`Index ${index} out of bounds [0, ${this.length})`);
2072
+ }
2073
+ return new AddressResultEntryView(this.buffer, this.baseOffset + index * 72);
2074
+ }
2075
+
2076
+ *[Symbol.iterator]() {
2077
+ for (let i = 0; i < this.length; i++) {
2078
+ yield this.at(i);
2079
+ }
2080
+ }
2081
+ }
2082
+
2083
+
2084
+
2085
+ // Export all generated classes and constants
2086
+ export {
2087
+ // Enums
2088
+ Curve,
2089
+ Error,
2090
+ AddressType,
2091
+ Network,
2092
+
2093
+ // Size and alignment constants
2094
+ BYTES32_SIZE,
2095
+ BYTES32_ALIGN,
2096
+ BYTES33_SIZE,
2097
+ BYTES33_ALIGN,
2098
+ BYTES64_SIZE,
2099
+ BYTES64_ALIGN,
2100
+ EXTENDEDKEYDATA_SIZE,
2101
+ EXTENDEDKEYDATA_ALIGN,
2102
+ BATCHDERIVEREQUEST_SIZE,
2103
+ BATCHDERIVEREQUEST_ALIGN,
2104
+ DERIVEDKEYENTRY_SIZE,
2105
+ DERIVEDKEYENTRY_ALIGN,
2106
+ BATCHSIGNREQUEST_SIZE,
2107
+ BATCHSIGNREQUEST_ALIGN,
2108
+ HASHENTRY_SIZE,
2109
+ HASHENTRY_ALIGN,
2110
+ SIGNATUREENTRY_SIZE,
2111
+ SIGNATUREENTRY_ALIGN,
2112
+ BATCHVERIFYREQUEST_SIZE,
2113
+ BATCHVERIFYREQUEST_ALIGN,
2114
+ VERIFYENTRY_SIZE,
2115
+ VERIFYENTRY_ALIGN,
2116
+ VERIFYRESULTENTRY_SIZE,
2117
+ VERIFYRESULTENTRY_ALIGN,
2118
+ STREAMDERIVECONFIG_SIZE,
2119
+ STREAMDERIVECONFIG_ALIGN,
2120
+ STREAMSTATUS_SIZE,
2121
+ STREAMSTATUS_ALIGN,
2122
+ BATCHADDRESSREQUEST_SIZE,
2123
+ BATCHADDRESSREQUEST_ALIGN,
2124
+ ADDRESSINPUTENTRY_SIZE,
2125
+ ADDRESSINPUTENTRY_ALIGN,
2126
+ ADDRESSRESULTENTRY_SIZE,
2127
+ ADDRESSRESULTENTRY_ALIGN,
2128
+
2129
+ // Offset objects
2130
+ Bytes32Offsets,
2131
+ Bytes33Offsets,
2132
+ Bytes64Offsets,
2133
+ ExtendedKeyDataOffsets,
2134
+ BatchDeriveRequestOffsets,
2135
+ DerivedKeyEntryOffsets,
2136
+ BatchSignRequestOffsets,
2137
+ HashEntryOffsets,
2138
+ SignatureEntryOffsets,
2139
+ BatchVerifyRequestOffsets,
2140
+ VerifyEntryOffsets,
2141
+ VerifyResultEntryOffsets,
2142
+ StreamDeriveConfigOffsets,
2143
+ StreamStatusOffsets,
2144
+ BatchAddressRequestOffsets,
2145
+ AddressInputEntryOffsets,
2146
+ AddressResultEntryOffsets,
2147
+
2148
+ // View classes
2149
+ Bytes32View,
2150
+ Bytes32ArrayView,
2151
+ Bytes33View,
2152
+ Bytes33ArrayView,
2153
+ Bytes64View,
2154
+ Bytes64ArrayView,
2155
+ ExtendedKeyDataView,
2156
+ ExtendedKeyDataArrayView,
2157
+ BatchDeriveRequestView,
2158
+ BatchDeriveRequestArrayView,
2159
+ DerivedKeyEntryView,
2160
+ DerivedKeyEntryArrayView,
2161
+ BatchSignRequestView,
2162
+ BatchSignRequestArrayView,
2163
+ HashEntryView,
2164
+ HashEntryArrayView,
2165
+ SignatureEntryView,
2166
+ SignatureEntryArrayView,
2167
+ BatchVerifyRequestView,
2168
+ BatchVerifyRequestArrayView,
2169
+ VerifyEntryView,
2170
+ VerifyEntryArrayView,
2171
+ VerifyResultEntryView,
2172
+ VerifyResultEntryArrayView,
2173
+ StreamDeriveConfigView,
2174
+ StreamDeriveConfigArrayView,
2175
+ StreamStatusView,
2176
+ StreamStatusArrayView,
2177
+ BatchAddressRequestView,
2178
+ BatchAddressRequestArrayView,
2179
+ AddressInputEntryView,
2180
+ AddressInputEntryArrayView,
2181
+ AddressResultEntryView,
2182
+ AddressResultEntryArrayView,
2183
+ };