@breeztech/breez-sdk-spark-react-native 0.2.5-dev2 → 0.3.0-rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/cpp/generated/breez_sdk_spark.cpp +354 -219
  2. package/cpp/generated/breez_sdk_spark.hpp +20 -22
  3. package/lib/commonjs/generated/breez_sdk_common.js +41 -4
  4. package/lib/commonjs/generated/breez_sdk_common.js.map +1 -1
  5. package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
  6. package/lib/commonjs/generated/breez_sdk_spark.js +795 -104
  7. package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -1
  8. package/lib/module/generated/breez_sdk_common.js +41 -4
  9. package/lib/module/generated/breez_sdk_common.js.map +1 -1
  10. package/lib/module/generated/breez_sdk_spark-ffi.js.map +1 -1
  11. package/lib/module/generated/breez_sdk_spark.js +795 -104
  12. package/lib/module/generated/breez_sdk_spark.js.map +1 -1
  13. package/lib/typescript/commonjs/src/generated/breez_sdk_common.d.ts +13 -1
  14. package/lib/typescript/commonjs/src/generated/breez_sdk_common.d.ts.map +1 -1
  15. package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +19 -17
  16. package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
  17. package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts +551 -47
  18. package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts.map +1 -1
  19. package/lib/typescript/module/src/generated/breez_sdk_common.d.ts +13 -1
  20. package/lib/typescript/module/src/generated/breez_sdk_common.d.ts.map +1 -1
  21. package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts +19 -17
  22. package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
  23. package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts +551 -47
  24. package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts.map +1 -1
  25. package/package.json +1 -1
  26. package/src/generated/breez_sdk_common.ts +47 -4
  27. package/src/generated/breez_sdk_spark-ffi.ts +32 -30
  28. package/src/generated/breez_sdk_spark.ts +1261 -219
@@ -3,7 +3,7 @@
3
3
  // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
4
4
  // Trust me, you don't want to mess with it!
5
5
  import nativeModule from "./breez_sdk_spark-ffi.js";
6
- import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterArrayBuffer, FfiConverterBool, FfiConverterCallback, FfiConverterInt32, FfiConverterObject, FfiConverterObjectWithCallbacks, FfiConverterOptional, FfiConverterUInt32, FfiConverterUInt64, UniffiAbstractObject, UniffiEnum, UniffiError, UniffiInternalError, UniffiResult, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiRustCallAsync, uniffiTraitInterfaceCall, uniffiTraitInterfaceCallAsync, uniffiTraitInterfaceCallAsyncWithError, uniffiTypeNameSymbol } from 'uniffi-bindgen-react-native';
6
+ import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterArrayBuffer, FfiConverterBool, FfiConverterCallback, FfiConverterInt32, FfiConverterMap, FfiConverterObject, FfiConverterObjectWithCallbacks, FfiConverterOptional, FfiConverterUInt32, FfiConverterUInt64, UniffiAbstractObject, UniffiEnum, UniffiError, UniffiInternalError, UniffiResult, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiCreateRecord, uniffiRustCallAsync, uniffiTraitInterfaceCall, uniffiTraitInterfaceCallAsync, uniffiTraitInterfaceCallAsyncWithError, uniffiTypeNameSymbol } from 'uniffi-bindgen-react-native';
7
7
 
8
8
  // Get converters from the other files, if any.
9
9
  import uniffiBreezSdkCommonModule from "./breez_sdk_common.js";
@@ -554,14 +554,16 @@ const FfiConverterTypeGetInfoResponse = (() => {
554
554
  class FFIConverter extends AbstractFfiConverterByteArray {
555
555
  read(from) {
556
556
  return {
557
- balanceSats: FfiConverterUInt64.read(from)
557
+ balanceSats: FfiConverterUInt64.read(from),
558
+ tokenBalances: FfiConverterMapStringTypeTokenBalance.read(from)
558
559
  };
559
560
  }
560
561
  write(value, into) {
561
562
  FfiConverterUInt64.write(value.balanceSats, into);
563
+ FfiConverterMapStringTypeTokenBalance.write(value.tokenBalances, into);
562
564
  }
563
565
  allocationSize(value) {
564
- return FfiConverterUInt64.allocationSize(value.balanceSats);
566
+ return FfiConverterUInt64.allocationSize(value.balanceSats) + FfiConverterMapStringTypeTokenBalance.allocationSize(value.tokenBalances);
565
567
  }
566
568
  }
567
569
  return new FFIConverter();
@@ -648,6 +650,88 @@ const FfiConverterTypeGetPaymentResponse = (() => {
648
650
  }
649
651
  return new FFIConverter();
650
652
  })();
653
+ /**
654
+ * Generated factory for {@link GetTokensMetadataRequest} record objects.
655
+ */
656
+ export const GetTokensMetadataRequest = (() => {
657
+ const defaults = () => ({});
658
+ const create = (() => {
659
+ return uniffiCreateRecord(defaults);
660
+ })();
661
+ return Object.freeze({
662
+ /**
663
+ * Create a frozen instance of {@link GetTokensMetadataRequest}, with defaults specified
664
+ * in Rust, in the {@link breez_sdk_spark} crate.
665
+ */
666
+ create,
667
+ /**
668
+ * Create a frozen instance of {@link GetTokensMetadataRequest}, with defaults specified
669
+ * in Rust, in the {@link breez_sdk_spark} crate.
670
+ */
671
+ new: create,
672
+ /**
673
+ * Defaults specified in the {@link breez_sdk_spark} crate.
674
+ */
675
+ defaults: () => Object.freeze(defaults())
676
+ });
677
+ })();
678
+ const FfiConverterTypeGetTokensMetadataRequest = (() => {
679
+ class FFIConverter extends AbstractFfiConverterByteArray {
680
+ read(from) {
681
+ return {
682
+ tokenIdentifiers: FfiConverterArrayString.read(from)
683
+ };
684
+ }
685
+ write(value, into) {
686
+ FfiConverterArrayString.write(value.tokenIdentifiers, into);
687
+ }
688
+ allocationSize(value) {
689
+ return FfiConverterArrayString.allocationSize(value.tokenIdentifiers);
690
+ }
691
+ }
692
+ return new FFIConverter();
693
+ })();
694
+ /**
695
+ * Generated factory for {@link GetTokensMetadataResponse} record objects.
696
+ */
697
+ export const GetTokensMetadataResponse = (() => {
698
+ const defaults = () => ({});
699
+ const create = (() => {
700
+ return uniffiCreateRecord(defaults);
701
+ })();
702
+ return Object.freeze({
703
+ /**
704
+ * Create a frozen instance of {@link GetTokensMetadataResponse}, with defaults specified
705
+ * in Rust, in the {@link breez_sdk_spark} crate.
706
+ */
707
+ create,
708
+ /**
709
+ * Create a frozen instance of {@link GetTokensMetadataResponse}, with defaults specified
710
+ * in Rust, in the {@link breez_sdk_spark} crate.
711
+ */
712
+ new: create,
713
+ /**
714
+ * Defaults specified in the {@link breez_sdk_spark} crate.
715
+ */
716
+ defaults: () => Object.freeze(defaults())
717
+ });
718
+ })();
719
+ const FfiConverterTypeGetTokensMetadataResponse = (() => {
720
+ class FFIConverter extends AbstractFfiConverterByteArray {
721
+ read(from) {
722
+ return {
723
+ tokensMetadata: FfiConverterArrayTypeTokenMetadata.read(from)
724
+ };
725
+ }
726
+ write(value, into) {
727
+ FfiConverterArrayTypeTokenMetadata.write(value.tokensMetadata, into);
728
+ }
729
+ allocationSize(value) {
730
+ return FfiConverterArrayTypeTokenMetadata.allocationSize(value.tokensMetadata);
731
+ }
732
+ }
733
+ return new FFIConverter();
734
+ })();
651
735
  /**
652
736
  * Generated factory for {@link LightningAddressInfo} record objects.
653
737
  */
@@ -789,7 +873,7 @@ const FfiConverterTypeListFiatRatesResponse = (() => {
789
873
  })();
790
874
 
791
875
  /**
792
- * Request to list payments with pagination
876
+ * Request to list payments with optional filters and pagination
793
877
  */
794
878
 
795
879
  /**
@@ -797,8 +881,14 @@ const FfiConverterTypeListFiatRatesResponse = (() => {
797
881
  */
798
882
  export const ListPaymentsRequest = (() => {
799
883
  const defaults = () => ({
884
+ typeFilter: undefined,
885
+ statusFilter: undefined,
886
+ assetFilter: undefined,
887
+ fromTimestamp: undefined,
888
+ toTimestamp: undefined,
800
889
  offset: undefined,
801
- limit: undefined
890
+ limit: undefined,
891
+ sortAscending: undefined
802
892
  });
803
893
  const create = (() => {
804
894
  return uniffiCreateRecord(defaults);
@@ -824,16 +914,28 @@ const FfiConverterTypeListPaymentsRequest = (() => {
824
914
  class FFIConverter extends AbstractFfiConverterByteArray {
825
915
  read(from) {
826
916
  return {
917
+ typeFilter: FfiConverterOptionalArrayTypePaymentType.read(from),
918
+ statusFilter: FfiConverterOptionalArrayTypePaymentStatus.read(from),
919
+ assetFilter: FfiConverterOptionalTypeAssetFilter.read(from),
920
+ fromTimestamp: FfiConverterOptionalUInt64.read(from),
921
+ toTimestamp: FfiConverterOptionalUInt64.read(from),
827
922
  offset: FfiConverterOptionalUInt32.read(from),
828
- limit: FfiConverterOptionalUInt32.read(from)
923
+ limit: FfiConverterOptionalUInt32.read(from),
924
+ sortAscending: FfiConverterOptionalBool.read(from)
829
925
  };
830
926
  }
831
927
  write(value, into) {
928
+ FfiConverterOptionalArrayTypePaymentType.write(value.typeFilter, into);
929
+ FfiConverterOptionalArrayTypePaymentStatus.write(value.statusFilter, into);
930
+ FfiConverterOptionalTypeAssetFilter.write(value.assetFilter, into);
931
+ FfiConverterOptionalUInt64.write(value.fromTimestamp, into);
932
+ FfiConverterOptionalUInt64.write(value.toTimestamp, into);
832
933
  FfiConverterOptionalUInt32.write(value.offset, into);
833
934
  FfiConverterOptionalUInt32.write(value.limit, into);
935
+ FfiConverterOptionalBool.write(value.sortAscending, into);
834
936
  }
835
937
  allocationSize(value) {
836
- return FfiConverterOptionalUInt32.allocationSize(value.offset) + FfiConverterOptionalUInt32.allocationSize(value.limit);
938
+ return FfiConverterOptionalArrayTypePaymentType.allocationSize(value.typeFilter) + FfiConverterOptionalArrayTypePaymentStatus.allocationSize(value.statusFilter) + FfiConverterOptionalTypeAssetFilter.allocationSize(value.assetFilter) + FfiConverterOptionalUInt64.allocationSize(value.fromTimestamp) + FfiConverterOptionalUInt64.allocationSize(value.toTimestamp) + FfiConverterOptionalUInt32.allocationSize(value.offset) + FfiConverterOptionalUInt32.allocationSize(value.limit) + FfiConverterOptionalBool.allocationSize(value.sortAscending);
837
939
  }
838
940
  }
839
941
  return new FFIConverter();
@@ -1182,8 +1284,8 @@ const FfiConverterTypePayment = (() => {
1182
1284
  id: FfiConverterString.read(from),
1183
1285
  paymentType: FfiConverterTypePaymentType.read(from),
1184
1286
  status: FfiConverterTypePaymentStatus.read(from),
1185
- amount: FfiConverterUInt64.read(from),
1186
- fees: FfiConverterUInt64.read(from),
1287
+ amount: FfiConverterTypeu128.read(from),
1288
+ fees: FfiConverterTypeu128.read(from),
1187
1289
  timestamp: FfiConverterUInt64.read(from),
1188
1290
  method: FfiConverterTypePaymentMethod.read(from),
1189
1291
  details: FfiConverterOptionalTypePaymentDetails.read(from)
@@ -1193,14 +1295,14 @@ const FfiConverterTypePayment = (() => {
1193
1295
  FfiConverterString.write(value.id, into);
1194
1296
  FfiConverterTypePaymentType.write(value.paymentType, into);
1195
1297
  FfiConverterTypePaymentStatus.write(value.status, into);
1196
- FfiConverterUInt64.write(value.amount, into);
1197
- FfiConverterUInt64.write(value.fees, into);
1298
+ FfiConverterTypeu128.write(value.amount, into);
1299
+ FfiConverterTypeu128.write(value.fees, into);
1198
1300
  FfiConverterUInt64.write(value.timestamp, into);
1199
1301
  FfiConverterTypePaymentMethod.write(value.method, into);
1200
1302
  FfiConverterOptionalTypePaymentDetails.write(value.details, into);
1201
1303
  }
1202
1304
  allocationSize(value) {
1203
- return FfiConverterString.allocationSize(value.id) + FfiConverterTypePaymentType.allocationSize(value.paymentType) + FfiConverterTypePaymentStatus.allocationSize(value.status) + FfiConverterUInt64.allocationSize(value.amount) + FfiConverterUInt64.allocationSize(value.fees) + FfiConverterUInt64.allocationSize(value.timestamp) + FfiConverterTypePaymentMethod.allocationSize(value.method) + FfiConverterOptionalTypePaymentDetails.allocationSize(value.details);
1305
+ return FfiConverterString.allocationSize(value.id) + FfiConverterTypePaymentType.allocationSize(value.paymentType) + FfiConverterTypePaymentStatus.allocationSize(value.status) + FfiConverterTypeu128.allocationSize(value.amount) + FfiConverterTypeu128.allocationSize(value.fees) + FfiConverterUInt64.allocationSize(value.timestamp) + FfiConverterTypePaymentMethod.allocationSize(value.method) + FfiConverterOptionalTypePaymentDetails.allocationSize(value.details);
1204
1306
  }
1205
1307
  }
1206
1308
  return new FFIConverter();
@@ -1359,7 +1461,8 @@ const FfiConverterTypePrepareLnurlPayResponse = (() => {
1359
1461
  */
1360
1462
  export const PrepareSendPaymentRequest = (() => {
1361
1463
  const defaults = () => ({
1362
- amountSats: undefined
1464
+ amount: undefined,
1465
+ tokenIdentifier: undefined
1363
1466
  });
1364
1467
  const create = (() => {
1365
1468
  return uniffiCreateRecord(defaults);
@@ -1386,15 +1489,17 @@ const FfiConverterTypePrepareSendPaymentRequest = (() => {
1386
1489
  read(from) {
1387
1490
  return {
1388
1491
  paymentRequest: FfiConverterString.read(from),
1389
- amountSats: FfiConverterOptionalUInt64.read(from)
1492
+ amount: FfiConverterOptionalTypeu128.read(from),
1493
+ tokenIdentifier: FfiConverterOptionalString.read(from)
1390
1494
  };
1391
1495
  }
1392
1496
  write(value, into) {
1393
1497
  FfiConverterString.write(value.paymentRequest, into);
1394
- FfiConverterOptionalUInt64.write(value.amountSats, into);
1498
+ FfiConverterOptionalTypeu128.write(value.amount, into);
1499
+ FfiConverterOptionalString.write(value.tokenIdentifier, into);
1395
1500
  }
1396
1501
  allocationSize(value) {
1397
- return FfiConverterString.allocationSize(value.paymentRequest) + FfiConverterOptionalUInt64.allocationSize(value.amountSats);
1502
+ return FfiConverterString.allocationSize(value.paymentRequest) + FfiConverterOptionalTypeu128.allocationSize(value.amount) + FfiConverterOptionalString.allocationSize(value.tokenIdentifier);
1398
1503
  }
1399
1504
  }
1400
1505
  return new FFIConverter();
@@ -1429,15 +1534,17 @@ const FfiConverterTypePrepareSendPaymentResponse = (() => {
1429
1534
  read(from) {
1430
1535
  return {
1431
1536
  paymentMethod: FfiConverterTypeSendPaymentMethod.read(from),
1432
- amountSats: FfiConverterUInt64.read(from)
1537
+ amount: FfiConverterTypeu128.read(from),
1538
+ tokenIdentifier: FfiConverterOptionalString.read(from)
1433
1539
  };
1434
1540
  }
1435
1541
  write(value, into) {
1436
1542
  FfiConverterTypeSendPaymentMethod.write(value.paymentMethod, into);
1437
- FfiConverterUInt64.write(value.amountSats, into);
1543
+ FfiConverterTypeu128.write(value.amount, into);
1544
+ FfiConverterOptionalString.write(value.tokenIdentifier, into);
1438
1545
  }
1439
1546
  allocationSize(value) {
1440
- return FfiConverterTypeSendPaymentMethod.allocationSize(value.paymentMethod) + FfiConverterUInt64.allocationSize(value.amountSats);
1547
+ return FfiConverterTypeSendPaymentMethod.allocationSize(value.paymentMethod) + FfiConverterTypeu128.allocationSize(value.amount) + FfiConverterOptionalString.allocationSize(value.tokenIdentifier);
1441
1548
  }
1442
1549
  }
1443
1550
  return new FFIConverter();
@@ -1923,6 +2030,102 @@ const FfiConverterTypeSyncWalletResponse = (() => {
1923
2030
  }
1924
2031
  return new FFIConverter();
1925
2032
  })();
2033
+ /**
2034
+ * Generated factory for {@link TokenBalance} record objects.
2035
+ */
2036
+ export const TokenBalance = (() => {
2037
+ const defaults = () => ({});
2038
+ const create = (() => {
2039
+ return uniffiCreateRecord(defaults);
2040
+ })();
2041
+ return Object.freeze({
2042
+ /**
2043
+ * Create a frozen instance of {@link TokenBalance}, with defaults specified
2044
+ * in Rust, in the {@link breez_sdk_spark} crate.
2045
+ */
2046
+ create,
2047
+ /**
2048
+ * Create a frozen instance of {@link TokenBalance}, with defaults specified
2049
+ * in Rust, in the {@link breez_sdk_spark} crate.
2050
+ */
2051
+ new: create,
2052
+ /**
2053
+ * Defaults specified in the {@link breez_sdk_spark} crate.
2054
+ */
2055
+ defaults: () => Object.freeze(defaults())
2056
+ });
2057
+ })();
2058
+ const FfiConverterTypeTokenBalance = (() => {
2059
+ class FFIConverter extends AbstractFfiConverterByteArray {
2060
+ read(from) {
2061
+ return {
2062
+ balance: FfiConverterTypeu128.read(from),
2063
+ tokenMetadata: FfiConverterTypeTokenMetadata.read(from)
2064
+ };
2065
+ }
2066
+ write(value, into) {
2067
+ FfiConverterTypeu128.write(value.balance, into);
2068
+ FfiConverterTypeTokenMetadata.write(value.tokenMetadata, into);
2069
+ }
2070
+ allocationSize(value) {
2071
+ return FfiConverterTypeu128.allocationSize(value.balance) + FfiConverterTypeTokenMetadata.allocationSize(value.tokenMetadata);
2072
+ }
2073
+ }
2074
+ return new FFIConverter();
2075
+ })();
2076
+ /**
2077
+ * Generated factory for {@link TokenMetadata} record objects.
2078
+ */
2079
+ export const TokenMetadata = (() => {
2080
+ const defaults = () => ({});
2081
+ const create = (() => {
2082
+ return uniffiCreateRecord(defaults);
2083
+ })();
2084
+ return Object.freeze({
2085
+ /**
2086
+ * Create a frozen instance of {@link TokenMetadata}, with defaults specified
2087
+ * in Rust, in the {@link breez_sdk_spark} crate.
2088
+ */
2089
+ create,
2090
+ /**
2091
+ * Create a frozen instance of {@link TokenMetadata}, with defaults specified
2092
+ * in Rust, in the {@link breez_sdk_spark} crate.
2093
+ */
2094
+ new: create,
2095
+ /**
2096
+ * Defaults specified in the {@link breez_sdk_spark} crate.
2097
+ */
2098
+ defaults: () => Object.freeze(defaults())
2099
+ });
2100
+ })();
2101
+ const FfiConverterTypeTokenMetadata = (() => {
2102
+ class FFIConverter extends AbstractFfiConverterByteArray {
2103
+ read(from) {
2104
+ return {
2105
+ identifier: FfiConverterString.read(from),
2106
+ issuerPublicKey: FfiConverterString.read(from),
2107
+ name: FfiConverterString.read(from),
2108
+ ticker: FfiConverterString.read(from),
2109
+ decimals: FfiConverterUInt32.read(from),
2110
+ maxSupply: FfiConverterTypeu128.read(from),
2111
+ isFreezable: FfiConverterBool.read(from)
2112
+ };
2113
+ }
2114
+ write(value, into) {
2115
+ FfiConverterString.write(value.identifier, into);
2116
+ FfiConverterString.write(value.issuerPublicKey, into);
2117
+ FfiConverterString.write(value.name, into);
2118
+ FfiConverterString.write(value.ticker, into);
2119
+ FfiConverterUInt32.write(value.decimals, into);
2120
+ FfiConverterTypeu128.write(value.maxSupply, into);
2121
+ FfiConverterBool.write(value.isFreezable, into);
2122
+ }
2123
+ allocationSize(value) {
2124
+ return FfiConverterString.allocationSize(value.identifier) + FfiConverterString.allocationSize(value.issuerPublicKey) + FfiConverterString.allocationSize(value.name) + FfiConverterString.allocationSize(value.ticker) + FfiConverterUInt32.allocationSize(value.decimals) + FfiConverterTypeu128.allocationSize(value.maxSupply) + FfiConverterBool.allocationSize(value.isFreezable);
2125
+ }
2126
+ }
2127
+ return new FFIConverter();
2128
+ })();
1926
2129
  /**
1927
2130
  * Generated factory for {@link TxStatus} record objects.
1928
2131
  */
@@ -2015,12 +2218,242 @@ const FfiConverterTypeUtxo = (() => {
2015
2218
  }
2016
2219
  return new FFIConverter();
2017
2220
  })();
2018
- const stringConverter = {
2019
- stringToBytes: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(s, status)),
2020
- bytesToString: ab => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(ab, status)),
2021
- stringByteLength: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(s, status))
2022
- };
2023
- const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
2221
+ /**
2222
+ * Generated factory for {@link WaitForPaymentRequest} record objects.
2223
+ */
2224
+ export const WaitForPaymentRequest = (() => {
2225
+ const defaults = () => ({});
2226
+ const create = (() => {
2227
+ return uniffiCreateRecord(defaults);
2228
+ })();
2229
+ return Object.freeze({
2230
+ /**
2231
+ * Create a frozen instance of {@link WaitForPaymentRequest}, with defaults specified
2232
+ * in Rust, in the {@link breez_sdk_spark} crate.
2233
+ */
2234
+ create,
2235
+ /**
2236
+ * Create a frozen instance of {@link WaitForPaymentRequest}, with defaults specified
2237
+ * in Rust, in the {@link breez_sdk_spark} crate.
2238
+ */
2239
+ new: create,
2240
+ /**
2241
+ * Defaults specified in the {@link breez_sdk_spark} crate.
2242
+ */
2243
+ defaults: () => Object.freeze(defaults())
2244
+ });
2245
+ })();
2246
+ const FfiConverterTypeWaitForPaymentRequest = (() => {
2247
+ class FFIConverter extends AbstractFfiConverterByteArray {
2248
+ read(from) {
2249
+ return {
2250
+ identifier: FfiConverterTypeWaitForPaymentIdentifier.read(from)
2251
+ };
2252
+ }
2253
+ write(value, into) {
2254
+ FfiConverterTypeWaitForPaymentIdentifier.write(value.identifier, into);
2255
+ }
2256
+ allocationSize(value) {
2257
+ return FfiConverterTypeWaitForPaymentIdentifier.allocationSize(value.identifier);
2258
+ }
2259
+ }
2260
+ return new FFIConverter();
2261
+ })();
2262
+ /**
2263
+ * Generated factory for {@link WaitForPaymentResponse} record objects.
2264
+ */
2265
+ export const WaitForPaymentResponse = (() => {
2266
+ const defaults = () => ({});
2267
+ const create = (() => {
2268
+ return uniffiCreateRecord(defaults);
2269
+ })();
2270
+ return Object.freeze({
2271
+ /**
2272
+ * Create a frozen instance of {@link WaitForPaymentResponse}, with defaults specified
2273
+ * in Rust, in the {@link breez_sdk_spark} crate.
2274
+ */
2275
+ create,
2276
+ /**
2277
+ * Create a frozen instance of {@link WaitForPaymentResponse}, with defaults specified
2278
+ * in Rust, in the {@link breez_sdk_spark} crate.
2279
+ */
2280
+ new: create,
2281
+ /**
2282
+ * Defaults specified in the {@link breez_sdk_spark} crate.
2283
+ */
2284
+ defaults: () => Object.freeze(defaults())
2285
+ });
2286
+ })();
2287
+ const FfiConverterTypeWaitForPaymentResponse = (() => {
2288
+ class FFIConverter extends AbstractFfiConverterByteArray {
2289
+ read(from) {
2290
+ return {
2291
+ payment: FfiConverterTypePayment.read(from)
2292
+ };
2293
+ }
2294
+ write(value, into) {
2295
+ FfiConverterTypePayment.write(value.payment, into);
2296
+ }
2297
+ allocationSize(value) {
2298
+ return FfiConverterTypePayment.allocationSize(value.payment);
2299
+ }
2300
+ }
2301
+ return new FFIConverter();
2302
+ })();
2303
+ const stringConverter = {
2304
+ stringToBytes: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(s, status)),
2305
+ bytesToString: ab => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(ab, status)),
2306
+ stringByteLength: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(s, status))
2307
+ };
2308
+ const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
2309
+
2310
+ /**
2311
+ * Typealias from the type name used in the UDL file to the custom type. This
2312
+ * is needed because the UDL type name is used in function/method signatures.
2313
+ */
2314
+
2315
+ // FfiConverter for U128
2316
+ const FfiConverterTypeu128 = (() => {
2317
+ const intermediateConverter = FfiConverterString;
2318
+ class FFIConverter {
2319
+ lift(value) {
2320
+ const intermediate = intermediateConverter.lift(value);
2321
+ return BigInt(intermediate);
2322
+ }
2323
+ lower(value) {
2324
+ const intermediate = value.toString();
2325
+ return intermediateConverter.lower(intermediate);
2326
+ }
2327
+ read(from) {
2328
+ const intermediate = intermediateConverter.read(from);
2329
+ return BigInt(intermediate);
2330
+ }
2331
+ write(value, into) {
2332
+ const intermediate = value.toString();
2333
+ intermediateConverter.write(intermediate, into);
2334
+ }
2335
+ allocationSize(value) {
2336
+ const intermediate = value.toString();
2337
+ return intermediateConverter.allocationSize(intermediate);
2338
+ }
2339
+ }
2340
+ return new FFIConverter();
2341
+ })();
2342
+
2343
+ // Enum: AssetFilter
2344
+ export let AssetFilter_Tags = /*#__PURE__*/function (AssetFilter_Tags) {
2345
+ AssetFilter_Tags["Bitcoin"] = "Bitcoin";
2346
+ AssetFilter_Tags["Token"] = "Token";
2347
+ return AssetFilter_Tags;
2348
+ }({});
2349
+ /**
2350
+ * A field of [`ListPaymentsRequest`] when listing payments filtered by asset
2351
+ */
2352
+ export const AssetFilter = (() => {
2353
+ class Bitcoin_ extends UniffiEnum {
2354
+ /**
2355
+ * @private
2356
+ * This field is private and should not be used, use `tag` instead.
2357
+ */
2358
+ [uniffiTypeNameSymbol] = 'AssetFilter';
2359
+ tag = AssetFilter_Tags.Bitcoin;
2360
+ constructor() {
2361
+ super('AssetFilter', 'Bitcoin');
2362
+ }
2363
+ static new() {
2364
+ return new Bitcoin_();
2365
+ }
2366
+ static instanceOf(obj) {
2367
+ return obj.tag === AssetFilter_Tags.Bitcoin;
2368
+ }
2369
+ }
2370
+ class Token_ extends UniffiEnum {
2371
+ /**
2372
+ * @private
2373
+ * This field is private and should not be used, use `tag` instead.
2374
+ */
2375
+ [uniffiTypeNameSymbol] = 'AssetFilter';
2376
+ tag = AssetFilter_Tags.Token;
2377
+ constructor(inner) {
2378
+ super('AssetFilter', 'Token');
2379
+ this.inner = Object.freeze(inner);
2380
+ }
2381
+ static new(inner) {
2382
+ return new Token_(inner);
2383
+ }
2384
+ static instanceOf(obj) {
2385
+ return obj.tag === AssetFilter_Tags.Token;
2386
+ }
2387
+ }
2388
+ function instanceOf(obj) {
2389
+ return obj[uniffiTypeNameSymbol] === 'AssetFilter';
2390
+ }
2391
+ return Object.freeze({
2392
+ instanceOf,
2393
+ Bitcoin: Bitcoin_,
2394
+ Token: Token_
2395
+ });
2396
+ })();
2397
+
2398
+ /**
2399
+ * A field of [`ListPaymentsRequest`] when listing payments filtered by asset
2400
+ */
2401
+
2402
+ // FfiConverter for enum AssetFilter
2403
+ const FfiConverterTypeAssetFilter = (() => {
2404
+ const ordinalConverter = FfiConverterInt32;
2405
+ class FFIConverter extends AbstractFfiConverterByteArray {
2406
+ read(from) {
2407
+ switch (ordinalConverter.read(from)) {
2408
+ case 1:
2409
+ return new AssetFilter.Bitcoin();
2410
+ case 2:
2411
+ return new AssetFilter.Token({
2412
+ tokenIdentifier: FfiConverterOptionalString.read(from)
2413
+ });
2414
+ default:
2415
+ throw new UniffiInternalError.UnexpectedEnumCase();
2416
+ }
2417
+ }
2418
+ write(value, into) {
2419
+ switch (value.tag) {
2420
+ case AssetFilter_Tags.Bitcoin:
2421
+ {
2422
+ ordinalConverter.write(1, into);
2423
+ return;
2424
+ }
2425
+ case AssetFilter_Tags.Token:
2426
+ {
2427
+ ordinalConverter.write(2, into);
2428
+ const inner = value.inner;
2429
+ FfiConverterOptionalString.write(inner.tokenIdentifier, into);
2430
+ return;
2431
+ }
2432
+ default:
2433
+ // Throwing from here means that AssetFilter_Tags hasn't matched an ordinal.
2434
+ throw new UniffiInternalError.UnexpectedEnumCase();
2435
+ }
2436
+ }
2437
+ allocationSize(value) {
2438
+ switch (value.tag) {
2439
+ case AssetFilter_Tags.Bitcoin:
2440
+ {
2441
+ return ordinalConverter.allocationSize(1);
2442
+ }
2443
+ case AssetFilter_Tags.Token:
2444
+ {
2445
+ const inner = value.inner;
2446
+ let size = ordinalConverter.allocationSize(2);
2447
+ size += FfiConverterOptionalString.allocationSize(inner.tokenIdentifier);
2448
+ return size;
2449
+ }
2450
+ default:
2451
+ throw new UniffiInternalError.UnexpectedEnumCase();
2452
+ }
2453
+ }
2454
+ }
2455
+ return new FFIConverter();
2456
+ })();
2024
2457
 
2025
2458
  // Error type: ChainServiceError
2026
2459
 
@@ -2588,6 +3021,7 @@ const FfiConverterTypeOnchainConfirmationSpeed = (() => {
2588
3021
  // Enum: PaymentDetails
2589
3022
  export let PaymentDetails_Tags = /*#__PURE__*/function (PaymentDetails_Tags) {
2590
3023
  PaymentDetails_Tags["Spark"] = "Spark";
3024
+ PaymentDetails_Tags["Token"] = "Token";
2591
3025
  PaymentDetails_Tags["Lightning"] = "Lightning";
2592
3026
  PaymentDetails_Tags["Withdraw"] = "Withdraw";
2593
3027
  PaymentDetails_Tags["Deposit"] = "Deposit";
@@ -2611,6 +3045,24 @@ export const PaymentDetails = (() => {
2611
3045
  return obj.tag === PaymentDetails_Tags.Spark;
2612
3046
  }
2613
3047
  }
3048
+ class Token_ extends UniffiEnum {
3049
+ /**
3050
+ * @private
3051
+ * This field is private and should not be used, use `tag` instead.
3052
+ */
3053
+ [uniffiTypeNameSymbol] = 'PaymentDetails';
3054
+ tag = PaymentDetails_Tags.Token;
3055
+ constructor(inner) {
3056
+ super('PaymentDetails', 'Token');
3057
+ this.inner = Object.freeze(inner);
3058
+ }
3059
+ static new(inner) {
3060
+ return new Token_(inner);
3061
+ }
3062
+ static instanceOf(obj) {
3063
+ return obj.tag === PaymentDetails_Tags.Token;
3064
+ }
3065
+ }
2614
3066
  class Lightning_ extends UniffiEnum {
2615
3067
  /**
2616
3068
  * @private
@@ -2671,6 +3123,7 @@ export const PaymentDetails = (() => {
2671
3123
  return Object.freeze({
2672
3124
  instanceOf,
2673
3125
  Spark: Spark_,
3126
+ Token: Token_,
2674
3127
  Lightning: Lightning_,
2675
3128
  Withdraw: Withdraw_,
2676
3129
  Deposit: Deposit_
@@ -2685,6 +3138,11 @@ const FfiConverterTypePaymentDetails = (() => {
2685
3138
  case 1:
2686
3139
  return new PaymentDetails.Spark();
2687
3140
  case 2:
3141
+ return new PaymentDetails.Token({
3142
+ metadata: FfiConverterTypeTokenMetadata.read(from),
3143
+ txHash: FfiConverterString.read(from)
3144
+ });
3145
+ case 3:
2688
3146
  return new PaymentDetails.Lightning({
2689
3147
  description: FfiConverterOptionalString.read(from),
2690
3148
  preimage: FfiConverterOptionalString.read(from),
@@ -2693,11 +3151,11 @@ const FfiConverterTypePaymentDetails = (() => {
2693
3151
  destinationPubkey: FfiConverterString.read(from),
2694
3152
  lnurlPayInfo: FfiConverterOptionalTypeLnurlPayInfo.read(from)
2695
3153
  });
2696
- case 3:
3154
+ case 4:
2697
3155
  return new PaymentDetails.Withdraw({
2698
3156
  txId: FfiConverterString.read(from)
2699
3157
  });
2700
- case 4:
3158
+ case 5:
2701
3159
  return new PaymentDetails.Deposit({
2702
3160
  txId: FfiConverterString.read(from)
2703
3161
  });
@@ -2712,10 +3170,18 @@ const FfiConverterTypePaymentDetails = (() => {
2712
3170
  ordinalConverter.write(1, into);
2713
3171
  return;
2714
3172
  }
2715
- case PaymentDetails_Tags.Lightning:
3173
+ case PaymentDetails_Tags.Token:
2716
3174
  {
2717
3175
  ordinalConverter.write(2, into);
2718
3176
  const inner = value.inner;
3177
+ FfiConverterTypeTokenMetadata.write(inner.metadata, into);
3178
+ FfiConverterString.write(inner.txHash, into);
3179
+ return;
3180
+ }
3181
+ case PaymentDetails_Tags.Lightning:
3182
+ {
3183
+ ordinalConverter.write(3, into);
3184
+ const inner = value.inner;
2719
3185
  FfiConverterOptionalString.write(inner.description, into);
2720
3186
  FfiConverterOptionalString.write(inner.preimage, into);
2721
3187
  FfiConverterString.write(inner.invoice, into);
@@ -2726,14 +3192,14 @@ const FfiConverterTypePaymentDetails = (() => {
2726
3192
  }
2727
3193
  case PaymentDetails_Tags.Withdraw:
2728
3194
  {
2729
- ordinalConverter.write(3, into);
3195
+ ordinalConverter.write(4, into);
2730
3196
  const inner = value.inner;
2731
3197
  FfiConverterString.write(inner.txId, into);
2732
3198
  return;
2733
3199
  }
2734
3200
  case PaymentDetails_Tags.Deposit:
2735
3201
  {
2736
- ordinalConverter.write(4, into);
3202
+ ordinalConverter.write(5, into);
2737
3203
  const inner = value.inner;
2738
3204
  FfiConverterString.write(inner.txId, into);
2739
3205
  return;
@@ -2749,10 +3215,18 @@ const FfiConverterTypePaymentDetails = (() => {
2749
3215
  {
2750
3216
  return ordinalConverter.allocationSize(1);
2751
3217
  }
2752
- case PaymentDetails_Tags.Lightning:
3218
+ case PaymentDetails_Tags.Token:
2753
3219
  {
2754
3220
  const inner = value.inner;
2755
3221
  let size = ordinalConverter.allocationSize(2);
3222
+ size += FfiConverterTypeTokenMetadata.allocationSize(inner.metadata);
3223
+ size += FfiConverterString.allocationSize(inner.txHash);
3224
+ return size;
3225
+ }
3226
+ case PaymentDetails_Tags.Lightning:
3227
+ {
3228
+ const inner = value.inner;
3229
+ let size = ordinalConverter.allocationSize(3);
2756
3230
  size += FfiConverterOptionalString.allocationSize(inner.description);
2757
3231
  size += FfiConverterOptionalString.allocationSize(inner.preimage);
2758
3232
  size += FfiConverterString.allocationSize(inner.invoice);
@@ -2764,14 +3238,14 @@ const FfiConverterTypePaymentDetails = (() => {
2764
3238
  case PaymentDetails_Tags.Withdraw:
2765
3239
  {
2766
3240
  const inner = value.inner;
2767
- let size = ordinalConverter.allocationSize(3);
3241
+ let size = ordinalConverter.allocationSize(4);
2768
3242
  size += FfiConverterString.allocationSize(inner.txId);
2769
3243
  return size;
2770
3244
  }
2771
3245
  case PaymentDetails_Tags.Deposit:
2772
3246
  {
2773
3247
  const inner = value.inner;
2774
- let size = ordinalConverter.allocationSize(4);
3248
+ let size = ordinalConverter.allocationSize(5);
2775
3249
  size += FfiConverterString.allocationSize(inner.txId);
2776
3250
  return size;
2777
3251
  }
@@ -2785,9 +3259,10 @@ const FfiConverterTypePaymentDetails = (() => {
2785
3259
  export let PaymentMethod = /*#__PURE__*/function (PaymentMethod) {
2786
3260
  PaymentMethod[PaymentMethod["Lightning"] = 0] = "Lightning";
2787
3261
  PaymentMethod[PaymentMethod["Spark"] = 1] = "Spark";
2788
- PaymentMethod[PaymentMethod["Deposit"] = 2] = "Deposit";
2789
- PaymentMethod[PaymentMethod["Withdraw"] = 3] = "Withdraw";
2790
- PaymentMethod[PaymentMethod["Unknown"] = 4] = "Unknown";
3262
+ PaymentMethod[PaymentMethod["Token"] = 2] = "Token";
3263
+ PaymentMethod[PaymentMethod["Deposit"] = 3] = "Deposit";
3264
+ PaymentMethod[PaymentMethod["Withdraw"] = 4] = "Withdraw";
3265
+ PaymentMethod[PaymentMethod["Unknown"] = 5] = "Unknown";
2791
3266
  return PaymentMethod;
2792
3267
  }({});
2793
3268
  const FfiConverterTypePaymentMethod = (() => {
@@ -2800,10 +3275,12 @@ const FfiConverterTypePaymentMethod = (() => {
2800
3275
  case 2:
2801
3276
  return PaymentMethod.Spark;
2802
3277
  case 3:
2803
- return PaymentMethod.Deposit;
3278
+ return PaymentMethod.Token;
2804
3279
  case 4:
2805
- return PaymentMethod.Withdraw;
3280
+ return PaymentMethod.Deposit;
2806
3281
  case 5:
3282
+ return PaymentMethod.Withdraw;
3283
+ case 6:
2807
3284
  return PaymentMethod.Unknown;
2808
3285
  default:
2809
3286
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -2815,12 +3292,14 @@ const FfiConverterTypePaymentMethod = (() => {
2815
3292
  return ordinalConverter.write(1, into);
2816
3293
  case PaymentMethod.Spark:
2817
3294
  return ordinalConverter.write(2, into);
2818
- case PaymentMethod.Deposit:
3295
+ case PaymentMethod.Token:
2819
3296
  return ordinalConverter.write(3, into);
2820
- case PaymentMethod.Withdraw:
3297
+ case PaymentMethod.Deposit:
2821
3298
  return ordinalConverter.write(4, into);
2822
- case PaymentMethod.Unknown:
3299
+ case PaymentMethod.Withdraw:
2823
3300
  return ordinalConverter.write(5, into);
3301
+ case PaymentMethod.Unknown:
3302
+ return ordinalConverter.write(6, into);
2824
3303
  }
2825
3304
  }
2826
3305
  allocationSize(value) {
@@ -4015,7 +4494,8 @@ const FfiConverterTypeSendPaymentMethod = (() => {
4015
4494
  case 3:
4016
4495
  return new SendPaymentMethod.SparkAddress({
4017
4496
  address: FfiConverterString.read(from),
4018
- feeSats: FfiConverterUInt64.read(from)
4497
+ fee: FfiConverterTypeu128.read(from),
4498
+ tokenIdentifier: FfiConverterOptionalString.read(from)
4019
4499
  });
4020
4500
  default:
4021
4501
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -4045,7 +4525,8 @@ const FfiConverterTypeSendPaymentMethod = (() => {
4045
4525
  ordinalConverter.write(3, into);
4046
4526
  const inner = value.inner;
4047
4527
  FfiConverterString.write(inner.address, into);
4048
- FfiConverterUInt64.write(inner.feeSats, into);
4528
+ FfiConverterTypeu128.write(inner.fee, into);
4529
+ FfiConverterOptionalString.write(inner.tokenIdentifier, into);
4049
4530
  return;
4050
4531
  }
4051
4532
  default:
@@ -4077,7 +4558,8 @@ const FfiConverterTypeSendPaymentMethod = (() => {
4077
4558
  const inner = value.inner;
4078
4559
  let size = ordinalConverter.allocationSize(3);
4079
4560
  size += FfiConverterString.allocationSize(inner.address);
4080
- size += FfiConverterUInt64.allocationSize(inner.feeSats);
4561
+ size += FfiConverterTypeu128.allocationSize(inner.fee);
4562
+ size += FfiConverterOptionalString.allocationSize(inner.tokenIdentifier);
4081
4563
  return size;
4082
4564
  }
4083
4565
  default:
@@ -4152,7 +4634,8 @@ const FfiConverterTypeSendPaymentOptions = (() => {
4152
4634
  });
4153
4635
  case 2:
4154
4636
  return new SendPaymentOptions.Bolt11Invoice({
4155
- preferSpark: FfiConverterBool.read(from)
4637
+ preferSpark: FfiConverterBool.read(from),
4638
+ completionTimeoutSecs: FfiConverterOptionalUInt32.read(from)
4156
4639
  });
4157
4640
  default:
4158
4641
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -4172,6 +4655,7 @@ const FfiConverterTypeSendPaymentOptions = (() => {
4172
4655
  ordinalConverter.write(2, into);
4173
4656
  const inner = value.inner;
4174
4657
  FfiConverterBool.write(inner.preferSpark, into);
4658
+ FfiConverterOptionalUInt32.write(inner.completionTimeoutSecs, into);
4175
4659
  return;
4176
4660
  }
4177
4661
  default:
@@ -4193,6 +4677,7 @@ const FfiConverterTypeSendPaymentOptions = (() => {
4193
4677
  const inner = value.inner;
4194
4678
  let size = ordinalConverter.allocationSize(2);
4195
4679
  size += FfiConverterBool.allocationSize(inner.preferSpark);
4680
+ size += FfiConverterOptionalUInt32.allocationSize(inner.completionTimeoutSecs);
4196
4681
  return size;
4197
4682
  }
4198
4683
  default:
@@ -4498,6 +4983,120 @@ const FfiConverterTypeUpdateDepositPayload = (() => {
4498
4983
  }
4499
4984
  return new FFIConverter();
4500
4985
  })();
4986
+
4987
+ // Enum: WaitForPaymentIdentifier
4988
+ export let WaitForPaymentIdentifier_Tags = /*#__PURE__*/function (WaitForPaymentIdentifier_Tags) {
4989
+ WaitForPaymentIdentifier_Tags["PaymentId"] = "PaymentId";
4990
+ WaitForPaymentIdentifier_Tags["PaymentRequest"] = "PaymentRequest";
4991
+ return WaitForPaymentIdentifier_Tags;
4992
+ }({});
4993
+ export const WaitForPaymentIdentifier = (() => {
4994
+ class PaymentId_ extends UniffiEnum {
4995
+ /**
4996
+ * @private
4997
+ * This field is private and should not be used, use `tag` instead.
4998
+ */
4999
+ [uniffiTypeNameSymbol] = 'WaitForPaymentIdentifier';
5000
+ tag = WaitForPaymentIdentifier_Tags.PaymentId;
5001
+ constructor(v0) {
5002
+ super('WaitForPaymentIdentifier', 'PaymentId');
5003
+ this.inner = Object.freeze([v0]);
5004
+ }
5005
+ static new(v0) {
5006
+ return new PaymentId_(v0);
5007
+ }
5008
+ static instanceOf(obj) {
5009
+ return obj.tag === WaitForPaymentIdentifier_Tags.PaymentId;
5010
+ }
5011
+ }
5012
+ class PaymentRequest_ extends UniffiEnum {
5013
+ /**
5014
+ * @private
5015
+ * This field is private and should not be used, use `tag` instead.
5016
+ */
5017
+ [uniffiTypeNameSymbol] = 'WaitForPaymentIdentifier';
5018
+ tag = WaitForPaymentIdentifier_Tags.PaymentRequest;
5019
+ constructor(v0) {
5020
+ super('WaitForPaymentIdentifier', 'PaymentRequest');
5021
+ this.inner = Object.freeze([v0]);
5022
+ }
5023
+ static new(v0) {
5024
+ return new PaymentRequest_(v0);
5025
+ }
5026
+ static instanceOf(obj) {
5027
+ return obj.tag === WaitForPaymentIdentifier_Tags.PaymentRequest;
5028
+ }
5029
+ }
5030
+ function instanceOf(obj) {
5031
+ return obj[uniffiTypeNameSymbol] === 'WaitForPaymentIdentifier';
5032
+ }
5033
+ return Object.freeze({
5034
+ instanceOf,
5035
+ PaymentId: PaymentId_,
5036
+ PaymentRequest: PaymentRequest_
5037
+ });
5038
+ })();
5039
+ // FfiConverter for enum WaitForPaymentIdentifier
5040
+ const FfiConverterTypeWaitForPaymentIdentifier = (() => {
5041
+ const ordinalConverter = FfiConverterInt32;
5042
+ class FFIConverter extends AbstractFfiConverterByteArray {
5043
+ read(from) {
5044
+ switch (ordinalConverter.read(from)) {
5045
+ case 1:
5046
+ return new WaitForPaymentIdentifier.PaymentId(FfiConverterString.read(from));
5047
+ case 2:
5048
+ return new WaitForPaymentIdentifier.PaymentRequest(FfiConverterString.read(from));
5049
+ default:
5050
+ throw new UniffiInternalError.UnexpectedEnumCase();
5051
+ }
5052
+ }
5053
+ write(value, into) {
5054
+ switch (value.tag) {
5055
+ case WaitForPaymentIdentifier_Tags.PaymentId:
5056
+ {
5057
+ ordinalConverter.write(1, into);
5058
+ const inner = value.inner;
5059
+ FfiConverterString.write(inner[0], into);
5060
+ return;
5061
+ }
5062
+ case WaitForPaymentIdentifier_Tags.PaymentRequest:
5063
+ {
5064
+ ordinalConverter.write(2, into);
5065
+ const inner = value.inner;
5066
+ FfiConverterString.write(inner[0], into);
5067
+ return;
5068
+ }
5069
+ default:
5070
+ // Throwing from here means that WaitForPaymentIdentifier_Tags hasn't matched an ordinal.
5071
+ throw new UniffiInternalError.UnexpectedEnumCase();
5072
+ }
5073
+ }
5074
+ allocationSize(value) {
5075
+ switch (value.tag) {
5076
+ case WaitForPaymentIdentifier_Tags.PaymentId:
5077
+ {
5078
+ const inner = value.inner;
5079
+ let size = ordinalConverter.allocationSize(1);
5080
+ size += FfiConverterString.allocationSize(inner[0]);
5081
+ return size;
5082
+ }
5083
+ case WaitForPaymentIdentifier_Tags.PaymentRequest:
5084
+ {
5085
+ const inner = value.inner;
5086
+ let size = ordinalConverter.allocationSize(2);
5087
+ size += FfiConverterString.allocationSize(inner[0]);
5088
+ return size;
5089
+ }
5090
+ default:
5091
+ throw new UniffiInternalError.UnexpectedEnumCase();
5092
+ }
5093
+ }
5094
+ }
5095
+ return new FFIConverter();
5096
+ })();
5097
+
5098
+ // FfiConverter for Map<string, TokenBalance>
5099
+ const FfiConverterMapStringTypeTokenBalance = new FfiConverterMap(FfiConverterString, FfiConverterTypeTokenBalance);
4501
5100
  export class BitcoinChainServiceImpl extends UniffiAbstractObject {
4502
5101
  [uniffiTypeNameSymbol] = 'BitcoinChainServiceImpl';
4503
5102
  // No primary constructor declared for this class.
@@ -4820,10 +5419,18 @@ export class BreezSdk extends UniffiAbstractObject {
4820
5419
  *
4821
5420
  * Result containing either success or an `SdkError` if the background task couldn't be stopped
4822
5421
  */
4823
- disconnect() /*throws*/{
4824
- uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError), /*caller:*/callStatus => {
4825
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_disconnect(uniffiTypeBreezSdkObjectFactory.clonePointer(this), callStatus);
4826
- }, /*liftString:*/FfiConverterString.lift);
5422
+ async disconnect(asyncOpts_) /*throws*/{
5423
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
5424
+ try {
5425
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5426
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_disconnect(uniffiTypeBreezSdkObjectFactory.clonePointer(this));
5427
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_void, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_void, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_void, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_void, /*liftFunc:*/_v => {}, /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
5428
+ } catch (__error) {
5429
+ if (uniffiIsDebug && __error instanceof Error) {
5430
+ __error.stack = __stack;
5431
+ }
5432
+ throw __error;
5433
+ }
4827
5434
  }
4828
5435
 
4829
5436
  /**
@@ -4869,6 +5476,28 @@ export class BreezSdk extends UniffiAbstractObject {
4869
5476
  }
4870
5477
  }
4871
5478
 
5479
+ /**
5480
+ * Returns the metadata for the given token identifiers.
5481
+ *
5482
+ * Results are not guaranteed to be in the same order as the input token identifiers.
5483
+ *
5484
+ * If the metadata is not found locally in cache, it will be queried from
5485
+ * the Spark network and then cached.
5486
+ */
5487
+ async getTokensMetadata(request, asyncOpts_) /*throws*/{
5488
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
5489
+ try {
5490
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5491
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_get_tokens_metadata(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypeGetTokensMetadataRequest.lower(request));
5492
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeGetTokensMetadataResponse.lift.bind(FfiConverterTypeGetTokensMetadataResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
5493
+ } catch (__error) {
5494
+ if (uniffiIsDebug && __error instanceof Error) {
5495
+ __error.stack = __stack;
5496
+ }
5497
+ throw __error;
5498
+ }
5499
+ }
5500
+
4872
5501
  /**
4873
5502
  * List fiat currencies for which there is a known exchange rate,
4874
5503
  * sorted by the canonical name of the currency.
@@ -4958,11 +5587,6 @@ export class BreezSdk extends UniffiAbstractObject {
4958
5587
  throw __error;
4959
5588
  }
4960
5589
  }
4961
- pollLightningSendPayment(payment, sspId) {
4962
- uniffiCaller.rustCall(/*caller:*/callStatus => {
4963
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypePayment.lower(payment), FfiConverterString.lower(sspId), callStatus);
4964
- }, /*liftString:*/FfiConverterString.lift);
4965
- }
4966
5590
  async prepareLnurlPay(request, asyncOpts_) /*throws*/{
4967
5591
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
4968
5592
  try {
@@ -5002,23 +5626,6 @@ export class BreezSdk extends UniffiAbstractObject {
5002
5626
  throw __error;
5003
5627
  }
5004
5628
  }
5005
-
5006
- /**
5007
- * Attempts to recover a lightning address from the lnurl server.
5008
- */
5009
- async recoverLightningAddress(asyncOpts_) /*throws*/{
5010
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
5011
- try {
5012
- return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5013
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_recover_lightning_address(uniffiTypeBreezSdkObjectFactory.clonePointer(this));
5014
- }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterOptionalTypeLightningAddressInfo.lift.bind(FfiConverterOptionalTypeLightningAddressInfo), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
5015
- } catch (__error) {
5016
- if (uniffiIsDebug && __error instanceof Error) {
5017
- __error.stack = __stack;
5018
- }
5019
- throw __error;
5020
- }
5021
- }
5022
5629
  async refundDeposit(request, asyncOpts_) /*throws*/{
5023
5630
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
5024
5631
  try {
@@ -5083,12 +5690,16 @@ export class BreezSdk extends UniffiAbstractObject {
5083
5690
  throw __error;
5084
5691
  }
5085
5692
  }
5086
- async sendPaymentInternal(request, suppressPaymentEvent, asyncOpts_) /*throws*/{
5693
+
5694
+ /**
5695
+ * Synchronizes the wallet with the Spark network
5696
+ */
5697
+ async syncWallet(request, asyncOpts_) /*throws*/{
5087
5698
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
5088
5699
  try {
5089
5700
  return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5090
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment_internal(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypeSendPaymentRequest.lower(request), FfiConverterBool.lower(suppressPaymentEvent));
5091
- }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeSendPaymentResponse.lift.bind(FfiConverterTypeSendPaymentResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
5701
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypeSyncWalletRequest.lower(request));
5702
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeSyncWalletResponse.lift.bind(FfiConverterTypeSyncWalletResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
5092
5703
  } catch (__error) {
5093
5704
  if (uniffiIsDebug && __error instanceof Error) {
5094
5705
  __error.stack = __stack;
@@ -5096,16 +5707,12 @@ export class BreezSdk extends UniffiAbstractObject {
5096
5707
  throw __error;
5097
5708
  }
5098
5709
  }
5099
-
5100
- /**
5101
- * Synchronizes the wallet with the Spark network
5102
- */
5103
- async syncWallet(request, asyncOpts_) /*throws*/{
5710
+ async waitForPayment(request, asyncOpts_) /*throws*/{
5104
5711
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
5105
5712
  try {
5106
5713
  return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5107
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypeSyncWalletRequest.lower(request));
5108
- }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeSyncWalletResponse.lift.bind(FfiConverterTypeSyncWalletResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
5714
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_wait_for_payment(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypeWaitForPaymentRequest.lower(request));
5715
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterTypeWaitForPaymentResponse.lift.bind(FfiConverterTypeWaitForPaymentResponse), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeSdkError.lift.bind(FfiConverterTypeSdkError));
5109
5716
  } catch (__error) {
5110
5717
  if (uniffiIsDebug && __error instanceof Error) {
5111
5718
  __error.stack = __stack;
@@ -5403,22 +6010,21 @@ export class StorageImpl extends UniffiAbstractObject {
5403
6010
  }
5404
6011
 
5405
6012
  /**
5406
- * Lists payments with pagination
6013
+ * Lists payments with optional filters and pagination
5407
6014
  *
5408
6015
  * # Arguments
5409
6016
  *
5410
- * * `offset` - Number of records to skip
5411
- * * `limit` - Maximum number of records to return
6017
+ * * `list_payments_request` - The request to list payments
5412
6018
  *
5413
6019
  * # Returns
5414
6020
  *
5415
6021
  * A vector of payments or a `StorageError`
5416
6022
  */
5417
- async listPayments(offset, limit, asyncOpts_) /*throws*/{
6023
+ async listPayments(request, asyncOpts_) /*throws*/{
5418
6024
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
5419
6025
  try {
5420
6026
  return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5421
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_list_payments(uniffiTypeStorageImplObjectFactory.clonePointer(this), FfiConverterOptionalUInt32.lower(offset), FfiConverterOptionalUInt32.lower(limit));
6027
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_list_payments(uniffiTypeStorageImplObjectFactory.clonePointer(this), FfiConverterTypeListPaymentsRequest.lower(request));
5422
6028
  }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterArrayTypePayment.lift.bind(FfiConverterArrayTypePayment), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeStorageError.lift.bind(FfiConverterTypeStorageError));
5423
6029
  } catch (__error) {
5424
6030
  if (uniffiIsDebug && __error instanceof Error) {
@@ -5503,6 +6109,29 @@ export class StorageImpl extends UniffiAbstractObject {
5503
6109
  }
5504
6110
  }
5505
6111
 
6112
+ /**
6113
+ * Gets a payment by its invoice
6114
+ * # Arguments
6115
+ *
6116
+ * * `invoice` - The invoice of the payment to retrieve
6117
+ * # Returns
6118
+ *
6119
+ * The payment if found or None if not found
6120
+ */
6121
+ async getPaymentByInvoice(invoice, asyncOpts_) /*throws*/{
6122
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
6123
+ try {
6124
+ return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
6125
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_get_payment_by_invoice(uniffiTypeStorageImplObjectFactory.clonePointer(this), FfiConverterString.lower(invoice));
6126
+ }, /*pollFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer, /*cancelFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer, /*completeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer, /*freeFunc:*/nativeModule().ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer, /*liftFunc:*/FfiConverterOptionalTypePayment.lift.bind(FfiConverterOptionalTypePayment), /*liftString:*/FfiConverterString.lift, /*asyncOpts:*/asyncOpts_, /*errorHandler:*/FfiConverterTypeStorageError.lift.bind(FfiConverterTypeStorageError));
6127
+ } catch (__error) {
6128
+ if (uniffiIsDebug && __error instanceof Error) {
6129
+ __error.stack = __stack;
6130
+ }
6131
+ throw __error;
6132
+ }
6133
+ }
6134
+
5506
6135
  /**
5507
6136
  * Add a deposit to storage
5508
6137
  * # Arguments
@@ -5731,10 +6360,10 @@ const uniffiCallbackInterfaceStorage = {
5731
6360
  const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/StorageError.instanceOf, /*lowerError:*/FfiConverterTypeStorageError.lower.bind(FfiConverterTypeStorageError), /*lowerString:*/FfiConverterString.lower);
5732
6361
  return UniffiResult.success(uniffiForeignFuture);
5733
6362
  },
5734
- listPayments: (uniffiHandle, offset, limit, uniffiFutureCallback, uniffiCallbackData) => {
6363
+ listPayments: (uniffiHandle, request, uniffiFutureCallback, uniffiCallbackData) => {
5735
6364
  const uniffiMakeCall = async signal => {
5736
6365
  const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
5737
- return await jsCallback.listPayments(FfiConverterOptionalUInt32.lift(offset), FfiConverterOptionalUInt32.lift(limit), {
6366
+ return await jsCallback.listPayments(FfiConverterTypeListPaymentsRequest.lift(request), {
5738
6367
  signal
5739
6368
  });
5740
6369
  };
@@ -5831,6 +6460,32 @@ const uniffiCallbackInterfaceStorage = {
5831
6460
  const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/StorageError.instanceOf, /*lowerError:*/FfiConverterTypeStorageError.lower.bind(FfiConverterTypeStorageError), /*lowerString:*/FfiConverterString.lower);
5832
6461
  return UniffiResult.success(uniffiForeignFuture);
5833
6462
  },
6463
+ getPaymentByInvoice: (uniffiHandle, invoice, uniffiFutureCallback, uniffiCallbackData) => {
6464
+ const uniffiMakeCall = async signal => {
6465
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
6466
+ return await jsCallback.getPaymentByInvoice(FfiConverterString.lift(invoice), {
6467
+ signal
6468
+ });
6469
+ };
6470
+ const uniffiHandleSuccess = returnValue => {
6471
+ uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
6472
+ returnValue: FfiConverterOptionalTypePayment.lower(returnValue),
6473
+ callStatus: uniffiCaller.createCallStatus()
6474
+ });
6475
+ };
6476
+ const uniffiHandleError = (code, errorBuf) => {
6477
+ uniffiFutureCallback(uniffiCallbackData, /* UniffiForeignFutureStructRustBuffer */{
6478
+ returnValue: /*empty*/new Uint8Array(0),
6479
+ // TODO create callstatus with error.
6480
+ callStatus: {
6481
+ code,
6482
+ errorBuf
6483
+ }
6484
+ });
6485
+ };
6486
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/StorageError.instanceOf, /*lowerError:*/FfiConverterTypeStorageError.lower.bind(FfiConverterTypeStorageError), /*lowerString:*/FfiConverterString.lower);
6487
+ return UniffiResult.success(uniffiForeignFuture);
6488
+ },
5834
6489
  addDeposit: (uniffiHandle, txid, vout, amountSats, uniffiFutureCallback, uniffiCallbackData) => {
5835
6490
  const uniffiMakeCall = async signal => {
5836
6491
  const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
@@ -5960,6 +6615,9 @@ const FfiConverterOptionalTypeLightningAddressInfo = new FfiConverterOptional(Ff
5960
6615
  // FfiConverter for LnurlPayInfo | undefined
5961
6616
  const FfiConverterOptionalTypeLnurlPayInfo = new FfiConverterOptional(FfiConverterTypeLnurlPayInfo);
5962
6617
 
6618
+ // FfiConverter for Payment | undefined
6619
+ const FfiConverterOptionalTypePayment = new FfiConverterOptional(FfiConverterTypePayment);
6620
+
5963
6621
  // FfiConverter for string | undefined
5964
6622
  const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
5965
6623
 
@@ -5981,9 +6639,21 @@ const FfiConverterArrayTypeDepositInfo = new FfiConverterArray(FfiConverterTypeD
5981
6639
  // FfiConverter for Array<Payment>
5982
6640
  const FfiConverterArrayTypePayment = new FfiConverterArray(FfiConverterTypePayment);
5983
6641
 
6642
+ // FfiConverter for Array<TokenMetadata>
6643
+ const FfiConverterArrayTypeTokenMetadata = new FfiConverterArray(FfiConverterTypeTokenMetadata);
6644
+
5984
6645
  // FfiConverter for Array<Utxo>
5985
6646
  const FfiConverterArrayTypeUtxo = new FfiConverterArray(FfiConverterTypeUtxo);
5986
6647
 
6648
+ // FfiConverter for Array<string>
6649
+ const FfiConverterArrayString = new FfiConverterArray(FfiConverterString);
6650
+
6651
+ // FfiConverter for U128 | undefined
6652
+ const FfiConverterOptionalTypeu128 = new FfiConverterOptional(FfiConverterTypeu128);
6653
+
6654
+ // FfiConverter for AssetFilter | undefined
6655
+ const FfiConverterOptionalTypeAssetFilter = new FfiConverterOptional(FfiConverterTypeAssetFilter);
6656
+
5987
6657
  // FfiConverter for DepositClaimError | undefined
5988
6658
  const FfiConverterOptionalTypeDepositClaimError = new FfiConverterOptional(FfiConverterTypeDepositClaimError);
5989
6659
 
@@ -5996,6 +6666,18 @@ const FfiConverterOptionalTypePaymentDetails = new FfiConverterOptional(FfiConve
5996
6666
  // FfiConverter for SendPaymentOptions | undefined
5997
6667
  const FfiConverterOptionalTypeSendPaymentOptions = new FfiConverterOptional(FfiConverterTypeSendPaymentOptions);
5998
6668
 
6669
+ // FfiConverter for Array<PaymentStatus>
6670
+ const FfiConverterArrayTypePaymentStatus = new FfiConverterArray(FfiConverterTypePaymentStatus);
6671
+
6672
+ // FfiConverter for Array<PaymentType>
6673
+ const FfiConverterArrayTypePaymentType = new FfiConverterArray(FfiConverterTypePaymentType);
6674
+
6675
+ // FfiConverter for Array<PaymentStatus> | undefined
6676
+ const FfiConverterOptionalArrayTypePaymentStatus = new FfiConverterOptional(FfiConverterArrayTypePaymentStatus);
6677
+
6678
+ // FfiConverter for Array<PaymentType> | undefined
6679
+ const FfiConverterOptionalArrayTypePaymentType = new FfiConverterOptional(FfiConverterArrayTypePaymentType);
6680
+
5999
6681
  /**
6000
6682
  * This should be called before anything else.
6001
6683
  *
@@ -6053,7 +6735,7 @@ function uniffiEnsureInitialized() {
6053
6735
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_delete_lightning_address() !== 44132) {
6054
6736
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_delete_lightning_address');
6055
6737
  }
6056
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_disconnect() !== 30986) {
6738
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_disconnect() !== 330) {
6057
6739
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_disconnect');
6058
6740
  }
6059
6741
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_get_info() !== 6771) {
@@ -6065,6 +6747,9 @@ function uniffiEnsureInitialized() {
6065
6747
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment() !== 11540) {
6066
6748
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment');
6067
6749
  }
6750
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_get_tokens_metadata() !== 40125) {
6751
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_get_tokens_metadata');
6752
+ }
6068
6753
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies() !== 63366) {
6069
6754
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies');
6070
6755
  }
@@ -6080,9 +6765,6 @@ function uniffiEnsureInitialized() {
6080
6765
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay() !== 10147) {
6081
6766
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay');
6082
6767
  }
6083
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment() !== 57601) {
6084
- throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment');
6085
- }
6086
6768
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay() !== 37691) {
6087
6769
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay');
6088
6770
  }
@@ -6092,9 +6774,6 @@ function uniffiEnsureInitialized() {
6092
6774
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_receive_payment() !== 36984) {
6093
6775
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_receive_payment');
6094
6776
  }
6095
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_recover_lightning_address() !== 43367) {
6096
- throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_recover_lightning_address');
6097
- }
6098
6777
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_deposit() !== 33646) {
6099
6778
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_deposit');
6100
6779
  }
@@ -6107,12 +6786,12 @@ function uniffiEnsureInitialized() {
6107
6786
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment() !== 54349) {
6108
6787
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment');
6109
6788
  }
6110
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal() !== 37855) {
6111
- throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal');
6112
- }
6113
6789
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet() !== 30368) {
6114
6790
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet');
6115
6791
  }
6792
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment() !== 64922) {
6793
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment');
6794
+ }
6116
6795
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build() !== 8126) {
6117
6796
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build');
6118
6797
  }
@@ -6140,7 +6819,7 @@ function uniffiEnsureInitialized() {
6140
6819
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_set_cached_item() !== 7970) {
6141
6820
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_set_cached_item');
6142
6821
  }
6143
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_list_payments() !== 35678) {
6822
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_list_payments() !== 19728) {
6144
6823
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_list_payments');
6145
6824
  }
6146
6825
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_insert_payment() !== 28075) {
@@ -6152,16 +6831,19 @@ function uniffiEnsureInitialized() {
6152
6831
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_id() !== 35394) {
6153
6832
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_id');
6154
6833
  }
6155
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_add_deposit() !== 55082) {
6834
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_invoice() !== 57075) {
6835
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_invoice');
6836
+ }
6837
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_add_deposit() !== 60240) {
6156
6838
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_add_deposit');
6157
6839
  }
6158
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_delete_deposit() !== 13111) {
6840
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_delete_deposit() !== 60586) {
6159
6841
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_delete_deposit');
6160
6842
  }
6161
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_list_deposits() !== 22806) {
6843
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_list_deposits() !== 54118) {
6162
6844
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_list_deposits');
6163
6845
  }
6164
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_update_deposit() !== 48478) {
6846
+ if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_update_deposit() !== 39803) {
6165
6847
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_update_deposit');
6166
6848
  }
6167
6849
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new() !== 53882) {
@@ -6181,6 +6863,7 @@ function uniffiEnsureInitialized() {
6181
6863
  export default Object.freeze({
6182
6864
  initialize: uniffiEnsureInitialized,
6183
6865
  converters: {
6866
+ FfiConverterTypeAssetFilter,
6184
6867
  FfiConverterTypeBitcoinChainService,
6185
6868
  FfiConverterTypeBreezSdk,
6186
6869
  FfiConverterTypeCheckLightningAddressRequest,
@@ -6196,6 +6879,8 @@ export default Object.freeze({
6196
6879
  FfiConverterTypeGetInfoResponse,
6197
6880
  FfiConverterTypeGetPaymentRequest,
6198
6881
  FfiConverterTypeGetPaymentResponse,
6882
+ FfiConverterTypeGetTokensMetadataRequest,
6883
+ FfiConverterTypeGetTokensMetadataResponse,
6199
6884
  FfiConverterTypeKeySetType,
6200
6885
  FfiConverterTypeLightningAddressInfo,
6201
6886
  FfiConverterTypeListFiatCurrenciesResponse,
@@ -6238,9 +6923,15 @@ export default Object.freeze({
6238
6923
  FfiConverterTypeStorage,
6239
6924
  FfiConverterTypeSyncWalletRequest,
6240
6925
  FfiConverterTypeSyncWalletResponse,
6926
+ FfiConverterTypeTokenBalance,
6927
+ FfiConverterTypeTokenMetadata,
6241
6928
  FfiConverterTypeTxStatus,
6242
6929
  FfiConverterTypeUpdateDepositPayload,
6243
- FfiConverterTypeUtxo
6930
+ FfiConverterTypeUtxo,
6931
+ FfiConverterTypeWaitForPaymentIdentifier,
6932
+ FfiConverterTypeWaitForPaymentRequest,
6933
+ FfiConverterTypeWaitForPaymentResponse,
6934
+ FfiConverterTypeu128
6244
6935
  }
6245
6936
  });
6246
6937
  //# sourceMappingURL=breez_sdk_spark.js.map