@breeztech/breez-sdk-spark-react-native 0.1.9-dev1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/cpp/generated/breez_sdk_common.cpp +675 -25
  2. package/cpp/generated/breez_sdk_common.hpp +27 -0
  3. package/cpp/generated/breez_sdk_spark.cpp +196 -3
  4. package/cpp/generated/breez_sdk_spark.hpp +27 -0
  5. package/lib/commonjs/generated/breez_sdk_common-ffi.js.map +1 -1
  6. package/lib/commonjs/generated/breez_sdk_common.js +185 -1
  7. package/lib/commonjs/generated/breez_sdk_common.js.map +1 -1
  8. package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
  9. package/lib/commonjs/generated/breez_sdk_spark.js +427 -17
  10. package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -1
  11. package/lib/module/generated/breez_sdk_common-ffi.js.map +1 -1
  12. package/lib/module/generated/breez_sdk_common.js +183 -0
  13. package/lib/module/generated/breez_sdk_common.js.map +1 -1
  14. package/lib/module/generated/breez_sdk_spark-ffi.js.map +1 -1
  15. package/lib/module/generated/breez_sdk_spark.js +427 -17
  16. package/lib/module/generated/breez_sdk_spark.js.map +1 -1
  17. package/lib/typescript/commonjs/src/generated/breez_sdk_common-ffi.d.ts +15 -0
  18. package/lib/typescript/commonjs/src/generated/breez_sdk_common-ffi.d.ts.map +1 -1
  19. package/lib/typescript/commonjs/src/generated/breez_sdk_common.d.ts +44 -0
  20. package/lib/typescript/commonjs/src/generated/breez_sdk_common.d.ts.map +1 -1
  21. package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +10 -2
  22. package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
  23. package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts +306 -12
  24. package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts.map +1 -1
  25. package/lib/typescript/module/src/generated/breez_sdk_common-ffi.d.ts +15 -0
  26. package/lib/typescript/module/src/generated/breez_sdk_common-ffi.d.ts.map +1 -1
  27. package/lib/typescript/module/src/generated/breez_sdk_common.d.ts +44 -0
  28. package/lib/typescript/module/src/generated/breez_sdk_common.d.ts.map +1 -1
  29. package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts +10 -2
  30. package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
  31. package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts +306 -12
  32. package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts.map +1 -1
  33. package/package.json +1 -1
  34. package/src/generated/breez_sdk_common-ffi.ts +38 -0
  35. package/src/generated/breez_sdk_common.ts +334 -0
  36. package/src/generated/breez_sdk_spark-ffi.ts +22 -2
  37. package/src/generated/breez_sdk_spark.ts +657 -20
@@ -3,15 +3,18 @@
3
3
  // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
4
4
  // Trust me, you don't want to mess with it!
5
5
  import nativeModule from "./breez_sdk_spark-ffi.js";
6
- import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterBool, FfiConverterCallback, FfiConverterInt32, FfiConverterObject, FfiConverterObjectWithCallbacks, FfiConverterOptional, FfiConverterUInt32, FfiConverterUInt64, UniffiAbstractObject, UniffiEnum, UniffiError, UniffiInternalError, UniffiResult, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiRustCallAsync, uniffiTraitInterfaceCall, uniffiTraitInterfaceCallAsyncWithError, uniffiTypeNameSymbol } from 'uniffi-bindgen-react-native';
6
+ import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterArrayBuffer, FfiConverterBool, FfiConverterCallback, FfiConverterInt32, FfiConverterObject, FfiConverterObjectWithCallbacks, FfiConverterOptional, FfiConverterUInt32, FfiConverterUInt64, UniffiAbstractObject, UniffiEnum, UniffiError, UniffiInternalError, UniffiResult, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiRustCallAsync, uniffiTraitInterfaceCall, uniffiTraitInterfaceCallAsyncWithError, uniffiTypeNameSymbol } from 'uniffi-bindgen-react-native';
7
7
 
8
8
  // Get converters from the other files, if any.
9
9
  import uniffiBreezSdkCommonModule from "./breez_sdk_common.js";
10
10
  const {
11
11
  FfiConverterTypeBitcoinAddressDetails,
12
12
  FfiConverterTypeBolt11InvoiceDetails,
13
+ FfiConverterTypeFiatCurrency,
14
+ FfiConverterTypeFiatService,
13
15
  FfiConverterTypeInputType,
14
16
  FfiConverterTypeLnurlPayRequestDetails,
17
+ FfiConverterTypeRate,
15
18
  FfiConverterTypeRestClient,
16
19
  FfiConverterTypeSuccessAction,
17
20
  FfiConverterTypeSuccessActionProcessed
@@ -303,7 +306,8 @@ const FfiConverterTypeConfig = (() => {
303
306
  network: FfiConverterTypeNetwork.read(from),
304
307
  syncIntervalSecs: FfiConverterUInt32.read(from),
305
308
  maxDepositClaimFee: FfiConverterOptionalTypeFee.read(from),
306
- lnurlDomain: FfiConverterOptionalString.read(from)
309
+ lnurlDomain: FfiConverterOptionalString.read(from),
310
+ preferSparkOverLightning: FfiConverterBool.read(from)
307
311
  };
308
312
  }
309
313
  write(value, into) {
@@ -312,9 +316,10 @@ const FfiConverterTypeConfig = (() => {
312
316
  FfiConverterUInt32.write(value.syncIntervalSecs, into);
313
317
  FfiConverterOptionalTypeFee.write(value.maxDepositClaimFee, into);
314
318
  FfiConverterOptionalString.write(value.lnurlDomain, into);
319
+ FfiConverterBool.write(value.preferSparkOverLightning, into);
315
320
  }
316
321
  allocationSize(value) {
317
- return FfiConverterOptionalString.allocationSize(value.apiKey) + FfiConverterTypeNetwork.allocationSize(value.network) + FfiConverterUInt32.allocationSize(value.syncIntervalSecs) + FfiConverterOptionalTypeFee.allocationSize(value.maxDepositClaimFee) + FfiConverterOptionalString.allocationSize(value.lnurlDomain);
322
+ return FfiConverterOptionalString.allocationSize(value.apiKey) + FfiConverterTypeNetwork.allocationSize(value.network) + FfiConverterUInt32.allocationSize(value.syncIntervalSecs) + FfiConverterOptionalTypeFee.allocationSize(value.maxDepositClaimFee) + FfiConverterOptionalString.allocationSize(value.lnurlDomain) + FfiConverterBool.allocationSize(value.preferSparkOverLightning);
318
323
  }
319
324
  }
320
325
  return new FFIConverter();
@@ -349,17 +354,17 @@ const FfiConverterTypeConnectRequest = (() => {
349
354
  read(from) {
350
355
  return {
351
356
  config: FfiConverterTypeConfig.read(from),
352
- mnemonic: FfiConverterString.read(from),
357
+ seed: FfiConverterTypeSeed.read(from),
353
358
  storageDir: FfiConverterString.read(from)
354
359
  };
355
360
  }
356
361
  write(value, into) {
357
362
  FfiConverterTypeConfig.write(value.config, into);
358
- FfiConverterString.write(value.mnemonic, into);
363
+ FfiConverterTypeSeed.write(value.seed, into);
359
364
  FfiConverterString.write(value.storageDir, into);
360
365
  }
361
366
  allocationSize(value) {
362
- return FfiConverterTypeConfig.allocationSize(value.config) + FfiConverterString.allocationSize(value.mnemonic) + FfiConverterString.allocationSize(value.storageDir);
367
+ return FfiConverterTypeConfig.allocationSize(value.config) + FfiConverterTypeSeed.allocationSize(value.seed) + FfiConverterString.allocationSize(value.storageDir);
363
368
  }
364
369
  }
365
370
  return new FFIConverter();
@@ -676,6 +681,98 @@ const FfiConverterTypeLightningAddressInfo = (() => {
676
681
  return new FFIConverter();
677
682
  })();
678
683
 
684
+ /**
685
+ * Response from listing fiat currencies
686
+ */
687
+
688
+ /**
689
+ * Generated factory for {@link ListFiatCurrenciesResponse} record objects.
690
+ */
691
+ export const ListFiatCurrenciesResponse = (() => {
692
+ const defaults = () => ({});
693
+ const create = (() => {
694
+ return uniffiCreateRecord(defaults);
695
+ })();
696
+ return Object.freeze({
697
+ /**
698
+ * Create a frozen instance of {@link ListFiatCurrenciesResponse}, with defaults specified
699
+ * in Rust, in the {@link breez_sdk_spark} crate.
700
+ */
701
+ create,
702
+ /**
703
+ * Create a frozen instance of {@link ListFiatCurrenciesResponse}, with defaults specified
704
+ * in Rust, in the {@link breez_sdk_spark} crate.
705
+ */
706
+ new: create,
707
+ /**
708
+ * Defaults specified in the {@link breez_sdk_spark} crate.
709
+ */
710
+ defaults: () => Object.freeze(defaults())
711
+ });
712
+ })();
713
+ const FfiConverterTypeListFiatCurrenciesResponse = (() => {
714
+ class FFIConverter extends AbstractFfiConverterByteArray {
715
+ read(from) {
716
+ return {
717
+ currencies: FfiConverterArrayTypeFiatCurrency.read(from)
718
+ };
719
+ }
720
+ write(value, into) {
721
+ FfiConverterArrayTypeFiatCurrency.write(value.currencies, into);
722
+ }
723
+ allocationSize(value) {
724
+ return FfiConverterArrayTypeFiatCurrency.allocationSize(value.currencies);
725
+ }
726
+ }
727
+ return new FFIConverter();
728
+ })();
729
+
730
+ /**
731
+ * Response from listing fiat rates
732
+ */
733
+
734
+ /**
735
+ * Generated factory for {@link ListFiatRatesResponse} record objects.
736
+ */
737
+ export const ListFiatRatesResponse = (() => {
738
+ const defaults = () => ({});
739
+ const create = (() => {
740
+ return uniffiCreateRecord(defaults);
741
+ })();
742
+ return Object.freeze({
743
+ /**
744
+ * Create a frozen instance of {@link ListFiatRatesResponse}, with defaults specified
745
+ * in Rust, in the {@link breez_sdk_spark} crate.
746
+ */
747
+ create,
748
+ /**
749
+ * Create a frozen instance of {@link ListFiatRatesResponse}, with defaults specified
750
+ * in Rust, in the {@link breez_sdk_spark} crate.
751
+ */
752
+ new: create,
753
+ /**
754
+ * Defaults specified in the {@link breez_sdk_spark} crate.
755
+ */
756
+ defaults: () => Object.freeze(defaults())
757
+ });
758
+ })();
759
+ const FfiConverterTypeListFiatRatesResponse = (() => {
760
+ class FFIConverter extends AbstractFfiConverterByteArray {
761
+ read(from) {
762
+ return {
763
+ rates: FfiConverterArrayTypeRate.read(from)
764
+ };
765
+ }
766
+ write(value, into) {
767
+ FfiConverterArrayTypeRate.write(value.rates, into);
768
+ }
769
+ allocationSize(value) {
770
+ return FfiConverterArrayTypeRate.allocationSize(value.rates);
771
+ }
772
+ }
773
+ return new FFIConverter();
774
+ })();
775
+
679
776
  /**
680
777
  * Request to list payments with pagination
681
778
  */
@@ -2352,6 +2449,53 @@ const FfiConverterTypeFee = (() => {
2352
2449
  }
2353
2450
  return new FFIConverter();
2354
2451
  })();
2452
+ export let KeySetType = /*#__PURE__*/function (KeySetType) {
2453
+ KeySetType[KeySetType["Default"] = 0] = "Default";
2454
+ KeySetType[KeySetType["Taproot"] = 1] = "Taproot";
2455
+ KeySetType[KeySetType["NativeSegwit"] = 2] = "NativeSegwit";
2456
+ KeySetType[KeySetType["WrappedSegwit"] = 3] = "WrappedSegwit";
2457
+ KeySetType[KeySetType["Legacy"] = 4] = "Legacy";
2458
+ return KeySetType;
2459
+ }({});
2460
+ const FfiConverterTypeKeySetType = (() => {
2461
+ const ordinalConverter = FfiConverterInt32;
2462
+ class FFIConverter extends AbstractFfiConverterByteArray {
2463
+ read(from) {
2464
+ switch (ordinalConverter.read(from)) {
2465
+ case 1:
2466
+ return KeySetType.Default;
2467
+ case 2:
2468
+ return KeySetType.Taproot;
2469
+ case 3:
2470
+ return KeySetType.NativeSegwit;
2471
+ case 4:
2472
+ return KeySetType.WrappedSegwit;
2473
+ case 5:
2474
+ return KeySetType.Legacy;
2475
+ default:
2476
+ throw new UniffiInternalError.UnexpectedEnumCase();
2477
+ }
2478
+ }
2479
+ write(value, into) {
2480
+ switch (value) {
2481
+ case KeySetType.Default:
2482
+ return ordinalConverter.write(1, into);
2483
+ case KeySetType.Taproot:
2484
+ return ordinalConverter.write(2, into);
2485
+ case KeySetType.NativeSegwit:
2486
+ return ordinalConverter.write(3, into);
2487
+ case KeySetType.WrappedSegwit:
2488
+ return ordinalConverter.write(4, into);
2489
+ case KeySetType.Legacy:
2490
+ return ordinalConverter.write(5, into);
2491
+ }
2492
+ }
2493
+ allocationSize(value) {
2494
+ return ordinalConverter.allocationSize(0);
2495
+ }
2496
+ }
2497
+ return new FFIConverter();
2498
+ })();
2355
2499
  export let Network = /*#__PURE__*/function (Network) {
2356
2500
  Network[Network["Mainnet"] = 0] = "Mainnet";
2357
2501
  Network[Network["Regtest"] = 1] = "Regtest";
@@ -3399,6 +3543,7 @@ export let SdkEvent_Tags = /*#__PURE__*/function (SdkEvent_Tags) {
3399
3543
  SdkEvent_Tags["ClaimDepositsFailed"] = "ClaimDepositsFailed";
3400
3544
  SdkEvent_Tags["ClaimDepositsSucceeded"] = "ClaimDepositsSucceeded";
3401
3545
  SdkEvent_Tags["PaymentSucceeded"] = "PaymentSucceeded";
3546
+ SdkEvent_Tags["PaymentFailed"] = "PaymentFailed";
3402
3547
  return SdkEvent_Tags;
3403
3548
  }({});
3404
3549
  /**
@@ -3482,6 +3627,24 @@ export const SdkEvent = (() => {
3482
3627
  return obj.tag === SdkEvent_Tags.PaymentSucceeded;
3483
3628
  }
3484
3629
  }
3630
+ class PaymentFailed_ extends UniffiEnum {
3631
+ /**
3632
+ * @private
3633
+ * This field is private and should not be used, use `tag` instead.
3634
+ */
3635
+ [uniffiTypeNameSymbol] = 'SdkEvent';
3636
+ tag = SdkEvent_Tags.PaymentFailed;
3637
+ constructor(inner) {
3638
+ super('SdkEvent', 'PaymentFailed');
3639
+ this.inner = Object.freeze(inner);
3640
+ }
3641
+ static new(inner) {
3642
+ return new PaymentFailed_(inner);
3643
+ }
3644
+ static instanceOf(obj) {
3645
+ return obj.tag === SdkEvent_Tags.PaymentFailed;
3646
+ }
3647
+ }
3485
3648
  function instanceOf(obj) {
3486
3649
  return obj[uniffiTypeNameSymbol] === 'SdkEvent';
3487
3650
  }
@@ -3490,7 +3653,8 @@ export const SdkEvent = (() => {
3490
3653
  Synced: Synced_,
3491
3654
  ClaimDepositsFailed: ClaimDepositsFailed_,
3492
3655
  ClaimDepositsSucceeded: ClaimDepositsSucceeded_,
3493
- PaymentSucceeded: PaymentSucceeded_
3656
+ PaymentSucceeded: PaymentSucceeded_,
3657
+ PaymentFailed: PaymentFailed_
3494
3658
  });
3495
3659
  })();
3496
3660
 
@@ -3518,6 +3682,10 @@ const FfiConverterTypeSdkEvent = (() => {
3518
3682
  return new SdkEvent.PaymentSucceeded({
3519
3683
  payment: FfiConverterTypePayment.read(from)
3520
3684
  });
3685
+ case 5:
3686
+ return new SdkEvent.PaymentFailed({
3687
+ payment: FfiConverterTypePayment.read(from)
3688
+ });
3521
3689
  default:
3522
3690
  throw new UniffiInternalError.UnexpectedEnumCase();
3523
3691
  }
@@ -3550,6 +3718,13 @@ const FfiConverterTypeSdkEvent = (() => {
3550
3718
  FfiConverterTypePayment.write(inner.payment, into);
3551
3719
  return;
3552
3720
  }
3721
+ case SdkEvent_Tags.PaymentFailed:
3722
+ {
3723
+ ordinalConverter.write(5, into);
3724
+ const inner = value.inner;
3725
+ FfiConverterTypePayment.write(inner.payment, into);
3726
+ return;
3727
+ }
3553
3728
  default:
3554
3729
  // Throwing from here means that SdkEvent_Tags hasn't matched an ordinal.
3555
3730
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -3582,6 +3757,145 @@ const FfiConverterTypeSdkEvent = (() => {
3582
3757
  size += FfiConverterTypePayment.allocationSize(inner.payment);
3583
3758
  return size;
3584
3759
  }
3760
+ case SdkEvent_Tags.PaymentFailed:
3761
+ {
3762
+ const inner = value.inner;
3763
+ let size = ordinalConverter.allocationSize(5);
3764
+ size += FfiConverterTypePayment.allocationSize(inner.payment);
3765
+ return size;
3766
+ }
3767
+ default:
3768
+ throw new UniffiInternalError.UnexpectedEnumCase();
3769
+ }
3770
+ }
3771
+ }
3772
+ return new FFIConverter();
3773
+ })();
3774
+
3775
+ // Enum: Seed
3776
+ export let Seed_Tags = /*#__PURE__*/function (Seed_Tags) {
3777
+ Seed_Tags["Mnemonic"] = "Mnemonic";
3778
+ Seed_Tags["Entropy"] = "Entropy";
3779
+ return Seed_Tags;
3780
+ }({});
3781
+ /**
3782
+ * Represents the seed for wallet generation, either as a mnemonic phrase with an optional
3783
+ * passphrase or as raw entropy bytes.
3784
+ */
3785
+ export const Seed = (() => {
3786
+ /**
3787
+ * A BIP-39 mnemonic phrase with an optional passphrase.
3788
+ */
3789
+ class Mnemonic_ extends UniffiEnum {
3790
+ /**
3791
+ * @private
3792
+ * This field is private and should not be used, use `tag` instead.
3793
+ */
3794
+ [uniffiTypeNameSymbol] = 'Seed';
3795
+ tag = Seed_Tags.Mnemonic;
3796
+ constructor(inner) {
3797
+ super('Seed', 'Mnemonic');
3798
+ this.inner = Object.freeze(inner);
3799
+ }
3800
+ static new(inner) {
3801
+ return new Mnemonic_(inner);
3802
+ }
3803
+ static instanceOf(obj) {
3804
+ return obj.tag === Seed_Tags.Mnemonic;
3805
+ }
3806
+ }
3807
+ /**
3808
+ * Raw entropy bytes.
3809
+ */
3810
+ class Entropy_ extends UniffiEnum {
3811
+ /**
3812
+ * @private
3813
+ * This field is private and should not be used, use `tag` instead.
3814
+ */
3815
+ [uniffiTypeNameSymbol] = 'Seed';
3816
+ tag = Seed_Tags.Entropy;
3817
+ constructor(v0) {
3818
+ super('Seed', 'Entropy');
3819
+ this.inner = Object.freeze([v0]);
3820
+ }
3821
+ static new(v0) {
3822
+ return new Entropy_(v0);
3823
+ }
3824
+ static instanceOf(obj) {
3825
+ return obj.tag === Seed_Tags.Entropy;
3826
+ }
3827
+ }
3828
+ function instanceOf(obj) {
3829
+ return obj[uniffiTypeNameSymbol] === 'Seed';
3830
+ }
3831
+ return Object.freeze({
3832
+ instanceOf,
3833
+ Mnemonic: Mnemonic_,
3834
+ Entropy: Entropy_
3835
+ });
3836
+ })();
3837
+
3838
+ /**
3839
+ * Represents the seed for wallet generation, either as a mnemonic phrase with an optional
3840
+ * passphrase or as raw entropy bytes.
3841
+ */
3842
+
3843
+ // FfiConverter for enum Seed
3844
+ const FfiConverterTypeSeed = (() => {
3845
+ const ordinalConverter = FfiConverterInt32;
3846
+ class FFIConverter extends AbstractFfiConverterByteArray {
3847
+ read(from) {
3848
+ switch (ordinalConverter.read(from)) {
3849
+ case 1:
3850
+ return new Seed.Mnemonic({
3851
+ mnemonic: FfiConverterString.read(from),
3852
+ passphrase: FfiConverterOptionalString.read(from)
3853
+ });
3854
+ case 2:
3855
+ return new Seed.Entropy(FfiConverterArrayBuffer.read(from));
3856
+ default:
3857
+ throw new UniffiInternalError.UnexpectedEnumCase();
3858
+ }
3859
+ }
3860
+ write(value, into) {
3861
+ switch (value.tag) {
3862
+ case Seed_Tags.Mnemonic:
3863
+ {
3864
+ ordinalConverter.write(1, into);
3865
+ const inner = value.inner;
3866
+ FfiConverterString.write(inner.mnemonic, into);
3867
+ FfiConverterOptionalString.write(inner.passphrase, into);
3868
+ return;
3869
+ }
3870
+ case Seed_Tags.Entropy:
3871
+ {
3872
+ ordinalConverter.write(2, into);
3873
+ const inner = value.inner;
3874
+ FfiConverterArrayBuffer.write(inner[0], into);
3875
+ return;
3876
+ }
3877
+ default:
3878
+ // Throwing from here means that Seed_Tags hasn't matched an ordinal.
3879
+ throw new UniffiInternalError.UnexpectedEnumCase();
3880
+ }
3881
+ }
3882
+ allocationSize(value) {
3883
+ switch (value.tag) {
3884
+ case Seed_Tags.Mnemonic:
3885
+ {
3886
+ const inner = value.inner;
3887
+ let size = ordinalConverter.allocationSize(1);
3888
+ size += FfiConverterString.allocationSize(inner.mnemonic);
3889
+ size += FfiConverterOptionalString.allocationSize(inner.passphrase);
3890
+ return size;
3891
+ }
3892
+ case Seed_Tags.Entropy:
3893
+ {
3894
+ const inner = value.inner;
3895
+ let size = ordinalConverter.allocationSize(2);
3896
+ size += FfiConverterArrayBuffer.allocationSize(inner[0]);
3897
+ return size;
3898
+ }
3585
3899
  default:
3586
3900
  throw new UniffiInternalError.UnexpectedEnumCase();
3587
3901
  }
@@ -3819,7 +4133,7 @@ const FfiConverterTypeSendPaymentOptions = (() => {
3819
4133
  });
3820
4134
  case 2:
3821
4135
  return new SendPaymentOptions.Bolt11Invoice({
3822
- useSpark: FfiConverterBool.read(from)
4136
+ preferSpark: FfiConverterBool.read(from)
3823
4137
  });
3824
4138
  default:
3825
4139
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -3838,7 +4152,7 @@ const FfiConverterTypeSendPaymentOptions = (() => {
3838
4152
  {
3839
4153
  ordinalConverter.write(2, into);
3840
4154
  const inner = value.inner;
3841
- FfiConverterBool.write(inner.useSpark, into);
4155
+ FfiConverterBool.write(inner.preferSpark, into);
3842
4156
  return;
3843
4157
  }
3844
4158
  default:
@@ -3859,7 +4173,7 @@ const FfiConverterTypeSendPaymentOptions = (() => {
3859
4173
  {
3860
4174
  const inner = value.inner;
3861
4175
  let size = ordinalConverter.allocationSize(2);
3862
- size += FfiConverterBool.allocationSize(inner.useSpark);
4176
+ size += FfiConverterBool.allocationSize(inner.preferSpark);
3863
4177
  return size;
3864
4178
  }
3865
4179
  default:
@@ -4489,6 +4803,41 @@ export class BreezSdk extends UniffiAbstractObject {
4489
4803
  }
4490
4804
  }
4491
4805
 
4806
+ /**
4807
+ * List fiat currencies for which there is a known exchange rate,
4808
+ * sorted by the canonical name of the currency.
4809
+ */
4810
+ async listFiatCurrencies(asyncOpts_) /*throws*/{
4811
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
4812
+ try {
4813
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
4814
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_list_fiat_currencies(uniffiTypeBreezSdkObjectFactory.clonePointer(this));
4815
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeListFiatCurrenciesResponse.lift.bind(FfiConverterTypeListFiatCurrenciesResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
4816
+ } catch (__error) {
4817
+ if (uniffiIsDebug && __error instanceof Error) {
4818
+ __error.stack = __stack;
4819
+ }
4820
+ throw __error;
4821
+ }
4822
+ }
4823
+
4824
+ /**
4825
+ * List the latest rates of fiat currencies, sorted by name.
4826
+ */
4827
+ async listFiatRates(asyncOpts_) /*throws*/{
4828
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
4829
+ try {
4830
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
4831
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_list_fiat_rates(uniffiTypeBreezSdkObjectFactory.clonePointer(this));
4832
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeListFiatRatesResponse.lift.bind(FfiConverterTypeListFiatRatesResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
4833
+ } catch (__error) {
4834
+ if (uniffiIsDebug && __error instanceof Error) {
4835
+ __error.stack = __stack;
4836
+ }
4837
+ throw __error;
4838
+ }
4839
+ }
4840
+
4492
4841
  /**
4493
4842
  * Lists payments from the storage with pagination
4494
4843
  *
@@ -4543,9 +4892,9 @@ export class BreezSdk extends UniffiAbstractObject {
4543
4892
  throw __error;
4544
4893
  }
4545
4894
  }
4546
- pollLightningSendPayment(paymentId) {
4895
+ pollLightningSendPayment(payment, sspId) {
4547
4896
  uniffiCaller.rustCall(/*caller:*/callStatus => {
4548
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterString.lower(paymentId), callStatus);
4897
+ nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypePayment.lower(payment), FfiConverterString.lower(sspId), callStatus);
4549
4898
  }, /*liftString:*/FfiConverterString.lift);
4550
4899
  }
4551
4900
  async prepareLnurlPay(request, asyncOpts_) /*throws*/{
@@ -4746,13 +5095,13 @@ export class SdkBuilder extends UniffiAbstractObject {
4746
5095
  * Creates a new `SdkBuilder` with the provided configuration.
4747
5096
  * Arguments:
4748
5097
  * - `config`: The configuration to be used.
4749
- * - `mnemonic`: The mnemonic phrase for the wallet.
5098
+ * - `seed`: The seed for wallet generation.
4750
5099
  * - `storage`: The storage backend to be used.
4751
5100
  */
4752
- constructor(config, mnemonic, storage) {
5101
+ constructor(config, seed, storage) {
4753
5102
  super();
4754
5103
  const pointer = uniffiCaller.rustCall(/*caller:*/callStatus => {
4755
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new(FfiConverterTypeConfig.lower(config), FfiConverterString.lower(mnemonic), FfiConverterTypeStorage.lower(storage), callStatus);
5104
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new(FfiConverterTypeConfig.lower(config), FfiConverterTypeSeed.lower(seed), FfiConverterTypeStorage.lower(storage), callStatus);
4756
5105
  }, /*liftString:*/FfiConverterString.lift);
4757
5106
  this[pointerLiteralSymbol] = pointer;
4758
5107
  this[destructorGuardSymbol] = uniffiTypeSdkBuilderObjectFactory.bless(pointer);
@@ -4793,6 +5142,45 @@ export class SdkBuilder extends UniffiAbstractObject {
4793
5142
  throw __error;
4794
5143
  }
4795
5144
  }
5145
+
5146
+ /**
5147
+ * Sets the fiat service to be used by the SDK.
5148
+ * Arguments:
5149
+ * - `fiat_service`: The fiat service to be used.
5150
+ */
5151
+ async withFiatService(fiatService, asyncOpts_) {
5152
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
5153
+ try {
5154
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5155
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_fiat_service(uniffiTypeSdkBuilderObjectFactory.clonePointer(this), FfiConverterTypeFiatService.lower(fiatService));
5156
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_void, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_void, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_void, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_);
5157
+ } catch (__error) {
5158
+ if (uniffiIsDebug && __error instanceof Error) {
5159
+ __error.stack = __stack;
5160
+ }
5161
+ throw __error;
5162
+ }
5163
+ }
5164
+
5165
+ /**
5166
+ * Sets the key set type to be used by the SDK.
5167
+ * Arguments:
5168
+ * - `key_set_type`: The key set type which determines the derivation path.
5169
+ * - `use_address_index`: Controls the structure of the BIP derivation path.
5170
+ */
5171
+ async withKeySet(keySetType, useAddressIndex, asyncOpts_) {
5172
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
5173
+ try {
5174
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5175
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_key_set(uniffiTypeSdkBuilderObjectFactory.clonePointer(this), FfiConverterTypeKeySetType.lower(keySetType), FfiConverterBool.lower(useAddressIndex));
5176
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_void, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_void, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_void, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_);
5177
+ } catch (__error) {
5178
+ if (uniffiIsDebug && __error instanceof Error) {
5179
+ __error.stack = __stack;
5180
+ }
5181
+ throw __error;
5182
+ }
5183
+ }
4796
5184
  async withLnurlClient(lnurlClient, asyncOpts_) {
4797
5185
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
4798
5186
  try {
@@ -5499,6 +5887,12 @@ const FfiConverterOptionalUInt32 = new FfiConverterOptional(FfiConverterUInt32);
5499
5887
  // FfiConverter for /*u64*/bigint | undefined
5500
5888
  const FfiConverterOptionalUInt64 = new FfiConverterOptional(FfiConverterUInt64);
5501
5889
 
5890
+ // FfiConverter for Array<FiatCurrency>
5891
+ const FfiConverterArrayTypeFiatCurrency = new FfiConverterArray(FfiConverterTypeFiatCurrency);
5892
+
5893
+ // FfiConverter for Array<Rate>
5894
+ const FfiConverterArrayTypeRate = new FfiConverterArray(FfiConverterTypeRate);
5895
+
5502
5896
  // FfiConverter for Array<DepositInfo>
5503
5897
  const FfiConverterArrayTypeDepositInfo = new FfiConverterArray(FfiConverterTypeDepositInfo);
5504
5898
 
@@ -5586,6 +5980,12 @@ function uniffiEnsureInitialized() {
5586
5980
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment() !== 11540) {
5587
5981
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment');
5588
5982
  }
5983
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies() !== 63366) {
5984
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies');
5985
+ }
5986
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_rates() !== 5904) {
5987
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_rates');
5988
+ }
5589
5989
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_list_payments() !== 16156) {
5590
5990
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_list_payments');
5591
5991
  }
@@ -5595,7 +5995,7 @@ function uniffiEnsureInitialized() {
5595
5995
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay() !== 10147) {
5596
5996
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay');
5597
5997
  }
5598
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment() !== 5478) {
5998
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment() !== 57601) {
5599
5999
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment');
5600
6000
  }
5601
6001
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay() !== 37691) {
@@ -5634,6 +6034,12 @@ function uniffiEnsureInitialized() {
5634
6034
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service() !== 2848) {
5635
6035
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service');
5636
6036
  }
6037
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_fiat_service() !== 41113) {
6038
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_fiat_service');
6039
+ }
6040
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set() !== 55523) {
6041
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set');
6042
+ }
5637
6043
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client() !== 61720) {
5638
6044
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client');
5639
6045
  }
@@ -5673,7 +6079,7 @@ function uniffiEnsureInitialized() {
5673
6079
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_update_deposit() !== 48478) {
5674
6080
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_update_deposit');
5675
6081
  }
5676
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new() !== 52744) {
6082
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new() !== 53882) {
5677
6083
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new');
5678
6084
  }
5679
6085
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_eventlistener_on_event() !== 10824) {
@@ -5705,7 +6111,10 @@ export default Object.freeze({
5705
6111
  FfiConverterTypeGetInfoResponse,
5706
6112
  FfiConverterTypeGetPaymentRequest,
5707
6113
  FfiConverterTypeGetPaymentResponse,
6114
+ FfiConverterTypeKeySetType,
5708
6115
  FfiConverterTypeLightningAddressInfo,
6116
+ FfiConverterTypeListFiatCurrenciesResponse,
6117
+ FfiConverterTypeListFiatRatesResponse,
5709
6118
  FfiConverterTypeListPaymentsRequest,
5710
6119
  FfiConverterTypeListPaymentsResponse,
5711
6120
  FfiConverterTypeListUnclaimedDepositsRequest,
@@ -5734,6 +6143,7 @@ export default Object.freeze({
5734
6143
  FfiConverterTypeRegisterLightningAddressRequest,
5735
6144
  FfiConverterTypeSdkBuilder,
5736
6145
  FfiConverterTypeSdkEvent,
6146
+ FfiConverterTypeSeed,
5737
6147
  FfiConverterTypeSendOnchainFeeQuote,
5738
6148
  FfiConverterTypeSendOnchainSpeedFeeQuote,
5739
6149
  FfiConverterTypeSendPaymentMethod,