@breeztech/breez-sdk-spark-react-native 0.1.8-dev4 → 0.1.9-dev2

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.
@@ -1 +1 @@
1
- {"version":3,"names":["getter","globalThis","NativeBreezSdkSpark","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/breez_sdk_spark-ffi.ts"],"mappings":";;AAAA;AACA;;AAkdA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,mBAAmB;AACzC,eAAeF,MAAM;;AAErB;;AAkPA;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","NativeBreezSdkSpark","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/breez_sdk_spark-ffi.ts"],"mappings":";;AAAA;AACA;;AA0dA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,mBAAmB;AACzC,eAAeF,MAAM;;AAErB;;AAkPA;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":[]}
@@ -53,18 +53,10 @@ export function defaultConfig(network) {
53
53
  return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_func_default_config(FfiConverterTypeNetwork.lower(network), callStatus);
54
54
  }, /*liftString:*/FfiConverterString.lift));
55
55
  }
56
- export async function defaultStorage(dataDir, asyncOpts_) /*throws*/{
57
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
58
- try {
59
- return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
60
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_func_default_storage(FfiConverterString.lower(dataDir));
61
- }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_pointer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_pointer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_pointer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_pointer, /*liftFunc:*/FfiConverterTypeStorage.lift.bind(FfiConverterTypeStorage), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
62
- } catch (__error) {
63
- if (uniffiIsDebug && __error instanceof Error) {
64
- __error.stack = __stack;
65
- }
66
- throw __error;
67
- }
56
+ export function defaultStorage(dataDir) /*throws*/{
57
+ return FfiConverterTypeStorage.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError), /*caller:*/callStatus => {
58
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_func_default_storage(FfiConverterString.lower(dataDir), callStatus);
59
+ }, /*liftString:*/FfiConverterString.lift));
68
60
  }
69
61
  export function initLogging(logDir, appLogger, logFilter) /*throws*/{
70
62
  uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError), /*caller:*/callStatus => {
@@ -311,7 +303,8 @@ const FfiConverterTypeConfig = (() => {
311
303
  network: FfiConverterTypeNetwork.read(from),
312
304
  syncIntervalSecs: FfiConverterUInt32.read(from),
313
305
  maxDepositClaimFee: FfiConverterOptionalTypeFee.read(from),
314
- lnurlDomain: FfiConverterOptionalString.read(from)
306
+ lnurlDomain: FfiConverterOptionalString.read(from),
307
+ preferSparkOverLightning: FfiConverterBool.read(from)
315
308
  };
316
309
  }
317
310
  write(value, into) {
@@ -320,9 +313,10 @@ const FfiConverterTypeConfig = (() => {
320
313
  FfiConverterUInt32.write(value.syncIntervalSecs, into);
321
314
  FfiConverterOptionalTypeFee.write(value.maxDepositClaimFee, into);
322
315
  FfiConverterOptionalString.write(value.lnurlDomain, into);
316
+ FfiConverterBool.write(value.preferSparkOverLightning, into);
323
317
  }
324
318
  allocationSize(value) {
325
- return FfiConverterOptionalString.allocationSize(value.apiKey) + FfiConverterTypeNetwork.allocationSize(value.network) + FfiConverterUInt32.allocationSize(value.syncIntervalSecs) + FfiConverterOptionalTypeFee.allocationSize(value.maxDepositClaimFee) + FfiConverterOptionalString.allocationSize(value.lnurlDomain);
319
+ 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);
326
320
  }
327
321
  }
328
322
  return new FFIConverter();
@@ -2360,6 +2354,53 @@ const FfiConverterTypeFee = (() => {
2360
2354
  }
2361
2355
  return new FFIConverter();
2362
2356
  })();
2357
+ export let KeySetType = /*#__PURE__*/function (KeySetType) {
2358
+ KeySetType[KeySetType["Default"] = 0] = "Default";
2359
+ KeySetType[KeySetType["Taproot"] = 1] = "Taproot";
2360
+ KeySetType[KeySetType["NativeSegwit"] = 2] = "NativeSegwit";
2361
+ KeySetType[KeySetType["WrappedSegwit"] = 3] = "WrappedSegwit";
2362
+ KeySetType[KeySetType["Legacy"] = 4] = "Legacy";
2363
+ return KeySetType;
2364
+ }({});
2365
+ const FfiConverterTypeKeySetType = (() => {
2366
+ const ordinalConverter = FfiConverterInt32;
2367
+ class FFIConverter extends AbstractFfiConverterByteArray {
2368
+ read(from) {
2369
+ switch (ordinalConverter.read(from)) {
2370
+ case 1:
2371
+ return KeySetType.Default;
2372
+ case 2:
2373
+ return KeySetType.Taproot;
2374
+ case 3:
2375
+ return KeySetType.NativeSegwit;
2376
+ case 4:
2377
+ return KeySetType.WrappedSegwit;
2378
+ case 5:
2379
+ return KeySetType.Legacy;
2380
+ default:
2381
+ throw new UniffiInternalError.UnexpectedEnumCase();
2382
+ }
2383
+ }
2384
+ write(value, into) {
2385
+ switch (value) {
2386
+ case KeySetType.Default:
2387
+ return ordinalConverter.write(1, into);
2388
+ case KeySetType.Taproot:
2389
+ return ordinalConverter.write(2, into);
2390
+ case KeySetType.NativeSegwit:
2391
+ return ordinalConverter.write(3, into);
2392
+ case KeySetType.WrappedSegwit:
2393
+ return ordinalConverter.write(4, into);
2394
+ case KeySetType.Legacy:
2395
+ return ordinalConverter.write(5, into);
2396
+ }
2397
+ }
2398
+ allocationSize(value) {
2399
+ return ordinalConverter.allocationSize(0);
2400
+ }
2401
+ }
2402
+ return new FFIConverter();
2403
+ })();
2363
2404
  export let Network = /*#__PURE__*/function (Network) {
2364
2405
  Network[Network["Mainnet"] = 0] = "Mainnet";
2365
2406
  Network[Network["Regtest"] = 1] = "Regtest";
@@ -3407,6 +3448,7 @@ export let SdkEvent_Tags = /*#__PURE__*/function (SdkEvent_Tags) {
3407
3448
  SdkEvent_Tags["ClaimDepositsFailed"] = "ClaimDepositsFailed";
3408
3449
  SdkEvent_Tags["ClaimDepositsSucceeded"] = "ClaimDepositsSucceeded";
3409
3450
  SdkEvent_Tags["PaymentSucceeded"] = "PaymentSucceeded";
3451
+ SdkEvent_Tags["PaymentFailed"] = "PaymentFailed";
3410
3452
  return SdkEvent_Tags;
3411
3453
  }({});
3412
3454
  /**
@@ -3490,6 +3532,24 @@ export const SdkEvent = (() => {
3490
3532
  return obj.tag === SdkEvent_Tags.PaymentSucceeded;
3491
3533
  }
3492
3534
  }
3535
+ class PaymentFailed_ extends UniffiEnum {
3536
+ /**
3537
+ * @private
3538
+ * This field is private and should not be used, use `tag` instead.
3539
+ */
3540
+ [uniffiTypeNameSymbol] = 'SdkEvent';
3541
+ tag = SdkEvent_Tags.PaymentFailed;
3542
+ constructor(inner) {
3543
+ super('SdkEvent', 'PaymentFailed');
3544
+ this.inner = Object.freeze(inner);
3545
+ }
3546
+ static new(inner) {
3547
+ return new PaymentFailed_(inner);
3548
+ }
3549
+ static instanceOf(obj) {
3550
+ return obj.tag === SdkEvent_Tags.PaymentFailed;
3551
+ }
3552
+ }
3493
3553
  function instanceOf(obj) {
3494
3554
  return obj[uniffiTypeNameSymbol] === 'SdkEvent';
3495
3555
  }
@@ -3498,7 +3558,8 @@ export const SdkEvent = (() => {
3498
3558
  Synced: Synced_,
3499
3559
  ClaimDepositsFailed: ClaimDepositsFailed_,
3500
3560
  ClaimDepositsSucceeded: ClaimDepositsSucceeded_,
3501
- PaymentSucceeded: PaymentSucceeded_
3561
+ PaymentSucceeded: PaymentSucceeded_,
3562
+ PaymentFailed: PaymentFailed_
3502
3563
  });
3503
3564
  })();
3504
3565
 
@@ -3526,6 +3587,10 @@ const FfiConverterTypeSdkEvent = (() => {
3526
3587
  return new SdkEvent.PaymentSucceeded({
3527
3588
  payment: FfiConverterTypePayment.read(from)
3528
3589
  });
3590
+ case 5:
3591
+ return new SdkEvent.PaymentFailed({
3592
+ payment: FfiConverterTypePayment.read(from)
3593
+ });
3529
3594
  default:
3530
3595
  throw new UniffiInternalError.UnexpectedEnumCase();
3531
3596
  }
@@ -3558,6 +3623,13 @@ const FfiConverterTypeSdkEvent = (() => {
3558
3623
  FfiConverterTypePayment.write(inner.payment, into);
3559
3624
  return;
3560
3625
  }
3626
+ case SdkEvent_Tags.PaymentFailed:
3627
+ {
3628
+ ordinalConverter.write(5, into);
3629
+ const inner = value.inner;
3630
+ FfiConverterTypePayment.write(inner.payment, into);
3631
+ return;
3632
+ }
3561
3633
  default:
3562
3634
  // Throwing from here means that SdkEvent_Tags hasn't matched an ordinal.
3563
3635
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -3590,6 +3662,13 @@ const FfiConverterTypeSdkEvent = (() => {
3590
3662
  size += FfiConverterTypePayment.allocationSize(inner.payment);
3591
3663
  return size;
3592
3664
  }
3665
+ case SdkEvent_Tags.PaymentFailed:
3666
+ {
3667
+ const inner = value.inner;
3668
+ let size = ordinalConverter.allocationSize(5);
3669
+ size += FfiConverterTypePayment.allocationSize(inner.payment);
3670
+ return size;
3671
+ }
3593
3672
  default:
3594
3673
  throw new UniffiInternalError.UnexpectedEnumCase();
3595
3674
  }
@@ -4551,9 +4630,9 @@ export class BreezSdk extends UniffiAbstractObject {
4551
4630
  throw __error;
4552
4631
  }
4553
4632
  }
4554
- pollLightningSendPayment(paymentId) {
4633
+ pollLightningSendPayment(payment, sspId) {
4555
4634
  uniffiCaller.rustCall(/*caller:*/callStatus => {
4556
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterString.lower(paymentId), callStatus);
4635
+ nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypePayment.lower(payment), FfiConverterString.lower(sspId), callStatus);
4557
4636
  }, /*liftString:*/FfiConverterString.lift);
4558
4637
  }
4559
4638
  async prepareLnurlPay(request, asyncOpts_) /*throws*/{
@@ -4801,6 +4880,26 @@ export class SdkBuilder extends UniffiAbstractObject {
4801
4880
  throw __error;
4802
4881
  }
4803
4882
  }
4883
+
4884
+ /**
4885
+ * Sets the key set type to be used by the SDK.
4886
+ * Arguments:
4887
+ * - `key_set_type`: The key set type which determines the derivation path.
4888
+ * - `use_address_index`: Controls the structure of the BIP derivation path.
4889
+ */
4890
+ async withKeySet(keySetType, useAddressIndex, asyncOpts_) {
4891
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
4892
+ try {
4893
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
4894
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_key_set(uniffiTypeSdkBuilderObjectFactory.clonePointer(this), FfiConverterTypeKeySetType.lower(keySetType), FfiConverterBool.lower(useAddressIndex));
4895
+ }, /*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_);
4896
+ } catch (__error) {
4897
+ if (uniffiIsDebug && __error instanceof Error) {
4898
+ __error.stack = __stack;
4899
+ }
4900
+ throw __error;
4901
+ }
4902
+ }
4804
4903
  async withLnurlClient(lnurlClient, asyncOpts_) {
4805
4904
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
4806
4905
  try {
@@ -5552,7 +5651,7 @@ function uniffiEnsureInitialized() {
5552
5651
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_default_config() !== 62194) {
5553
5652
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_func_default_config');
5554
5653
  }
5555
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_default_storage() !== 30804) {
5654
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_default_storage() !== 46285) {
5556
5655
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_func_default_storage');
5557
5656
  }
5558
5657
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_init_logging() !== 8518) {
@@ -5603,7 +5702,7 @@ function uniffiEnsureInitialized() {
5603
5702
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay() !== 10147) {
5604
5703
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay');
5605
5704
  }
5606
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment() !== 5478) {
5705
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment() !== 57601) {
5607
5706
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment');
5608
5707
  }
5609
5708
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay() !== 37691) {
@@ -5642,6 +5741,9 @@ function uniffiEnsureInitialized() {
5642
5741
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service() !== 2848) {
5643
5742
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service');
5644
5743
  }
5744
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set() !== 55523) {
5745
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set');
5746
+ }
5645
5747
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client() !== 61720) {
5646
5748
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client');
5647
5749
  }
@@ -5713,6 +5815,7 @@ export default Object.freeze({
5713
5815
  FfiConverterTypeGetInfoResponse,
5714
5816
  FfiConverterTypeGetPaymentRequest,
5715
5817
  FfiConverterTypeGetPaymentResponse,
5818
+ FfiConverterTypeKeySetType,
5716
5819
  FfiConverterTypeLightningAddressInfo,
5717
5820
  FfiConverterTypeListPaymentsRequest,
5718
5821
  FfiConverterTypeListPaymentsResponse,