react-native-neural-wallet-lib 0.1.34 → 0.1.35
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/android/src/main/jniLibs/arm64-v8a/libwallet.a +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libwallet.a +0 -0
- package/android/src/main/jniLibs/x86/libwallet.a +0 -0
- package/android/src/main/jniLibs/x86_64/libwallet.a +0 -0
- package/ios/libs/libwallet.a +0 -0
- package/lib/module/generated/wallet.js +312 -102
- package/lib/module/generated/wallet.js.map +1 -1
- package/lib/typescript/src/generated/wallet.d.ts +417 -62
- package/lib/typescript/src/generated/wallet.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/generated/wallet.ts +394 -117
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/ios/libs/libwallet.a
CHANGED
|
Binary file
|
|
@@ -18,7 +18,7 @@ process?.env?.NODE_ENV !== 'production' || false;
|
|
|
18
18
|
|
|
19
19
|
export function generateBitcoinKeypair(mnemonic, path, addrType, network) /*throws*/{
|
|
20
20
|
return FfiConverterTypeBitcoinKeyPair.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBitcoinWalletError.lift.bind(FfiConverterTypeBitcoinWalletError), /*caller:*/callStatus => {
|
|
21
|
-
return nativeModule().ubrn_uniffi_wallet_fn_func_generate_bitcoin_keypair(FfiConverterString.lower(mnemonic), FfiConverterString.lower(path), FfiConverterTypeAddressType.lower(addrType),
|
|
21
|
+
return nativeModule().ubrn_uniffi_wallet_fn_func_generate_bitcoin_keypair(FfiConverterString.lower(mnemonic), FfiConverterString.lower(path), FfiConverterTypeAddressType.lower(addrType), FfiConverterTypeNetwork.lower(network), callStatus);
|
|
22
22
|
}, /*liftString:*/FfiConverterString.lift));
|
|
23
23
|
}
|
|
24
24
|
export function generateComplexPassword(length) /*throws*/{
|
|
@@ -186,38 +186,6 @@ const FfiConverterTypeAddressType = (() => {
|
|
|
186
186
|
}
|
|
187
187
|
return new FFIConverter();
|
|
188
188
|
})();
|
|
189
|
-
export let BitcoinNetwork = /*#__PURE__*/function (BitcoinNetwork) {
|
|
190
|
-
BitcoinNetwork[BitcoinNetwork["Mainnet"] = 0] = "Mainnet";
|
|
191
|
-
BitcoinNetwork[BitcoinNetwork["Testnet"] = 1] = "Testnet";
|
|
192
|
-
return BitcoinNetwork;
|
|
193
|
-
}({});
|
|
194
|
-
const FfiConverterTypeBitcoinNetwork = (() => {
|
|
195
|
-
const ordinalConverter = FfiConverterInt32;
|
|
196
|
-
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
197
|
-
read(from) {
|
|
198
|
-
switch (ordinalConverter.read(from)) {
|
|
199
|
-
case 1:
|
|
200
|
-
return BitcoinNetwork.Mainnet;
|
|
201
|
-
case 2:
|
|
202
|
-
return BitcoinNetwork.Testnet;
|
|
203
|
-
default:
|
|
204
|
-
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
write(value, into) {
|
|
208
|
-
switch (value) {
|
|
209
|
-
case BitcoinNetwork.Mainnet:
|
|
210
|
-
return ordinalConverter.write(1, into);
|
|
211
|
-
case BitcoinNetwork.Testnet:
|
|
212
|
-
return ordinalConverter.write(2, into);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
allocationSize(value) {
|
|
216
|
-
return ordinalConverter.allocationSize(0);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
return new FFIConverter();
|
|
220
|
-
})();
|
|
221
189
|
|
|
222
190
|
// Error type: BitcoinWalletError
|
|
223
191
|
|
|
@@ -226,7 +194,6 @@ export let BitcoinWalletError_Tags = /*#__PURE__*/function (BitcoinWalletError_T
|
|
|
226
194
|
BitcoinWalletError_Tags["InvalidMnemonic"] = "InvalidMnemonic";
|
|
227
195
|
BitcoinWalletError_Tags["DerivationError"] = "DerivationError";
|
|
228
196
|
BitcoinWalletError_Tags["InvalidDerivationPath"] = "InvalidDerivationPath";
|
|
229
|
-
BitcoinWalletError_Tags["Secp256k1Error"] = "Secp256k1Error";
|
|
230
197
|
BitcoinWalletError_Tags["AddressGenerationError"] = "AddressGenerationError";
|
|
231
198
|
BitcoinWalletError_Tags["InvalidPrivateKey"] = "InvalidPrivateKey";
|
|
232
199
|
BitcoinWalletError_Tags["InvalidPublicKey"] = "InvalidPublicKey";
|
|
@@ -234,6 +201,12 @@ export let BitcoinWalletError_Tags = /*#__PURE__*/function (BitcoinWalletError_T
|
|
|
234
201
|
BitcoinWalletError_Tags["WifGenerationError"] = "WifGenerationError";
|
|
235
202
|
BitcoinWalletError_Tags["JsonSerializationError"] = "JsonSerializationError";
|
|
236
203
|
BitcoinWalletError_Tags["JsonFieldMissing"] = "JsonFieldMissing";
|
|
204
|
+
BitcoinWalletError_Tags["Bech32EncodingError"] = "Bech32EncodingError";
|
|
205
|
+
BitcoinWalletError_Tags["BitsConversionError"] = "BitsConversionError";
|
|
206
|
+
BitcoinWalletError_Tags["InvalidPointFormat"] = "InvalidPointFormat";
|
|
207
|
+
BitcoinWalletError_Tags["InvalidTweak"] = "InvalidTweak";
|
|
208
|
+
BitcoinWalletError_Tags["InvalidDataRange"] = "InvalidDataRange";
|
|
209
|
+
BitcoinWalletError_Tags["InvalidPadding"] = "InvalidPadding";
|
|
237
210
|
BitcoinWalletError_Tags["UnknownError"] = "UnknownError";
|
|
238
211
|
return BitcoinWalletError_Tags;
|
|
239
212
|
}({});
|
|
@@ -310,30 +283,6 @@ export const BitcoinWalletError = (() => {
|
|
|
310
283
|
return obj.inner;
|
|
311
284
|
}
|
|
312
285
|
}
|
|
313
|
-
class Secp256k1Error_ extends UniffiError {
|
|
314
|
-
/**
|
|
315
|
-
* @private
|
|
316
|
-
* This field is private and should not be used, use `tag` instead.
|
|
317
|
-
*/
|
|
318
|
-
[uniffiTypeNameSymbol] = 'BitcoinWalletError';
|
|
319
|
-
tag = BitcoinWalletError_Tags.Secp256k1Error;
|
|
320
|
-
constructor(v0) {
|
|
321
|
-
super('BitcoinWalletError', 'Secp256k1Error');
|
|
322
|
-
this.inner = Object.freeze([v0]);
|
|
323
|
-
}
|
|
324
|
-
static new(v0) {
|
|
325
|
-
return new Secp256k1Error_(v0);
|
|
326
|
-
}
|
|
327
|
-
static instanceOf(obj) {
|
|
328
|
-
return obj.tag === BitcoinWalletError_Tags.Secp256k1Error;
|
|
329
|
-
}
|
|
330
|
-
static hasInner(obj) {
|
|
331
|
-
return Secp256k1Error_.instanceOf(obj);
|
|
332
|
-
}
|
|
333
|
-
static getInner(obj) {
|
|
334
|
-
return obj.inner;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
286
|
class AddressGenerationError_ extends UniffiError {
|
|
338
287
|
/**
|
|
339
288
|
* @private
|
|
@@ -365,17 +314,21 @@ export const BitcoinWalletError = (() => {
|
|
|
365
314
|
*/
|
|
366
315
|
[uniffiTypeNameSymbol] = 'BitcoinWalletError';
|
|
367
316
|
tag = BitcoinWalletError_Tags.InvalidPrivateKey;
|
|
368
|
-
constructor() {
|
|
317
|
+
constructor(v0) {
|
|
369
318
|
super('BitcoinWalletError', 'InvalidPrivateKey');
|
|
319
|
+
this.inner = Object.freeze([v0]);
|
|
370
320
|
}
|
|
371
|
-
static new() {
|
|
372
|
-
return new InvalidPrivateKey_();
|
|
321
|
+
static new(v0) {
|
|
322
|
+
return new InvalidPrivateKey_(v0);
|
|
373
323
|
}
|
|
374
324
|
static instanceOf(obj) {
|
|
375
325
|
return obj.tag === BitcoinWalletError_Tags.InvalidPrivateKey;
|
|
376
326
|
}
|
|
377
327
|
static hasInner(obj) {
|
|
378
|
-
return
|
|
328
|
+
return InvalidPrivateKey_.instanceOf(obj);
|
|
329
|
+
}
|
|
330
|
+
static getInner(obj) {
|
|
331
|
+
return obj.inner;
|
|
379
332
|
}
|
|
380
333
|
}
|
|
381
334
|
class InvalidPublicKey_ extends UniffiError {
|
|
@@ -385,17 +338,21 @@ export const BitcoinWalletError = (() => {
|
|
|
385
338
|
*/
|
|
386
339
|
[uniffiTypeNameSymbol] = 'BitcoinWalletError';
|
|
387
340
|
tag = BitcoinWalletError_Tags.InvalidPublicKey;
|
|
388
|
-
constructor() {
|
|
341
|
+
constructor(v0) {
|
|
389
342
|
super('BitcoinWalletError', 'InvalidPublicKey');
|
|
343
|
+
this.inner = Object.freeze([v0]);
|
|
390
344
|
}
|
|
391
|
-
static new() {
|
|
392
|
-
return new InvalidPublicKey_();
|
|
345
|
+
static new(v0) {
|
|
346
|
+
return new InvalidPublicKey_(v0);
|
|
393
347
|
}
|
|
394
348
|
static instanceOf(obj) {
|
|
395
349
|
return obj.tag === BitcoinWalletError_Tags.InvalidPublicKey;
|
|
396
350
|
}
|
|
397
351
|
static hasInner(obj) {
|
|
398
|
-
return
|
|
352
|
+
return InvalidPublicKey_.instanceOf(obj);
|
|
353
|
+
}
|
|
354
|
+
static getInner(obj) {
|
|
355
|
+
return obj.inner;
|
|
399
356
|
}
|
|
400
357
|
}
|
|
401
358
|
class NetworkMismatch_ extends UniffiError {
|
|
@@ -425,17 +382,21 @@ export const BitcoinWalletError = (() => {
|
|
|
425
382
|
*/
|
|
426
383
|
[uniffiTypeNameSymbol] = 'BitcoinWalletError';
|
|
427
384
|
tag = BitcoinWalletError_Tags.WifGenerationError;
|
|
428
|
-
constructor() {
|
|
385
|
+
constructor(v0) {
|
|
429
386
|
super('BitcoinWalletError', 'WifGenerationError');
|
|
387
|
+
this.inner = Object.freeze([v0]);
|
|
430
388
|
}
|
|
431
|
-
static new() {
|
|
432
|
-
return new WifGenerationError_();
|
|
389
|
+
static new(v0) {
|
|
390
|
+
return new WifGenerationError_(v0);
|
|
433
391
|
}
|
|
434
392
|
static instanceOf(obj) {
|
|
435
393
|
return obj.tag === BitcoinWalletError_Tags.WifGenerationError;
|
|
436
394
|
}
|
|
437
395
|
static hasInner(obj) {
|
|
438
|
-
return
|
|
396
|
+
return WifGenerationError_.instanceOf(obj);
|
|
397
|
+
}
|
|
398
|
+
static getInner(obj) {
|
|
399
|
+
return obj.inner;
|
|
439
400
|
}
|
|
440
401
|
}
|
|
441
402
|
class JsonSerializationError_ extends UniffiError {
|
|
@@ -482,6 +443,138 @@ export const BitcoinWalletError = (() => {
|
|
|
482
443
|
return obj.inner;
|
|
483
444
|
}
|
|
484
445
|
}
|
|
446
|
+
class Bech32EncodingError_ extends UniffiError {
|
|
447
|
+
/**
|
|
448
|
+
* @private
|
|
449
|
+
* This field is private and should not be used, use `tag` instead.
|
|
450
|
+
*/
|
|
451
|
+
[uniffiTypeNameSymbol] = 'BitcoinWalletError';
|
|
452
|
+
tag = BitcoinWalletError_Tags.Bech32EncodingError;
|
|
453
|
+
constructor(v0) {
|
|
454
|
+
super('BitcoinWalletError', 'Bech32EncodingError');
|
|
455
|
+
this.inner = Object.freeze([v0]);
|
|
456
|
+
}
|
|
457
|
+
static new(v0) {
|
|
458
|
+
return new Bech32EncodingError_(v0);
|
|
459
|
+
}
|
|
460
|
+
static instanceOf(obj) {
|
|
461
|
+
return obj.tag === BitcoinWalletError_Tags.Bech32EncodingError;
|
|
462
|
+
}
|
|
463
|
+
static hasInner(obj) {
|
|
464
|
+
return Bech32EncodingError_.instanceOf(obj);
|
|
465
|
+
}
|
|
466
|
+
static getInner(obj) {
|
|
467
|
+
return obj.inner;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
class BitsConversionError_ extends UniffiError {
|
|
471
|
+
/**
|
|
472
|
+
* @private
|
|
473
|
+
* This field is private and should not be used, use `tag` instead.
|
|
474
|
+
*/
|
|
475
|
+
[uniffiTypeNameSymbol] = 'BitcoinWalletError';
|
|
476
|
+
tag = BitcoinWalletError_Tags.BitsConversionError;
|
|
477
|
+
constructor(v0) {
|
|
478
|
+
super('BitcoinWalletError', 'BitsConversionError');
|
|
479
|
+
this.inner = Object.freeze([v0]);
|
|
480
|
+
}
|
|
481
|
+
static new(v0) {
|
|
482
|
+
return new BitsConversionError_(v0);
|
|
483
|
+
}
|
|
484
|
+
static instanceOf(obj) {
|
|
485
|
+
return obj.tag === BitcoinWalletError_Tags.BitsConversionError;
|
|
486
|
+
}
|
|
487
|
+
static hasInner(obj) {
|
|
488
|
+
return BitsConversionError_.instanceOf(obj);
|
|
489
|
+
}
|
|
490
|
+
static getInner(obj) {
|
|
491
|
+
return obj.inner;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
class InvalidPointFormat_ extends UniffiError {
|
|
495
|
+
/**
|
|
496
|
+
* @private
|
|
497
|
+
* This field is private and should not be used, use `tag` instead.
|
|
498
|
+
*/
|
|
499
|
+
[uniffiTypeNameSymbol] = 'BitcoinWalletError';
|
|
500
|
+
tag = BitcoinWalletError_Tags.InvalidPointFormat;
|
|
501
|
+
constructor(v0) {
|
|
502
|
+
super('BitcoinWalletError', 'InvalidPointFormat');
|
|
503
|
+
this.inner = Object.freeze([v0]);
|
|
504
|
+
}
|
|
505
|
+
static new(v0) {
|
|
506
|
+
return new InvalidPointFormat_(v0);
|
|
507
|
+
}
|
|
508
|
+
static instanceOf(obj) {
|
|
509
|
+
return obj.tag === BitcoinWalletError_Tags.InvalidPointFormat;
|
|
510
|
+
}
|
|
511
|
+
static hasInner(obj) {
|
|
512
|
+
return InvalidPointFormat_.instanceOf(obj);
|
|
513
|
+
}
|
|
514
|
+
static getInner(obj) {
|
|
515
|
+
return obj.inner;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
class InvalidTweak_ extends UniffiError {
|
|
519
|
+
/**
|
|
520
|
+
* @private
|
|
521
|
+
* This field is private and should not be used, use `tag` instead.
|
|
522
|
+
*/
|
|
523
|
+
[uniffiTypeNameSymbol] = 'BitcoinWalletError';
|
|
524
|
+
tag = BitcoinWalletError_Tags.InvalidTweak;
|
|
525
|
+
constructor() {
|
|
526
|
+
super('BitcoinWalletError', 'InvalidTweak');
|
|
527
|
+
}
|
|
528
|
+
static new() {
|
|
529
|
+
return new InvalidTweak_();
|
|
530
|
+
}
|
|
531
|
+
static instanceOf(obj) {
|
|
532
|
+
return obj.tag === BitcoinWalletError_Tags.InvalidTweak;
|
|
533
|
+
}
|
|
534
|
+
static hasInner(obj) {
|
|
535
|
+
return false;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
class InvalidDataRange_ extends UniffiError {
|
|
539
|
+
/**
|
|
540
|
+
* @private
|
|
541
|
+
* This field is private and should not be used, use `tag` instead.
|
|
542
|
+
*/
|
|
543
|
+
[uniffiTypeNameSymbol] = 'BitcoinWalletError';
|
|
544
|
+
tag = BitcoinWalletError_Tags.InvalidDataRange;
|
|
545
|
+
constructor() {
|
|
546
|
+
super('BitcoinWalletError', 'InvalidDataRange');
|
|
547
|
+
}
|
|
548
|
+
static new() {
|
|
549
|
+
return new InvalidDataRange_();
|
|
550
|
+
}
|
|
551
|
+
static instanceOf(obj) {
|
|
552
|
+
return obj.tag === BitcoinWalletError_Tags.InvalidDataRange;
|
|
553
|
+
}
|
|
554
|
+
static hasInner(obj) {
|
|
555
|
+
return false;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
class InvalidPadding_ extends UniffiError {
|
|
559
|
+
/**
|
|
560
|
+
* @private
|
|
561
|
+
* This field is private and should not be used, use `tag` instead.
|
|
562
|
+
*/
|
|
563
|
+
[uniffiTypeNameSymbol] = 'BitcoinWalletError';
|
|
564
|
+
tag = BitcoinWalletError_Tags.InvalidPadding;
|
|
565
|
+
constructor() {
|
|
566
|
+
super('BitcoinWalletError', 'InvalidPadding');
|
|
567
|
+
}
|
|
568
|
+
static new() {
|
|
569
|
+
return new InvalidPadding_();
|
|
570
|
+
}
|
|
571
|
+
static instanceOf(obj) {
|
|
572
|
+
return obj.tag === BitcoinWalletError_Tags.InvalidPadding;
|
|
573
|
+
}
|
|
574
|
+
static hasInner(obj) {
|
|
575
|
+
return false;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
485
578
|
class UnknownError_ extends UniffiError {
|
|
486
579
|
/**
|
|
487
580
|
* @private
|
|
@@ -510,7 +603,6 @@ export const BitcoinWalletError = (() => {
|
|
|
510
603
|
InvalidMnemonic: InvalidMnemonic_,
|
|
511
604
|
DerivationError: DerivationError_,
|
|
512
605
|
InvalidDerivationPath: InvalidDerivationPath_,
|
|
513
|
-
Secp256k1Error: Secp256k1Error_,
|
|
514
606
|
AddressGenerationError: AddressGenerationError_,
|
|
515
607
|
InvalidPrivateKey: InvalidPrivateKey_,
|
|
516
608
|
InvalidPublicKey: InvalidPublicKey_,
|
|
@@ -518,6 +610,12 @@ export const BitcoinWalletError = (() => {
|
|
|
518
610
|
WifGenerationError: WifGenerationError_,
|
|
519
611
|
JsonSerializationError: JsonSerializationError_,
|
|
520
612
|
JsonFieldMissing: JsonFieldMissing_,
|
|
613
|
+
Bech32EncodingError: Bech32EncodingError_,
|
|
614
|
+
BitsConversionError: BitsConversionError_,
|
|
615
|
+
InvalidPointFormat: InvalidPointFormat_,
|
|
616
|
+
InvalidTweak: InvalidTweak_,
|
|
617
|
+
InvalidDataRange: InvalidDataRange_,
|
|
618
|
+
InvalidPadding: InvalidPadding_,
|
|
521
619
|
UnknownError: UnknownError_
|
|
522
620
|
});
|
|
523
621
|
})();
|
|
@@ -534,22 +632,32 @@ const FfiConverterTypeBitcoinWalletError = (() => {
|
|
|
534
632
|
case 3:
|
|
535
633
|
return new BitcoinWalletError.InvalidDerivationPath(FfiConverterString.read(from));
|
|
536
634
|
case 4:
|
|
537
|
-
return new BitcoinWalletError.Secp256k1Error(FfiConverterString.read(from));
|
|
538
|
-
case 5:
|
|
539
635
|
return new BitcoinWalletError.AddressGenerationError(FfiConverterString.read(from));
|
|
636
|
+
case 5:
|
|
637
|
+
return new BitcoinWalletError.InvalidPrivateKey(FfiConverterString.read(from));
|
|
540
638
|
case 6:
|
|
541
|
-
return new BitcoinWalletError.
|
|
639
|
+
return new BitcoinWalletError.InvalidPublicKey(FfiConverterString.read(from));
|
|
542
640
|
case 7:
|
|
543
|
-
return new BitcoinWalletError.InvalidPublicKey();
|
|
544
|
-
case 8:
|
|
545
641
|
return new BitcoinWalletError.NetworkMismatch();
|
|
642
|
+
case 8:
|
|
643
|
+
return new BitcoinWalletError.WifGenerationError(FfiConverterString.read(from));
|
|
546
644
|
case 9:
|
|
547
|
-
return new BitcoinWalletError.WifGenerationError();
|
|
548
|
-
case 10:
|
|
549
645
|
return new BitcoinWalletError.JsonSerializationError();
|
|
550
|
-
case
|
|
646
|
+
case 10:
|
|
551
647
|
return new BitcoinWalletError.JsonFieldMissing(FfiConverterString.read(from));
|
|
648
|
+
case 11:
|
|
649
|
+
return new BitcoinWalletError.Bech32EncodingError(FfiConverterString.read(from));
|
|
552
650
|
case 12:
|
|
651
|
+
return new BitcoinWalletError.BitsConversionError(FfiConverterString.read(from));
|
|
652
|
+
case 13:
|
|
653
|
+
return new BitcoinWalletError.InvalidPointFormat(FfiConverterString.read(from));
|
|
654
|
+
case 14:
|
|
655
|
+
return new BitcoinWalletError.InvalidTweak();
|
|
656
|
+
case 15:
|
|
657
|
+
return new BitcoinWalletError.InvalidDataRange();
|
|
658
|
+
case 16:
|
|
659
|
+
return new BitcoinWalletError.InvalidPadding();
|
|
660
|
+
case 17:
|
|
553
661
|
return new BitcoinWalletError.UnknownError();
|
|
554
662
|
default:
|
|
555
663
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
@@ -578,55 +686,90 @@ const FfiConverterTypeBitcoinWalletError = (() => {
|
|
|
578
686
|
FfiConverterString.write(inner[0], into);
|
|
579
687
|
return;
|
|
580
688
|
}
|
|
581
|
-
case BitcoinWalletError_Tags.
|
|
689
|
+
case BitcoinWalletError_Tags.AddressGenerationError:
|
|
582
690
|
{
|
|
583
691
|
ordinalConverter.write(4, into);
|
|
584
692
|
const inner = value.inner;
|
|
585
693
|
FfiConverterString.write(inner[0], into);
|
|
586
694
|
return;
|
|
587
695
|
}
|
|
588
|
-
case BitcoinWalletError_Tags.
|
|
696
|
+
case BitcoinWalletError_Tags.InvalidPrivateKey:
|
|
589
697
|
{
|
|
590
698
|
ordinalConverter.write(5, into);
|
|
591
699
|
const inner = value.inner;
|
|
592
700
|
FfiConverterString.write(inner[0], into);
|
|
593
701
|
return;
|
|
594
702
|
}
|
|
595
|
-
case BitcoinWalletError_Tags.
|
|
703
|
+
case BitcoinWalletError_Tags.InvalidPublicKey:
|
|
596
704
|
{
|
|
597
705
|
ordinalConverter.write(6, into);
|
|
706
|
+
const inner = value.inner;
|
|
707
|
+
FfiConverterString.write(inner[0], into);
|
|
598
708
|
return;
|
|
599
709
|
}
|
|
600
|
-
case BitcoinWalletError_Tags.
|
|
710
|
+
case BitcoinWalletError_Tags.NetworkMismatch:
|
|
601
711
|
{
|
|
602
712
|
ordinalConverter.write(7, into);
|
|
603
713
|
return;
|
|
604
714
|
}
|
|
605
|
-
case BitcoinWalletError_Tags.
|
|
715
|
+
case BitcoinWalletError_Tags.WifGenerationError:
|
|
606
716
|
{
|
|
607
717
|
ordinalConverter.write(8, into);
|
|
718
|
+
const inner = value.inner;
|
|
719
|
+
FfiConverterString.write(inner[0], into);
|
|
608
720
|
return;
|
|
609
721
|
}
|
|
610
|
-
case BitcoinWalletError_Tags.
|
|
722
|
+
case BitcoinWalletError_Tags.JsonSerializationError:
|
|
611
723
|
{
|
|
612
724
|
ordinalConverter.write(9, into);
|
|
613
725
|
return;
|
|
614
726
|
}
|
|
615
|
-
case BitcoinWalletError_Tags.
|
|
727
|
+
case BitcoinWalletError_Tags.JsonFieldMissing:
|
|
616
728
|
{
|
|
617
729
|
ordinalConverter.write(10, into);
|
|
730
|
+
const inner = value.inner;
|
|
731
|
+
FfiConverterString.write(inner[0], into);
|
|
618
732
|
return;
|
|
619
733
|
}
|
|
620
|
-
case BitcoinWalletError_Tags.
|
|
734
|
+
case BitcoinWalletError_Tags.Bech32EncodingError:
|
|
621
735
|
{
|
|
622
736
|
ordinalConverter.write(11, into);
|
|
623
737
|
const inner = value.inner;
|
|
624
738
|
FfiConverterString.write(inner[0], into);
|
|
625
739
|
return;
|
|
626
740
|
}
|
|
627
|
-
case BitcoinWalletError_Tags.
|
|
741
|
+
case BitcoinWalletError_Tags.BitsConversionError:
|
|
628
742
|
{
|
|
629
743
|
ordinalConverter.write(12, into);
|
|
744
|
+
const inner = value.inner;
|
|
745
|
+
FfiConverterString.write(inner[0], into);
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
case BitcoinWalletError_Tags.InvalidPointFormat:
|
|
749
|
+
{
|
|
750
|
+
ordinalConverter.write(13, into);
|
|
751
|
+
const inner = value.inner;
|
|
752
|
+
FfiConverterString.write(inner[0], into);
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
case BitcoinWalletError_Tags.InvalidTweak:
|
|
756
|
+
{
|
|
757
|
+
ordinalConverter.write(14, into);
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
case BitcoinWalletError_Tags.InvalidDataRange:
|
|
761
|
+
{
|
|
762
|
+
ordinalConverter.write(15, into);
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
case BitcoinWalletError_Tags.InvalidPadding:
|
|
766
|
+
{
|
|
767
|
+
ordinalConverter.write(16, into);
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
770
|
+
case BitcoinWalletError_Tags.UnknownError:
|
|
771
|
+
{
|
|
772
|
+
ordinalConverter.write(17, into);
|
|
630
773
|
return;
|
|
631
774
|
}
|
|
632
775
|
default:
|
|
@@ -657,50 +800,85 @@ const FfiConverterTypeBitcoinWalletError = (() => {
|
|
|
657
800
|
size += FfiConverterString.allocationSize(inner[0]);
|
|
658
801
|
return size;
|
|
659
802
|
}
|
|
660
|
-
case BitcoinWalletError_Tags.
|
|
803
|
+
case BitcoinWalletError_Tags.AddressGenerationError:
|
|
661
804
|
{
|
|
662
805
|
const inner = value.inner;
|
|
663
806
|
let size = ordinalConverter.allocationSize(4);
|
|
664
807
|
size += FfiConverterString.allocationSize(inner[0]);
|
|
665
808
|
return size;
|
|
666
809
|
}
|
|
667
|
-
case BitcoinWalletError_Tags.
|
|
810
|
+
case BitcoinWalletError_Tags.InvalidPrivateKey:
|
|
668
811
|
{
|
|
669
812
|
const inner = value.inner;
|
|
670
813
|
let size = ordinalConverter.allocationSize(5);
|
|
671
814
|
size += FfiConverterString.allocationSize(inner[0]);
|
|
672
815
|
return size;
|
|
673
816
|
}
|
|
674
|
-
case BitcoinWalletError_Tags.InvalidPrivateKey:
|
|
675
|
-
{
|
|
676
|
-
return ordinalConverter.allocationSize(6);
|
|
677
|
-
}
|
|
678
817
|
case BitcoinWalletError_Tags.InvalidPublicKey:
|
|
679
818
|
{
|
|
680
|
-
|
|
819
|
+
const inner = value.inner;
|
|
820
|
+
let size = ordinalConverter.allocationSize(6);
|
|
821
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
822
|
+
return size;
|
|
681
823
|
}
|
|
682
824
|
case BitcoinWalletError_Tags.NetworkMismatch:
|
|
683
825
|
{
|
|
684
|
-
return ordinalConverter.allocationSize(
|
|
826
|
+
return ordinalConverter.allocationSize(7);
|
|
685
827
|
}
|
|
686
828
|
case BitcoinWalletError_Tags.WifGenerationError:
|
|
687
829
|
{
|
|
688
|
-
|
|
830
|
+
const inner = value.inner;
|
|
831
|
+
let size = ordinalConverter.allocationSize(8);
|
|
832
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
833
|
+
return size;
|
|
689
834
|
}
|
|
690
835
|
case BitcoinWalletError_Tags.JsonSerializationError:
|
|
691
836
|
{
|
|
692
|
-
return ordinalConverter.allocationSize(
|
|
837
|
+
return ordinalConverter.allocationSize(9);
|
|
693
838
|
}
|
|
694
839
|
case BitcoinWalletError_Tags.JsonFieldMissing:
|
|
840
|
+
{
|
|
841
|
+
const inner = value.inner;
|
|
842
|
+
let size = ordinalConverter.allocationSize(10);
|
|
843
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
844
|
+
return size;
|
|
845
|
+
}
|
|
846
|
+
case BitcoinWalletError_Tags.Bech32EncodingError:
|
|
695
847
|
{
|
|
696
848
|
const inner = value.inner;
|
|
697
849
|
let size = ordinalConverter.allocationSize(11);
|
|
698
850
|
size += FfiConverterString.allocationSize(inner[0]);
|
|
699
851
|
return size;
|
|
700
852
|
}
|
|
853
|
+
case BitcoinWalletError_Tags.BitsConversionError:
|
|
854
|
+
{
|
|
855
|
+
const inner = value.inner;
|
|
856
|
+
let size = ordinalConverter.allocationSize(12);
|
|
857
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
858
|
+
return size;
|
|
859
|
+
}
|
|
860
|
+
case BitcoinWalletError_Tags.InvalidPointFormat:
|
|
861
|
+
{
|
|
862
|
+
const inner = value.inner;
|
|
863
|
+
let size = ordinalConverter.allocationSize(13);
|
|
864
|
+
size += FfiConverterString.allocationSize(inner[0]);
|
|
865
|
+
return size;
|
|
866
|
+
}
|
|
867
|
+
case BitcoinWalletError_Tags.InvalidTweak:
|
|
868
|
+
{
|
|
869
|
+
return ordinalConverter.allocationSize(14);
|
|
870
|
+
}
|
|
871
|
+
case BitcoinWalletError_Tags.InvalidDataRange:
|
|
872
|
+
{
|
|
873
|
+
return ordinalConverter.allocationSize(15);
|
|
874
|
+
}
|
|
875
|
+
case BitcoinWalletError_Tags.InvalidPadding:
|
|
876
|
+
{
|
|
877
|
+
return ordinalConverter.allocationSize(16);
|
|
878
|
+
}
|
|
701
879
|
case BitcoinWalletError_Tags.UnknownError:
|
|
702
880
|
{
|
|
703
|
-
return ordinalConverter.allocationSize(
|
|
881
|
+
return ordinalConverter.allocationSize(17);
|
|
704
882
|
}
|
|
705
883
|
default:
|
|
706
884
|
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
@@ -816,6 +994,38 @@ const FfiConverterTypeMnemonicError = (() => {
|
|
|
816
994
|
}
|
|
817
995
|
return new FFIConverter();
|
|
818
996
|
})();
|
|
997
|
+
export let Network = /*#__PURE__*/function (Network) {
|
|
998
|
+
Network[Network["Mainnet"] = 0] = "Mainnet";
|
|
999
|
+
Network[Network["Testnet"] = 1] = "Testnet";
|
|
1000
|
+
return Network;
|
|
1001
|
+
}({});
|
|
1002
|
+
const FfiConverterTypeNetwork = (() => {
|
|
1003
|
+
const ordinalConverter = FfiConverterInt32;
|
|
1004
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
1005
|
+
read(from) {
|
|
1006
|
+
switch (ordinalConverter.read(from)) {
|
|
1007
|
+
case 1:
|
|
1008
|
+
return Network.Mainnet;
|
|
1009
|
+
case 2:
|
|
1010
|
+
return Network.Testnet;
|
|
1011
|
+
default:
|
|
1012
|
+
throw new UniffiInternalError.UnexpectedEnumCase();
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
write(value, into) {
|
|
1016
|
+
switch (value) {
|
|
1017
|
+
case Network.Mainnet:
|
|
1018
|
+
return ordinalConverter.write(1, into);
|
|
1019
|
+
case Network.Testnet:
|
|
1020
|
+
return ordinalConverter.write(2, into);
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
allocationSize(value) {
|
|
1024
|
+
return ordinalConverter.allocationSize(0);
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
return new FFIConverter();
|
|
1028
|
+
})();
|
|
819
1029
|
|
|
820
1030
|
// Error type: PasswordError
|
|
821
1031
|
|
|
@@ -1016,7 +1226,7 @@ function uniffiEnsureInitialized() {
|
|
|
1016
1226
|
if (bindingsContractVersion !== scaffoldingContractVersion) {
|
|
1017
1227
|
throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
|
|
1018
1228
|
}
|
|
1019
|
-
if (nativeModule().ubrn_uniffi_wallet_checksum_func_generate_bitcoin_keypair() !==
|
|
1229
|
+
if (nativeModule().ubrn_uniffi_wallet_checksum_func_generate_bitcoin_keypair() !== 16576) {
|
|
1020
1230
|
throw new UniffiInternalError.ApiChecksumMismatch('uniffi_wallet_checksum_func_generate_bitcoin_keypair');
|
|
1021
1231
|
}
|
|
1022
1232
|
if (nativeModule().ubrn_uniffi_wallet_checksum_func_generate_complex_password() !== 60238) {
|
|
@@ -1040,8 +1250,8 @@ export default Object.freeze({
|
|
|
1040
1250
|
converters: {
|
|
1041
1251
|
FfiConverterTypeAddressType,
|
|
1042
1252
|
FfiConverterTypeBitcoinKeyPair,
|
|
1043
|
-
|
|
1044
|
-
|
|
1253
|
+
FfiConverterTypeKeyPair,
|
|
1254
|
+
FfiConverterTypeNetwork
|
|
1045
1255
|
}
|
|
1046
1256
|
});
|
|
1047
1257
|
//# sourceMappingURL=wallet.js.map
|