@breeztech/breez-sdk-spark-react-native 0.7.21 → 0.8.2

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.
@@ -37,7 +37,6 @@ import nativeModule, {
37
37
  type UniffiVTableCallbackInterfacePaymentObserver,
38
38
  type UniffiVTableCallbackInterfaceRestClient,
39
39
  type UniffiVTableCallbackInterfaceStorage,
40
- type UniffiVTableCallbackInterfaceSyncStorage,
41
40
  } from './breez_sdk_spark-ffi';
42
41
  import {
43
42
  type FfiConverter,
@@ -247,6 +246,46 @@ export function defaultExternalSigner(
247
246
  )
248
247
  );
249
248
  }
249
+ /**
250
+ * Fetches the current status of Spark network services relevant to the SDK.
251
+ *
252
+ * This function queries the Spark status API and returns the worst status
253
+ * across the Spark Operators and SSP services.
254
+ */
255
+ export async function getSparkStatus(asyncOpts_?: {
256
+ signal: AbortSignal;
257
+ }): Promise<SparkStatus> /*throws*/ {
258
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
259
+ try {
260
+ return await uniffiRustCallAsync(
261
+ /*rustCaller:*/ uniffiCaller,
262
+ /*rustFutureFunc:*/ () => {
263
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_func_get_spark_status();
264
+ },
265
+ /*pollFunc:*/ nativeModule()
266
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
267
+ /*cancelFunc:*/ nativeModule()
268
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
269
+ /*completeFunc:*/ nativeModule()
270
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
271
+ /*freeFunc:*/ nativeModule()
272
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
273
+ /*liftFunc:*/ FfiConverterTypeSparkStatus.lift.bind(
274
+ FfiConverterTypeSparkStatus
275
+ ),
276
+ /*liftString:*/ FfiConverterString.lift,
277
+ /*asyncOpts:*/ asyncOpts_,
278
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
279
+ FfiConverterTypeSdkError
280
+ )
281
+ );
282
+ } catch (__error: any) {
283
+ if (uniffiIsDebug && __error instanceof Error) {
284
+ __error.stack = __stack;
285
+ }
286
+ throw __error;
287
+ }
288
+ }
250
289
  export function initLogging(
251
290
  logDir: string | undefined,
252
291
  appLogger: Logger | undefined,
@@ -1448,6 +1487,135 @@ const FfiConverterTypeBurnIssuerTokenRequest = (() => {
1448
1487
  return new FFIConverter();
1449
1488
  })();
1450
1489
 
1490
+ /**
1491
+ * Request to buy Bitcoin using an external provider (`MoonPay`)
1492
+ */
1493
+ export type BuyBitcoinRequest = {
1494
+ /**
1495
+ * Optional: Lock the purchase to a specific amount in satoshis.
1496
+ * When provided, the user cannot change the amount in the purchase flow.
1497
+ */
1498
+ lockedAmountSat: /*u64*/ bigint | undefined;
1499
+ /**
1500
+ * Optional: Custom redirect URL after purchase completion
1501
+ */
1502
+ redirectUrl: string | undefined;
1503
+ };
1504
+
1505
+ /**
1506
+ * Generated factory for {@link BuyBitcoinRequest} record objects.
1507
+ */
1508
+ export const BuyBitcoinRequest = (() => {
1509
+ const defaults = () => ({
1510
+ lockedAmountSat: undefined,
1511
+ redirectUrl: undefined,
1512
+ });
1513
+ const create = (() => {
1514
+ return uniffiCreateRecord<BuyBitcoinRequest, ReturnType<typeof defaults>>(
1515
+ defaults
1516
+ );
1517
+ })();
1518
+ return Object.freeze({
1519
+ /**
1520
+ * Create a frozen instance of {@link BuyBitcoinRequest}, with defaults specified
1521
+ * in Rust, in the {@link breez_sdk_spark} crate.
1522
+ */
1523
+ create,
1524
+
1525
+ /**
1526
+ * Create a frozen instance of {@link BuyBitcoinRequest}, with defaults specified
1527
+ * in Rust, in the {@link breez_sdk_spark} crate.
1528
+ */
1529
+ new: create,
1530
+
1531
+ /**
1532
+ * Defaults specified in the {@link breez_sdk_spark} crate.
1533
+ */
1534
+ defaults: () => Object.freeze(defaults()) as Partial<BuyBitcoinRequest>,
1535
+ });
1536
+ })();
1537
+
1538
+ const FfiConverterTypeBuyBitcoinRequest = (() => {
1539
+ type TypeName = BuyBitcoinRequest;
1540
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1541
+ read(from: RustBuffer): TypeName {
1542
+ return {
1543
+ lockedAmountSat: FfiConverterOptionalUInt64.read(from),
1544
+ redirectUrl: FfiConverterOptionalString.read(from),
1545
+ };
1546
+ }
1547
+ write(value: TypeName, into: RustBuffer): void {
1548
+ FfiConverterOptionalUInt64.write(value.lockedAmountSat, into);
1549
+ FfiConverterOptionalString.write(value.redirectUrl, into);
1550
+ }
1551
+ allocationSize(value: TypeName): number {
1552
+ return (
1553
+ FfiConverterOptionalUInt64.allocationSize(value.lockedAmountSat) +
1554
+ FfiConverterOptionalString.allocationSize(value.redirectUrl)
1555
+ );
1556
+ }
1557
+ }
1558
+ return new FFIConverter();
1559
+ })();
1560
+
1561
+ /**
1562
+ * Response containing a URL to complete the Bitcoin purchase
1563
+ */
1564
+ export type BuyBitcoinResponse = {
1565
+ /**
1566
+ * The URL to open in a browser to complete the purchase
1567
+ */
1568
+ url: string;
1569
+ };
1570
+
1571
+ /**
1572
+ * Generated factory for {@link BuyBitcoinResponse} record objects.
1573
+ */
1574
+ export const BuyBitcoinResponse = (() => {
1575
+ const defaults = () => ({});
1576
+ const create = (() => {
1577
+ return uniffiCreateRecord<BuyBitcoinResponse, ReturnType<typeof defaults>>(
1578
+ defaults
1579
+ );
1580
+ })();
1581
+ return Object.freeze({
1582
+ /**
1583
+ * Create a frozen instance of {@link BuyBitcoinResponse}, with defaults specified
1584
+ * in Rust, in the {@link breez_sdk_spark} crate.
1585
+ */
1586
+ create,
1587
+
1588
+ /**
1589
+ * Create a frozen instance of {@link BuyBitcoinResponse}, with defaults specified
1590
+ * in Rust, in the {@link breez_sdk_spark} crate.
1591
+ */
1592
+ new: create,
1593
+
1594
+ /**
1595
+ * Defaults specified in the {@link breez_sdk_spark} crate.
1596
+ */
1597
+ defaults: () => Object.freeze(defaults()) as Partial<BuyBitcoinResponse>,
1598
+ });
1599
+ })();
1600
+
1601
+ const FfiConverterTypeBuyBitcoinResponse = (() => {
1602
+ type TypeName = BuyBitcoinResponse;
1603
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1604
+ read(from: RustBuffer): TypeName {
1605
+ return {
1606
+ url: FfiConverterString.read(from),
1607
+ };
1608
+ }
1609
+ write(value: TypeName, into: RustBuffer): void {
1610
+ FfiConverterString.write(value.url, into);
1611
+ }
1612
+ allocationSize(value: TypeName): number {
1613
+ return FfiConverterString.allocationSize(value.url);
1614
+ }
1615
+ }
1616
+ return new FFIConverter();
1617
+ })();
1618
+
1451
1619
  export type CheckLightningAddressRequest = {
1452
1620
  username: string;
1453
1621
  };
@@ -2116,6 +2284,73 @@ const FfiConverterTypeConnectWithSignerRequest = (() => {
2116
2284
  return new FFIConverter();
2117
2285
  })();
2118
2286
 
2287
+ /**
2288
+ * Outlines the steps involved in a conversion
2289
+ */
2290
+ export type ConversionDetails = {
2291
+ /**
2292
+ * First step is converting from the available asset
2293
+ */
2294
+ from: ConversionStep;
2295
+ /**
2296
+ * Second step is converting to the requested asset
2297
+ */
2298
+ to: ConversionStep;
2299
+ };
2300
+
2301
+ /**
2302
+ * Generated factory for {@link ConversionDetails} record objects.
2303
+ */
2304
+ export const ConversionDetails = (() => {
2305
+ const defaults = () => ({});
2306
+ const create = (() => {
2307
+ return uniffiCreateRecord<ConversionDetails, ReturnType<typeof defaults>>(
2308
+ defaults
2309
+ );
2310
+ })();
2311
+ return Object.freeze({
2312
+ /**
2313
+ * Create a frozen instance of {@link ConversionDetails}, with defaults specified
2314
+ * in Rust, in the {@link breez_sdk_spark} crate.
2315
+ */
2316
+ create,
2317
+
2318
+ /**
2319
+ * Create a frozen instance of {@link ConversionDetails}, with defaults specified
2320
+ * in Rust, in the {@link breez_sdk_spark} crate.
2321
+ */
2322
+ new: create,
2323
+
2324
+ /**
2325
+ * Defaults specified in the {@link breez_sdk_spark} crate.
2326
+ */
2327
+ defaults: () => Object.freeze(defaults()) as Partial<ConversionDetails>,
2328
+ });
2329
+ })();
2330
+
2331
+ const FfiConverterTypeConversionDetails = (() => {
2332
+ type TypeName = ConversionDetails;
2333
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
2334
+ read(from: RustBuffer): TypeName {
2335
+ return {
2336
+ from: FfiConverterTypeConversionStep.read(from),
2337
+ to: FfiConverterTypeConversionStep.read(from),
2338
+ };
2339
+ }
2340
+ write(value: TypeName, into: RustBuffer): void {
2341
+ FfiConverterTypeConversionStep.write(value.from, into);
2342
+ FfiConverterTypeConversionStep.write(value.to, into);
2343
+ }
2344
+ allocationSize(value: TypeName): number {
2345
+ return (
2346
+ FfiConverterTypeConversionStep.allocationSize(value.from) +
2347
+ FfiConverterTypeConversionStep.allocationSize(value.to)
2348
+ );
2349
+ }
2350
+ }
2351
+ return new FFIConverter();
2352
+ })();
2353
+
2119
2354
  /**
2120
2355
  * Response from estimating a conversion, used when preparing a payment that requires conversion
2121
2356
  */
@@ -2290,7 +2525,7 @@ export type ConversionOptions = {
2290
2525
  conversionType: ConversionType;
2291
2526
  /**
2292
2527
  * The optional maximum slippage in basis points (1/100 of a percent) allowed when
2293
- * a conversion is needed to fulfill the payment. Defaults to 50 bps (0.5%) if not set.
2528
+ * a conversion is needed to fulfill the payment. Defaults to 10 bps (0.1%) if not set.
2294
2529
  * The conversion will fail if the actual amount received is less than
2295
2530
  * `estimated_amount * (1 - max_slippage_bps / 10_000)`.
2296
2531
  */
@@ -2363,6 +2598,97 @@ const FfiConverterTypeConversionOptions = (() => {
2363
2598
  return new FFIConverter();
2364
2599
  })();
2365
2600
 
2601
+ /**
2602
+ * A single step in a conversion
2603
+ */
2604
+ export type ConversionStep = {
2605
+ /**
2606
+ * The underlying payment id of the conversion step
2607
+ */
2608
+ paymentId: string;
2609
+ /**
2610
+ * Payment amount in satoshis or token base units
2611
+ */
2612
+ amount: U128;
2613
+ /**
2614
+ * Fee paid in satoshis or token base units
2615
+ * This represents the payment fee + the conversion fee
2616
+ */
2617
+ fee: U128;
2618
+ /**
2619
+ * Method of payment
2620
+ */
2621
+ method: PaymentMethod;
2622
+ /**
2623
+ * Token metadata if a token is used for payment
2624
+ */
2625
+ tokenMetadata: TokenMetadata | undefined;
2626
+ };
2627
+
2628
+ /**
2629
+ * Generated factory for {@link ConversionStep} record objects.
2630
+ */
2631
+ export const ConversionStep = (() => {
2632
+ const defaults = () => ({});
2633
+ const create = (() => {
2634
+ return uniffiCreateRecord<ConversionStep, ReturnType<typeof defaults>>(
2635
+ defaults
2636
+ );
2637
+ })();
2638
+ return Object.freeze({
2639
+ /**
2640
+ * Create a frozen instance of {@link ConversionStep}, with defaults specified
2641
+ * in Rust, in the {@link breez_sdk_spark} crate.
2642
+ */
2643
+ create,
2644
+
2645
+ /**
2646
+ * Create a frozen instance of {@link ConversionStep}, with defaults specified
2647
+ * in Rust, in the {@link breez_sdk_spark} crate.
2648
+ */
2649
+ new: create,
2650
+
2651
+ /**
2652
+ * Defaults specified in the {@link breez_sdk_spark} crate.
2653
+ */
2654
+ defaults: () => Object.freeze(defaults()) as Partial<ConversionStep>,
2655
+ });
2656
+ })();
2657
+
2658
+ const FfiConverterTypeConversionStep = (() => {
2659
+ type TypeName = ConversionStep;
2660
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
2661
+ read(from: RustBuffer): TypeName {
2662
+ return {
2663
+ paymentId: FfiConverterString.read(from),
2664
+ amount: FfiConverterTypeu128.read(from),
2665
+ fee: FfiConverterTypeu128.read(from),
2666
+ method: FfiConverterTypePaymentMethod.read(from),
2667
+ tokenMetadata: FfiConverterOptionalTypeTokenMetadata.read(from),
2668
+ };
2669
+ }
2670
+ write(value: TypeName, into: RustBuffer): void {
2671
+ FfiConverterString.write(value.paymentId, into);
2672
+ FfiConverterTypeu128.write(value.amount, into);
2673
+ FfiConverterTypeu128.write(value.fee, into);
2674
+ FfiConverterTypePaymentMethod.write(value.method, into);
2675
+ FfiConverterOptionalTypeTokenMetadata.write(value.tokenMetadata, into);
2676
+ }
2677
+ allocationSize(value: TypeName): number {
2678
+ return (
2679
+ FfiConverterString.allocationSize(value.paymentId) +
2680
+ FfiConverterTypeu128.allocationSize(value.amount) +
2681
+ FfiConverterTypeu128.allocationSize(value.fee) +
2682
+ FfiConverterTypePaymentMethod.allocationSize(value.method) +
2683
+ FfiConverterOptionalTypeTokenMetadata.allocationSize(
2684
+ value.tokenMetadata
2685
+ )
2686
+ );
2687
+ }
2688
+ }
2689
+ return new FFIConverter();
2690
+ })();
2691
+
2366
2692
  export type CreateIssuerTokenRequest = {
2367
2693
  name: string;
2368
2694
  ticker: string;
@@ -4054,6 +4380,10 @@ const FfiConverterTypeGetInfoRequest = (() => {
4054
4380
  * Response containing the balance of the wallet
4055
4381
  */
4056
4382
  export type GetInfoResponse = {
4383
+ /**
4384
+ * The identity public key of the wallet as a hex string
4385
+ */
4386
+ identityPubkey: string;
4057
4387
  /**
4058
4388
  * The balance in satoshis
4059
4389
  */
@@ -4099,16 +4429,19 @@ const FfiConverterTypeGetInfoResponse = (() => {
4099
4429
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
4100
4430
  read(from: RustBuffer): TypeName {
4101
4431
  return {
4432
+ identityPubkey: FfiConverterString.read(from),
4102
4433
  balanceSats: FfiConverterUInt64.read(from),
4103
4434
  tokenBalances: FfiConverterMapStringTypeTokenBalance.read(from),
4104
4435
  };
4105
4436
  }
4106
4437
  write(value: TypeName, into: RustBuffer): void {
4438
+ FfiConverterString.write(value.identityPubkey, into);
4107
4439
  FfiConverterUInt64.write(value.balanceSats, into);
4108
4440
  FfiConverterMapStringTypeTokenBalance.write(value.tokenBalances, into);
4109
4441
  }
4110
4442
  allocationSize(value: TypeName): number {
4111
4443
  return (
4444
+ FfiConverterString.allocationSize(value.identityPubkey) +
4112
4445
  FfiConverterUInt64.allocationSize(value.balanceSats) +
4113
4446
  FfiConverterMapStringTypeTokenBalance.allocationSize(
4114
4447
  value.tokenBalances
@@ -4775,7 +5108,7 @@ const FfiConverterTypeLightningAddressDetails = (() => {
4775
5108
  export type LightningAddressInfo = {
4776
5109
  description: string;
4777
5110
  lightningAddress: string;
4778
- lnurl: string;
5111
+ lnurl: LnurlInfo;
4779
5112
  username: string;
4780
5113
  };
4781
5114
 
@@ -4817,21 +5150,21 @@ const FfiConverterTypeLightningAddressInfo = (() => {
4817
5150
  return {
4818
5151
  description: FfiConverterString.read(from),
4819
5152
  lightningAddress: FfiConverterString.read(from),
4820
- lnurl: FfiConverterString.read(from),
5153
+ lnurl: FfiConverterTypeLnurlInfo.read(from),
4821
5154
  username: FfiConverterString.read(from),
4822
5155
  };
4823
5156
  }
4824
5157
  write(value: TypeName, into: RustBuffer): void {
4825
5158
  FfiConverterString.write(value.description, into);
4826
5159
  FfiConverterString.write(value.lightningAddress, into);
4827
- FfiConverterString.write(value.lnurl, into);
5160
+ FfiConverterTypeLnurlInfo.write(value.lnurl, into);
4828
5161
  FfiConverterString.write(value.username, into);
4829
5162
  }
4830
5163
  allocationSize(value: TypeName): number {
4831
5164
  return (
4832
5165
  FfiConverterString.allocationSize(value.description) +
4833
5166
  FfiConverterString.allocationSize(value.lightningAddress) +
4834
- FfiConverterString.allocationSize(value.lnurl) +
5167
+ FfiConverterTypeLnurlInfo.allocationSize(value.lnurl) +
4835
5168
  FfiConverterString.allocationSize(value.username)
4836
5169
  );
4837
5170
  }
@@ -5390,27 +5723,83 @@ const FfiConverterTypeLnurlErrorDetails = (() => {
5390
5723
  return new FFIConverter();
5391
5724
  })();
5392
5725
 
5393
- /**
5394
- * Represents the payment LNURL info
5395
- */
5396
- export type LnurlPayInfo = {
5397
- lnAddress: string | undefined;
5398
- comment: string | undefined;
5399
- domain: string | undefined;
5400
- metadata: string | undefined;
5401
- processedSuccessAction: SuccessActionProcessed | undefined;
5402
- rawSuccessAction: SuccessAction | undefined;
5726
+ export type LnurlInfo = {
5727
+ url: string;
5728
+ bech32: string;
5403
5729
  };
5404
5730
 
5405
5731
  /**
5406
- * Generated factory for {@link LnurlPayInfo} record objects.
5732
+ * Generated factory for {@link LnurlInfo} record objects.
5407
5733
  */
5408
- export const LnurlPayInfo = (() => {
5734
+ export const LnurlInfo = (() => {
5409
5735
  const defaults = () => ({});
5410
5736
  const create = (() => {
5411
- return uniffiCreateRecord<LnurlPayInfo, ReturnType<typeof defaults>>(
5412
- defaults
5413
- );
5737
+ return uniffiCreateRecord<LnurlInfo, ReturnType<typeof defaults>>(defaults);
5738
+ })();
5739
+ return Object.freeze({
5740
+ /**
5741
+ * Create a frozen instance of {@link LnurlInfo}, with defaults specified
5742
+ * in Rust, in the {@link breez_sdk_spark} crate.
5743
+ */
5744
+ create,
5745
+
5746
+ /**
5747
+ * Create a frozen instance of {@link LnurlInfo}, with defaults specified
5748
+ * in Rust, in the {@link breez_sdk_spark} crate.
5749
+ */
5750
+ new: create,
5751
+
5752
+ /**
5753
+ * Defaults specified in the {@link breez_sdk_spark} crate.
5754
+ */
5755
+ defaults: () => Object.freeze(defaults()) as Partial<LnurlInfo>,
5756
+ });
5757
+ })();
5758
+
5759
+ const FfiConverterTypeLnurlInfo = (() => {
5760
+ type TypeName = LnurlInfo;
5761
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
5762
+ read(from: RustBuffer): TypeName {
5763
+ return {
5764
+ url: FfiConverterString.read(from),
5765
+ bech32: FfiConverterString.read(from),
5766
+ };
5767
+ }
5768
+ write(value: TypeName, into: RustBuffer): void {
5769
+ FfiConverterString.write(value.url, into);
5770
+ FfiConverterString.write(value.bech32, into);
5771
+ }
5772
+ allocationSize(value: TypeName): number {
5773
+ return (
5774
+ FfiConverterString.allocationSize(value.url) +
5775
+ FfiConverterString.allocationSize(value.bech32)
5776
+ );
5777
+ }
5778
+ }
5779
+ return new FFIConverter();
5780
+ })();
5781
+
5782
+ /**
5783
+ * Represents the payment LNURL info
5784
+ */
5785
+ export type LnurlPayInfo = {
5786
+ lnAddress: string | undefined;
5787
+ comment: string | undefined;
5788
+ domain: string | undefined;
5789
+ metadata: string | undefined;
5790
+ processedSuccessAction: SuccessActionProcessed | undefined;
5791
+ rawSuccessAction: SuccessAction | undefined;
5792
+ };
5793
+
5794
+ /**
5795
+ * Generated factory for {@link LnurlPayInfo} record objects.
5796
+ */
5797
+ export const LnurlPayInfo = (() => {
5798
+ const defaults = () => ({});
5799
+ const create = (() => {
5800
+ return uniffiCreateRecord<LnurlPayInfo, ReturnType<typeof defaults>>(
5801
+ defaults
5802
+ );
5414
5803
  })();
5415
5804
  return Object.freeze({
5416
5805
  /**
@@ -6647,6 +7036,10 @@ export type Payment = {
6647
7036
  * Details of the payment
6648
7037
  */
6649
7038
  details: PaymentDetails | undefined;
7039
+ /**
7040
+ * If set, this payment involved a conversion before the payment
7041
+ */
7042
+ conversionDetails: ConversionDetails | undefined;
6650
7043
  };
6651
7044
 
6652
7045
  /**
@@ -6690,6 +7083,7 @@ const FfiConverterTypePayment = (() => {
6690
7083
  timestamp: FfiConverterUInt64.read(from),
6691
7084
  method: FfiConverterTypePaymentMethod.read(from),
6692
7085
  details: FfiConverterOptionalTypePaymentDetails.read(from),
7086
+ conversionDetails: FfiConverterOptionalTypeConversionDetails.read(from),
6693
7087
  };
6694
7088
  }
6695
7089
  write(value: TypeName, into: RustBuffer): void {
@@ -6701,6 +7095,10 @@ const FfiConverterTypePayment = (() => {
6701
7095
  FfiConverterUInt64.write(value.timestamp, into);
6702
7096
  FfiConverterTypePaymentMethod.write(value.method, into);
6703
7097
  FfiConverterOptionalTypePaymentDetails.write(value.details, into);
7098
+ FfiConverterOptionalTypeConversionDetails.write(
7099
+ value.conversionDetails,
7100
+ into
7101
+ );
6704
7102
  }
6705
7103
  allocationSize(value: TypeName): number {
6706
7104
  return (
@@ -6711,7 +7109,10 @@ const FfiConverterTypePayment = (() => {
6711
7109
  FfiConverterTypeu128.allocationSize(value.fees) +
6712
7110
  FfiConverterUInt64.allocationSize(value.timestamp) +
6713
7111
  FfiConverterTypePaymentMethod.allocationSize(value.method) +
6714
- FfiConverterOptionalTypePaymentDetails.allocationSize(value.details)
7112
+ FfiConverterOptionalTypePaymentDetails.allocationSize(value.details) +
7113
+ FfiConverterOptionalTypeConversionDetails.allocationSize(
7114
+ value.conversionDetails
7115
+ )
6715
7116
  );
6716
7117
  }
6717
7118
  }
@@ -6860,10 +7261,21 @@ const FfiConverterTypePaymentRequestSource = (() => {
6860
7261
  })();
6861
7262
 
6862
7263
  export type PrepareLnurlPayRequest = {
7264
+ /**
7265
+ * The amount to send in satoshis.
7266
+ */
6863
7267
  amountSats: /*u64*/ bigint;
6864
7268
  payRequest: LnurlPayRequestDetails;
6865
7269
  comment: string | undefined;
6866
7270
  validateSuccessActionUrl: boolean | undefined;
7271
+ /**
7272
+ * If provided, the payment will include a token conversion step before sending the payment
7273
+ */
7274
+ conversionOptions: ConversionOptions | undefined;
7275
+ /**
7276
+ * How fees should be handled. Defaults to `FeesExcluded` (fees added on top).
7277
+ */
7278
+ feePolicy: FeePolicy | undefined;
6867
7279
  };
6868
7280
 
6869
7281
  /**
@@ -6873,6 +7285,8 @@ export const PrepareLnurlPayRequest = (() => {
6873
7285
  const defaults = () => ({
6874
7286
  comment: undefined,
6875
7287
  validateSuccessActionUrl: undefined,
7288
+ conversionOptions: undefined,
7289
+ feePolicy: undefined,
6876
7290
  });
6877
7291
  const create = (() => {
6878
7292
  return uniffiCreateRecord<
@@ -6910,6 +7324,8 @@ const FfiConverterTypePrepareLnurlPayRequest = (() => {
6910
7324
  payRequest: FfiConverterTypeLnurlPayRequestDetails.read(from),
6911
7325
  comment: FfiConverterOptionalString.read(from),
6912
7326
  validateSuccessActionUrl: FfiConverterOptionalBool.read(from),
7327
+ conversionOptions: FfiConverterOptionalTypeConversionOptions.read(from),
7328
+ feePolicy: FfiConverterOptionalTypeFeePolicy.read(from),
6913
7329
  };
6914
7330
  }
6915
7331
  write(value: TypeName, into: RustBuffer): void {
@@ -6917,6 +7333,11 @@ const FfiConverterTypePrepareLnurlPayRequest = (() => {
6917
7333
  FfiConverterTypeLnurlPayRequestDetails.write(value.payRequest, into);
6918
7334
  FfiConverterOptionalString.write(value.comment, into);
6919
7335
  FfiConverterOptionalBool.write(value.validateSuccessActionUrl, into);
7336
+ FfiConverterOptionalTypeConversionOptions.write(
7337
+ value.conversionOptions,
7338
+ into
7339
+ );
7340
+ FfiConverterOptionalTypeFeePolicy.write(value.feePolicy, into);
6920
7341
  }
6921
7342
  allocationSize(value: TypeName): number {
6922
7343
  return (
@@ -6925,7 +7346,13 @@ const FfiConverterTypePrepareLnurlPayRequest = (() => {
6925
7346
  value.payRequest
6926
7347
  ) +
6927
7348
  FfiConverterOptionalString.allocationSize(value.comment) +
6928
- FfiConverterOptionalBool.allocationSize(value.validateSuccessActionUrl)
7349
+ FfiConverterOptionalBool.allocationSize(
7350
+ value.validateSuccessActionUrl
7351
+ ) +
7352
+ FfiConverterOptionalTypeConversionOptions.allocationSize(
7353
+ value.conversionOptions
7354
+ ) +
7355
+ FfiConverterOptionalTypeFeePolicy.allocationSize(value.feePolicy)
6929
7356
  );
6930
7357
  }
6931
7358
  }
@@ -6933,12 +7360,27 @@ const FfiConverterTypePrepareLnurlPayRequest = (() => {
6933
7360
  })();
6934
7361
 
6935
7362
  export type PrepareLnurlPayResponse = {
7363
+ /**
7364
+ * The amount to send in satoshis.
7365
+ */
6936
7366
  amountSats: /*u64*/ bigint;
6937
7367
  comment: string | undefined;
6938
7368
  payRequest: LnurlPayRequestDetails;
7369
+ /**
7370
+ * The fee in satoshis. For `FeesIncluded` operations, this represents the total fee
7371
+ * (including potential overpayment).
7372
+ */
6939
7373
  feeSats: /*u64*/ bigint;
6940
7374
  invoiceDetails: Bolt11InvoiceDetails;
6941
7375
  successAction: SuccessAction | undefined;
7376
+ /**
7377
+ * When set, the payment will include a token conversion step before sending the payment
7378
+ */
7379
+ conversionEstimate: ConversionEstimate | undefined;
7380
+ /**
7381
+ * How fees are handled for this payment.
7382
+ */
7383
+ feePolicy: FeePolicy;
6942
7384
  };
6943
7385
 
6944
7386
  /**
@@ -6984,6 +7426,9 @@ const FfiConverterTypePrepareLnurlPayResponse = (() => {
6984
7426
  feeSats: FfiConverterUInt64.read(from),
6985
7427
  invoiceDetails: FfiConverterTypeBolt11InvoiceDetails.read(from),
6986
7428
  successAction: FfiConverterOptionalTypeSuccessAction.read(from),
7429
+ conversionEstimate:
7430
+ FfiConverterOptionalTypeConversionEstimate.read(from),
7431
+ feePolicy: FfiConverterTypeFeePolicy.read(from),
6987
7432
  };
6988
7433
  }
6989
7434
  write(value: TypeName, into: RustBuffer): void {
@@ -6993,6 +7438,11 @@ const FfiConverterTypePrepareLnurlPayResponse = (() => {
6993
7438
  FfiConverterUInt64.write(value.feeSats, into);
6994
7439
  FfiConverterTypeBolt11InvoiceDetails.write(value.invoiceDetails, into);
6995
7440
  FfiConverterOptionalTypeSuccessAction.write(value.successAction, into);
7441
+ FfiConverterOptionalTypeConversionEstimate.write(
7442
+ value.conversionEstimate,
7443
+ into
7444
+ );
7445
+ FfiConverterTypeFeePolicy.write(value.feePolicy, into);
6996
7446
  }
6997
7447
  allocationSize(value: TypeName): number {
6998
7448
  return (
@@ -7007,7 +7457,11 @@ const FfiConverterTypePrepareLnurlPayResponse = (() => {
7007
7457
  ) +
7008
7458
  FfiConverterOptionalTypeSuccessAction.allocationSize(
7009
7459
  value.successAction
7010
- )
7460
+ ) +
7461
+ FfiConverterOptionalTypeConversionEstimate.allocationSize(
7462
+ value.conversionEstimate
7463
+ ) +
7464
+ FfiConverterTypeFeePolicy.allocationSize(value.feePolicy)
7011
7465
  );
7012
7466
  }
7013
7467
  }
@@ -7017,19 +7471,25 @@ const FfiConverterTypePrepareLnurlPayResponse = (() => {
7017
7471
  export type PrepareSendPaymentRequest = {
7018
7472
  paymentRequest: string;
7019
7473
  /**
7020
- * Amount to send. By default is denominated in sats.
7021
- * If a token identifier is provided, the amount will be denominated in the token base units.
7474
+ * The amount to send.
7475
+ * Optional for payment requests with embedded amounts (e.g., Spark/Bolt11 invoices with amounts).
7476
+ * Required for Spark addresses, Bitcoin addresses, and amountless invoices.
7477
+ * Denominated in satoshis for Bitcoin payments, or token base units for token payments.
7022
7478
  */
7023
7479
  amount: U128 | undefined;
7024
7480
  /**
7025
- * If provided, the payment will be for a token.
7026
- * May only be provided if the payment request is a spark address.
7481
+ * Optional token identifier for token payments.
7482
+ * Absence indicates that the payment is a Bitcoin payment.
7027
7483
  */
7028
7484
  tokenIdentifier: string | undefined;
7029
7485
  /**
7030
7486
  * If provided, the payment will include a conversion step before sending the payment
7031
7487
  */
7032
7488
  conversionOptions: ConversionOptions | undefined;
7489
+ /**
7490
+ * How fees should be handled. Defaults to `FeesExcluded` (fees added on top).
7491
+ */
7492
+ feePolicy: FeePolicy | undefined;
7033
7493
  };
7034
7494
 
7035
7495
  /**
@@ -7040,6 +7500,7 @@ export const PrepareSendPaymentRequest = (() => {
7040
7500
  amount: undefined,
7041
7501
  tokenIdentifier: undefined,
7042
7502
  conversionOptions: undefined,
7503
+ feePolicy: undefined,
7043
7504
  });
7044
7505
  const create = (() => {
7045
7506
  return uniffiCreateRecord<
@@ -7077,6 +7538,7 @@ const FfiConverterTypePrepareSendPaymentRequest = (() => {
7077
7538
  amount: FfiConverterOptionalTypeu128.read(from),
7078
7539
  tokenIdentifier: FfiConverterOptionalString.read(from),
7079
7540
  conversionOptions: FfiConverterOptionalTypeConversionOptions.read(from),
7541
+ feePolicy: FfiConverterOptionalTypeFeePolicy.read(from),
7080
7542
  };
7081
7543
  }
7082
7544
  write(value: TypeName, into: RustBuffer): void {
@@ -7087,6 +7549,7 @@ const FfiConverterTypePrepareSendPaymentRequest = (() => {
7087
7549
  value.conversionOptions,
7088
7550
  into
7089
7551
  );
7552
+ FfiConverterOptionalTypeFeePolicy.write(value.feePolicy, into);
7090
7553
  }
7091
7554
  allocationSize(value: TypeName): number {
7092
7555
  return (
@@ -7095,7 +7558,8 @@ const FfiConverterTypePrepareSendPaymentRequest = (() => {
7095
7558
  FfiConverterOptionalString.allocationSize(value.tokenIdentifier) +
7096
7559
  FfiConverterOptionalTypeConversionOptions.allocationSize(
7097
7560
  value.conversionOptions
7098
- )
7561
+ ) +
7562
+ FfiConverterOptionalTypeFeePolicy.allocationSize(value.feePolicy)
7099
7563
  );
7100
7564
  }
7101
7565
  }
@@ -7105,19 +7569,23 @@ const FfiConverterTypePrepareSendPaymentRequest = (() => {
7105
7569
  export type PrepareSendPaymentResponse = {
7106
7570
  paymentMethod: SendPaymentMethod;
7107
7571
  /**
7108
- * Amount to send. By default is denominated in sats.
7109
- * If a token identifier is provided, the amount will be denominated in the token base units.
7572
+ * The amount for the payment.
7573
+ * Denominated in satoshis for Bitcoin payments, or token base units for token payments.
7110
7574
  */
7111
7575
  amount: U128;
7112
7576
  /**
7113
- * The presence of this field indicates that the payment is for a token.
7114
- * If empty, it is a Bitcoin payment.
7577
+ * Optional token identifier for token payments.
7578
+ * Absence indicates that the payment is a Bitcoin payment.
7115
7579
  */
7116
7580
  tokenIdentifier: string | undefined;
7117
7581
  /**
7118
7582
  * When set, the payment will include a conversion step before sending the payment
7119
7583
  */
7120
7584
  conversionEstimate: ConversionEstimate | undefined;
7585
+ /**
7586
+ * How fees are handled for this payment.
7587
+ */
7588
+ feePolicy: FeePolicy;
7121
7589
  };
7122
7590
 
7123
7591
  /**
@@ -7162,6 +7630,7 @@ const FfiConverterTypePrepareSendPaymentResponse = (() => {
7162
7630
  tokenIdentifier: FfiConverterOptionalString.read(from),
7163
7631
  conversionEstimate:
7164
7632
  FfiConverterOptionalTypeConversionEstimate.read(from),
7633
+ feePolicy: FfiConverterTypeFeePolicy.read(from),
7165
7634
  };
7166
7635
  }
7167
7636
  write(value: TypeName, into: RustBuffer): void {
@@ -7172,6 +7641,7 @@ const FfiConverterTypePrepareSendPaymentResponse = (() => {
7172
7641
  value.conversionEstimate,
7173
7642
  into
7174
7643
  );
7644
+ FfiConverterTypeFeePolicy.write(value.feePolicy, into);
7175
7645
  }
7176
7646
  allocationSize(value: TypeName): number {
7177
7647
  return (
@@ -7180,7 +7650,8 @@ const FfiConverterTypePrepareSendPaymentResponse = (() => {
7180
7650
  FfiConverterOptionalString.allocationSize(value.tokenIdentifier) +
7181
7651
  FfiConverterOptionalTypeConversionEstimate.allocationSize(
7182
7652
  value.conversionEstimate
7183
- )
7653
+ ) +
7654
+ FfiConverterTypeFeePolicy.allocationSize(value.feePolicy)
7184
7655
  );
7185
7656
  }
7186
7657
  }
@@ -7629,7 +8100,7 @@ export type RecordChange = {
7629
8100
  id: RecordId;
7630
8101
  schemaVersion: string;
7631
8102
  updatedFields: Map<string, string>;
7632
- revision: /*u64*/ bigint;
8103
+ localRevision: /*u64*/ bigint;
7633
8104
  };
7634
8105
 
7635
8106
  /**
@@ -7670,21 +8141,21 @@ const FfiConverterTypeRecordChange = (() => {
7670
8141
  id: FfiConverterTypeRecordId.read(from),
7671
8142
  schemaVersion: FfiConverterString.read(from),
7672
8143
  updatedFields: FfiConverterMapStringString.read(from),
7673
- revision: FfiConverterUInt64.read(from),
8144
+ localRevision: FfiConverterUInt64.read(from),
7674
8145
  };
7675
8146
  }
7676
8147
  write(value: TypeName, into: RustBuffer): void {
7677
8148
  FfiConverterTypeRecordId.write(value.id, into);
7678
8149
  FfiConverterString.write(value.schemaVersion, into);
7679
8150
  FfiConverterMapStringString.write(value.updatedFields, into);
7680
- FfiConverterUInt64.write(value.revision, into);
8151
+ FfiConverterUInt64.write(value.localRevision, into);
7681
8152
  }
7682
8153
  allocationSize(value: TypeName): number {
7683
8154
  return (
7684
8155
  FfiConverterTypeRecordId.allocationSize(value.id) +
7685
8156
  FfiConverterString.allocationSize(value.schemaVersion) +
7686
8157
  FfiConverterMapStringString.allocationSize(value.updatedFields) +
7687
- FfiConverterUInt64.allocationSize(value.revision)
8158
+ FfiConverterUInt64.allocationSize(value.localRevision)
7688
8159
  );
7689
8160
  }
7690
8161
  }
@@ -9057,6 +9528,73 @@ const FfiConverterTypeSparkInvoicePaymentDetails = (() => {
9057
9528
  return new FFIConverter();
9058
9529
  })();
9059
9530
 
9531
+ /**
9532
+ * The status of the Spark network services relevant to the SDK.
9533
+ */
9534
+ export type SparkStatus = {
9535
+ /**
9536
+ * The worst status across all relevant services.
9537
+ */
9538
+ status: ServiceStatus;
9539
+ /**
9540
+ * The last time the status was updated, as a unix timestamp in seconds.
9541
+ */
9542
+ lastUpdated: /*u64*/ bigint;
9543
+ };
9544
+
9545
+ /**
9546
+ * Generated factory for {@link SparkStatus} record objects.
9547
+ */
9548
+ export const SparkStatus = (() => {
9549
+ const defaults = () => ({});
9550
+ const create = (() => {
9551
+ return uniffiCreateRecord<SparkStatus, ReturnType<typeof defaults>>(
9552
+ defaults
9553
+ );
9554
+ })();
9555
+ return Object.freeze({
9556
+ /**
9557
+ * Create a frozen instance of {@link SparkStatus}, with defaults specified
9558
+ * in Rust, in the {@link breez_sdk_spark} crate.
9559
+ */
9560
+ create,
9561
+
9562
+ /**
9563
+ * Create a frozen instance of {@link SparkStatus}, with defaults specified
9564
+ * in Rust, in the {@link breez_sdk_spark} crate.
9565
+ */
9566
+ new: create,
9567
+
9568
+ /**
9569
+ * Defaults specified in the {@link breez_sdk_spark} crate.
9570
+ */
9571
+ defaults: () => Object.freeze(defaults()) as Partial<SparkStatus>,
9572
+ });
9573
+ })();
9574
+
9575
+ const FfiConverterTypeSparkStatus = (() => {
9576
+ type TypeName = SparkStatus;
9577
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
9578
+ read(from: RustBuffer): TypeName {
9579
+ return {
9580
+ status: FfiConverterTypeServiceStatus.read(from),
9581
+ lastUpdated: FfiConverterUInt64.read(from),
9582
+ };
9583
+ }
9584
+ write(value: TypeName, into: RustBuffer): void {
9585
+ FfiConverterTypeServiceStatus.write(value.status, into);
9586
+ FfiConverterUInt64.write(value.lastUpdated, into);
9587
+ }
9588
+ allocationSize(value: TypeName): number {
9589
+ return (
9590
+ FfiConverterTypeServiceStatus.allocationSize(value.status) +
9591
+ FfiConverterUInt64.allocationSize(value.lastUpdated)
9592
+ );
9593
+ }
9594
+ }
9595
+ return new FFIConverter();
9596
+ })();
9597
+
9060
9598
  /**
9061
9599
  * Settings for the symbol representation of a currency
9062
9600
  */
@@ -11650,6 +12188,51 @@ const FfiConverterTypeFee = (() => {
11650
12188
  return new FFIConverter();
11651
12189
  })();
11652
12190
 
12191
+ /**
12192
+ * Specifies how fees are handled in a payment.
12193
+ */
12194
+ export enum FeePolicy {
12195
+ /**
12196
+ * Fees are added on top of the specified amount (default behavior).
12197
+ * The receiver gets the exact amount specified.
12198
+ */
12199
+ FeesExcluded,
12200
+ /**
12201
+ * Fees are deducted from the specified amount.
12202
+ * The receiver gets the amount minus fees.
12203
+ */
12204
+ FeesIncluded,
12205
+ }
12206
+
12207
+ const FfiConverterTypeFeePolicy = (() => {
12208
+ const ordinalConverter = FfiConverterInt32;
12209
+ type TypeName = FeePolicy;
12210
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
12211
+ read(from: RustBuffer): TypeName {
12212
+ switch (ordinalConverter.read(from)) {
12213
+ case 1:
12214
+ return FeePolicy.FeesExcluded;
12215
+ case 2:
12216
+ return FeePolicy.FeesIncluded;
12217
+ default:
12218
+ throw new UniffiInternalError.UnexpectedEnumCase();
12219
+ }
12220
+ }
12221
+ write(value: TypeName, into: RustBuffer): void {
12222
+ switch (value) {
12223
+ case FeePolicy.FeesExcluded:
12224
+ return ordinalConverter.write(1, into);
12225
+ case FeePolicy.FeesIncluded:
12226
+ return ordinalConverter.write(2, into);
12227
+ }
12228
+ }
12229
+ allocationSize(value: TypeName): number {
12230
+ return ordinalConverter.allocationSize(0);
12231
+ }
12232
+ }
12233
+ return new FFIConverter();
12234
+ })();
12235
+
11653
12236
  // Enum: InputType
11654
12237
  export enum InputType_Tags {
11655
12238
  BitcoinAddress = 'BitcoinAddress',
@@ -13185,6 +13768,7 @@ export const PaymentDetails = (() => {
13185
13768
  inner: Readonly<{
13186
13769
  metadata: TokenMetadata;
13187
13770
  txHash: string;
13771
+ txType: TokenTransactionType;
13188
13772
  invoiceDetails: SparkInvoicePaymentDetails | undefined;
13189
13773
  conversionInfo: ConversionInfo | undefined;
13190
13774
  }>;
@@ -13200,12 +13784,14 @@ export const PaymentDetails = (() => {
13200
13784
  readonly inner: Readonly<{
13201
13785
  metadata: TokenMetadata;
13202
13786
  txHash: string;
13787
+ txType: TokenTransactionType;
13203
13788
  invoiceDetails: SparkInvoicePaymentDetails | undefined;
13204
13789
  conversionInfo: ConversionInfo | undefined;
13205
13790
  }>;
13206
13791
  constructor(inner: {
13207
13792
  metadata: TokenMetadata;
13208
13793
  txHash: string;
13794
+ txType: TokenTransactionType;
13209
13795
  /**
13210
13796
  * The invoice details if the payment fulfilled a spark invoice
13211
13797
  */ invoiceDetails: SparkInvoicePaymentDetails | undefined;
@@ -13220,6 +13806,7 @@ export const PaymentDetails = (() => {
13220
13806
  static new(inner: {
13221
13807
  metadata: TokenMetadata;
13222
13808
  txHash: string;
13809
+ txType: TokenTransactionType;
13223
13810
  /**
13224
13811
  * The invoice details if the payment fulfilled a spark invoice
13225
13812
  */ invoiceDetails: SparkInvoicePaymentDetails | undefined;
@@ -13424,6 +14011,7 @@ const FfiConverterTypePaymentDetails = (() => {
13424
14011
  return new PaymentDetails.Token({
13425
14012
  metadata: FfiConverterTypeTokenMetadata.read(from),
13426
14013
  txHash: FfiConverterString.read(from),
14014
+ txType: FfiConverterTypeTokenTransactionType.read(from),
13427
14015
  invoiceDetails:
13428
14016
  FfiConverterOptionalTypeSparkInvoicePaymentDetails.read(from),
13429
14017
  conversionInfo: FfiConverterOptionalTypeConversionInfo.read(from),
@@ -13477,6 +14065,7 @@ const FfiConverterTypePaymentDetails = (() => {
13477
14065
  const inner = value.inner;
13478
14066
  FfiConverterTypeTokenMetadata.write(inner.metadata, into);
13479
14067
  FfiConverterString.write(inner.txHash, into);
14068
+ FfiConverterTypeTokenTransactionType.write(inner.txType, into);
13480
14069
  FfiConverterOptionalTypeSparkInvoicePaymentDetails.write(
13481
14070
  inner.invoiceDetails,
13482
14071
  into
@@ -13545,6 +14134,9 @@ const FfiConverterTypePaymentDetails = (() => {
13545
14134
  let size = ordinalConverter.allocationSize(2);
13546
14135
  size += FfiConverterTypeTokenMetadata.allocationSize(inner.metadata);
13547
14136
  size += FfiConverterString.allocationSize(inner.txHash);
14137
+ size += FfiConverterTypeTokenTransactionType.allocationSize(
14138
+ inner.txType
14139
+ );
13548
14140
  size +=
13549
14141
  FfiConverterOptionalTypeSparkInvoicePaymentDetails.allocationSize(
13550
14142
  inner.invoiceDetails
@@ -13651,6 +14243,7 @@ export const PaymentDetailsFilter = (() => {
13651
14243
  inner: Readonly<{
13652
14244
  conversionRefundNeeded: boolean | undefined;
13653
14245
  txHash: string | undefined;
14246
+ txType: TokenTransactionType | undefined;
13654
14247
  }>;
13655
14248
  };
13656
14249
 
@@ -13664,6 +14257,7 @@ export const PaymentDetailsFilter = (() => {
13664
14257
  readonly inner: Readonly<{
13665
14258
  conversionRefundNeeded: boolean | undefined;
13666
14259
  txHash: string | undefined;
14260
+ txType: TokenTransactionType | undefined;
13667
14261
  }>;
13668
14262
  constructor(inner: {
13669
14263
  /**
@@ -13672,6 +14266,9 @@ export const PaymentDetailsFilter = (() => {
13672
14266
  /**
13673
14267
  * Filter by transaction hash
13674
14268
  */ txHash: string | undefined;
14269
+ /**
14270
+ * Filter by transaction type
14271
+ */ txType: TokenTransactionType | undefined;
13675
14272
  }) {
13676
14273
  super('PaymentDetailsFilter', 'Token');
13677
14274
  this.inner = Object.freeze(inner);
@@ -13684,6 +14281,9 @@ export const PaymentDetailsFilter = (() => {
13684
14281
  /**
13685
14282
  * Filter by transaction hash
13686
14283
  */ txHash: string | undefined;
14284
+ /**
14285
+ * Filter by transaction type
14286
+ */ txType: TokenTransactionType | undefined;
13687
14287
  }): Token_ {
13688
14288
  return new Token_(inner);
13689
14289
  }
@@ -13727,6 +14327,7 @@ const FfiConverterTypePaymentDetailsFilter = (() => {
13727
14327
  return new PaymentDetailsFilter.Token({
13728
14328
  conversionRefundNeeded: FfiConverterOptionalBool.read(from),
13729
14329
  txHash: FfiConverterOptionalString.read(from),
14330
+ txType: FfiConverterOptionalTypeTokenTransactionType.read(from),
13730
14331
  });
13731
14332
  default:
13732
14333
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -13749,6 +14350,10 @@ const FfiConverterTypePaymentDetailsFilter = (() => {
13749
14350
  const inner = value.inner;
13750
14351
  FfiConverterOptionalBool.write(inner.conversionRefundNeeded, into);
13751
14352
  FfiConverterOptionalString.write(inner.txHash, into);
14353
+ FfiConverterOptionalTypeTokenTransactionType.write(
14354
+ inner.txType,
14355
+ into
14356
+ );
13752
14357
  return;
13753
14358
  }
13754
14359
  default:
@@ -13776,6 +14381,9 @@ const FfiConverterTypePaymentDetailsFilter = (() => {
13776
14381
  inner.conversionRefundNeeded
13777
14382
  );
13778
14383
  size += FfiConverterOptionalString.allocationSize(inner.txHash);
14384
+ size += FfiConverterOptionalTypeTokenTransactionType.allocationSize(
14385
+ inner.txType
14386
+ );
13779
14387
  return size;
13780
14388
  }
13781
14389
  default:
@@ -16320,13 +16928,19 @@ export const SendPaymentOptions = (() => {
16320
16928
  readonly [uniffiTypeNameSymbol] = 'SendPaymentOptions';
16321
16929
  readonly tag = SendPaymentOptions_Tags.BitcoinAddress;
16322
16930
  readonly inner: Readonly<{ confirmationSpeed: OnchainConfirmationSpeed }>;
16323
- constructor(inner: { confirmationSpeed: OnchainConfirmationSpeed }) {
16931
+ constructor(inner: {
16932
+ /**
16933
+ * Confirmation speed for the on-chain transaction.
16934
+ */ confirmationSpeed: OnchainConfirmationSpeed;
16935
+ }) {
16324
16936
  super('SendPaymentOptions', 'BitcoinAddress');
16325
16937
  this.inner = Object.freeze(inner);
16326
16938
  }
16327
16939
 
16328
16940
  static new(inner: {
16329
- confirmationSpeed: OnchainConfirmationSpeed;
16941
+ /**
16942
+ * Confirmation speed for the on-chain transaction.
16943
+ */ confirmationSpeed: OnchainConfirmationSpeed;
16330
16944
  }): BitcoinAddress_ {
16331
16945
  return new BitcoinAddress_(inner);
16332
16946
  }
@@ -17114,6 +17728,73 @@ const FfiConverterTypeServiceConnectivityError = (() => {
17114
17728
  return new FFIConverter();
17115
17729
  })();
17116
17730
 
17731
+ /**
17732
+ * The operational status of a Spark service.
17733
+ */
17734
+ export enum ServiceStatus {
17735
+ /**
17736
+ * Service is fully operational.
17737
+ */
17738
+ Operational,
17739
+ /**
17740
+ * Service is experiencing degraded performance.
17741
+ */
17742
+ Degraded,
17743
+ /**
17744
+ * Service is partially unavailable.
17745
+ */
17746
+ Partial,
17747
+ /**
17748
+ * Service status is unknown.
17749
+ */
17750
+ Unknown,
17751
+ /**
17752
+ * Service is experiencing a major outage.
17753
+ */
17754
+ Major,
17755
+ }
17756
+
17757
+ const FfiConverterTypeServiceStatus = (() => {
17758
+ const ordinalConverter = FfiConverterInt32;
17759
+ type TypeName = ServiceStatus;
17760
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
17761
+ read(from: RustBuffer): TypeName {
17762
+ switch (ordinalConverter.read(from)) {
17763
+ case 1:
17764
+ return ServiceStatus.Operational;
17765
+ case 2:
17766
+ return ServiceStatus.Degraded;
17767
+ case 3:
17768
+ return ServiceStatus.Partial;
17769
+ case 4:
17770
+ return ServiceStatus.Unknown;
17771
+ case 5:
17772
+ return ServiceStatus.Major;
17773
+ default:
17774
+ throw new UniffiInternalError.UnexpectedEnumCase();
17775
+ }
17776
+ }
17777
+ write(value: TypeName, into: RustBuffer): void {
17778
+ switch (value) {
17779
+ case ServiceStatus.Operational:
17780
+ return ordinalConverter.write(1, into);
17781
+ case ServiceStatus.Degraded:
17782
+ return ordinalConverter.write(2, into);
17783
+ case ServiceStatus.Partial:
17784
+ return ordinalConverter.write(3, into);
17785
+ case ServiceStatus.Unknown:
17786
+ return ordinalConverter.write(4, into);
17787
+ case ServiceStatus.Major:
17788
+ return ordinalConverter.write(5, into);
17789
+ }
17790
+ }
17791
+ allocationSize(value: TypeName): number {
17792
+ return ordinalConverter.allocationSize(0);
17793
+ }
17794
+ }
17795
+ return new FFIConverter();
17796
+ })();
17797
+
17117
17798
  // Error type: SignerError
17118
17799
 
17119
17800
  // Enum: SignerError
@@ -17577,6 +18258,7 @@ const FfiConverterTypeSparkHtlcStatus = (() => {
17577
18258
 
17578
18259
  // Enum: StorageError
17579
18260
  export enum StorageError_Tags {
18261
+ Connection = 'Connection',
17580
18262
  Implementation = 'Implementation',
17581
18263
  InitializationError = 'InitializationError',
17582
18264
  Serialization = 'Serialization',
@@ -17585,33 +18267,72 @@ export enum StorageError_Tags {
17585
18267
  * Errors that can occur during storage operations
17586
18268
  */
17587
18269
  export const StorageError = (() => {
17588
- type Implementation__interface = {
17589
- tag: StorageError_Tags.Implementation;
18270
+ type Connection__interface = {
18271
+ tag: StorageError_Tags.Connection;
17590
18272
  inner: Readonly<[string]>;
17591
18273
  };
17592
18274
 
17593
- class Implementation_
17594
- extends UniffiError
17595
- implements Implementation__interface
17596
- {
18275
+ /**
18276
+ * Connection-related errors (pool exhaustion, timeouts, connection refused).
18277
+ * These are often transient and may be retried.
18278
+ */
18279
+ class Connection_ extends UniffiError implements Connection__interface {
17597
18280
  /**
17598
18281
  * @private
17599
18282
  * This field is private and should not be used, use `tag` instead.
17600
18283
  */
17601
18284
  readonly [uniffiTypeNameSymbol] = 'StorageError';
17602
- readonly tag = StorageError_Tags.Implementation;
18285
+ readonly tag = StorageError_Tags.Connection;
17603
18286
  readonly inner: Readonly<[string]>;
17604
18287
  constructor(v0: string) {
17605
- super('StorageError', 'Implementation');
18288
+ super('StorageError', 'Connection');
17606
18289
  this.inner = Object.freeze([v0]);
17607
18290
  }
17608
18291
 
17609
- static new(v0: string): Implementation_ {
17610
- return new Implementation_(v0);
18292
+ static new(v0: string): Connection_ {
18293
+ return new Connection_(v0);
17611
18294
  }
17612
18295
 
17613
- static instanceOf(obj: any): obj is Implementation_ {
17614
- return obj.tag === StorageError_Tags.Implementation;
18296
+ static instanceOf(obj: any): obj is Connection_ {
18297
+ return obj.tag === StorageError_Tags.Connection;
18298
+ }
18299
+
18300
+ static hasInner(obj: any): obj is Connection_ {
18301
+ return Connection_.instanceOf(obj);
18302
+ }
18303
+
18304
+ static getInner(obj: Connection_): Readonly<[string]> {
18305
+ return obj.inner;
18306
+ }
18307
+ }
18308
+
18309
+ type Implementation__interface = {
18310
+ tag: StorageError_Tags.Implementation;
18311
+ inner: Readonly<[string]>;
18312
+ };
18313
+
18314
+ class Implementation_
18315
+ extends UniffiError
18316
+ implements Implementation__interface
18317
+ {
18318
+ /**
18319
+ * @private
18320
+ * This field is private and should not be used, use `tag` instead.
18321
+ */
18322
+ readonly [uniffiTypeNameSymbol] = 'StorageError';
18323
+ readonly tag = StorageError_Tags.Implementation;
18324
+ readonly inner: Readonly<[string]>;
18325
+ constructor(v0: string) {
18326
+ super('StorageError', 'Implementation');
18327
+ this.inner = Object.freeze([v0]);
18328
+ }
18329
+
18330
+ static new(v0: string): Implementation_ {
18331
+ return new Implementation_(v0);
18332
+ }
18333
+
18334
+ static instanceOf(obj: any): obj is Implementation_ {
18335
+ return obj.tag === StorageError_Tags.Implementation;
17615
18336
  }
17616
18337
 
17617
18338
  static hasInner(obj: any): obj is Implementation_ {
@@ -17705,6 +18426,7 @@ export const StorageError = (() => {
17705
18426
 
17706
18427
  return Object.freeze({
17707
18428
  instanceOf,
18429
+ Connection: Connection_,
17708
18430
  Implementation: Implementation_,
17709
18431
  InitializationError: InitializationError_,
17710
18432
  Serialization: Serialization_,
@@ -17727,12 +18449,14 @@ const FfiConverterTypeStorageError = (() => {
17727
18449
  read(from: RustBuffer): TypeName {
17728
18450
  switch (ordinalConverter.read(from)) {
17729
18451
  case 1:
17730
- return new StorageError.Implementation(FfiConverterString.read(from));
18452
+ return new StorageError.Connection(FfiConverterString.read(from));
17731
18453
  case 2:
18454
+ return new StorageError.Implementation(FfiConverterString.read(from));
18455
+ case 3:
17732
18456
  return new StorageError.InitializationError(
17733
18457
  FfiConverterString.read(from)
17734
18458
  );
17735
- case 3:
18459
+ case 4:
17736
18460
  return new StorageError.Serialization(FfiConverterString.read(from));
17737
18461
  default:
17738
18462
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -17740,24 +18464,30 @@ const FfiConverterTypeStorageError = (() => {
17740
18464
  }
17741
18465
  write(value: TypeName, into: RustBuffer): void {
17742
18466
  switch (value.tag) {
17743
- case StorageError_Tags.Implementation: {
18467
+ case StorageError_Tags.Connection: {
17744
18468
  ordinalConverter.write(1, into);
17745
18469
  const inner = value.inner;
17746
18470
  FfiConverterString.write(inner[0], into);
17747
18471
  return;
17748
18472
  }
17749
- case StorageError_Tags.InitializationError: {
18473
+ case StorageError_Tags.Implementation: {
17750
18474
  ordinalConverter.write(2, into);
17751
18475
  const inner = value.inner;
17752
18476
  FfiConverterString.write(inner[0], into);
17753
18477
  return;
17754
18478
  }
17755
- case StorageError_Tags.Serialization: {
18479
+ case StorageError_Tags.InitializationError: {
17756
18480
  ordinalConverter.write(3, into);
17757
18481
  const inner = value.inner;
17758
18482
  FfiConverterString.write(inner[0], into);
17759
18483
  return;
17760
18484
  }
18485
+ case StorageError_Tags.Serialization: {
18486
+ ordinalConverter.write(4, into);
18487
+ const inner = value.inner;
18488
+ FfiConverterString.write(inner[0], into);
18489
+ return;
18490
+ }
17761
18491
  default:
17762
18492
  // Throwing from here means that StorageError_Tags hasn't matched an ordinal.
17763
18493
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -17765,24 +18495,30 @@ const FfiConverterTypeStorageError = (() => {
17765
18495
  }
17766
18496
  allocationSize(value: TypeName): number {
17767
18497
  switch (value.tag) {
17768
- case StorageError_Tags.Implementation: {
18498
+ case StorageError_Tags.Connection: {
17769
18499
  const inner = value.inner;
17770
18500
  let size = ordinalConverter.allocationSize(1);
17771
18501
  size += FfiConverterString.allocationSize(inner[0]);
17772
18502
  return size;
17773
18503
  }
17774
- case StorageError_Tags.InitializationError: {
18504
+ case StorageError_Tags.Implementation: {
17775
18505
  const inner = value.inner;
17776
18506
  let size = ordinalConverter.allocationSize(2);
17777
18507
  size += FfiConverterString.allocationSize(inner[0]);
17778
18508
  return size;
17779
18509
  }
17780
- case StorageError_Tags.Serialization: {
18510
+ case StorageError_Tags.InitializationError: {
17781
18511
  const inner = value.inner;
17782
18512
  let size = ordinalConverter.allocationSize(3);
17783
18513
  size += FfiConverterString.allocationSize(inner[0]);
17784
18514
  return size;
17785
18515
  }
18516
+ case StorageError_Tags.Serialization: {
18517
+ const inner = value.inner;
18518
+ let size = ordinalConverter.allocationSize(4);
18519
+ size += FfiConverterString.allocationSize(inner[0]);
18520
+ return size;
18521
+ }
17786
18522
  default:
17787
18523
  throw new UniffiInternalError.UnexpectedEnumCase();
17788
18524
  }
@@ -18210,223 +18946,40 @@ const FfiConverterTypeSuccessActionProcessed = (() => {
18210
18946
  return new FFIConverter();
18211
18947
  })();
18212
18948
 
18213
- // Error type: SyncStorageError
18214
-
18215
- // Enum: SyncStorageError
18216
- export enum SyncStorageError_Tags {
18217
- Implementation = 'Implementation',
18218
- InitializationError = 'InitializationError',
18219
- Serialization = 'Serialization',
18949
+ export enum TokenTransactionType {
18950
+ Transfer,
18951
+ Mint,
18952
+ Burn,
18220
18953
  }
18221
- /**
18222
- * Errors that can occur during storage operations
18223
- */
18224
- export const SyncStorageError = (() => {
18225
- type Implementation__interface = {
18226
- tag: SyncStorageError_Tags.Implementation;
18227
- inner: Readonly<[string]>;
18228
- };
18229
-
18230
- class Implementation_
18231
- extends UniffiError
18232
- implements Implementation__interface
18233
- {
18234
- /**
18235
- * @private
18236
- * This field is private and should not be used, use `tag` instead.
18237
- */
18238
- readonly [uniffiTypeNameSymbol] = 'SyncStorageError';
18239
- readonly tag = SyncStorageError_Tags.Implementation;
18240
- readonly inner: Readonly<[string]>;
18241
- constructor(v0: string) {
18242
- super('SyncStorageError', 'Implementation');
18243
- this.inner = Object.freeze([v0]);
18244
- }
18245
-
18246
- static new(v0: string): Implementation_ {
18247
- return new Implementation_(v0);
18248
- }
18249
-
18250
- static instanceOf(obj: any): obj is Implementation_ {
18251
- return obj.tag === SyncStorageError_Tags.Implementation;
18252
- }
18253
-
18254
- static hasInner(obj: any): obj is Implementation_ {
18255
- return Implementation_.instanceOf(obj);
18256
- }
18257
-
18258
- static getInner(obj: Implementation_): Readonly<[string]> {
18259
- return obj.inner;
18260
- }
18261
- }
18262
-
18263
- type InitializationError__interface = {
18264
- tag: SyncStorageError_Tags.InitializationError;
18265
- inner: Readonly<[string]>;
18266
- };
18267
-
18268
- /**
18269
- * Database initialization error
18270
- */
18271
- class InitializationError_
18272
- extends UniffiError
18273
- implements InitializationError__interface
18274
- {
18275
- /**
18276
- * @private
18277
- * This field is private and should not be used, use `tag` instead.
18278
- */
18279
- readonly [uniffiTypeNameSymbol] = 'SyncStorageError';
18280
- readonly tag = SyncStorageError_Tags.InitializationError;
18281
- readonly inner: Readonly<[string]>;
18282
- constructor(v0: string) {
18283
- super('SyncStorageError', 'InitializationError');
18284
- this.inner = Object.freeze([v0]);
18285
- }
18286
-
18287
- static new(v0: string): InitializationError_ {
18288
- return new InitializationError_(v0);
18289
- }
18290
-
18291
- static instanceOf(obj: any): obj is InitializationError_ {
18292
- return obj.tag === SyncStorageError_Tags.InitializationError;
18293
- }
18294
18954
 
18295
- static hasInner(obj: any): obj is InitializationError_ {
18296
- return InitializationError_.instanceOf(obj);
18297
- }
18298
-
18299
- static getInner(obj: InitializationError_): Readonly<[string]> {
18300
- return obj.inner;
18301
- }
18302
- }
18303
-
18304
- type Serialization__interface = {
18305
- tag: SyncStorageError_Tags.Serialization;
18306
- inner: Readonly<[string]>;
18307
- };
18308
-
18309
- class Serialization_ extends UniffiError implements Serialization__interface {
18310
- /**
18311
- * @private
18312
- * This field is private and should not be used, use `tag` instead.
18313
- */
18314
- readonly [uniffiTypeNameSymbol] = 'SyncStorageError';
18315
- readonly tag = SyncStorageError_Tags.Serialization;
18316
- readonly inner: Readonly<[string]>;
18317
- constructor(v0: string) {
18318
- super('SyncStorageError', 'Serialization');
18319
- this.inner = Object.freeze([v0]);
18320
- }
18321
-
18322
- static new(v0: string): Serialization_ {
18323
- return new Serialization_(v0);
18324
- }
18325
-
18326
- static instanceOf(obj: any): obj is Serialization_ {
18327
- return obj.tag === SyncStorageError_Tags.Serialization;
18328
- }
18329
-
18330
- static hasInner(obj: any): obj is Serialization_ {
18331
- return Serialization_.instanceOf(obj);
18332
- }
18333
-
18334
- static getInner(obj: Serialization_): Readonly<[string]> {
18335
- return obj.inner;
18336
- }
18337
- }
18338
-
18339
- function instanceOf(obj: any): obj is SyncStorageError {
18340
- return obj[uniffiTypeNameSymbol] === 'SyncStorageError';
18341
- }
18342
-
18343
- return Object.freeze({
18344
- instanceOf,
18345
- Implementation: Implementation_,
18346
- InitializationError: InitializationError_,
18347
- Serialization: Serialization_,
18348
- });
18349
- })();
18350
-
18351
- /**
18352
- * Errors that can occur during storage operations
18353
- */
18354
-
18355
- export type SyncStorageError = InstanceType<
18356
- (typeof SyncStorageError)[keyof Omit<typeof SyncStorageError, 'instanceOf'>]
18357
- >;
18358
-
18359
- // FfiConverter for enum SyncStorageError
18360
- const FfiConverterTypeSyncStorageError = (() => {
18955
+ const FfiConverterTypeTokenTransactionType = (() => {
18361
18956
  const ordinalConverter = FfiConverterInt32;
18362
- type TypeName = SyncStorageError;
18957
+ type TypeName = TokenTransactionType;
18363
18958
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
18364
18959
  read(from: RustBuffer): TypeName {
18365
18960
  switch (ordinalConverter.read(from)) {
18366
18961
  case 1:
18367
- return new SyncStorageError.Implementation(
18368
- FfiConverterString.read(from)
18369
- );
18962
+ return TokenTransactionType.Transfer;
18370
18963
  case 2:
18371
- return new SyncStorageError.InitializationError(
18372
- FfiConverterString.read(from)
18373
- );
18964
+ return TokenTransactionType.Mint;
18374
18965
  case 3:
18375
- return new SyncStorageError.Serialization(
18376
- FfiConverterString.read(from)
18377
- );
18966
+ return TokenTransactionType.Burn;
18378
18967
  default:
18379
18968
  throw new UniffiInternalError.UnexpectedEnumCase();
18380
18969
  }
18381
18970
  }
18382
18971
  write(value: TypeName, into: RustBuffer): void {
18383
- switch (value.tag) {
18384
- case SyncStorageError_Tags.Implementation: {
18385
- ordinalConverter.write(1, into);
18386
- const inner = value.inner;
18387
- FfiConverterString.write(inner[0], into);
18388
- return;
18389
- }
18390
- case SyncStorageError_Tags.InitializationError: {
18391
- ordinalConverter.write(2, into);
18392
- const inner = value.inner;
18393
- FfiConverterString.write(inner[0], into);
18394
- return;
18395
- }
18396
- case SyncStorageError_Tags.Serialization: {
18397
- ordinalConverter.write(3, into);
18398
- const inner = value.inner;
18399
- FfiConverterString.write(inner[0], into);
18400
- return;
18401
- }
18402
- default:
18403
- // Throwing from here means that SyncStorageError_Tags hasn't matched an ordinal.
18404
- throw new UniffiInternalError.UnexpectedEnumCase();
18972
+ switch (value) {
18973
+ case TokenTransactionType.Transfer:
18974
+ return ordinalConverter.write(1, into);
18975
+ case TokenTransactionType.Mint:
18976
+ return ordinalConverter.write(2, into);
18977
+ case TokenTransactionType.Burn:
18978
+ return ordinalConverter.write(3, into);
18405
18979
  }
18406
18980
  }
18407
18981
  allocationSize(value: TypeName): number {
18408
- switch (value.tag) {
18409
- case SyncStorageError_Tags.Implementation: {
18410
- const inner = value.inner;
18411
- let size = ordinalConverter.allocationSize(1);
18412
- size += FfiConverterString.allocationSize(inner[0]);
18413
- return size;
18414
- }
18415
- case SyncStorageError_Tags.InitializationError: {
18416
- const inner = value.inner;
18417
- let size = ordinalConverter.allocationSize(2);
18418
- size += FfiConverterString.allocationSize(inner[0]);
18419
- return size;
18420
- }
18421
- case SyncStorageError_Tags.Serialization: {
18422
- const inner = value.inner;
18423
- let size = ordinalConverter.allocationSize(3);
18424
- size += FfiConverterString.allocationSize(inner[0]);
18425
- return size;
18426
- }
18427
- default:
18428
- throw new UniffiInternalError.UnexpectedEnumCase();
18429
- }
18982
+ return ordinalConverter.allocationSize(0);
18430
18983
  }
18431
18984
  }
18432
18985
  return new FFIConverter();
@@ -19162,6 +19715,25 @@ export interface BreezSdkInterface {
19162
19715
  listener: EventListener,
19163
19716
  asyncOpts_?: { signal: AbortSignal }
19164
19717
  ): Promise<string>;
19718
+ /**
19719
+ * Initiates a Bitcoin purchase flow via an external provider (`MoonPay`).
19720
+ *
19721
+ * This method generates a URL that the user can open in a browser to complete
19722
+ * the Bitcoin purchase. The purchased Bitcoin will be sent to an automatically
19723
+ * generated deposit address.
19724
+ *
19725
+ * # Arguments
19726
+ *
19727
+ * * `request` - The purchase request containing optional amount and redirect URL
19728
+ *
19729
+ * # Returns
19730
+ *
19731
+ * A response containing the URL to open in a browser to complete the purchase
19732
+ */
19733
+ buyBitcoin(
19734
+ request: BuyBitcoinRequest,
19735
+ asyncOpts_?: { signal: AbortSignal }
19736
+ ): /*throws*/ Promise<BuyBitcoinResponse>;
19165
19737
  /**
19166
19738
  * Cancels the ongoing leaf optimization.
19167
19739
  *
@@ -19270,21 +19842,20 @@ export interface BreezSdkInterface {
19270
19842
  signal: AbortSignal;
19271
19843
  }): /*throws*/ Promise<ListFiatRatesResponse>;
19272
19844
  /**
19273
- * Lists payments from the storage with pagination
19274
- *
19275
- * This method provides direct access to the payment history stored in the database.
19276
- * It returns payments in reverse chronological order (newest first).
19277
- *
19278
- * # Arguments
19279
- *
19280
- * * `request` - Contains pagination parameters (offset and limit)
19281
- *
19282
- * # Returns
19283
- *
19284
- * * `Ok(ListPaymentsResponse)` - Contains the list of payments if successful
19285
- * * `Err(SdkError)` - If there was an error accessing the storage
19286
-
19287
- */
19845
+ * Lists payments from the storage with pagination
19846
+ *
19847
+ * This method provides direct access to the payment history stored in the database.
19848
+ * It returns payments in reverse chronological order (newest first).
19849
+ *
19850
+ * # Arguments
19851
+ *
19852
+ * * `request` - Contains pagination parameters (offset and limit)
19853
+ *
19854
+ * # Returns
19855
+ *
19856
+ * * `Ok(ListPaymentsResponse)` - Contains the list of payments if successful
19857
+ * * `Err(SdkError)` - If there was an error accessing the storage
19858
+ */
19288
19859
  listPayments(
19289
19860
  request: ListPaymentsRequest,
19290
19861
  asyncOpts_?: { signal: AbortSignal }
@@ -19299,48 +19870,6 @@ export interface BreezSdkInterface {
19299
19870
  * This method implements the LNURL-auth protocol as specified in LUD-04 and LUD-05.
19300
19871
  * It derives a domain-specific linking key, signs the challenge, and sends the
19301
19872
  * authentication request to the service.
19302
- *
19303
- * # Arguments
19304
- *
19305
- * * `request_data` - The parsed LNURL-auth request details obtained from [`parse`]
19306
- *
19307
- * # Returns
19308
- *
19309
- * * `Ok(LnurlCallbackStatus::Ok)` - Authentication was successful
19310
- * * `Ok(LnurlCallbackStatus::ErrorStatus{reason})` - Service returned an error
19311
- * * `Err(SdkError)` - An error occurred during the authentication process
19312
- *
19313
- * # Example
19314
- *
19315
- * ```rust,no_run
19316
- * # use breez_sdk_spark::{BreezSdk, InputType};
19317
- * # async fn example(sdk: BreezSdk) -> Result<(), Box<dyn std::error::Error>> {
19318
- * // 1. Parse the LNURL-auth string
19319
- * let input = sdk.parse("lnurl1...").await?;
19320
- * let auth_request = match input {
19321
- * InputType::LnurlAuth(data) => data,
19322
- * _ => return Err("Not an auth request".into()),
19323
- * };
19324
- *
19325
- * // 2. Show user the domain and get confirmation
19326
- * println!("Authenticate with {}?", auth_request.domain);
19327
- *
19328
- * // 3. Perform authentication
19329
- * let status = sdk.lnurl_auth(auth_request).await?;
19330
- * match status {
19331
- * breez_sdk_spark::LnurlCallbackStatus::Ok => println!("Success!"),
19332
- * breez_sdk_spark::LnurlCallbackStatus::ErrorStatus { error_details } => {
19333
- * println!("Error: {}", error_details.reason)
19334
- * }
19335
- * }
19336
- * # Ok(())
19337
- * # }
19338
- * ```
19339
- *
19340
- * # See Also
19341
- *
19342
- * * LUD-04: <https://github.com/lnurl/luds/blob/luds/04.md>
19343
- * * LUD-05: <https://github.com/lnurl/luds/blob/luds/05.md>
19344
19873
  */
19345
19874
  lnurlAuth(
19346
19875
  requestData: LnurlAuthRequestDetails,
@@ -19529,6 +20058,60 @@ export class BreezSdk
19529
20058
  }
19530
20059
  }
19531
20060
 
20061
+ /**
20062
+ * Initiates a Bitcoin purchase flow via an external provider (`MoonPay`).
20063
+ *
20064
+ * This method generates a URL that the user can open in a browser to complete
20065
+ * the Bitcoin purchase. The purchased Bitcoin will be sent to an automatically
20066
+ * generated deposit address.
20067
+ *
20068
+ * # Arguments
20069
+ *
20070
+ * * `request` - The purchase request containing optional amount and redirect URL
20071
+ *
20072
+ * # Returns
20073
+ *
20074
+ * A response containing the URL to open in a browser to complete the purchase
20075
+ */
20076
+ public async buyBitcoin(
20077
+ request: BuyBitcoinRequest,
20078
+ asyncOpts_?: { signal: AbortSignal }
20079
+ ): Promise<BuyBitcoinResponse> /*throws*/ {
20080
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
20081
+ try {
20082
+ return await uniffiRustCallAsync(
20083
+ /*rustCaller:*/ uniffiCaller,
20084
+ /*rustFutureFunc:*/ () => {
20085
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_buy_bitcoin(
20086
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this),
20087
+ FfiConverterTypeBuyBitcoinRequest.lower(request)
20088
+ );
20089
+ },
20090
+ /*pollFunc:*/ nativeModule()
20091
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
20092
+ /*cancelFunc:*/ nativeModule()
20093
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
20094
+ /*completeFunc:*/ nativeModule()
20095
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
20096
+ /*freeFunc:*/ nativeModule()
20097
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
20098
+ /*liftFunc:*/ FfiConverterTypeBuyBitcoinResponse.lift.bind(
20099
+ FfiConverterTypeBuyBitcoinResponse
20100
+ ),
20101
+ /*liftString:*/ FfiConverterString.lift,
20102
+ /*asyncOpts:*/ asyncOpts_,
20103
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
20104
+ FfiConverterTypeSdkError
20105
+ )
20106
+ );
20107
+ } catch (__error: any) {
20108
+ if (uniffiIsDebug && __error instanceof Error) {
20109
+ __error.stack = __stack;
20110
+ }
20111
+ throw __error;
20112
+ }
20113
+ }
20114
+
19532
20115
  /**
19533
20116
  * Cancels the ongoing leaf optimization.
19534
20117
  *
@@ -20175,21 +20758,20 @@ export class BreezSdk
20175
20758
  }
20176
20759
 
20177
20760
  /**
20178
- * Lists payments from the storage with pagination
20179
- *
20180
- * This method provides direct access to the payment history stored in the database.
20181
- * It returns payments in reverse chronological order (newest first).
20182
- *
20183
- * # Arguments
20184
- *
20185
- * * `request` - Contains pagination parameters (offset and limit)
20186
- *
20187
- * # Returns
20188
- *
20189
- * * `Ok(ListPaymentsResponse)` - Contains the list of payments if successful
20190
- * * `Err(SdkError)` - If there was an error accessing the storage
20191
-
20192
- */
20761
+ * Lists payments from the storage with pagination
20762
+ *
20763
+ * This method provides direct access to the payment history stored in the database.
20764
+ * It returns payments in reverse chronological order (newest first).
20765
+ *
20766
+ * # Arguments
20767
+ *
20768
+ * * `request` - Contains pagination parameters (offset and limit)
20769
+ *
20770
+ * # Returns
20771
+ *
20772
+ * * `Ok(ListPaymentsResponse)` - Contains the list of payments if successful
20773
+ * * `Err(SdkError)` - If there was an error accessing the storage
20774
+ */
20193
20775
  public async listPayments(
20194
20776
  request: ListPaymentsRequest,
20195
20777
  asyncOpts_?: { signal: AbortSignal }
@@ -20274,48 +20856,6 @@ export class BreezSdk
20274
20856
  * This method implements the LNURL-auth protocol as specified in LUD-04 and LUD-05.
20275
20857
  * It derives a domain-specific linking key, signs the challenge, and sends the
20276
20858
  * authentication request to the service.
20277
- *
20278
- * # Arguments
20279
- *
20280
- * * `request_data` - The parsed LNURL-auth request details obtained from [`parse`]
20281
- *
20282
- * # Returns
20283
- *
20284
- * * `Ok(LnurlCallbackStatus::Ok)` - Authentication was successful
20285
- * * `Ok(LnurlCallbackStatus::ErrorStatus{reason})` - Service returned an error
20286
- * * `Err(SdkError)` - An error occurred during the authentication process
20287
- *
20288
- * # Example
20289
- *
20290
- * ```rust,no_run
20291
- * # use breez_sdk_spark::{BreezSdk, InputType};
20292
- * # async fn example(sdk: BreezSdk) -> Result<(), Box<dyn std::error::Error>> {
20293
- * // 1. Parse the LNURL-auth string
20294
- * let input = sdk.parse("lnurl1...").await?;
20295
- * let auth_request = match input {
20296
- * InputType::LnurlAuth(data) => data,
20297
- * _ => return Err("Not an auth request".into()),
20298
- * };
20299
- *
20300
- * // 2. Show user the domain and get confirmation
20301
- * println!("Authenticate with {}?", auth_request.domain);
20302
- *
20303
- * // 3. Perform authentication
20304
- * let status = sdk.lnurl_auth(auth_request).await?;
20305
- * match status {
20306
- * breez_sdk_spark::LnurlCallbackStatus::Ok => println!("Success!"),
20307
- * breez_sdk_spark::LnurlCallbackStatus::ErrorStatus { error_details } => {
20308
- * println!("Error: {}", error_details.reason)
20309
- * }
20310
- * }
20311
- * # Ok(())
20312
- * # }
20313
- * ```
20314
- *
20315
- * # See Also
20316
- *
20317
- * * LUD-04: <https://github.com/lnurl/luds/blob/luds/04.md>
20318
- * * LUD-05: <https://github.com/lnurl/luds/blob/luds/05.md>
20319
20859
  */
20320
20860
  public async lnurlAuth(
20321
20861
  requestData: LnurlAuthRequestDetails,
@@ -21277,6 +21817,8 @@ export interface ExternalSigner {
21277
21817
  /**
21278
21818
  * Subtracts one secret from another.
21279
21819
  *
21820
+ * This is a lower-level primitive used as part of key tweaking operations.
21821
+ *
21280
21822
  * # Arguments
21281
21823
  * * `signing_key` - The first secret
21282
21824
  * * `new_signing_key` - The second secret to subtract
@@ -22089,6 +22631,8 @@ export class ExternalSignerImpl
22089
22631
  /**
22090
22632
  * Subtracts one secret from another.
22091
22633
  *
22634
+ * This is a lower-level primitive used as part of key tweaking operations.
22635
+ *
22092
22636
  * # Arguments
22093
22637
  * * `signing_key` - The first secret
22094
22638
  * * `new_signing_key` - The second secret to subtract
@@ -24476,15 +25020,6 @@ export interface SdkBuilderInterface {
24476
25020
  paymentObserver: PaymentObserver,
24477
25021
  asyncOpts_?: { signal: AbortSignal }
24478
25022
  ): Promise<void>;
24479
- /**
24480
- * Sets the real-time sync storage implementation to be used by the SDK.
24481
- * Arguments:
24482
- * - `storage`: The sync storage implementation to be used.
24483
- */
24484
- withRealTimeSyncStorage(
24485
- storage: SyncStorage,
24486
- asyncOpts_?: { signal: AbortSignal }
24487
- ): Promise<void>;
24488
25023
  /**
24489
25024
  * Sets the REST chain service to be used by the SDK.
24490
25025
  * Arguments:
@@ -24813,45 +25348,6 @@ export class SdkBuilder
24813
25348
  }
24814
25349
  }
24815
25350
 
24816
- /**
24817
- * Sets the real-time sync storage implementation to be used by the SDK.
24818
- * Arguments:
24819
- * - `storage`: The sync storage implementation to be used.
24820
- */
24821
- public async withRealTimeSyncStorage(
24822
- storage: SyncStorage,
24823
- asyncOpts_?: { signal: AbortSignal }
24824
- ): Promise<void> {
24825
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
24826
- try {
24827
- return await uniffiRustCallAsync(
24828
- /*rustCaller:*/ uniffiCaller,
24829
- /*rustFutureFunc:*/ () => {
24830
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_real_time_sync_storage(
24831
- uniffiTypeSdkBuilderObjectFactory.clonePointer(this),
24832
- FfiConverterTypeSyncStorage.lower(storage)
24833
- );
24834
- },
24835
- /*pollFunc:*/ nativeModule()
24836
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
24837
- /*cancelFunc:*/ nativeModule()
24838
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
24839
- /*completeFunc:*/ nativeModule()
24840
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
24841
- /*freeFunc:*/ nativeModule()
24842
- .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
24843
- /*liftFunc:*/ (_v) => {},
24844
- /*liftString:*/ FfiConverterString.lift,
24845
- /*asyncOpts:*/ asyncOpts_
24846
- );
24847
- } catch (__error: any) {
24848
- if (uniffiIsDebug && __error instanceof Error) {
24849
- __error.stack = __stack;
24850
- }
24851
- throw __error;
24852
- }
24853
- }
24854
-
24855
25351
  /**
24856
25352
  * Sets the REST chain service to be used by the SDK.
24857
25353
  * Arguments:
@@ -25079,7 +25575,7 @@ export interface Storage {
25079
25575
  *
25080
25576
  * Success or a `StorageError`
25081
25577
  */
25082
- setPaymentMetadata(
25578
+ insertPaymentMetadata(
25083
25579
  paymentId: string,
25084
25580
  metadata: PaymentMetadata,
25085
25581
  asyncOpts_?: { signal: AbortSignal }
@@ -25111,6 +25607,22 @@ export interface Storage {
25111
25607
  invoice: string,
25112
25608
  asyncOpts_?: { signal: AbortSignal }
25113
25609
  ): /*throws*/ Promise<Payment | undefined>;
25610
+ /**
25611
+ * Gets payments that have any of the specified parent payment IDs.
25612
+ * Used to load related payments for a set of parent payments.
25613
+ *
25614
+ * # Arguments
25615
+ *
25616
+ * * `parent_payment_ids` - The IDs of the parent payments
25617
+ *
25618
+ * # Returns
25619
+ *
25620
+ * A map of `parent_payment_id` -> Vec<Payment> or a `StorageError`
25621
+ */
25622
+ getPaymentsByParentIds(
25623
+ parentPaymentIds: Array<string>,
25624
+ asyncOpts_?: { signal: AbortSignal }
25625
+ ): /*throws*/ Promise<Map<string, Array<Payment>>>;
25114
25626
  /**
25115
25627
  * Add a deposit to storage
25116
25628
  * # Arguments
@@ -25176,6 +25688,64 @@ export interface Storage {
25176
25688
  metadata: Array<SetLnurlMetadataItem>,
25177
25689
  asyncOpts_?: { signal: AbortSignal }
25178
25690
  ): /*throws*/ Promise<void>;
25691
+ addOutgoingChange(
25692
+ record: UnversionedRecordChange,
25693
+ asyncOpts_?: { signal: AbortSignal }
25694
+ ): /*throws*/ Promise</*u64*/ bigint>;
25695
+ completeOutgoingSync(
25696
+ record: Record,
25697
+ localRevision: /*u64*/ bigint,
25698
+ asyncOpts_?: { signal: AbortSignal }
25699
+ ): /*throws*/ Promise<void>;
25700
+ getPendingOutgoingChanges(
25701
+ limit: /*u32*/ number,
25702
+ asyncOpts_?: { signal: AbortSignal }
25703
+ ): /*throws*/ Promise<Array<OutgoingChange>>;
25704
+ /**
25705
+ * Get the last committed sync revision.
25706
+ *
25707
+ * The `sync_revision` table tracks the highest revision that has been committed
25708
+ * (i.e. acknowledged by the server or received from it). It does NOT include
25709
+ * pending outgoing queue ids. This value is used by the sync protocol to
25710
+ * request changes from the server.
25711
+ */
25712
+ getLastRevision(asyncOpts_?: {
25713
+ signal: AbortSignal;
25714
+ }): /*throws*/ Promise</*u64*/ bigint>;
25715
+ /**
25716
+ * Insert incoming records from remote sync
25717
+ */
25718
+ insertIncomingRecords(
25719
+ records: Array<Record>,
25720
+ asyncOpts_?: { signal: AbortSignal }
25721
+ ): /*throws*/ Promise<void>;
25722
+ /**
25723
+ * Delete an incoming record after it has been processed
25724
+ */
25725
+ deleteIncomingRecord(
25726
+ record: Record,
25727
+ asyncOpts_?: { signal: AbortSignal }
25728
+ ): /*throws*/ Promise<void>;
25729
+ /**
25730
+ * Get incoming records that need to be processed, up to the specified limit
25731
+ */
25732
+ getIncomingRecords(
25733
+ limit: /*u32*/ number,
25734
+ asyncOpts_?: { signal: AbortSignal }
25735
+ ): /*throws*/ Promise<Array<IncomingChange>>;
25736
+ /**
25737
+ * Get the latest outgoing record if any exists
25738
+ */
25739
+ getLatestOutgoingChange(asyncOpts_?: {
25740
+ signal: AbortSignal;
25741
+ }): /*throws*/ Promise<OutgoingChange | undefined>;
25742
+ /**
25743
+ * Update the sync state record from an incoming record
25744
+ */
25745
+ updateRecordFromIncoming(
25746
+ record: Record,
25747
+ asyncOpts_?: { signal: AbortSignal }
25748
+ ): /*throws*/ Promise<void>;
25179
25749
  }
25180
25750
 
25181
25751
  /**
@@ -25418,7 +25988,7 @@ export class StorageImpl extends UniffiAbstractObject implements Storage {
25418
25988
  *
25419
25989
  * Success or a `StorageError`
25420
25990
  */
25421
- public async setPaymentMetadata(
25991
+ public async insertPaymentMetadata(
25422
25992
  paymentId: string,
25423
25993
  metadata: PaymentMetadata,
25424
25994
  asyncOpts_?: { signal: AbortSignal }
@@ -25428,7 +25998,7 @@ export class StorageImpl extends UniffiAbstractObject implements Storage {
25428
25998
  return await uniffiRustCallAsync(
25429
25999
  /*rustCaller:*/ uniffiCaller,
25430
26000
  /*rustFutureFunc:*/ () => {
25431
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_set_payment_metadata(
26001
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_insert_payment_metadata(
25432
26002
  uniffiTypeStorageImplObjectFactory.clonePointer(this),
25433
26003
  FfiConverterString.lower(paymentId),
25434
26004
  FfiConverterTypePaymentMetadata.lower(metadata)
@@ -25554,6 +26124,57 @@ export class StorageImpl extends UniffiAbstractObject implements Storage {
25554
26124
  }
25555
26125
  }
25556
26126
 
26127
+ /**
26128
+ * Gets payments that have any of the specified parent payment IDs.
26129
+ * Used to load related payments for a set of parent payments.
26130
+ *
26131
+ * # Arguments
26132
+ *
26133
+ * * `parent_payment_ids` - The IDs of the parent payments
26134
+ *
26135
+ * # Returns
26136
+ *
26137
+ * A map of `parent_payment_id` -> Vec<Payment> or a `StorageError`
26138
+ */
26139
+ public async getPaymentsByParentIds(
26140
+ parentPaymentIds: Array<string>,
26141
+ asyncOpts_?: { signal: AbortSignal }
26142
+ ): Promise<Map<string, Array<Payment>>> /*throws*/ {
26143
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
26144
+ try {
26145
+ return await uniffiRustCallAsync(
26146
+ /*rustCaller:*/ uniffiCaller,
26147
+ /*rustFutureFunc:*/ () => {
26148
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_get_payments_by_parent_ids(
26149
+ uniffiTypeStorageImplObjectFactory.clonePointer(this),
26150
+ FfiConverterArrayString.lower(parentPaymentIds)
26151
+ );
26152
+ },
26153
+ /*pollFunc:*/ nativeModule()
26154
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
26155
+ /*cancelFunc:*/ nativeModule()
26156
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
26157
+ /*completeFunc:*/ nativeModule()
26158
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
26159
+ /*freeFunc:*/ nativeModule()
26160
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
26161
+ /*liftFunc:*/ FfiConverterMapStringArrayTypePayment.lift.bind(
26162
+ FfiConverterMapStringArrayTypePayment
26163
+ ),
26164
+ /*liftString:*/ FfiConverterString.lift,
26165
+ /*asyncOpts:*/ asyncOpts_,
26166
+ /*errorHandler:*/ FfiConverterTypeStorageError.lift.bind(
26167
+ FfiConverterTypeStorageError
26168
+ )
26169
+ );
26170
+ } catch (__error: any) {
26171
+ if (uniffiIsDebug && __error instanceof Error) {
26172
+ __error.stack = __stack;
26173
+ }
26174
+ throw __error;
26175
+ }
26176
+ }
26177
+
25557
26178
  /**
25558
26179
  * Add a deposit to storage
25559
26180
  * # Arguments
@@ -25790,378 +26411,475 @@ export class StorageImpl extends UniffiAbstractObject implements Storage {
25790
26411
  }
25791
26412
  }
25792
26413
 
25793
- /**
25794
- * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
25795
- */
25796
- uniffiDestroy(): void {
25797
- const ptr = (this as any)[destructorGuardSymbol];
25798
- if (ptr !== undefined) {
25799
- const pointer = uniffiTypeStorageImplObjectFactory.pointer(this);
25800
- uniffiTypeStorageImplObjectFactory.freePointer(pointer);
25801
- uniffiTypeStorageImplObjectFactory.unbless(ptr);
25802
- delete (this as any)[destructorGuardSymbol];
26414
+ public async addOutgoingChange(
26415
+ record: UnversionedRecordChange,
26416
+ asyncOpts_?: { signal: AbortSignal }
26417
+ ): Promise</*u64*/ bigint> /*throws*/ {
26418
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
26419
+ try {
26420
+ return await uniffiRustCallAsync(
26421
+ /*rustCaller:*/ uniffiCaller,
26422
+ /*rustFutureFunc:*/ () => {
26423
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_add_outgoing_change(
26424
+ uniffiTypeStorageImplObjectFactory.clonePointer(this),
26425
+ FfiConverterTypeUnversionedRecordChange.lower(record)
26426
+ );
26427
+ },
26428
+ /*pollFunc:*/ nativeModule()
26429
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_u64,
26430
+ /*cancelFunc:*/ nativeModule()
26431
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_u64,
26432
+ /*completeFunc:*/ nativeModule()
26433
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_u64,
26434
+ /*freeFunc:*/ nativeModule()
26435
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_u64,
26436
+ /*liftFunc:*/ FfiConverterUInt64.lift.bind(FfiConverterUInt64),
26437
+ /*liftString:*/ FfiConverterString.lift,
26438
+ /*asyncOpts:*/ asyncOpts_,
26439
+ /*errorHandler:*/ FfiConverterTypeStorageError.lift.bind(
26440
+ FfiConverterTypeStorageError
26441
+ )
26442
+ );
26443
+ } catch (__error: any) {
26444
+ if (uniffiIsDebug && __error instanceof Error) {
26445
+ __error.stack = __stack;
26446
+ }
26447
+ throw __error;
25803
26448
  }
25804
26449
  }
25805
26450
 
25806
- static instanceOf(obj: any): obj is StorageImpl {
25807
- return uniffiTypeStorageImplObjectFactory.isConcreteType(obj);
25808
- }
25809
- }
25810
-
25811
- const uniffiTypeStorageImplObjectFactory: UniffiObjectFactory<Storage> = {
25812
- create(pointer: UnsafeMutableRawPointer): Storage {
25813
- const instance = Object.create(StorageImpl.prototype);
25814
- instance[pointerLiteralSymbol] = pointer;
25815
- instance[destructorGuardSymbol] = this.bless(pointer);
25816
- instance[uniffiTypeNameSymbol] = 'StorageImpl';
25817
- return instance;
25818
- },
25819
-
25820
- bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr {
25821
- return uniffiCaller.rustCall(
25822
- /*caller:*/ (status) =>
25823
- nativeModule().ubrn_uniffi_internal_fn_method_storage_ffi__bless_pointer(
25824
- p,
25825
- status
25826
- ),
25827
- /*liftString:*/ FfiConverterString.lift
25828
- );
25829
- },
25830
-
25831
- unbless(ptr: UniffiRustArcPtr) {
25832
- ptr.markDestroyed();
25833
- },
25834
-
25835
- pointer(obj: Storage): UnsafeMutableRawPointer {
25836
- if ((obj as any)[destructorGuardSymbol] === undefined) {
25837
- throw new UniffiInternalError.UnexpectedNullPointer();
26451
+ public async completeOutgoingSync(
26452
+ record: Record,
26453
+ localRevision: /*u64*/ bigint,
26454
+ asyncOpts_?: { signal: AbortSignal }
26455
+ ): Promise<void> /*throws*/ {
26456
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
26457
+ try {
26458
+ return await uniffiRustCallAsync(
26459
+ /*rustCaller:*/ uniffiCaller,
26460
+ /*rustFutureFunc:*/ () => {
26461
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_complete_outgoing_sync(
26462
+ uniffiTypeStorageImplObjectFactory.clonePointer(this),
26463
+ FfiConverterTypeRecord.lower(record),
26464
+ FfiConverterUInt64.lower(localRevision)
26465
+ );
26466
+ },
26467
+ /*pollFunc:*/ nativeModule()
26468
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
26469
+ /*cancelFunc:*/ nativeModule()
26470
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
26471
+ /*completeFunc:*/ nativeModule()
26472
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
26473
+ /*freeFunc:*/ nativeModule()
26474
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
26475
+ /*liftFunc:*/ (_v) => {},
26476
+ /*liftString:*/ FfiConverterString.lift,
26477
+ /*asyncOpts:*/ asyncOpts_,
26478
+ /*errorHandler:*/ FfiConverterTypeStorageError.lift.bind(
26479
+ FfiConverterTypeStorageError
26480
+ )
26481
+ );
26482
+ } catch (__error: any) {
26483
+ if (uniffiIsDebug && __error instanceof Error) {
26484
+ __error.stack = __stack;
26485
+ }
26486
+ throw __error;
25838
26487
  }
25839
- return (obj as any)[pointerLiteralSymbol];
25840
- },
25841
-
25842
- clonePointer(obj: Storage): UnsafeMutableRawPointer {
25843
- const pointer = this.pointer(obj);
25844
- return uniffiCaller.rustCall(
25845
- /*caller:*/ (callStatus) =>
25846
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_clone_storage(
25847
- pointer,
25848
- callStatus
25849
- ),
25850
- /*liftString:*/ FfiConverterString.lift
25851
- );
25852
- },
26488
+ }
25853
26489
 
25854
- freePointer(pointer: UnsafeMutableRawPointer): void {
25855
- uniffiCaller.rustCall(
25856
- /*caller:*/ (callStatus) =>
25857
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_free_storage(
25858
- pointer,
25859
- callStatus
26490
+ public async getPendingOutgoingChanges(
26491
+ limit: /*u32*/ number,
26492
+ asyncOpts_?: { signal: AbortSignal }
26493
+ ): Promise<Array<OutgoingChange>> /*throws*/ {
26494
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
26495
+ try {
26496
+ return await uniffiRustCallAsync(
26497
+ /*rustCaller:*/ uniffiCaller,
26498
+ /*rustFutureFunc:*/ () => {
26499
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_get_pending_outgoing_changes(
26500
+ uniffiTypeStorageImplObjectFactory.clonePointer(this),
26501
+ FfiConverterUInt32.lower(limit)
26502
+ );
26503
+ },
26504
+ /*pollFunc:*/ nativeModule()
26505
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
26506
+ /*cancelFunc:*/ nativeModule()
26507
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
26508
+ /*completeFunc:*/ nativeModule()
26509
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
26510
+ /*freeFunc:*/ nativeModule()
26511
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
26512
+ /*liftFunc:*/ FfiConverterArrayTypeOutgoingChange.lift.bind(
26513
+ FfiConverterArrayTypeOutgoingChange
25860
26514
  ),
25861
- /*liftString:*/ FfiConverterString.lift
25862
- );
25863
- },
25864
-
25865
- isConcreteType(obj: any): obj is Storage {
25866
- return (
25867
- obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'StorageImpl'
25868
- );
25869
- },
25870
- };
25871
- // FfiConverter for Storage
25872
- const FfiConverterTypeStorage = new FfiConverterObjectWithCallbacks(
25873
- uniffiTypeStorageImplObjectFactory
25874
- );
25875
-
25876
- // Add a vtavble for the callbacks that go in Storage.
25877
-
25878
- // Put the implementation in a struct so we don't pollute the top-level namespace
25879
- const uniffiCallbackInterfaceStorage: {
25880
- vtable: UniffiVTableCallbackInterfaceStorage;
25881
- register: () => void;
25882
- } = {
25883
- // Create the VTable using a series of closures.
25884
- // ts automatically converts these into C callback functions.
25885
- vtable: {
25886
- deleteCachedItem: (
25887
- uniffiHandle: bigint,
25888
- key: Uint8Array,
25889
- uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
25890
- uniffiCallbackData: bigint
25891
- ) => {
25892
- const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
25893
- const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
25894
- return await jsCallback.deleteCachedItem(FfiConverterString.lift(key), {
25895
- signal,
25896
- });
25897
- };
25898
- const uniffiHandleSuccess = (returnValue: void) => {
25899
- uniffiFutureCallback(
25900
- uniffiCallbackData,
25901
- /* UniffiForeignFutureStructVoid */ {
25902
- callStatus: uniffiCaller.createCallStatus(),
25903
- }
25904
- );
25905
- };
25906
- const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
25907
- uniffiFutureCallback(
25908
- uniffiCallbackData,
25909
- /* UniffiForeignFutureStructVoid */ {
25910
- // TODO create callstatus with error.
25911
- callStatus: { code, errorBuf },
25912
- }
25913
- );
25914
- };
25915
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
25916
- /*makeCall:*/ uniffiMakeCall,
25917
- /*handleSuccess:*/ uniffiHandleSuccess,
25918
- /*handleError:*/ uniffiHandleError,
25919
- /*isErrorType:*/ StorageError.instanceOf,
25920
- /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
26515
+ /*liftString:*/ FfiConverterString.lift,
26516
+ /*asyncOpts:*/ asyncOpts_,
26517
+ /*errorHandler:*/ FfiConverterTypeStorageError.lift.bind(
25921
26518
  FfiConverterTypeStorageError
25922
- ),
25923
- /*lowerString:*/ FfiConverterString.lower
26519
+ )
25924
26520
  );
25925
- return UniffiResult.success(uniffiForeignFuture);
25926
- },
25927
- getCachedItem: (
25928
- uniffiHandle: bigint,
25929
- key: Uint8Array,
25930
- uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
25931
- uniffiCallbackData: bigint
25932
- ) => {
25933
- const uniffiMakeCall = async (
25934
- signal: AbortSignal
25935
- ): Promise<string | undefined> => {
25936
- const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
25937
- return await jsCallback.getCachedItem(FfiConverterString.lift(key), {
25938
- signal,
25939
- });
25940
- };
25941
- const uniffiHandleSuccess = (returnValue: string | undefined) => {
25942
- uniffiFutureCallback(
25943
- uniffiCallbackData,
25944
- /* UniffiForeignFutureStructRustBuffer */ {
25945
- returnValue: FfiConverterOptionalString.lower(returnValue),
25946
- callStatus: uniffiCaller.createCallStatus(),
25947
- }
25948
- );
25949
- };
25950
- const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
25951
- uniffiFutureCallback(
25952
- uniffiCallbackData,
25953
- /* UniffiForeignFutureStructRustBuffer */ {
25954
- returnValue: /*empty*/ new Uint8Array(0),
25955
- // TODO create callstatus with error.
25956
- callStatus: { code, errorBuf },
25957
- }
25958
- );
25959
- };
25960
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
25961
- /*makeCall:*/ uniffiMakeCall,
25962
- /*handleSuccess:*/ uniffiHandleSuccess,
25963
- /*handleError:*/ uniffiHandleError,
25964
- /*isErrorType:*/ StorageError.instanceOf,
25965
- /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
26521
+ } catch (__error: any) {
26522
+ if (uniffiIsDebug && __error instanceof Error) {
26523
+ __error.stack = __stack;
26524
+ }
26525
+ throw __error;
26526
+ }
26527
+ }
26528
+
26529
+ /**
26530
+ * Get the last committed sync revision.
26531
+ *
26532
+ * The `sync_revision` table tracks the highest revision that has been committed
26533
+ * (i.e. acknowledged by the server or received from it). It does NOT include
26534
+ * pending outgoing queue ids. This value is used by the sync protocol to
26535
+ * request changes from the server.
26536
+ */
26537
+ public async getLastRevision(asyncOpts_?: {
26538
+ signal: AbortSignal;
26539
+ }): Promise</*u64*/ bigint> /*throws*/ {
26540
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
26541
+ try {
26542
+ return await uniffiRustCallAsync(
26543
+ /*rustCaller:*/ uniffiCaller,
26544
+ /*rustFutureFunc:*/ () => {
26545
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_get_last_revision(
26546
+ uniffiTypeStorageImplObjectFactory.clonePointer(this)
26547
+ );
26548
+ },
26549
+ /*pollFunc:*/ nativeModule()
26550
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_u64,
26551
+ /*cancelFunc:*/ nativeModule()
26552
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_u64,
26553
+ /*completeFunc:*/ nativeModule()
26554
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_u64,
26555
+ /*freeFunc:*/ nativeModule()
26556
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_u64,
26557
+ /*liftFunc:*/ FfiConverterUInt64.lift.bind(FfiConverterUInt64),
26558
+ /*liftString:*/ FfiConverterString.lift,
26559
+ /*asyncOpts:*/ asyncOpts_,
26560
+ /*errorHandler:*/ FfiConverterTypeStorageError.lift.bind(
25966
26561
  FfiConverterTypeStorageError
25967
- ),
25968
- /*lowerString:*/ FfiConverterString.lower
26562
+ )
25969
26563
  );
25970
- return UniffiResult.success(uniffiForeignFuture);
25971
- },
25972
- setCachedItem: (
25973
- uniffiHandle: bigint,
25974
- key: Uint8Array,
25975
- value: Uint8Array,
25976
- uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
25977
- uniffiCallbackData: bigint
25978
- ) => {
25979
- const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
25980
- const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
25981
- return await jsCallback.setCachedItem(
25982
- FfiConverterString.lift(key),
25983
- FfiConverterString.lift(value),
25984
- { signal }
25985
- );
25986
- };
25987
- const uniffiHandleSuccess = (returnValue: void) => {
25988
- uniffiFutureCallback(
25989
- uniffiCallbackData,
25990
- /* UniffiForeignFutureStructVoid */ {
25991
- callStatus: uniffiCaller.createCallStatus(),
25992
- }
25993
- );
25994
- };
25995
- const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
25996
- uniffiFutureCallback(
25997
- uniffiCallbackData,
25998
- /* UniffiForeignFutureStructVoid */ {
25999
- // TODO create callstatus with error.
26000
- callStatus: { code, errorBuf },
26001
- }
26002
- );
26003
- };
26004
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
26005
- /*makeCall:*/ uniffiMakeCall,
26006
- /*handleSuccess:*/ uniffiHandleSuccess,
26007
- /*handleError:*/ uniffiHandleError,
26008
- /*isErrorType:*/ StorageError.instanceOf,
26009
- /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
26564
+ } catch (__error: any) {
26565
+ if (uniffiIsDebug && __error instanceof Error) {
26566
+ __error.stack = __stack;
26567
+ }
26568
+ throw __error;
26569
+ }
26570
+ }
26571
+
26572
+ /**
26573
+ * Insert incoming records from remote sync
26574
+ */
26575
+ public async insertIncomingRecords(
26576
+ records: Array<Record>,
26577
+ asyncOpts_?: { signal: AbortSignal }
26578
+ ): Promise<void> /*throws*/ {
26579
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
26580
+ try {
26581
+ return await uniffiRustCallAsync(
26582
+ /*rustCaller:*/ uniffiCaller,
26583
+ /*rustFutureFunc:*/ () => {
26584
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_insert_incoming_records(
26585
+ uniffiTypeStorageImplObjectFactory.clonePointer(this),
26586
+ FfiConverterArrayTypeRecord.lower(records)
26587
+ );
26588
+ },
26589
+ /*pollFunc:*/ nativeModule()
26590
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
26591
+ /*cancelFunc:*/ nativeModule()
26592
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
26593
+ /*completeFunc:*/ nativeModule()
26594
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
26595
+ /*freeFunc:*/ nativeModule()
26596
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
26597
+ /*liftFunc:*/ (_v) => {},
26598
+ /*liftString:*/ FfiConverterString.lift,
26599
+ /*asyncOpts:*/ asyncOpts_,
26600
+ /*errorHandler:*/ FfiConverterTypeStorageError.lift.bind(
26010
26601
  FfiConverterTypeStorageError
26011
- ),
26012
- /*lowerString:*/ FfiConverterString.lower
26602
+ )
26013
26603
  );
26014
- return UniffiResult.success(uniffiForeignFuture);
26015
- },
26016
- listPayments: (
26017
- uniffiHandle: bigint,
26018
- request: Uint8Array,
26019
- uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
26020
- uniffiCallbackData: bigint
26021
- ) => {
26022
- const uniffiMakeCall = async (
26023
- signal: AbortSignal
26024
- ): Promise<Array<Payment>> => {
26025
- const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
26026
- return await jsCallback.listPayments(
26027
- FfiConverterTypeListPaymentsRequest.lift(request),
26028
- { signal }
26029
- );
26030
- };
26031
- const uniffiHandleSuccess = (returnValue: Array<Payment>) => {
26032
- uniffiFutureCallback(
26033
- uniffiCallbackData,
26034
- /* UniffiForeignFutureStructRustBuffer */ {
26035
- returnValue: FfiConverterArrayTypePayment.lower(returnValue),
26036
- callStatus: uniffiCaller.createCallStatus(),
26037
- }
26038
- );
26039
- };
26040
- const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
26041
- uniffiFutureCallback(
26042
- uniffiCallbackData,
26043
- /* UniffiForeignFutureStructRustBuffer */ {
26044
- returnValue: /*empty*/ new Uint8Array(0),
26045
- // TODO create callstatus with error.
26046
- callStatus: { code, errorBuf },
26047
- }
26048
- );
26049
- };
26050
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
26051
- /*makeCall:*/ uniffiMakeCall,
26052
- /*handleSuccess:*/ uniffiHandleSuccess,
26053
- /*handleError:*/ uniffiHandleError,
26054
- /*isErrorType:*/ StorageError.instanceOf,
26055
- /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
26604
+ } catch (__error: any) {
26605
+ if (uniffiIsDebug && __error instanceof Error) {
26606
+ __error.stack = __stack;
26607
+ }
26608
+ throw __error;
26609
+ }
26610
+ }
26611
+
26612
+ /**
26613
+ * Delete an incoming record after it has been processed
26614
+ */
26615
+ public async deleteIncomingRecord(
26616
+ record: Record,
26617
+ asyncOpts_?: { signal: AbortSignal }
26618
+ ): Promise<void> /*throws*/ {
26619
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
26620
+ try {
26621
+ return await uniffiRustCallAsync(
26622
+ /*rustCaller:*/ uniffiCaller,
26623
+ /*rustFutureFunc:*/ () => {
26624
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_delete_incoming_record(
26625
+ uniffiTypeStorageImplObjectFactory.clonePointer(this),
26626
+ FfiConverterTypeRecord.lower(record)
26627
+ );
26628
+ },
26629
+ /*pollFunc:*/ nativeModule()
26630
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
26631
+ /*cancelFunc:*/ nativeModule()
26632
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
26633
+ /*completeFunc:*/ nativeModule()
26634
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
26635
+ /*freeFunc:*/ nativeModule()
26636
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
26637
+ /*liftFunc:*/ (_v) => {},
26638
+ /*liftString:*/ FfiConverterString.lift,
26639
+ /*asyncOpts:*/ asyncOpts_,
26640
+ /*errorHandler:*/ FfiConverterTypeStorageError.lift.bind(
26056
26641
  FfiConverterTypeStorageError
26057
- ),
26058
- /*lowerString:*/ FfiConverterString.lower
26642
+ )
26059
26643
  );
26060
- return UniffiResult.success(uniffiForeignFuture);
26061
- },
26062
- insertPayment: (
26063
- uniffiHandle: bigint,
26064
- payment: Uint8Array,
26065
- uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
26066
- uniffiCallbackData: bigint
26067
- ) => {
26068
- const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
26069
- const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
26070
- return await jsCallback.insertPayment(
26071
- FfiConverterTypePayment.lift(payment),
26072
- { signal }
26073
- );
26074
- };
26075
- const uniffiHandleSuccess = (returnValue: void) => {
26076
- uniffiFutureCallback(
26077
- uniffiCallbackData,
26078
- /* UniffiForeignFutureStructVoid */ {
26079
- callStatus: uniffiCaller.createCallStatus(),
26080
- }
26081
- );
26082
- };
26083
- const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
26084
- uniffiFutureCallback(
26085
- uniffiCallbackData,
26086
- /* UniffiForeignFutureStructVoid */ {
26087
- // TODO create callstatus with error.
26088
- callStatus: { code, errorBuf },
26089
- }
26090
- );
26091
- };
26092
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
26093
- /*makeCall:*/ uniffiMakeCall,
26094
- /*handleSuccess:*/ uniffiHandleSuccess,
26095
- /*handleError:*/ uniffiHandleError,
26096
- /*isErrorType:*/ StorageError.instanceOf,
26097
- /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
26098
- FfiConverterTypeStorageError
26644
+ } catch (__error: any) {
26645
+ if (uniffiIsDebug && __error instanceof Error) {
26646
+ __error.stack = __stack;
26647
+ }
26648
+ throw __error;
26649
+ }
26650
+ }
26651
+
26652
+ /**
26653
+ * Get incoming records that need to be processed, up to the specified limit
26654
+ */
26655
+ public async getIncomingRecords(
26656
+ limit: /*u32*/ number,
26657
+ asyncOpts_?: { signal: AbortSignal }
26658
+ ): Promise<Array<IncomingChange>> /*throws*/ {
26659
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
26660
+ try {
26661
+ return await uniffiRustCallAsync(
26662
+ /*rustCaller:*/ uniffiCaller,
26663
+ /*rustFutureFunc:*/ () => {
26664
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_get_incoming_records(
26665
+ uniffiTypeStorageImplObjectFactory.clonePointer(this),
26666
+ FfiConverterUInt32.lower(limit)
26667
+ );
26668
+ },
26669
+ /*pollFunc:*/ nativeModule()
26670
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
26671
+ /*cancelFunc:*/ nativeModule()
26672
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
26673
+ /*completeFunc:*/ nativeModule()
26674
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
26675
+ /*freeFunc:*/ nativeModule()
26676
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
26677
+ /*liftFunc:*/ FfiConverterArrayTypeIncomingChange.lift.bind(
26678
+ FfiConverterArrayTypeIncomingChange
26099
26679
  ),
26100
- /*lowerString:*/ FfiConverterString.lower
26680
+ /*liftString:*/ FfiConverterString.lift,
26681
+ /*asyncOpts:*/ asyncOpts_,
26682
+ /*errorHandler:*/ FfiConverterTypeStorageError.lift.bind(
26683
+ FfiConverterTypeStorageError
26684
+ )
26101
26685
  );
26102
- return UniffiResult.success(uniffiForeignFuture);
26103
- },
26104
- setPaymentMetadata: (
26105
- uniffiHandle: bigint,
26106
- paymentId: Uint8Array,
26107
- metadata: Uint8Array,
26108
- uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
26109
- uniffiCallbackData: bigint
26110
- ) => {
26111
- const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
26112
- const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
26113
- return await jsCallback.setPaymentMetadata(
26114
- FfiConverterString.lift(paymentId),
26115
- FfiConverterTypePaymentMetadata.lift(metadata),
26116
- { signal }
26117
- );
26118
- };
26119
- const uniffiHandleSuccess = (returnValue: void) => {
26120
- uniffiFutureCallback(
26121
- uniffiCallbackData,
26122
- /* UniffiForeignFutureStructVoid */ {
26123
- callStatus: uniffiCaller.createCallStatus(),
26124
- }
26125
- );
26126
- };
26127
- const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
26128
- uniffiFutureCallback(
26129
- uniffiCallbackData,
26130
- /* UniffiForeignFutureStructVoid */ {
26131
- // TODO create callstatus with error.
26132
- callStatus: { code, errorBuf },
26133
- }
26134
- );
26135
- };
26136
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
26137
- /*makeCall:*/ uniffiMakeCall,
26138
- /*handleSuccess:*/ uniffiHandleSuccess,
26139
- /*handleError:*/ uniffiHandleError,
26140
- /*isErrorType:*/ StorageError.instanceOf,
26141
- /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
26142
- FfiConverterTypeStorageError
26686
+ } catch (__error: any) {
26687
+ if (uniffiIsDebug && __error instanceof Error) {
26688
+ __error.stack = __stack;
26689
+ }
26690
+ throw __error;
26691
+ }
26692
+ }
26693
+
26694
+ /**
26695
+ * Get the latest outgoing record if any exists
26696
+ */
26697
+ public async getLatestOutgoingChange(asyncOpts_?: {
26698
+ signal: AbortSignal;
26699
+ }): Promise<OutgoingChange | undefined> /*throws*/ {
26700
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
26701
+ try {
26702
+ return await uniffiRustCallAsync(
26703
+ /*rustCaller:*/ uniffiCaller,
26704
+ /*rustFutureFunc:*/ () => {
26705
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_get_latest_outgoing_change(
26706
+ uniffiTypeStorageImplObjectFactory.clonePointer(this)
26707
+ );
26708
+ },
26709
+ /*pollFunc:*/ nativeModule()
26710
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
26711
+ /*cancelFunc:*/ nativeModule()
26712
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
26713
+ /*completeFunc:*/ nativeModule()
26714
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
26715
+ /*freeFunc:*/ nativeModule()
26716
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
26717
+ /*liftFunc:*/ FfiConverterOptionalTypeOutgoingChange.lift.bind(
26718
+ FfiConverterOptionalTypeOutgoingChange
26143
26719
  ),
26144
- /*lowerString:*/ FfiConverterString.lower
26720
+ /*liftString:*/ FfiConverterString.lift,
26721
+ /*asyncOpts:*/ asyncOpts_,
26722
+ /*errorHandler:*/ FfiConverterTypeStorageError.lift.bind(
26723
+ FfiConverterTypeStorageError
26724
+ )
26145
26725
  );
26146
- return UniffiResult.success(uniffiForeignFuture);
26147
- },
26148
- getPaymentById: (
26726
+ } catch (__error: any) {
26727
+ if (uniffiIsDebug && __error instanceof Error) {
26728
+ __error.stack = __stack;
26729
+ }
26730
+ throw __error;
26731
+ }
26732
+ }
26733
+
26734
+ /**
26735
+ * Update the sync state record from an incoming record
26736
+ */
26737
+ public async updateRecordFromIncoming(
26738
+ record: Record,
26739
+ asyncOpts_?: { signal: AbortSignal }
26740
+ ): Promise<void> /*throws*/ {
26741
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
26742
+ try {
26743
+ return await uniffiRustCallAsync(
26744
+ /*rustCaller:*/ uniffiCaller,
26745
+ /*rustFutureFunc:*/ () => {
26746
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_update_record_from_incoming(
26747
+ uniffiTypeStorageImplObjectFactory.clonePointer(this),
26748
+ FfiConverterTypeRecord.lower(record)
26749
+ );
26750
+ },
26751
+ /*pollFunc:*/ nativeModule()
26752
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
26753
+ /*cancelFunc:*/ nativeModule()
26754
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
26755
+ /*completeFunc:*/ nativeModule()
26756
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
26757
+ /*freeFunc:*/ nativeModule()
26758
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
26759
+ /*liftFunc:*/ (_v) => {},
26760
+ /*liftString:*/ FfiConverterString.lift,
26761
+ /*asyncOpts:*/ asyncOpts_,
26762
+ /*errorHandler:*/ FfiConverterTypeStorageError.lift.bind(
26763
+ FfiConverterTypeStorageError
26764
+ )
26765
+ );
26766
+ } catch (__error: any) {
26767
+ if (uniffiIsDebug && __error instanceof Error) {
26768
+ __error.stack = __stack;
26769
+ }
26770
+ throw __error;
26771
+ }
26772
+ }
26773
+
26774
+ /**
26775
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
26776
+ */
26777
+ uniffiDestroy(): void {
26778
+ const ptr = (this as any)[destructorGuardSymbol];
26779
+ if (ptr !== undefined) {
26780
+ const pointer = uniffiTypeStorageImplObjectFactory.pointer(this);
26781
+ uniffiTypeStorageImplObjectFactory.freePointer(pointer);
26782
+ uniffiTypeStorageImplObjectFactory.unbless(ptr);
26783
+ delete (this as any)[destructorGuardSymbol];
26784
+ }
26785
+ }
26786
+
26787
+ static instanceOf(obj: any): obj is StorageImpl {
26788
+ return uniffiTypeStorageImplObjectFactory.isConcreteType(obj);
26789
+ }
26790
+ }
26791
+
26792
+ const uniffiTypeStorageImplObjectFactory: UniffiObjectFactory<Storage> = {
26793
+ create(pointer: UnsafeMutableRawPointer): Storage {
26794
+ const instance = Object.create(StorageImpl.prototype);
26795
+ instance[pointerLiteralSymbol] = pointer;
26796
+ instance[destructorGuardSymbol] = this.bless(pointer);
26797
+ instance[uniffiTypeNameSymbol] = 'StorageImpl';
26798
+ return instance;
26799
+ },
26800
+
26801
+ bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr {
26802
+ return uniffiCaller.rustCall(
26803
+ /*caller:*/ (status) =>
26804
+ nativeModule().ubrn_uniffi_internal_fn_method_storage_ffi__bless_pointer(
26805
+ p,
26806
+ status
26807
+ ),
26808
+ /*liftString:*/ FfiConverterString.lift
26809
+ );
26810
+ },
26811
+
26812
+ unbless(ptr: UniffiRustArcPtr) {
26813
+ ptr.markDestroyed();
26814
+ },
26815
+
26816
+ pointer(obj: Storage): UnsafeMutableRawPointer {
26817
+ if ((obj as any)[destructorGuardSymbol] === undefined) {
26818
+ throw new UniffiInternalError.UnexpectedNullPointer();
26819
+ }
26820
+ return (obj as any)[pointerLiteralSymbol];
26821
+ },
26822
+
26823
+ clonePointer(obj: Storage): UnsafeMutableRawPointer {
26824
+ const pointer = this.pointer(obj);
26825
+ return uniffiCaller.rustCall(
26826
+ /*caller:*/ (callStatus) =>
26827
+ nativeModule().ubrn_uniffi_breez_sdk_spark_fn_clone_storage(
26828
+ pointer,
26829
+ callStatus
26830
+ ),
26831
+ /*liftString:*/ FfiConverterString.lift
26832
+ );
26833
+ },
26834
+
26835
+ freePointer(pointer: UnsafeMutableRawPointer): void {
26836
+ uniffiCaller.rustCall(
26837
+ /*caller:*/ (callStatus) =>
26838
+ nativeModule().ubrn_uniffi_breez_sdk_spark_fn_free_storage(
26839
+ pointer,
26840
+ callStatus
26841
+ ),
26842
+ /*liftString:*/ FfiConverterString.lift
26843
+ );
26844
+ },
26845
+
26846
+ isConcreteType(obj: any): obj is Storage {
26847
+ return (
26848
+ obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'StorageImpl'
26849
+ );
26850
+ },
26851
+ };
26852
+ // FfiConverter for Storage
26853
+ const FfiConverterTypeStorage = new FfiConverterObjectWithCallbacks(
26854
+ uniffiTypeStorageImplObjectFactory
26855
+ );
26856
+
26857
+ // Add a vtavble for the callbacks that go in Storage.
26858
+
26859
+ // Put the implementation in a struct so we don't pollute the top-level namespace
26860
+ const uniffiCallbackInterfaceStorage: {
26861
+ vtable: UniffiVTableCallbackInterfaceStorage;
26862
+ register: () => void;
26863
+ } = {
26864
+ // Create the VTable using a series of closures.
26865
+ // ts automatically converts these into C callback functions.
26866
+ vtable: {
26867
+ deleteCachedItem: (
26149
26868
  uniffiHandle: bigint,
26150
- id: Uint8Array,
26151
- uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
26869
+ key: Uint8Array,
26870
+ uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
26152
26871
  uniffiCallbackData: bigint
26153
26872
  ) => {
26154
- const uniffiMakeCall = async (signal: AbortSignal): Promise<Payment> => {
26873
+ const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
26155
26874
  const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
26156
- return await jsCallback.getPaymentById(FfiConverterString.lift(id), {
26875
+ return await jsCallback.deleteCachedItem(FfiConverterString.lift(key), {
26157
26876
  signal,
26158
26877
  });
26159
26878
  };
26160
- const uniffiHandleSuccess = (returnValue: Payment) => {
26879
+ const uniffiHandleSuccess = (returnValue: void) => {
26161
26880
  uniffiFutureCallback(
26162
26881
  uniffiCallbackData,
26163
- /* UniffiForeignFutureStructRustBuffer */ {
26164
- returnValue: FfiConverterTypePayment.lower(returnValue),
26882
+ /* UniffiForeignFutureStructVoid */ {
26165
26883
  callStatus: uniffiCaller.createCallStatus(),
26166
26884
  }
26167
26885
  );
@@ -26169,8 +26887,7 @@ const uniffiCallbackInterfaceStorage: {
26169
26887
  const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
26170
26888
  uniffiFutureCallback(
26171
26889
  uniffiCallbackData,
26172
- /* UniffiForeignFutureStructRustBuffer */ {
26173
- returnValue: /*empty*/ new Uint8Array(0),
26890
+ /* UniffiForeignFutureStructVoid */ {
26174
26891
  // TODO create callstatus with error.
26175
26892
  callStatus: { code, errorBuf },
26176
26893
  }
@@ -26188,26 +26905,25 @@ const uniffiCallbackInterfaceStorage: {
26188
26905
  );
26189
26906
  return UniffiResult.success(uniffiForeignFuture);
26190
26907
  },
26191
- getPaymentByInvoice: (
26908
+ getCachedItem: (
26192
26909
  uniffiHandle: bigint,
26193
- invoice: Uint8Array,
26910
+ key: Uint8Array,
26194
26911
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
26195
26912
  uniffiCallbackData: bigint
26196
26913
  ) => {
26197
26914
  const uniffiMakeCall = async (
26198
26915
  signal: AbortSignal
26199
- ): Promise<Payment | undefined> => {
26916
+ ): Promise<string | undefined> => {
26200
26917
  const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
26201
- return await jsCallback.getPaymentByInvoice(
26202
- FfiConverterString.lift(invoice),
26203
- { signal }
26204
- );
26918
+ return await jsCallback.getCachedItem(FfiConverterString.lift(key), {
26919
+ signal,
26920
+ });
26205
26921
  };
26206
- const uniffiHandleSuccess = (returnValue: Payment | undefined) => {
26922
+ const uniffiHandleSuccess = (returnValue: string | undefined) => {
26207
26923
  uniffiFutureCallback(
26208
26924
  uniffiCallbackData,
26209
26925
  /* UniffiForeignFutureStructRustBuffer */ {
26210
- returnValue: FfiConverterOptionalTypePayment.lower(returnValue),
26926
+ returnValue: FfiConverterOptionalString.lower(returnValue),
26211
26927
  callStatus: uniffiCaller.createCallStatus(),
26212
26928
  }
26213
26929
  );
@@ -26234,20 +26950,18 @@ const uniffiCallbackInterfaceStorage: {
26234
26950
  );
26235
26951
  return UniffiResult.success(uniffiForeignFuture);
26236
26952
  },
26237
- addDeposit: (
26953
+ setCachedItem: (
26238
26954
  uniffiHandle: bigint,
26239
- txid: Uint8Array,
26240
- vout: number,
26241
- amountSats: bigint,
26955
+ key: Uint8Array,
26956
+ value: Uint8Array,
26242
26957
  uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
26243
26958
  uniffiCallbackData: bigint
26244
26959
  ) => {
26245
26960
  const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
26246
26961
  const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
26247
- return await jsCallback.addDeposit(
26248
- FfiConverterString.lift(txid),
26249
- FfiConverterUInt32.lift(vout),
26250
- FfiConverterUInt64.lift(amountSats),
26962
+ return await jsCallback.setCachedItem(
26963
+ FfiConverterString.lift(key),
26964
+ FfiConverterString.lift(value),
26251
26965
  { signal }
26252
26966
  );
26253
26967
  };
@@ -26280,25 +26994,26 @@ const uniffiCallbackInterfaceStorage: {
26280
26994
  );
26281
26995
  return UniffiResult.success(uniffiForeignFuture);
26282
26996
  },
26283
- deleteDeposit: (
26997
+ listPayments: (
26284
26998
  uniffiHandle: bigint,
26285
- txid: Uint8Array,
26286
- vout: number,
26287
- uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
26999
+ request: Uint8Array,
27000
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
26288
27001
  uniffiCallbackData: bigint
26289
27002
  ) => {
26290
- const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
27003
+ const uniffiMakeCall = async (
27004
+ signal: AbortSignal
27005
+ ): Promise<Array<Payment>> => {
26291
27006
  const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
26292
- return await jsCallback.deleteDeposit(
26293
- FfiConverterString.lift(txid),
26294
- FfiConverterUInt32.lift(vout),
27007
+ return await jsCallback.listPayments(
27008
+ FfiConverterTypeListPaymentsRequest.lift(request),
26295
27009
  { signal }
26296
27010
  );
26297
27011
  };
26298
- const uniffiHandleSuccess = (returnValue: void) => {
27012
+ const uniffiHandleSuccess = (returnValue: Array<Payment>) => {
26299
27013
  uniffiFutureCallback(
26300
27014
  uniffiCallbackData,
26301
- /* UniffiForeignFutureStructVoid */ {
27015
+ /* UniffiForeignFutureStructRustBuffer */ {
27016
+ returnValue: FfiConverterArrayTypePayment.lower(returnValue),
26302
27017
  callStatus: uniffiCaller.createCallStatus(),
26303
27018
  }
26304
27019
  );
@@ -26306,8 +27021,9 @@ const uniffiCallbackInterfaceStorage: {
26306
27021
  const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
26307
27022
  uniffiFutureCallback(
26308
27023
  uniffiCallbackData,
26309
- /* UniffiForeignFutureStructVoid */ {
26310
- // TODO create callstatus with error.
27024
+ /* UniffiForeignFutureStructRustBuffer */ {
27025
+ returnValue: /*empty*/ new Uint8Array(0),
27026
+ // TODO create callstatus with error.
26311
27027
  callStatus: { code, errorBuf },
26312
27028
  }
26313
27029
  );
@@ -26324,22 +27040,23 @@ const uniffiCallbackInterfaceStorage: {
26324
27040
  );
26325
27041
  return UniffiResult.success(uniffiForeignFuture);
26326
27042
  },
26327
- listDeposits: (
27043
+ insertPayment: (
26328
27044
  uniffiHandle: bigint,
26329
- uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
27045
+ payment: Uint8Array,
27046
+ uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
26330
27047
  uniffiCallbackData: bigint
26331
27048
  ) => {
26332
- const uniffiMakeCall = async (
26333
- signal: AbortSignal
26334
- ): Promise<Array<DepositInfo>> => {
27049
+ const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
26335
27050
  const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
26336
- return await jsCallback.listDeposits({ signal });
27051
+ return await jsCallback.insertPayment(
27052
+ FfiConverterTypePayment.lift(payment),
27053
+ { signal }
27054
+ );
26337
27055
  };
26338
- const uniffiHandleSuccess = (returnValue: Array<DepositInfo>) => {
27056
+ const uniffiHandleSuccess = (returnValue: void) => {
26339
27057
  uniffiFutureCallback(
26340
27058
  uniffiCallbackData,
26341
- /* UniffiForeignFutureStructRustBuffer */ {
26342
- returnValue: FfiConverterArrayTypeDepositInfo.lower(returnValue),
27059
+ /* UniffiForeignFutureStructVoid */ {
26343
27060
  callStatus: uniffiCaller.createCallStatus(),
26344
27061
  }
26345
27062
  );
@@ -26347,8 +27064,7 @@ const uniffiCallbackInterfaceStorage: {
26347
27064
  const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
26348
27065
  uniffiFutureCallback(
26349
27066
  uniffiCallbackData,
26350
- /* UniffiForeignFutureStructRustBuffer */ {
26351
- returnValue: /*empty*/ new Uint8Array(0),
27067
+ /* UniffiForeignFutureStructVoid */ {
26352
27068
  // TODO create callstatus with error.
26353
27069
  callStatus: { code, errorBuf },
26354
27070
  }
@@ -26366,20 +27082,18 @@ const uniffiCallbackInterfaceStorage: {
26366
27082
  );
26367
27083
  return UniffiResult.success(uniffiForeignFuture);
26368
27084
  },
26369
- updateDeposit: (
27085
+ insertPaymentMetadata: (
26370
27086
  uniffiHandle: bigint,
26371
- txid: Uint8Array,
26372
- vout: number,
26373
- payload: Uint8Array,
27087
+ paymentId: Uint8Array,
27088
+ metadata: Uint8Array,
26374
27089
  uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
26375
27090
  uniffiCallbackData: bigint
26376
27091
  ) => {
26377
27092
  const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
26378
27093
  const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
26379
- return await jsCallback.updateDeposit(
26380
- FfiConverterString.lift(txid),
26381
- FfiConverterUInt32.lift(vout),
26382
- FfiConverterTypeUpdateDepositPayload.lift(payload),
27094
+ return await jsCallback.insertPaymentMetadata(
27095
+ FfiConverterString.lift(paymentId),
27096
+ FfiConverterTypePaymentMetadata.lift(metadata),
26383
27097
  { signal }
26384
27098
  );
26385
27099
  };
@@ -26412,23 +27126,23 @@ const uniffiCallbackInterfaceStorage: {
26412
27126
  );
26413
27127
  return UniffiResult.success(uniffiForeignFuture);
26414
27128
  },
26415
- setLnurlMetadata: (
27129
+ getPaymentById: (
26416
27130
  uniffiHandle: bigint,
26417
- metadata: Uint8Array,
26418
- uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
27131
+ id: Uint8Array,
27132
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
26419
27133
  uniffiCallbackData: bigint
26420
27134
  ) => {
26421
- const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
27135
+ const uniffiMakeCall = async (signal: AbortSignal): Promise<Payment> => {
26422
27136
  const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
26423
- return await jsCallback.setLnurlMetadata(
26424
- FfiConverterArrayTypeSetLnurlMetadataItem.lift(metadata),
26425
- { signal }
26426
- );
27137
+ return await jsCallback.getPaymentById(FfiConverterString.lift(id), {
27138
+ signal,
27139
+ });
26427
27140
  };
26428
- const uniffiHandleSuccess = (returnValue: void) => {
27141
+ const uniffiHandleSuccess = (returnValue: Payment) => {
26429
27142
  uniffiFutureCallback(
26430
27143
  uniffiCallbackData,
26431
- /* UniffiForeignFutureStructVoid */ {
27144
+ /* UniffiForeignFutureStructRustBuffer */ {
27145
+ returnValue: FfiConverterTypePayment.lower(returnValue),
26432
27146
  callStatus: uniffiCaller.createCallStatus(),
26433
27147
  }
26434
27148
  );
@@ -26436,7 +27150,8 @@ const uniffiCallbackInterfaceStorage: {
26436
27150
  const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
26437
27151
  uniffiFutureCallback(
26438
27152
  uniffiCallbackData,
26439
- /* UniffiForeignFutureStructVoid */ {
27153
+ /* UniffiForeignFutureStructRustBuffer */ {
27154
+ returnValue: /*empty*/ new Uint8Array(0),
26440
27155
  // TODO create callstatus with error.
26441
27156
  callStatus: { code, errorBuf },
26442
27157
  }
@@ -26454,583 +27169,321 @@ const uniffiCallbackInterfaceStorage: {
26454
27169
  );
26455
27170
  return UniffiResult.success(uniffiForeignFuture);
26456
27171
  },
26457
- uniffiFree: (uniffiHandle: UniffiHandle): void => {
26458
- // Storage: this will throw a stale handle error if the handle isn't found.
26459
- FfiConverterTypeStorage.drop(uniffiHandle);
26460
- },
26461
- },
26462
- register: () => {
26463
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_init_callback_vtable_storage(
26464
- uniffiCallbackInterfaceStorage.vtable
26465
- );
26466
- },
26467
- };
26468
-
26469
- export interface SyncStorage {
26470
- addOutgoingChange(
26471
- record: UnversionedRecordChange,
26472
- asyncOpts_?: { signal: AbortSignal }
26473
- ): /*throws*/ Promise</*u64*/ bigint>;
26474
- completeOutgoingSync(
26475
- record: Record,
26476
- asyncOpts_?: { signal: AbortSignal }
26477
- ): /*throws*/ Promise<void>;
26478
- getPendingOutgoingChanges(
26479
- limit: /*u32*/ number,
26480
- asyncOpts_?: { signal: AbortSignal }
26481
- ): /*throws*/ Promise<Array<OutgoingChange>>;
26482
- /**
26483
- * Get the revision number of the last synchronized record
26484
- */
26485
- getLastRevision(asyncOpts_?: {
26486
- signal: AbortSignal;
26487
- }): /*throws*/ Promise</*u64*/ bigint>;
26488
- /**
26489
- * Insert incoming records from remote sync
26490
- */
26491
- insertIncomingRecords(
26492
- records: Array<Record>,
26493
- asyncOpts_?: { signal: AbortSignal }
26494
- ): /*throws*/ Promise<void>;
26495
- /**
26496
- * Delete an incoming record after it has been processed
26497
- */
26498
- deleteIncomingRecord(
26499
- record: Record,
26500
- asyncOpts_?: { signal: AbortSignal }
26501
- ): /*throws*/ Promise<void>;
26502
- /**
26503
- * Update revision numbers of pending outgoing records to be higher than the given revision
26504
- */
26505
- rebasePendingOutgoingRecords(
26506
- revision: /*u64*/ bigint,
26507
- asyncOpts_?: { signal: AbortSignal }
26508
- ): /*throws*/ Promise<void>;
26509
- /**
26510
- * Get incoming records that need to be processed, up to the specified limit
26511
- */
26512
- getIncomingRecords(
26513
- limit: /*u32*/ number,
26514
- asyncOpts_?: { signal: AbortSignal }
26515
- ): /*throws*/ Promise<Array<IncomingChange>>;
26516
- /**
26517
- * Get the latest outgoing record if any exists
26518
- */
26519
- getLatestOutgoingChange(asyncOpts_?: {
26520
- signal: AbortSignal;
26521
- }): /*throws*/ Promise<OutgoingChange | undefined>;
26522
- /**
26523
- * Update the sync state record from an incoming record
26524
- */
26525
- updateRecordFromIncoming(
26526
- record: Record,
26527
- asyncOpts_?: { signal: AbortSignal }
26528
- ): /*throws*/ Promise<void>;
26529
- }
26530
-
26531
- export class SyncStorageImpl
26532
- extends UniffiAbstractObject
26533
- implements SyncStorage
26534
- {
26535
- readonly [uniffiTypeNameSymbol] = 'SyncStorageImpl';
26536
- readonly [destructorGuardSymbol]: UniffiRustArcPtr;
26537
- readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
26538
- // No primary constructor declared for this class.
26539
- private constructor(pointer: UnsafeMutableRawPointer) {
26540
- super();
26541
- this[pointerLiteralSymbol] = pointer;
26542
- this[destructorGuardSymbol] =
26543
- uniffiTypeSyncStorageImplObjectFactory.bless(pointer);
26544
- }
26545
-
26546
- public async addOutgoingChange(
26547
- record: UnversionedRecordChange,
26548
- asyncOpts_?: { signal: AbortSignal }
26549
- ): Promise</*u64*/ bigint> /*throws*/ {
26550
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
26551
- try {
26552
- return await uniffiRustCallAsync(
26553
- /*rustCaller:*/ uniffiCaller,
26554
- /*rustFutureFunc:*/ () => {
26555
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_syncstorage_add_outgoing_change(
26556
- uniffiTypeSyncStorageImplObjectFactory.clonePointer(this),
26557
- FfiConverterTypeUnversionedRecordChange.lower(record)
26558
- );
26559
- },
26560
- /*pollFunc:*/ nativeModule()
26561
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_u64,
26562
- /*cancelFunc:*/ nativeModule()
26563
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_u64,
26564
- /*completeFunc:*/ nativeModule()
26565
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_u64,
26566
- /*freeFunc:*/ nativeModule()
26567
- .ubrn_ffi_breez_sdk_spark_rust_future_free_u64,
26568
- /*liftFunc:*/ FfiConverterUInt64.lift.bind(FfiConverterUInt64),
26569
- /*liftString:*/ FfiConverterString.lift,
26570
- /*asyncOpts:*/ asyncOpts_,
26571
- /*errorHandler:*/ FfiConverterTypeSyncStorageError.lift.bind(
26572
- FfiConverterTypeSyncStorageError
26573
- )
26574
- );
26575
- } catch (__error: any) {
26576
- if (uniffiIsDebug && __error instanceof Error) {
26577
- __error.stack = __stack;
26578
- }
26579
- throw __error;
26580
- }
26581
- }
26582
-
26583
- public async completeOutgoingSync(
26584
- record: Record,
26585
- asyncOpts_?: { signal: AbortSignal }
26586
- ): Promise<void> /*throws*/ {
26587
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
26588
- try {
26589
- return await uniffiRustCallAsync(
26590
- /*rustCaller:*/ uniffiCaller,
26591
- /*rustFutureFunc:*/ () => {
26592
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_syncstorage_complete_outgoing_sync(
26593
- uniffiTypeSyncStorageImplObjectFactory.clonePointer(this),
26594
- FfiConverterTypeRecord.lower(record)
26595
- );
26596
- },
26597
- /*pollFunc:*/ nativeModule()
26598
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
26599
- /*cancelFunc:*/ nativeModule()
26600
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
26601
- /*completeFunc:*/ nativeModule()
26602
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
26603
- /*freeFunc:*/ nativeModule()
26604
- .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
26605
- /*liftFunc:*/ (_v) => {},
26606
- /*liftString:*/ FfiConverterString.lift,
26607
- /*asyncOpts:*/ asyncOpts_,
26608
- /*errorHandler:*/ FfiConverterTypeSyncStorageError.lift.bind(
26609
- FfiConverterTypeSyncStorageError
26610
- )
26611
- );
26612
- } catch (__error: any) {
26613
- if (uniffiIsDebug && __error instanceof Error) {
26614
- __error.stack = __stack;
26615
- }
26616
- throw __error;
26617
- }
26618
- }
26619
-
26620
- public async getPendingOutgoingChanges(
26621
- limit: /*u32*/ number,
26622
- asyncOpts_?: { signal: AbortSignal }
26623
- ): Promise<Array<OutgoingChange>> /*throws*/ {
26624
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
26625
- try {
26626
- return await uniffiRustCallAsync(
26627
- /*rustCaller:*/ uniffiCaller,
26628
- /*rustFutureFunc:*/ () => {
26629
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_syncstorage_get_pending_outgoing_changes(
26630
- uniffiTypeSyncStorageImplObjectFactory.clonePointer(this),
26631
- FfiConverterUInt32.lower(limit)
26632
- );
26633
- },
26634
- /*pollFunc:*/ nativeModule()
26635
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
26636
- /*cancelFunc:*/ nativeModule()
26637
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
26638
- /*completeFunc:*/ nativeModule()
26639
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
26640
- /*freeFunc:*/ nativeModule()
26641
- .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
26642
- /*liftFunc:*/ FfiConverterArrayTypeOutgoingChange.lift.bind(
26643
- FfiConverterArrayTypeOutgoingChange
26644
- ),
26645
- /*liftString:*/ FfiConverterString.lift,
26646
- /*asyncOpts:*/ asyncOpts_,
26647
- /*errorHandler:*/ FfiConverterTypeSyncStorageError.lift.bind(
26648
- FfiConverterTypeSyncStorageError
26649
- )
26650
- );
26651
- } catch (__error: any) {
26652
- if (uniffiIsDebug && __error instanceof Error) {
26653
- __error.stack = __stack;
26654
- }
26655
- throw __error;
26656
- }
26657
- }
26658
-
26659
- /**
26660
- * Get the revision number of the last synchronized record
26661
- */
26662
- public async getLastRevision(asyncOpts_?: {
26663
- signal: AbortSignal;
26664
- }): Promise</*u64*/ bigint> /*throws*/ {
26665
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
26666
- try {
26667
- return await uniffiRustCallAsync(
26668
- /*rustCaller:*/ uniffiCaller,
26669
- /*rustFutureFunc:*/ () => {
26670
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_syncstorage_get_last_revision(
26671
- uniffiTypeSyncStorageImplObjectFactory.clonePointer(this)
26672
- );
26673
- },
26674
- /*pollFunc:*/ nativeModule()
26675
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_u64,
26676
- /*cancelFunc:*/ nativeModule()
26677
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_u64,
26678
- /*completeFunc:*/ nativeModule()
26679
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_u64,
26680
- /*freeFunc:*/ nativeModule()
26681
- .ubrn_ffi_breez_sdk_spark_rust_future_free_u64,
26682
- /*liftFunc:*/ FfiConverterUInt64.lift.bind(FfiConverterUInt64),
26683
- /*liftString:*/ FfiConverterString.lift,
26684
- /*asyncOpts:*/ asyncOpts_,
26685
- /*errorHandler:*/ FfiConverterTypeSyncStorageError.lift.bind(
26686
- FfiConverterTypeSyncStorageError
26687
- )
26688
- );
26689
- } catch (__error: any) {
26690
- if (uniffiIsDebug && __error instanceof Error) {
26691
- __error.stack = __stack;
26692
- }
26693
- throw __error;
26694
- }
26695
- }
26696
-
26697
- /**
26698
- * Insert incoming records from remote sync
26699
- */
26700
- public async insertIncomingRecords(
26701
- records: Array<Record>,
26702
- asyncOpts_?: { signal: AbortSignal }
26703
- ): Promise<void> /*throws*/ {
26704
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
26705
- try {
26706
- return await uniffiRustCallAsync(
26707
- /*rustCaller:*/ uniffiCaller,
26708
- /*rustFutureFunc:*/ () => {
26709
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_syncstorage_insert_incoming_records(
26710
- uniffiTypeSyncStorageImplObjectFactory.clonePointer(this),
26711
- FfiConverterArrayTypeRecord.lower(records)
26712
- );
26713
- },
26714
- /*pollFunc:*/ nativeModule()
26715
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
26716
- /*cancelFunc:*/ nativeModule()
26717
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
26718
- /*completeFunc:*/ nativeModule()
26719
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
26720
- /*freeFunc:*/ nativeModule()
26721
- .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
26722
- /*liftFunc:*/ (_v) => {},
26723
- /*liftString:*/ FfiConverterString.lift,
26724
- /*asyncOpts:*/ asyncOpts_,
26725
- /*errorHandler:*/ FfiConverterTypeSyncStorageError.lift.bind(
26726
- FfiConverterTypeSyncStorageError
26727
- )
26728
- );
26729
- } catch (__error: any) {
26730
- if (uniffiIsDebug && __error instanceof Error) {
26731
- __error.stack = __stack;
26732
- }
26733
- throw __error;
26734
- }
26735
- }
26736
-
26737
- /**
26738
- * Delete an incoming record after it has been processed
26739
- */
26740
- public async deleteIncomingRecord(
26741
- record: Record,
26742
- asyncOpts_?: { signal: AbortSignal }
26743
- ): Promise<void> /*throws*/ {
26744
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
26745
- try {
26746
- return await uniffiRustCallAsync(
26747
- /*rustCaller:*/ uniffiCaller,
26748
- /*rustFutureFunc:*/ () => {
26749
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_syncstorage_delete_incoming_record(
26750
- uniffiTypeSyncStorageImplObjectFactory.clonePointer(this),
26751
- FfiConverterTypeRecord.lower(record)
26752
- );
26753
- },
26754
- /*pollFunc:*/ nativeModule()
26755
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
26756
- /*cancelFunc:*/ nativeModule()
26757
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
26758
- /*completeFunc:*/ nativeModule()
26759
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
26760
- /*freeFunc:*/ nativeModule()
26761
- .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
26762
- /*liftFunc:*/ (_v) => {},
26763
- /*liftString:*/ FfiConverterString.lift,
26764
- /*asyncOpts:*/ asyncOpts_,
26765
- /*errorHandler:*/ FfiConverterTypeSyncStorageError.lift.bind(
26766
- FfiConverterTypeSyncStorageError
26767
- )
26768
- );
26769
- } catch (__error: any) {
26770
- if (uniffiIsDebug && __error instanceof Error) {
26771
- __error.stack = __stack;
26772
- }
26773
- throw __error;
26774
- }
26775
- }
26776
-
26777
- /**
26778
- * Update revision numbers of pending outgoing records to be higher than the given revision
26779
- */
26780
- public async rebasePendingOutgoingRecords(
26781
- revision: /*u64*/ bigint,
26782
- asyncOpts_?: { signal: AbortSignal }
26783
- ): Promise<void> /*throws*/ {
26784
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
26785
- try {
26786
- return await uniffiRustCallAsync(
26787
- /*rustCaller:*/ uniffiCaller,
26788
- /*rustFutureFunc:*/ () => {
26789
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_syncstorage_rebase_pending_outgoing_records(
26790
- uniffiTypeSyncStorageImplObjectFactory.clonePointer(this),
26791
- FfiConverterUInt64.lower(revision)
26792
- );
26793
- },
26794
- /*pollFunc:*/ nativeModule()
26795
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
26796
- /*cancelFunc:*/ nativeModule()
26797
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
26798
- /*completeFunc:*/ nativeModule()
26799
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
26800
- /*freeFunc:*/ nativeModule()
26801
- .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
26802
- /*liftFunc:*/ (_v) => {},
26803
- /*liftString:*/ FfiConverterString.lift,
26804
- /*asyncOpts:*/ asyncOpts_,
26805
- /*errorHandler:*/ FfiConverterTypeSyncStorageError.lift.bind(
26806
- FfiConverterTypeSyncStorageError
26807
- )
26808
- );
26809
- } catch (__error: any) {
26810
- if (uniffiIsDebug && __error instanceof Error) {
26811
- __error.stack = __stack;
26812
- }
26813
- throw __error;
26814
- }
26815
- }
26816
-
26817
- /**
26818
- * Get incoming records that need to be processed, up to the specified limit
26819
- */
26820
- public async getIncomingRecords(
26821
- limit: /*u32*/ number,
26822
- asyncOpts_?: { signal: AbortSignal }
26823
- ): Promise<Array<IncomingChange>> /*throws*/ {
26824
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
26825
- try {
26826
- return await uniffiRustCallAsync(
26827
- /*rustCaller:*/ uniffiCaller,
26828
- /*rustFutureFunc:*/ () => {
26829
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_syncstorage_get_incoming_records(
26830
- uniffiTypeSyncStorageImplObjectFactory.clonePointer(this),
26831
- FfiConverterUInt32.lower(limit)
26832
- );
26833
- },
26834
- /*pollFunc:*/ nativeModule()
26835
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
26836
- /*cancelFunc:*/ nativeModule()
26837
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
26838
- /*completeFunc:*/ nativeModule()
26839
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
26840
- /*freeFunc:*/ nativeModule()
26841
- .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
26842
- /*liftFunc:*/ FfiConverterArrayTypeIncomingChange.lift.bind(
26843
- FfiConverterArrayTypeIncomingChange
27172
+ getPaymentByInvoice: (
27173
+ uniffiHandle: bigint,
27174
+ invoice: Uint8Array,
27175
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
27176
+ uniffiCallbackData: bigint
27177
+ ) => {
27178
+ const uniffiMakeCall = async (
27179
+ signal: AbortSignal
27180
+ ): Promise<Payment | undefined> => {
27181
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27182
+ return await jsCallback.getPaymentByInvoice(
27183
+ FfiConverterString.lift(invoice),
27184
+ { signal }
27185
+ );
27186
+ };
27187
+ const uniffiHandleSuccess = (returnValue: Payment | undefined) => {
27188
+ uniffiFutureCallback(
27189
+ uniffiCallbackData,
27190
+ /* UniffiForeignFutureStructRustBuffer */ {
27191
+ returnValue: FfiConverterOptionalTypePayment.lower(returnValue),
27192
+ callStatus: uniffiCaller.createCallStatus(),
27193
+ }
27194
+ );
27195
+ };
27196
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
27197
+ uniffiFutureCallback(
27198
+ uniffiCallbackData,
27199
+ /* UniffiForeignFutureStructRustBuffer */ {
27200
+ returnValue: /*empty*/ new Uint8Array(0),
27201
+ // TODO create callstatus with error.
27202
+ callStatus: { code, errorBuf },
27203
+ }
27204
+ );
27205
+ };
27206
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
27207
+ /*makeCall:*/ uniffiMakeCall,
27208
+ /*handleSuccess:*/ uniffiHandleSuccess,
27209
+ /*handleError:*/ uniffiHandleError,
27210
+ /*isErrorType:*/ StorageError.instanceOf,
27211
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27212
+ FfiConverterTypeStorageError
26844
27213
  ),
26845
- /*liftString:*/ FfiConverterString.lift,
26846
- /*asyncOpts:*/ asyncOpts_,
26847
- /*errorHandler:*/ FfiConverterTypeSyncStorageError.lift.bind(
26848
- FfiConverterTypeSyncStorageError
26849
- )
27214
+ /*lowerString:*/ FfiConverterString.lower
26850
27215
  );
26851
- } catch (__error: any) {
26852
- if (uniffiIsDebug && __error instanceof Error) {
26853
- __error.stack = __stack;
26854
- }
26855
- throw __error;
26856
- }
26857
- }
26858
-
26859
- /**
26860
- * Get the latest outgoing record if any exists
26861
- */
26862
- public async getLatestOutgoingChange(asyncOpts_?: {
26863
- signal: AbortSignal;
26864
- }): Promise<OutgoingChange | undefined> /*throws*/ {
26865
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
26866
- try {
26867
- return await uniffiRustCallAsync(
26868
- /*rustCaller:*/ uniffiCaller,
26869
- /*rustFutureFunc:*/ () => {
26870
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_syncstorage_get_latest_outgoing_change(
26871
- uniffiTypeSyncStorageImplObjectFactory.clonePointer(this)
26872
- );
26873
- },
26874
- /*pollFunc:*/ nativeModule()
26875
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
26876
- /*cancelFunc:*/ nativeModule()
26877
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
26878
- /*completeFunc:*/ nativeModule()
26879
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
26880
- /*freeFunc:*/ nativeModule()
26881
- .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
26882
- /*liftFunc:*/ FfiConverterOptionalTypeOutgoingChange.lift.bind(
26883
- FfiConverterOptionalTypeOutgoingChange
27216
+ return UniffiResult.success(uniffiForeignFuture);
27217
+ },
27218
+ getPaymentsByParentIds: (
27219
+ uniffiHandle: bigint,
27220
+ parentPaymentIds: Uint8Array,
27221
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
27222
+ uniffiCallbackData: bigint
27223
+ ) => {
27224
+ const uniffiMakeCall = async (
27225
+ signal: AbortSignal
27226
+ ): Promise<Map<string, Array<Payment>>> => {
27227
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27228
+ return await jsCallback.getPaymentsByParentIds(
27229
+ FfiConverterArrayString.lift(parentPaymentIds),
27230
+ { signal }
27231
+ );
27232
+ };
27233
+ const uniffiHandleSuccess = (
27234
+ returnValue: Map<string, Array<Payment>>
27235
+ ) => {
27236
+ uniffiFutureCallback(
27237
+ uniffiCallbackData,
27238
+ /* UniffiForeignFutureStructRustBuffer */ {
27239
+ returnValue:
27240
+ FfiConverterMapStringArrayTypePayment.lower(returnValue),
27241
+ callStatus: uniffiCaller.createCallStatus(),
27242
+ }
27243
+ );
27244
+ };
27245
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
27246
+ uniffiFutureCallback(
27247
+ uniffiCallbackData,
27248
+ /* UniffiForeignFutureStructRustBuffer */ {
27249
+ returnValue: /*empty*/ new Uint8Array(0),
27250
+ // TODO create callstatus with error.
27251
+ callStatus: { code, errorBuf },
27252
+ }
27253
+ );
27254
+ };
27255
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
27256
+ /*makeCall:*/ uniffiMakeCall,
27257
+ /*handleSuccess:*/ uniffiHandleSuccess,
27258
+ /*handleError:*/ uniffiHandleError,
27259
+ /*isErrorType:*/ StorageError.instanceOf,
27260
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27261
+ FfiConverterTypeStorageError
26884
27262
  ),
26885
- /*liftString:*/ FfiConverterString.lift,
26886
- /*asyncOpts:*/ asyncOpts_,
26887
- /*errorHandler:*/ FfiConverterTypeSyncStorageError.lift.bind(
26888
- FfiConverterTypeSyncStorageError
26889
- )
26890
- );
26891
- } catch (__error: any) {
26892
- if (uniffiIsDebug && __error instanceof Error) {
26893
- __error.stack = __stack;
26894
- }
26895
- throw __error;
26896
- }
26897
- }
26898
-
26899
- /**
26900
- * Update the sync state record from an incoming record
26901
- */
26902
- public async updateRecordFromIncoming(
26903
- record: Record,
26904
- asyncOpts_?: { signal: AbortSignal }
26905
- ): Promise<void> /*throws*/ {
26906
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
26907
- try {
26908
- return await uniffiRustCallAsync(
26909
- /*rustCaller:*/ uniffiCaller,
26910
- /*rustFutureFunc:*/ () => {
26911
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_syncstorage_update_record_from_incoming(
26912
- uniffiTypeSyncStorageImplObjectFactory.clonePointer(this),
26913
- FfiConverterTypeRecord.lower(record)
26914
- );
26915
- },
26916
- /*pollFunc:*/ nativeModule()
26917
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
26918
- /*cancelFunc:*/ nativeModule()
26919
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
26920
- /*completeFunc:*/ nativeModule()
26921
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
26922
- /*freeFunc:*/ nativeModule()
26923
- .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
26924
- /*liftFunc:*/ (_v) => {},
26925
- /*liftString:*/ FfiConverterString.lift,
26926
- /*asyncOpts:*/ asyncOpts_,
26927
- /*errorHandler:*/ FfiConverterTypeSyncStorageError.lift.bind(
26928
- FfiConverterTypeSyncStorageError
26929
- )
27263
+ /*lowerString:*/ FfiConverterString.lower
26930
27264
  );
26931
- } catch (__error: any) {
26932
- if (uniffiIsDebug && __error instanceof Error) {
26933
- __error.stack = __stack;
26934
- }
26935
- throw __error;
26936
- }
26937
- }
26938
-
26939
- /**
26940
- * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
26941
- */
26942
- uniffiDestroy(): void {
26943
- const ptr = (this as any)[destructorGuardSymbol];
26944
- if (ptr !== undefined) {
26945
- const pointer = uniffiTypeSyncStorageImplObjectFactory.pointer(this);
26946
- uniffiTypeSyncStorageImplObjectFactory.freePointer(pointer);
26947
- uniffiTypeSyncStorageImplObjectFactory.unbless(ptr);
26948
- delete (this as any)[destructorGuardSymbol];
26949
- }
26950
- }
26951
-
26952
- static instanceOf(obj: any): obj is SyncStorageImpl {
26953
- return uniffiTypeSyncStorageImplObjectFactory.isConcreteType(obj);
26954
- }
26955
- }
26956
-
26957
- const uniffiTypeSyncStorageImplObjectFactory: UniffiObjectFactory<SyncStorage> =
26958
- {
26959
- create(pointer: UnsafeMutableRawPointer): SyncStorage {
26960
- const instance = Object.create(SyncStorageImpl.prototype);
26961
- instance[pointerLiteralSymbol] = pointer;
26962
- instance[destructorGuardSymbol] = this.bless(pointer);
26963
- instance[uniffiTypeNameSymbol] = 'SyncStorageImpl';
26964
- return instance;
27265
+ return UniffiResult.success(uniffiForeignFuture);
26965
27266
  },
26966
-
26967
- bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr {
26968
- return uniffiCaller.rustCall(
26969
- /*caller:*/ (status) =>
26970
- nativeModule().ubrn_uniffi_internal_fn_method_syncstorage_ffi__bless_pointer(
26971
- p,
26972
- status
26973
- ),
26974
- /*liftString:*/ FfiConverterString.lift
27267
+ addDeposit: (
27268
+ uniffiHandle: bigint,
27269
+ txid: Uint8Array,
27270
+ vout: number,
27271
+ amountSats: bigint,
27272
+ uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
27273
+ uniffiCallbackData: bigint
27274
+ ) => {
27275
+ const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
27276
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27277
+ return await jsCallback.addDeposit(
27278
+ FfiConverterString.lift(txid),
27279
+ FfiConverterUInt32.lift(vout),
27280
+ FfiConverterUInt64.lift(amountSats),
27281
+ { signal }
27282
+ );
27283
+ };
27284
+ const uniffiHandleSuccess = (returnValue: void) => {
27285
+ uniffiFutureCallback(
27286
+ uniffiCallbackData,
27287
+ /* UniffiForeignFutureStructVoid */ {
27288
+ callStatus: uniffiCaller.createCallStatus(),
27289
+ }
27290
+ );
27291
+ };
27292
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
27293
+ uniffiFutureCallback(
27294
+ uniffiCallbackData,
27295
+ /* UniffiForeignFutureStructVoid */ {
27296
+ // TODO create callstatus with error.
27297
+ callStatus: { code, errorBuf },
27298
+ }
27299
+ );
27300
+ };
27301
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
27302
+ /*makeCall:*/ uniffiMakeCall,
27303
+ /*handleSuccess:*/ uniffiHandleSuccess,
27304
+ /*handleError:*/ uniffiHandleError,
27305
+ /*isErrorType:*/ StorageError.instanceOf,
27306
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27307
+ FfiConverterTypeStorageError
27308
+ ),
27309
+ /*lowerString:*/ FfiConverterString.lower
26975
27310
  );
27311
+ return UniffiResult.success(uniffiForeignFuture);
26976
27312
  },
26977
-
26978
- unbless(ptr: UniffiRustArcPtr) {
26979
- ptr.markDestroyed();
26980
- },
26981
-
26982
- pointer(obj: SyncStorage): UnsafeMutableRawPointer {
26983
- if ((obj as any)[destructorGuardSymbol] === undefined) {
26984
- throw new UniffiInternalError.UnexpectedNullPointer();
26985
- }
26986
- return (obj as any)[pointerLiteralSymbol];
27313
+ deleteDeposit: (
27314
+ uniffiHandle: bigint,
27315
+ txid: Uint8Array,
27316
+ vout: number,
27317
+ uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
27318
+ uniffiCallbackData: bigint
27319
+ ) => {
27320
+ const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
27321
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27322
+ return await jsCallback.deleteDeposit(
27323
+ FfiConverterString.lift(txid),
27324
+ FfiConverterUInt32.lift(vout),
27325
+ { signal }
27326
+ );
27327
+ };
27328
+ const uniffiHandleSuccess = (returnValue: void) => {
27329
+ uniffiFutureCallback(
27330
+ uniffiCallbackData,
27331
+ /* UniffiForeignFutureStructVoid */ {
27332
+ callStatus: uniffiCaller.createCallStatus(),
27333
+ }
27334
+ );
27335
+ };
27336
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
27337
+ uniffiFutureCallback(
27338
+ uniffiCallbackData,
27339
+ /* UniffiForeignFutureStructVoid */ {
27340
+ // TODO create callstatus with error.
27341
+ callStatus: { code, errorBuf },
27342
+ }
27343
+ );
27344
+ };
27345
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
27346
+ /*makeCall:*/ uniffiMakeCall,
27347
+ /*handleSuccess:*/ uniffiHandleSuccess,
27348
+ /*handleError:*/ uniffiHandleError,
27349
+ /*isErrorType:*/ StorageError.instanceOf,
27350
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27351
+ FfiConverterTypeStorageError
27352
+ ),
27353
+ /*lowerString:*/ FfiConverterString.lower
27354
+ );
27355
+ return UniffiResult.success(uniffiForeignFuture);
26987
27356
  },
26988
-
26989
- clonePointer(obj: SyncStorage): UnsafeMutableRawPointer {
26990
- const pointer = this.pointer(obj);
26991
- return uniffiCaller.rustCall(
26992
- /*caller:*/ (callStatus) =>
26993
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_clone_syncstorage(
26994
- pointer,
26995
- callStatus
26996
- ),
26997
- /*liftString:*/ FfiConverterString.lift
27357
+ listDeposits: (
27358
+ uniffiHandle: bigint,
27359
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
27360
+ uniffiCallbackData: bigint
27361
+ ) => {
27362
+ const uniffiMakeCall = async (
27363
+ signal: AbortSignal
27364
+ ): Promise<Array<DepositInfo>> => {
27365
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27366
+ return await jsCallback.listDeposits({ signal });
27367
+ };
27368
+ const uniffiHandleSuccess = (returnValue: Array<DepositInfo>) => {
27369
+ uniffiFutureCallback(
27370
+ uniffiCallbackData,
27371
+ /* UniffiForeignFutureStructRustBuffer */ {
27372
+ returnValue: FfiConverterArrayTypeDepositInfo.lower(returnValue),
27373
+ callStatus: uniffiCaller.createCallStatus(),
27374
+ }
27375
+ );
27376
+ };
27377
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
27378
+ uniffiFutureCallback(
27379
+ uniffiCallbackData,
27380
+ /* UniffiForeignFutureStructRustBuffer */ {
27381
+ returnValue: /*empty*/ new Uint8Array(0),
27382
+ // TODO create callstatus with error.
27383
+ callStatus: { code, errorBuf },
27384
+ }
27385
+ );
27386
+ };
27387
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
27388
+ /*makeCall:*/ uniffiMakeCall,
27389
+ /*handleSuccess:*/ uniffiHandleSuccess,
27390
+ /*handleError:*/ uniffiHandleError,
27391
+ /*isErrorType:*/ StorageError.instanceOf,
27392
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27393
+ FfiConverterTypeStorageError
27394
+ ),
27395
+ /*lowerString:*/ FfiConverterString.lower
26998
27396
  );
27397
+ return UniffiResult.success(uniffiForeignFuture);
26999
27398
  },
27000
-
27001
- freePointer(pointer: UnsafeMutableRawPointer): void {
27002
- uniffiCaller.rustCall(
27003
- /*caller:*/ (callStatus) =>
27004
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_free_syncstorage(
27005
- pointer,
27006
- callStatus
27007
- ),
27008
- /*liftString:*/ FfiConverterString.lift
27399
+ updateDeposit: (
27400
+ uniffiHandle: bigint,
27401
+ txid: Uint8Array,
27402
+ vout: number,
27403
+ payload: Uint8Array,
27404
+ uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
27405
+ uniffiCallbackData: bigint
27406
+ ) => {
27407
+ const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
27408
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27409
+ return await jsCallback.updateDeposit(
27410
+ FfiConverterString.lift(txid),
27411
+ FfiConverterUInt32.lift(vout),
27412
+ FfiConverterTypeUpdateDepositPayload.lift(payload),
27413
+ { signal }
27414
+ );
27415
+ };
27416
+ const uniffiHandleSuccess = (returnValue: void) => {
27417
+ uniffiFutureCallback(
27418
+ uniffiCallbackData,
27419
+ /* UniffiForeignFutureStructVoid */ {
27420
+ callStatus: uniffiCaller.createCallStatus(),
27421
+ }
27422
+ );
27423
+ };
27424
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
27425
+ uniffiFutureCallback(
27426
+ uniffiCallbackData,
27427
+ /* UniffiForeignFutureStructVoid */ {
27428
+ // TODO create callstatus with error.
27429
+ callStatus: { code, errorBuf },
27430
+ }
27431
+ );
27432
+ };
27433
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
27434
+ /*makeCall:*/ uniffiMakeCall,
27435
+ /*handleSuccess:*/ uniffiHandleSuccess,
27436
+ /*handleError:*/ uniffiHandleError,
27437
+ /*isErrorType:*/ StorageError.instanceOf,
27438
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27439
+ FfiConverterTypeStorageError
27440
+ ),
27441
+ /*lowerString:*/ FfiConverterString.lower
27009
27442
  );
27443
+ return UniffiResult.success(uniffiForeignFuture);
27010
27444
  },
27011
-
27012
- isConcreteType(obj: any): obj is SyncStorage {
27013
- return (
27014
- obj[destructorGuardSymbol] &&
27015
- obj[uniffiTypeNameSymbol] === 'SyncStorageImpl'
27445
+ setLnurlMetadata: (
27446
+ uniffiHandle: bigint,
27447
+ metadata: Uint8Array,
27448
+ uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
27449
+ uniffiCallbackData: bigint
27450
+ ) => {
27451
+ const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
27452
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27453
+ return await jsCallback.setLnurlMetadata(
27454
+ FfiConverterArrayTypeSetLnurlMetadataItem.lift(metadata),
27455
+ { signal }
27456
+ );
27457
+ };
27458
+ const uniffiHandleSuccess = (returnValue: void) => {
27459
+ uniffiFutureCallback(
27460
+ uniffiCallbackData,
27461
+ /* UniffiForeignFutureStructVoid */ {
27462
+ callStatus: uniffiCaller.createCallStatus(),
27463
+ }
27464
+ );
27465
+ };
27466
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
27467
+ uniffiFutureCallback(
27468
+ uniffiCallbackData,
27469
+ /* UniffiForeignFutureStructVoid */ {
27470
+ // TODO create callstatus with error.
27471
+ callStatus: { code, errorBuf },
27472
+ }
27473
+ );
27474
+ };
27475
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
27476
+ /*makeCall:*/ uniffiMakeCall,
27477
+ /*handleSuccess:*/ uniffiHandleSuccess,
27478
+ /*handleError:*/ uniffiHandleError,
27479
+ /*isErrorType:*/ StorageError.instanceOf,
27480
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27481
+ FfiConverterTypeStorageError
27482
+ ),
27483
+ /*lowerString:*/ FfiConverterString.lower
27016
27484
  );
27485
+ return UniffiResult.success(uniffiForeignFuture);
27017
27486
  },
27018
- };
27019
- // FfiConverter for SyncStorage
27020
- const FfiConverterTypeSyncStorage = new FfiConverterObjectWithCallbacks(
27021
- uniffiTypeSyncStorageImplObjectFactory
27022
- );
27023
-
27024
- // Add a vtavble for the callbacks that go in SyncStorage.
27025
-
27026
- // Put the implementation in a struct so we don't pollute the top-level namespace
27027
- const uniffiCallbackInterfaceSyncStorage: {
27028
- vtable: UniffiVTableCallbackInterfaceSyncStorage;
27029
- register: () => void;
27030
- } = {
27031
- // Create the VTable using a series of closures.
27032
- // ts automatically converts these into C callback functions.
27033
- vtable: {
27034
27487
  addOutgoingChange: (
27035
27488
  uniffiHandle: bigint,
27036
27489
  record: Uint8Array,
@@ -27040,7 +27493,7 @@ const uniffiCallbackInterfaceSyncStorage: {
27040
27493
  const uniffiMakeCall = async (
27041
27494
  signal: AbortSignal
27042
27495
  ): Promise</*u64*/ bigint> => {
27043
- const jsCallback = FfiConverterTypeSyncStorage.lift(uniffiHandle);
27496
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27044
27497
  return await jsCallback.addOutgoingChange(
27045
27498
  FfiConverterTypeUnversionedRecordChange.lift(record),
27046
27499
  { signal }
@@ -27069,9 +27522,9 @@ const uniffiCallbackInterfaceSyncStorage: {
27069
27522
  /*makeCall:*/ uniffiMakeCall,
27070
27523
  /*handleSuccess:*/ uniffiHandleSuccess,
27071
27524
  /*handleError:*/ uniffiHandleError,
27072
- /*isErrorType:*/ SyncStorageError.instanceOf,
27073
- /*lowerError:*/ FfiConverterTypeSyncStorageError.lower.bind(
27074
- FfiConverterTypeSyncStorageError
27525
+ /*isErrorType:*/ StorageError.instanceOf,
27526
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27527
+ FfiConverterTypeStorageError
27075
27528
  ),
27076
27529
  /*lowerString:*/ FfiConverterString.lower
27077
27530
  );
@@ -27080,13 +27533,15 @@ const uniffiCallbackInterfaceSyncStorage: {
27080
27533
  completeOutgoingSync: (
27081
27534
  uniffiHandle: bigint,
27082
27535
  record: Uint8Array,
27536
+ localRevision: bigint,
27083
27537
  uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
27084
27538
  uniffiCallbackData: bigint
27085
27539
  ) => {
27086
27540
  const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
27087
- const jsCallback = FfiConverterTypeSyncStorage.lift(uniffiHandle);
27541
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27088
27542
  return await jsCallback.completeOutgoingSync(
27089
27543
  FfiConverterTypeRecord.lift(record),
27544
+ FfiConverterUInt64.lift(localRevision),
27090
27545
  { signal }
27091
27546
  );
27092
27547
  };
@@ -27111,9 +27566,9 @@ const uniffiCallbackInterfaceSyncStorage: {
27111
27566
  /*makeCall:*/ uniffiMakeCall,
27112
27567
  /*handleSuccess:*/ uniffiHandleSuccess,
27113
27568
  /*handleError:*/ uniffiHandleError,
27114
- /*isErrorType:*/ SyncStorageError.instanceOf,
27115
- /*lowerError:*/ FfiConverterTypeSyncStorageError.lower.bind(
27116
- FfiConverterTypeSyncStorageError
27569
+ /*isErrorType:*/ StorageError.instanceOf,
27570
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27571
+ FfiConverterTypeStorageError
27117
27572
  ),
27118
27573
  /*lowerString:*/ FfiConverterString.lower
27119
27574
  );
@@ -27128,7 +27583,7 @@ const uniffiCallbackInterfaceSyncStorage: {
27128
27583
  const uniffiMakeCall = async (
27129
27584
  signal: AbortSignal
27130
27585
  ): Promise<Array<OutgoingChange>> => {
27131
- const jsCallback = FfiConverterTypeSyncStorage.lift(uniffiHandle);
27586
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27132
27587
  return await jsCallback.getPendingOutgoingChanges(
27133
27588
  FfiConverterUInt32.lift(limit),
27134
27589
  { signal }
@@ -27157,9 +27612,9 @@ const uniffiCallbackInterfaceSyncStorage: {
27157
27612
  /*makeCall:*/ uniffiMakeCall,
27158
27613
  /*handleSuccess:*/ uniffiHandleSuccess,
27159
27614
  /*handleError:*/ uniffiHandleError,
27160
- /*isErrorType:*/ SyncStorageError.instanceOf,
27161
- /*lowerError:*/ FfiConverterTypeSyncStorageError.lower.bind(
27162
- FfiConverterTypeSyncStorageError
27615
+ /*isErrorType:*/ StorageError.instanceOf,
27616
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27617
+ FfiConverterTypeStorageError
27163
27618
  ),
27164
27619
  /*lowerString:*/ FfiConverterString.lower
27165
27620
  );
@@ -27173,7 +27628,7 @@ const uniffiCallbackInterfaceSyncStorage: {
27173
27628
  const uniffiMakeCall = async (
27174
27629
  signal: AbortSignal
27175
27630
  ): Promise</*u64*/ bigint> => {
27176
- const jsCallback = FfiConverterTypeSyncStorage.lift(uniffiHandle);
27631
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27177
27632
  return await jsCallback.getLastRevision({ signal });
27178
27633
  };
27179
27634
  const uniffiHandleSuccess = (returnValue: /*u64*/ bigint) => {
@@ -27199,9 +27654,9 @@ const uniffiCallbackInterfaceSyncStorage: {
27199
27654
  /*makeCall:*/ uniffiMakeCall,
27200
27655
  /*handleSuccess:*/ uniffiHandleSuccess,
27201
27656
  /*handleError:*/ uniffiHandleError,
27202
- /*isErrorType:*/ SyncStorageError.instanceOf,
27203
- /*lowerError:*/ FfiConverterTypeSyncStorageError.lower.bind(
27204
- FfiConverterTypeSyncStorageError
27657
+ /*isErrorType:*/ StorageError.instanceOf,
27658
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27659
+ FfiConverterTypeStorageError
27205
27660
  ),
27206
27661
  /*lowerString:*/ FfiConverterString.lower
27207
27662
  );
@@ -27214,7 +27669,7 @@ const uniffiCallbackInterfaceSyncStorage: {
27214
27669
  uniffiCallbackData: bigint
27215
27670
  ) => {
27216
27671
  const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
27217
- const jsCallback = FfiConverterTypeSyncStorage.lift(uniffiHandle);
27672
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27218
27673
  return await jsCallback.insertIncomingRecords(
27219
27674
  FfiConverterArrayTypeRecord.lift(records),
27220
27675
  { signal }
@@ -27241,9 +27696,9 @@ const uniffiCallbackInterfaceSyncStorage: {
27241
27696
  /*makeCall:*/ uniffiMakeCall,
27242
27697
  /*handleSuccess:*/ uniffiHandleSuccess,
27243
27698
  /*handleError:*/ uniffiHandleError,
27244
- /*isErrorType:*/ SyncStorageError.instanceOf,
27245
- /*lowerError:*/ FfiConverterTypeSyncStorageError.lower.bind(
27246
- FfiConverterTypeSyncStorageError
27699
+ /*isErrorType:*/ StorageError.instanceOf,
27700
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27701
+ FfiConverterTypeStorageError
27247
27702
  ),
27248
27703
  /*lowerString:*/ FfiConverterString.lower
27249
27704
  );
@@ -27256,7 +27711,7 @@ const uniffiCallbackInterfaceSyncStorage: {
27256
27711
  uniffiCallbackData: bigint
27257
27712
  ) => {
27258
27713
  const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
27259
- const jsCallback = FfiConverterTypeSyncStorage.lift(uniffiHandle);
27714
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27260
27715
  return await jsCallback.deleteIncomingRecord(
27261
27716
  FfiConverterTypeRecord.lift(record),
27262
27717
  { signal }
@@ -27283,51 +27738,9 @@ const uniffiCallbackInterfaceSyncStorage: {
27283
27738
  /*makeCall:*/ uniffiMakeCall,
27284
27739
  /*handleSuccess:*/ uniffiHandleSuccess,
27285
27740
  /*handleError:*/ uniffiHandleError,
27286
- /*isErrorType:*/ SyncStorageError.instanceOf,
27287
- /*lowerError:*/ FfiConverterTypeSyncStorageError.lower.bind(
27288
- FfiConverterTypeSyncStorageError
27289
- ),
27290
- /*lowerString:*/ FfiConverterString.lower
27291
- );
27292
- return UniffiResult.success(uniffiForeignFuture);
27293
- },
27294
- rebasePendingOutgoingRecords: (
27295
- uniffiHandle: bigint,
27296
- revision: bigint,
27297
- uniffiFutureCallback: UniffiForeignFutureCompleteVoid,
27298
- uniffiCallbackData: bigint
27299
- ) => {
27300
- const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
27301
- const jsCallback = FfiConverterTypeSyncStorage.lift(uniffiHandle);
27302
- return await jsCallback.rebasePendingOutgoingRecords(
27303
- FfiConverterUInt64.lift(revision),
27304
- { signal }
27305
- );
27306
- };
27307
- const uniffiHandleSuccess = (returnValue: void) => {
27308
- uniffiFutureCallback(
27309
- uniffiCallbackData,
27310
- /* UniffiForeignFutureStructVoid */ {
27311
- callStatus: uniffiCaller.createCallStatus(),
27312
- }
27313
- );
27314
- };
27315
- const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
27316
- uniffiFutureCallback(
27317
- uniffiCallbackData,
27318
- /* UniffiForeignFutureStructVoid */ {
27319
- // TODO create callstatus with error.
27320
- callStatus: { code, errorBuf },
27321
- }
27322
- );
27323
- };
27324
- const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
27325
- /*makeCall:*/ uniffiMakeCall,
27326
- /*handleSuccess:*/ uniffiHandleSuccess,
27327
- /*handleError:*/ uniffiHandleError,
27328
- /*isErrorType:*/ SyncStorageError.instanceOf,
27329
- /*lowerError:*/ FfiConverterTypeSyncStorageError.lower.bind(
27330
- FfiConverterTypeSyncStorageError
27741
+ /*isErrorType:*/ StorageError.instanceOf,
27742
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27743
+ FfiConverterTypeStorageError
27331
27744
  ),
27332
27745
  /*lowerString:*/ FfiConverterString.lower
27333
27746
  );
@@ -27342,7 +27755,7 @@ const uniffiCallbackInterfaceSyncStorage: {
27342
27755
  const uniffiMakeCall = async (
27343
27756
  signal: AbortSignal
27344
27757
  ): Promise<Array<IncomingChange>> => {
27345
- const jsCallback = FfiConverterTypeSyncStorage.lift(uniffiHandle);
27758
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27346
27759
  return await jsCallback.getIncomingRecords(
27347
27760
  FfiConverterUInt32.lift(limit),
27348
27761
  { signal }
@@ -27371,9 +27784,9 @@ const uniffiCallbackInterfaceSyncStorage: {
27371
27784
  /*makeCall:*/ uniffiMakeCall,
27372
27785
  /*handleSuccess:*/ uniffiHandleSuccess,
27373
27786
  /*handleError:*/ uniffiHandleError,
27374
- /*isErrorType:*/ SyncStorageError.instanceOf,
27375
- /*lowerError:*/ FfiConverterTypeSyncStorageError.lower.bind(
27376
- FfiConverterTypeSyncStorageError
27787
+ /*isErrorType:*/ StorageError.instanceOf,
27788
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27789
+ FfiConverterTypeStorageError
27377
27790
  ),
27378
27791
  /*lowerString:*/ FfiConverterString.lower
27379
27792
  );
@@ -27387,7 +27800,7 @@ const uniffiCallbackInterfaceSyncStorage: {
27387
27800
  const uniffiMakeCall = async (
27388
27801
  signal: AbortSignal
27389
27802
  ): Promise<OutgoingChange | undefined> => {
27390
- const jsCallback = FfiConverterTypeSyncStorage.lift(uniffiHandle);
27803
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27391
27804
  return await jsCallback.getLatestOutgoingChange({ signal });
27392
27805
  };
27393
27806
  const uniffiHandleSuccess = (returnValue: OutgoingChange | undefined) => {
@@ -27414,9 +27827,9 @@ const uniffiCallbackInterfaceSyncStorage: {
27414
27827
  /*makeCall:*/ uniffiMakeCall,
27415
27828
  /*handleSuccess:*/ uniffiHandleSuccess,
27416
27829
  /*handleError:*/ uniffiHandleError,
27417
- /*isErrorType:*/ SyncStorageError.instanceOf,
27418
- /*lowerError:*/ FfiConverterTypeSyncStorageError.lower.bind(
27419
- FfiConverterTypeSyncStorageError
27830
+ /*isErrorType:*/ StorageError.instanceOf,
27831
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27832
+ FfiConverterTypeStorageError
27420
27833
  ),
27421
27834
  /*lowerString:*/ FfiConverterString.lower
27422
27835
  );
@@ -27429,7 +27842,7 @@ const uniffiCallbackInterfaceSyncStorage: {
27429
27842
  uniffiCallbackData: bigint
27430
27843
  ) => {
27431
27844
  const uniffiMakeCall = async (signal: AbortSignal): Promise<void> => {
27432
- const jsCallback = FfiConverterTypeSyncStorage.lift(uniffiHandle);
27845
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
27433
27846
  return await jsCallback.updateRecordFromIncoming(
27434
27847
  FfiConverterTypeRecord.lift(record),
27435
27848
  { signal }
@@ -27456,22 +27869,22 @@ const uniffiCallbackInterfaceSyncStorage: {
27456
27869
  /*makeCall:*/ uniffiMakeCall,
27457
27870
  /*handleSuccess:*/ uniffiHandleSuccess,
27458
27871
  /*handleError:*/ uniffiHandleError,
27459
- /*isErrorType:*/ SyncStorageError.instanceOf,
27460
- /*lowerError:*/ FfiConverterTypeSyncStorageError.lower.bind(
27461
- FfiConverterTypeSyncStorageError
27872
+ /*isErrorType:*/ StorageError.instanceOf,
27873
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
27874
+ FfiConverterTypeStorageError
27462
27875
  ),
27463
27876
  /*lowerString:*/ FfiConverterString.lower
27464
27877
  );
27465
27878
  return UniffiResult.success(uniffiForeignFuture);
27466
27879
  },
27467
27880
  uniffiFree: (uniffiHandle: UniffiHandle): void => {
27468
- // SyncStorage: this will throw a stale handle error if the handle isn't found.
27469
- FfiConverterTypeSyncStorage.drop(uniffiHandle);
27881
+ // Storage: this will throw a stale handle error if the handle isn't found.
27882
+ FfiConverterTypeStorage.drop(uniffiHandle);
27470
27883
  },
27471
27884
  },
27472
27885
  register: () => {
27473
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_init_callback_vtable_syncstorage(
27474
- uniffiCallbackInterfaceSyncStorage.vtable
27886
+ nativeModule().ubrn_uniffi_breez_sdk_spark_fn_init_callback_vtable_storage(
27887
+ uniffiCallbackInterfaceStorage.vtable
27475
27888
  );
27476
27889
  },
27477
27890
  };
@@ -28053,6 +28466,11 @@ const FfiConverterOptionalTypeLogger = new FfiConverterOptional(
28053
28466
  FfiConverterTypeLogger
28054
28467
  );
28055
28468
 
28469
+ // FfiConverter for ConversionDetails | undefined
28470
+ const FfiConverterOptionalTypeConversionDetails = new FfiConverterOptional(
28471
+ FfiConverterTypeConversionDetails
28472
+ );
28473
+
28056
28474
  // FfiConverter for ConversionEstimate | undefined
28057
28475
  const FfiConverterOptionalTypeConversionEstimate = new FfiConverterOptional(
28058
28476
  FfiConverterTypeConversionEstimate
@@ -28132,6 +28550,11 @@ const FfiConverterOptionalTypeSymbol = new FfiConverterOptional(
28132
28550
  FfiConverterTypeSymbol
28133
28551
  );
28134
28552
 
28553
+ // FfiConverter for TokenMetadata | undefined
28554
+ const FfiConverterOptionalTypeTokenMetadata = new FfiConverterOptional(
28555
+ FfiConverterTypeTokenMetadata
28556
+ );
28557
+
28135
28558
  // FfiConverter for string | undefined
28136
28559
  const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
28137
28560
 
@@ -28254,6 +28677,12 @@ const FfiConverterArrayTypeUtxo = new FfiConverterArray(FfiConverterTypeUtxo);
28254
28677
  // FfiConverter for Array<string>
28255
28678
  const FfiConverterArrayString = new FfiConverterArray(FfiConverterString);
28256
28679
 
28680
+ // FfiConverter for Map<string, Array<Payment>>
28681
+ const FfiConverterMapStringArrayTypePayment = new FfiConverterMap(
28682
+ FfiConverterString,
28683
+ FfiConverterArrayTypePayment
28684
+ );
28685
+
28257
28686
  // FfiConverter for U128 | undefined
28258
28687
  const FfiConverterOptionalTypeu128 = new FfiConverterOptional(
28259
28688
  FfiConverterTypeu128
@@ -28284,6 +28713,11 @@ const FfiConverterOptionalTypeFee = new FfiConverterOptional(
28284
28713
  FfiConverterTypeFee
28285
28714
  );
28286
28715
 
28716
+ // FfiConverter for FeePolicy | undefined
28717
+ const FfiConverterOptionalTypeFeePolicy = new FfiConverterOptional(
28718
+ FfiConverterTypeFeePolicy
28719
+ );
28720
+
28287
28721
  // FfiConverter for MaxFee | undefined
28288
28722
  const FfiConverterOptionalTypeMaxFee = new FfiConverterOptional(
28289
28723
  FfiConverterTypeMaxFee
@@ -28309,6 +28743,11 @@ const FfiConverterOptionalTypeSuccessActionProcessed = new FfiConverterOptional(
28309
28743
  FfiConverterTypeSuccessActionProcessed
28310
28744
  );
28311
28745
 
28746
+ // FfiConverter for TokenTransactionType | undefined
28747
+ const FfiConverterOptionalTypeTokenTransactionType = new FfiConverterOptional(
28748
+ FfiConverterTypeTokenTransactionType
28749
+ );
28750
+
28312
28751
  // FfiConverter for Map<string, string> | undefined
28313
28752
  const FfiConverterOptionalMapStringString = new FfiConverterOptional(
28314
28753
  FfiConverterMapStringString
@@ -28415,6 +28854,14 @@ function uniffiEnsureInitialized() {
28415
28854
  'uniffi_breez_sdk_spark_checksum_func_default_external_signer'
28416
28855
  );
28417
28856
  }
28857
+ if (
28858
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_get_spark_status() !==
28859
+ 62888
28860
+ ) {
28861
+ throw new UniffiInternalError.ApiChecksumMismatch(
28862
+ 'uniffi_breez_sdk_spark_checksum_func_get_spark_status'
28863
+ );
28864
+ }
28418
28865
  if (
28419
28866
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_func_init_logging() !==
28420
28867
  8518
@@ -28471,6 +28918,14 @@ function uniffiEnsureInitialized() {
28471
28918
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_add_event_listener'
28472
28919
  );
28473
28920
  }
28921
+ if (
28922
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_buy_bitcoin() !==
28923
+ 32150
28924
+ ) {
28925
+ throw new UniffiInternalError.ApiChecksumMismatch(
28926
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_buy_bitcoin'
28927
+ );
28928
+ }
28474
28929
  if (
28475
28930
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_cancel_leaf_optimization() !==
28476
28931
  56996
@@ -28609,7 +29064,7 @@ function uniffiEnsureInitialized() {
28609
29064
  }
28610
29065
  if (
28611
29066
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_list_payments() !==
28612
- 16156
29067
+ 39170
28613
29068
  ) {
28614
29069
  throw new UniffiInternalError.ApiChecksumMismatch(
28615
29070
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_list_payments'
@@ -28625,7 +29080,7 @@ function uniffiEnsureInitialized() {
28625
29080
  }
28626
29081
  if (
28627
29082
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_auth() !==
28628
- 37942
29083
+ 125
28629
29084
  ) {
28630
29085
  throw new UniffiInternalError.ApiChecksumMismatch(
28631
29086
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_auth'
@@ -28865,7 +29320,7 @@ function uniffiEnsureInitialized() {
28865
29320
  }
28866
29321
  if (
28867
29322
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_externalsigner_subtract_secrets() !==
28868
- 51106
29323
+ 45969
28869
29324
  ) {
28870
29325
  throw new UniffiInternalError.ApiChecksumMismatch(
28871
29326
  'uniffi_breez_sdk_spark_checksum_method_externalsigner_subtract_secrets'
@@ -29015,14 +29470,6 @@ function uniffiEnsureInitialized() {
29015
29470
  'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_payment_observer'
29016
29471
  );
29017
29472
  }
29018
- if (
29019
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_real_time_sync_storage() !==
29020
- 20579
29021
- ) {
29022
- throw new UniffiInternalError.ApiChecksumMismatch(
29023
- 'uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_real_time_sync_storage'
29024
- );
29025
- }
29026
29473
  if (
29027
29474
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_rest_chain_service() !==
29028
29475
  63155
@@ -29080,11 +29527,11 @@ function uniffiEnsureInitialized() {
29080
29527
  );
29081
29528
  }
29082
29529
  if (
29083
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_set_payment_metadata() !==
29084
- 45500
29530
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_insert_payment_metadata() !==
29531
+ 32757
29085
29532
  ) {
29086
29533
  throw new UniffiInternalError.ApiChecksumMismatch(
29087
- 'uniffi_breez_sdk_spark_checksum_method_storage_set_payment_metadata'
29534
+ 'uniffi_breez_sdk_spark_checksum_method_storage_insert_payment_metadata'
29088
29535
  );
29089
29536
  }
29090
29537
  if (
@@ -29103,9 +29550,17 @@ function uniffiEnsureInitialized() {
29103
29550
  'uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_invoice'
29104
29551
  );
29105
29552
  }
29553
+ if (
29554
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_get_payments_by_parent_ids() !==
29555
+ 10948
29556
+ ) {
29557
+ throw new UniffiInternalError.ApiChecksumMismatch(
29558
+ 'uniffi_breez_sdk_spark_checksum_method_storage_get_payments_by_parent_ids'
29559
+ );
29560
+ }
29106
29561
  if (
29107
29562
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_add_deposit() !==
29108
- 60240
29563
+ 13181
29109
29564
  ) {
29110
29565
  throw new UniffiInternalError.ApiChecksumMismatch(
29111
29566
  'uniffi_breez_sdk_spark_checksum_method_storage_add_deposit'
@@ -29113,7 +29568,7 @@ function uniffiEnsureInitialized() {
29113
29568
  }
29114
29569
  if (
29115
29570
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_delete_deposit() !==
29116
- 60586
29571
+ 28477
29117
29572
  ) {
29118
29573
  throw new UniffiInternalError.ApiChecksumMismatch(
29119
29574
  'uniffi_breez_sdk_spark_checksum_method_storage_delete_deposit'
@@ -29121,7 +29576,7 @@ function uniffiEnsureInitialized() {
29121
29576
  }
29122
29577
  if (
29123
29578
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_list_deposits() !==
29124
- 54118
29579
+ 62636
29125
29580
  ) {
29126
29581
  throw new UniffiInternalError.ApiChecksumMismatch(
29127
29582
  'uniffi_breez_sdk_spark_checksum_method_storage_list_deposits'
@@ -29129,7 +29584,7 @@ function uniffiEnsureInitialized() {
29129
29584
  }
29130
29585
  if (
29131
29586
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_update_deposit() !==
29132
- 39803
29587
+ 18714
29133
29588
  ) {
29134
29589
  throw new UniffiInternalError.ApiChecksumMismatch(
29135
29590
  'uniffi_breez_sdk_spark_checksum_method_storage_update_deposit'
@@ -29137,90 +29592,82 @@ function uniffiEnsureInitialized() {
29137
29592
  }
29138
29593
  if (
29139
29594
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_set_lnurl_metadata() !==
29140
- 7460
29595
+ 64210
29141
29596
  ) {
29142
29597
  throw new UniffiInternalError.ApiChecksumMismatch(
29143
29598
  'uniffi_breez_sdk_spark_checksum_method_storage_set_lnurl_metadata'
29144
29599
  );
29145
29600
  }
29146
29601
  if (
29147
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_syncstorage_add_outgoing_change() !==
29148
- 19087
29149
- ) {
29150
- throw new UniffiInternalError.ApiChecksumMismatch(
29151
- 'uniffi_breez_sdk_spark_checksum_method_syncstorage_add_outgoing_change'
29152
- );
29153
- }
29154
- if (
29155
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_syncstorage_complete_outgoing_sync() !==
29156
- 20071
29602
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_add_outgoing_change() !==
29603
+ 50774
29157
29604
  ) {
29158
29605
  throw new UniffiInternalError.ApiChecksumMismatch(
29159
- 'uniffi_breez_sdk_spark_checksum_method_syncstorage_complete_outgoing_sync'
29606
+ 'uniffi_breez_sdk_spark_checksum_method_storage_add_outgoing_change'
29160
29607
  );
29161
29608
  }
29162
29609
  if (
29163
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_syncstorage_get_pending_outgoing_changes() !==
29164
- 23473
29610
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_complete_outgoing_sync() !==
29611
+ 8796
29165
29612
  ) {
29166
29613
  throw new UniffiInternalError.ApiChecksumMismatch(
29167
- 'uniffi_breez_sdk_spark_checksum_method_syncstorage_get_pending_outgoing_changes'
29614
+ 'uniffi_breez_sdk_spark_checksum_method_storage_complete_outgoing_sync'
29168
29615
  );
29169
29616
  }
29170
29617
  if (
29171
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_syncstorage_get_last_revision() !==
29172
- 36887
29618
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_get_pending_outgoing_changes() !==
29619
+ 20314
29173
29620
  ) {
29174
29621
  throw new UniffiInternalError.ApiChecksumMismatch(
29175
- 'uniffi_breez_sdk_spark_checksum_method_syncstorage_get_last_revision'
29622
+ 'uniffi_breez_sdk_spark_checksum_method_storage_get_pending_outgoing_changes'
29176
29623
  );
29177
29624
  }
29178
29625
  if (
29179
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_syncstorage_insert_incoming_records() !==
29180
- 41782
29626
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_get_last_revision() !==
29627
+ 48442
29181
29628
  ) {
29182
29629
  throw new UniffiInternalError.ApiChecksumMismatch(
29183
- 'uniffi_breez_sdk_spark_checksum_method_syncstorage_insert_incoming_records'
29630
+ 'uniffi_breez_sdk_spark_checksum_method_storage_get_last_revision'
29184
29631
  );
29185
29632
  }
29186
29633
  if (
29187
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_syncstorage_delete_incoming_record() !==
29188
- 23002
29634
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_insert_incoming_records() !==
29635
+ 38174
29189
29636
  ) {
29190
29637
  throw new UniffiInternalError.ApiChecksumMismatch(
29191
- 'uniffi_breez_sdk_spark_checksum_method_syncstorage_delete_incoming_record'
29638
+ 'uniffi_breez_sdk_spark_checksum_method_storage_insert_incoming_records'
29192
29639
  );
29193
29640
  }
29194
29641
  if (
29195
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_syncstorage_rebase_pending_outgoing_records() !==
29196
- 61508
29642
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_delete_incoming_record() !==
29643
+ 26412
29197
29644
  ) {
29198
29645
  throw new UniffiInternalError.ApiChecksumMismatch(
29199
- 'uniffi_breez_sdk_spark_checksum_method_syncstorage_rebase_pending_outgoing_records'
29646
+ 'uniffi_breez_sdk_spark_checksum_method_storage_delete_incoming_record'
29200
29647
  );
29201
29648
  }
29202
29649
  if (
29203
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_syncstorage_get_incoming_records() !==
29204
- 53552
29650
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_get_incoming_records() !==
29651
+ 13705
29205
29652
  ) {
29206
29653
  throw new UniffiInternalError.ApiChecksumMismatch(
29207
- 'uniffi_breez_sdk_spark_checksum_method_syncstorage_get_incoming_records'
29654
+ 'uniffi_breez_sdk_spark_checksum_method_storage_get_incoming_records'
29208
29655
  );
29209
29656
  }
29210
29657
  if (
29211
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_syncstorage_get_latest_outgoing_change() !==
29212
- 16326
29658
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_get_latest_outgoing_change() !==
29659
+ 41859
29213
29660
  ) {
29214
29661
  throw new UniffiInternalError.ApiChecksumMismatch(
29215
- 'uniffi_breez_sdk_spark_checksum_method_syncstorage_get_latest_outgoing_change'
29662
+ 'uniffi_breez_sdk_spark_checksum_method_storage_get_latest_outgoing_change'
29216
29663
  );
29217
29664
  }
29218
29665
  if (
29219
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_syncstorage_update_record_from_incoming() !==
29220
- 9986
29666
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_update_record_from_incoming() !==
29667
+ 54499
29221
29668
  ) {
29222
29669
  throw new UniffiInternalError.ApiChecksumMismatch(
29223
- 'uniffi_breez_sdk_spark_checksum_method_syncstorage_update_record_from_incoming'
29670
+ 'uniffi_breez_sdk_spark_checksum_method_storage_update_record_from_incoming'
29224
29671
  );
29225
29672
  }
29226
29673
  if (
@@ -29312,7 +29759,6 @@ function uniffiEnsureInitialized() {
29312
29759
  uniffiCallbackInterfacePaymentObserver.register();
29313
29760
  uniffiCallbackInterfaceRestClient.register();
29314
29761
  uniffiCallbackInterfaceStorage.register();
29315
- uniffiCallbackInterfaceSyncStorage.register();
29316
29762
  }
29317
29763
 
29318
29764
  export default Object.freeze({
@@ -29340,6 +29786,8 @@ export default Object.freeze({
29340
29786
  FfiConverterTypeBolt12OfferDetails,
29341
29787
  FfiConverterTypeBreezSdk,
29342
29788
  FfiConverterTypeBurnIssuerTokenRequest,
29789
+ FfiConverterTypeBuyBitcoinRequest,
29790
+ FfiConverterTypeBuyBitcoinResponse,
29343
29791
  FfiConverterTypeChainApiType,
29344
29792
  FfiConverterTypeCheckLightningAddressRequest,
29345
29793
  FfiConverterTypeCheckMessageRequest,
@@ -29351,11 +29799,13 @@ export default Object.freeze({
29351
29799
  FfiConverterTypeConfig,
29352
29800
  FfiConverterTypeConnectRequest,
29353
29801
  FfiConverterTypeConnectWithSignerRequest,
29802
+ FfiConverterTypeConversionDetails,
29354
29803
  FfiConverterTypeConversionEstimate,
29355
29804
  FfiConverterTypeConversionInfo,
29356
29805
  FfiConverterTypeConversionOptions,
29357
29806
  FfiConverterTypeConversionPurpose,
29358
29807
  FfiConverterTypeConversionStatus,
29808
+ FfiConverterTypeConversionStep,
29359
29809
  FfiConverterTypeConversionType,
29360
29810
  FfiConverterTypeCreateIssuerTokenRequest,
29361
29811
  FfiConverterTypeCredentials,
@@ -29380,6 +29830,7 @@ export default Object.freeze({
29380
29830
  FfiConverterTypeExternalTreeNodeId,
29381
29831
  FfiConverterTypeExternalVerifiableSecretShare,
29382
29832
  FfiConverterTypeFee,
29833
+ FfiConverterTypeFeePolicy,
29383
29834
  FfiConverterTypeFetchConversionLimitsRequest,
29384
29835
  FfiConverterTypeFetchConversionLimitsResponse,
29385
29836
  FfiConverterTypeFiatCurrency,
@@ -29411,6 +29862,7 @@ export default Object.freeze({
29411
29862
  FfiConverterTypeLnurlAuthRequestDetails,
29412
29863
  FfiConverterTypeLnurlCallbackStatus,
29413
29864
  FfiConverterTypeLnurlErrorDetails,
29865
+ FfiConverterTypeLnurlInfo,
29414
29866
  FfiConverterTypeLnurlPayInfo,
29415
29867
  FfiConverterTypeLnurlPayRequest,
29416
29868
  FfiConverterTypeLnurlPayRequestDetails,
@@ -29474,6 +29926,7 @@ export default Object.freeze({
29474
29926
  FfiConverterTypeSendPaymentOptions,
29475
29927
  FfiConverterTypeSendPaymentRequest,
29476
29928
  FfiConverterTypeSendPaymentResponse,
29929
+ FfiConverterTypeServiceStatus,
29477
29930
  FfiConverterTypeSetLnurlMetadataItem,
29478
29931
  FfiConverterTypeSignMessageRequest,
29479
29932
  FfiConverterTypeSignMessageResponse,
@@ -29484,16 +29937,17 @@ export default Object.freeze({
29484
29937
  FfiConverterTypeSparkHtlcStatus,
29485
29938
  FfiConverterTypeSparkInvoiceDetails,
29486
29939
  FfiConverterTypeSparkInvoicePaymentDetails,
29940
+ FfiConverterTypeSparkStatus,
29487
29941
  FfiConverterTypeStorage,
29488
29942
  FfiConverterTypeSuccessAction,
29489
29943
  FfiConverterTypeSuccessActionProcessed,
29490
29944
  FfiConverterTypeSymbol,
29491
- FfiConverterTypeSyncStorage,
29492
29945
  FfiConverterTypeSyncWalletRequest,
29493
29946
  FfiConverterTypeSyncWalletResponse,
29494
29947
  FfiConverterTypeTokenBalance,
29495
29948
  FfiConverterTypeTokenIssuer,
29496
29949
  FfiConverterTypeTokenMetadata,
29950
+ FfiConverterTypeTokenTransactionType,
29497
29951
  FfiConverterTypeTxStatus,
29498
29952
  FfiConverterTypeUnfreezeIssuerTokenRequest,
29499
29953
  FfiConverterTypeUnfreezeIssuerTokenResponse,