@breeztech/breez-sdk-spark-react-native 0.1.9-dev2 → 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 +142 -1
  4. package/cpp/generated/breez_sdk_spark.hpp +21 -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 +310 -11
  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 +310 -11
  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 +7 -1
  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 +225 -9
  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 +7 -1
  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 +225 -9
  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 +14 -1
  37. package/src/generated/breez_sdk_spark.ts +486 -15
@@ -1 +1 @@
1
- {"version":3,"names":["getter","globalThis","NativeBreezSdkCommon","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/breez_sdk_common-ffi.ts"],"mappings":";;AAAA;AACA;;AA+MA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,oBAAoB;AAC1C,eAAeF,MAAM;;AAErB;;AAgJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,8CAGL,GAAG,IAAI;AACR,MAAMC,mCAGL,GAAG,IAAI","ignoreList":[]}
1
+ {"version":3,"names":["getter","globalThis","NativeBreezSdkCommon","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/breez_sdk_common-ffi.ts"],"mappings":";;AAAA;AACA;;AAsOA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,oBAAoB;AAC1C,eAAeF,MAAM;;AAErB;;AA+JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,8CAGL,GAAG,IAAI;AACR,MAAMC,mCAGL,GAAG,IAAI","ignoreList":[]}
@@ -3593,6 +3593,175 @@ const FfiConverterTypeSuccessActionProcessed = (() => {
3593
3593
 
3594
3594
  // FfiConverter for Map<string, string>
3595
3595
  const FfiConverterMapStringString = new FfiConverterMap(FfiConverterString, FfiConverterString);
3596
+
3597
+ /**
3598
+ * Trait covering fiat-related functionality
3599
+ */
3600
+
3601
+ /**
3602
+ * Trait covering fiat-related functionality
3603
+ */
3604
+ export class FiatServiceImpl extends UniffiAbstractObject {
3605
+ [uniffiTypeNameSymbol] = 'FiatServiceImpl';
3606
+ // No primary constructor declared for this class.
3607
+ constructor(pointer) {
3608
+ super();
3609
+ this[pointerLiteralSymbol] = pointer;
3610
+ this[destructorGuardSymbol] = uniffiTypeFiatServiceImplObjectFactory.bless(pointer);
3611
+ }
3612
+
3613
+ /**
3614
+ * List all supported fiat currencies for which there is a known exchange rate.
3615
+ */
3616
+ async fetchFiatCurrencies(asyncOpts_) /*throws*/{
3617
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3618
+ try {
3619
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3620
+ return nativeModule().ubrn_uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_currencies(uniffiTypeFiatServiceImplObjectFactory.clonePointer(this));
3621
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterArrayTypeFiatCurrency.lift.bind(FfiConverterArrayTypeFiatCurrency), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeServiceConnectivityError.lift.bind(FfiConverterTypeServiceConnectivityError));
3622
+ } catch (__error) {
3623
+ if (uniffiIsDebug && __error instanceof Error) {
3624
+ __error.stack = __stack;
3625
+ }
3626
+ throw __error;
3627
+ }
3628
+ }
3629
+
3630
+ /**
3631
+ * Get the live rates from the server.
3632
+ */
3633
+ async fetchFiatRates(asyncOpts_) /*throws*/{
3634
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
3635
+ try {
3636
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
3637
+ return nativeModule().ubrn_uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_rates(uniffiTypeFiatServiceImplObjectFactory.clonePointer(this));
3638
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_common_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterArrayTypeRate.lift.bind(FfiConverterArrayTypeRate), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeServiceConnectivityError.lift.bind(FfiConverterTypeServiceConnectivityError));
3639
+ } catch (__error) {
3640
+ if (uniffiIsDebug && __error instanceof Error) {
3641
+ __error.stack = __stack;
3642
+ }
3643
+ throw __error;
3644
+ }
3645
+ }
3646
+
3647
+ /**
3648
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
3649
+ */
3650
+ uniffiDestroy() {
3651
+ const ptr = this[destructorGuardSymbol];
3652
+ if (ptr !== undefined) {
3653
+ const pointer = uniffiTypeFiatServiceImplObjectFactory.pointer(this);
3654
+ uniffiTypeFiatServiceImplObjectFactory.freePointer(pointer);
3655
+ uniffiTypeFiatServiceImplObjectFactory.unbless(ptr);
3656
+ delete this[destructorGuardSymbol];
3657
+ }
3658
+ }
3659
+ static instanceOf(obj) {
3660
+ return uniffiTypeFiatServiceImplObjectFactory.isConcreteType(obj);
3661
+ }
3662
+ }
3663
+ const uniffiTypeFiatServiceImplObjectFactory = {
3664
+ create(pointer) {
3665
+ const instance = Object.create(FiatServiceImpl.prototype);
3666
+ instance[pointerLiteralSymbol] = pointer;
3667
+ instance[destructorGuardSymbol] = this.bless(pointer);
3668
+ instance[uniffiTypeNameSymbol] = 'FiatServiceImpl';
3669
+ return instance;
3670
+ },
3671
+ bless(p) {
3672
+ return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_fiatservice_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
3673
+ },
3674
+ unbless(ptr) {
3675
+ ptr.markDestroyed();
3676
+ },
3677
+ pointer(obj) {
3678
+ if (obj[destructorGuardSymbol] === undefined) {
3679
+ throw new UniffiInternalError.UnexpectedNullPointer();
3680
+ }
3681
+ return obj[pointerLiteralSymbol];
3682
+ },
3683
+ clonePointer(obj) {
3684
+ const pointer = this.pointer(obj);
3685
+ return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_breez_sdk_common_fn_clone_fiatservice(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3686
+ },
3687
+ freePointer(pointer) {
3688
+ uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_breez_sdk_common_fn_free_fiatservice(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
3689
+ },
3690
+ isConcreteType(obj) {
3691
+ return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'FiatServiceImpl';
3692
+ }
3693
+ };
3694
+ // FfiConverter for FiatService
3695
+ const FfiConverterTypeFiatService = new FfiConverterObjectWithCallbacks(uniffiTypeFiatServiceImplObjectFactory);
3696
+
3697
+ // Add a vtavble for the callbacks that go in FiatService.
3698
+
3699
+ // Put the implementation in a struct so we don't pollute the top-level namespace
3700
+ const uniffiCallbackInterfaceFiatService = {
3701
+ // Create the VTable using a series of closures.
3702
+ // ts automatically converts these into C callback functions.
3703
+ vtable: {
3704
+ fetchFiatCurrencies: (uniffiHandle, uniffiFutureCallback, uniffiCallbackData) => {
3705
+ const uniffiMakeCall = async signal => {
3706
+ const jsCallback = FfiConverterTypeFiatService.lift(uniffiHandle);
3707
+ return await jsCallback.fetchFiatCurrencies({
3708
+ signal
3709
+ });
3710
+ };
3711
+ const uniffiHandleSuccess = returnValue => {
3712
+ uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
3713
+ returnValue: FfiConverterArrayTypeFiatCurrency.lower(returnValue),
3714
+ callStatus: uniffiCaller.createCallStatus()
3715
+ });
3716
+ };
3717
+ const uniffiHandleError = (code, errorBuf) => {
3718
+ uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
3719
+ returnValue: /*empty*/new Uint8Array(0),
3720
+ // TODO create callstatus with error.
3721
+ callStatus: {
3722
+ code,
3723
+ errorBuf
3724
+ }
3725
+ });
3726
+ };
3727
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/ServiceConnectivityError.instanceOf, /*lowerError:*/FfiConverterTypeServiceConnectivityError.lower.bind(FfiConverterTypeServiceConnectivityError), /*lowerString:*/FfiConverterString.lower);
3728
+ return UniffiResult.success(uniffiForeignFuture);
3729
+ },
3730
+ fetchFiatRates: (uniffiHandle, uniffiFutureCallback, uniffiCallbackData) => {
3731
+ const uniffiMakeCall = async signal => {
3732
+ const jsCallback = FfiConverterTypeFiatService.lift(uniffiHandle);
3733
+ return await jsCallback.fetchFiatRates({
3734
+ signal
3735
+ });
3736
+ };
3737
+ const uniffiHandleSuccess = returnValue => {
3738
+ uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
3739
+ returnValue: FfiConverterArrayTypeRate.lower(returnValue),
3740
+ callStatus: uniffiCaller.createCallStatus()
3741
+ });
3742
+ };
3743
+ const uniffiHandleError = (code, errorBuf) => {
3744
+ uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
3745
+ returnValue: /*empty*/new Uint8Array(0),
3746
+ // TODO create callstatus with error.
3747
+ callStatus: {
3748
+ code,
3749
+ errorBuf
3750
+ }
3751
+ });
3752
+ };
3753
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/ServiceConnectivityError.instanceOf, /*lowerError:*/FfiConverterTypeServiceConnectivityError.lower.bind(FfiConverterTypeServiceConnectivityError), /*lowerString:*/FfiConverterString.lower);
3754
+ return UniffiResult.success(uniffiForeignFuture);
3755
+ },
3756
+ uniffiFree: uniffiHandle => {
3757
+ // FiatService: this will throw a stale handle error if the handle isn't found.
3758
+ FfiConverterTypeFiatService.drop(uniffiHandle);
3759
+ }
3760
+ },
3761
+ register: () => {
3762
+ nativeModule().ubrn_uniffi_breez_sdk_common_fn_init_callback_vtable_fiatservice(uniffiCallbackInterfaceFiatService.vtable);
3763
+ }
3764
+ };
3596
3765
  export class RestClientImpl extends UniffiAbstractObject {
3597
3766
  [uniffiTypeNameSymbol] = 'RestClientImpl';
3598
3767
  // No primary constructor declared for this class.
@@ -3839,12 +4008,18 @@ const FfiConverterArrayTypeBolt11RouteHintHop = new FfiConverterArray(FfiConvert
3839
4008
  // FfiConverter for Array<Bolt12OfferBlindedPath>
3840
4009
  const FfiConverterArrayTypeBolt12OfferBlindedPath = new FfiConverterArray(FfiConverterTypeBolt12OfferBlindedPath);
3841
4010
 
4011
+ // FfiConverter for Array<FiatCurrency>
4012
+ const FfiConverterArrayTypeFiatCurrency = new FfiConverterArray(FfiConverterTypeFiatCurrency);
4013
+
3842
4014
  // FfiConverter for Array<LocaleOverrides>
3843
4015
  const FfiConverterArrayTypeLocaleOverrides = new FfiConverterArray(FfiConverterTypeLocaleOverrides);
3844
4016
 
3845
4017
  // FfiConverter for Array<LocalizedName>
3846
4018
  const FfiConverterArrayTypeLocalizedName = new FfiConverterArray(FfiConverterTypeLocalizedName);
3847
4019
 
4020
+ // FfiConverter for Array<Rate>
4021
+ const FfiConverterArrayTypeRate = new FfiConverterArray(FfiConverterTypeRate);
4022
+
3848
4023
  // FfiConverter for Array<string>
3849
4024
  const FfiConverterArrayString = new FfiConverterArray(FfiConverterString);
3850
4025
 
@@ -3878,6 +4053,12 @@ function uniffiEnsureInitialized() {
3878
4053
  if (bindingsContractVersion !== scaffoldingContractVersion) {
3879
4054
  throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
3880
4055
  }
4056
+ if (nativeModule().ubrn_uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_currencies() !== 63089) {
4057
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_currencies');
4058
+ }
4059
+ if (nativeModule().ubrn_uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_rates() !== 48636) {
4060
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_rates');
4061
+ }
3881
4062
  if (nativeModule().ubrn_uniffi_breez_sdk_common_checksum_method_restclient_get_request() !== 1702) {
3882
4063
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_common_checksum_method_restclient_get_request');
3883
4064
  }
@@ -3887,6 +4068,7 @@ function uniffiEnsureInitialized() {
3887
4068
  if (nativeModule().ubrn_uniffi_breez_sdk_common_checksum_method_restclient_delete_request() !== 26893) {
3888
4069
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_common_checksum_method_restclient_delete_request');
3889
4070
  }
4071
+ uniffiCallbackInterfaceFiatService.register();
3890
4072
  uniffiCallbackInterfaceRestClient.register();
3891
4073
  }
3892
4074
  export default Object.freeze({
@@ -3912,6 +4094,7 @@ export default Object.freeze({
3912
4094
  FfiConverterTypeBolt12OfferDetails,
3913
4095
  FfiConverterTypeCurrencyInfo,
3914
4096
  FfiConverterTypeFiatCurrency,
4097
+ FfiConverterTypeFiatService,
3915
4098
  FfiConverterTypeInputType,
3916
4099
  FfiConverterTypeLightningAddressDetails,
3917
4100
  FfiConverterTypeLnurlAuthRequestDetails,