@breeztech/breez-sdk-spark-react-native 0.2.6 → 0.3.0-rc2

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 +66 -338
  2. package/cpp/generated/breez_sdk_spark.hpp +7 -45
  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 +504 -139
  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 +504 -139
  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 +4 -14
  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 +373 -63
  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 +4 -14
  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 +373 -63
  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 +7 -42
  28. package/src/generated/breez_sdk_spark.ts +769 -365
@@ -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
  */
@@ -2104,6 +2307,154 @@ const stringConverter = {
2104
2307
  };
2105
2308
  const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
2106
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
+ })();
2457
+
2107
2458
  // Error type: ChainServiceError
2108
2459
 
2109
2460
  // Enum: ChainServiceError
@@ -2670,6 +3021,7 @@ const FfiConverterTypeOnchainConfirmationSpeed = (() => {
2670
3021
  // Enum: PaymentDetails
2671
3022
  export let PaymentDetails_Tags = /*#__PURE__*/function (PaymentDetails_Tags) {
2672
3023
  PaymentDetails_Tags["Spark"] = "Spark";
3024
+ PaymentDetails_Tags["Token"] = "Token";
2673
3025
  PaymentDetails_Tags["Lightning"] = "Lightning";
2674
3026
  PaymentDetails_Tags["Withdraw"] = "Withdraw";
2675
3027
  PaymentDetails_Tags["Deposit"] = "Deposit";
@@ -2693,6 +3045,24 @@ export const PaymentDetails = (() => {
2693
3045
  return obj.tag === PaymentDetails_Tags.Spark;
2694
3046
  }
2695
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
+ }
2696
3066
  class Lightning_ extends UniffiEnum {
2697
3067
  /**
2698
3068
  * @private
@@ -2753,6 +3123,7 @@ export const PaymentDetails = (() => {
2753
3123
  return Object.freeze({
2754
3124
  instanceOf,
2755
3125
  Spark: Spark_,
3126
+ Token: Token_,
2756
3127
  Lightning: Lightning_,
2757
3128
  Withdraw: Withdraw_,
2758
3129
  Deposit: Deposit_
@@ -2767,6 +3138,11 @@ const FfiConverterTypePaymentDetails = (() => {
2767
3138
  case 1:
2768
3139
  return new PaymentDetails.Spark();
2769
3140
  case 2:
3141
+ return new PaymentDetails.Token({
3142
+ metadata: FfiConverterTypeTokenMetadata.read(from),
3143
+ txHash: FfiConverterString.read(from)
3144
+ });
3145
+ case 3:
2770
3146
  return new PaymentDetails.Lightning({
2771
3147
  description: FfiConverterOptionalString.read(from),
2772
3148
  preimage: FfiConverterOptionalString.read(from),
@@ -2775,11 +3151,11 @@ const FfiConverterTypePaymentDetails = (() => {
2775
3151
  destinationPubkey: FfiConverterString.read(from),
2776
3152
  lnurlPayInfo: FfiConverterOptionalTypeLnurlPayInfo.read(from)
2777
3153
  });
2778
- case 3:
3154
+ case 4:
2779
3155
  return new PaymentDetails.Withdraw({
2780
3156
  txId: FfiConverterString.read(from)
2781
3157
  });
2782
- case 4:
3158
+ case 5:
2783
3159
  return new PaymentDetails.Deposit({
2784
3160
  txId: FfiConverterString.read(from)
2785
3161
  });
@@ -2794,10 +3170,18 @@ const FfiConverterTypePaymentDetails = (() => {
2794
3170
  ordinalConverter.write(1, into);
2795
3171
  return;
2796
3172
  }
2797
- case PaymentDetails_Tags.Lightning:
3173
+ case PaymentDetails_Tags.Token:
2798
3174
  {
2799
3175
  ordinalConverter.write(2, into);
2800
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;
2801
3185
  FfiConverterOptionalString.write(inner.description, into);
2802
3186
  FfiConverterOptionalString.write(inner.preimage, into);
2803
3187
  FfiConverterString.write(inner.invoice, into);
@@ -2808,14 +3192,14 @@ const FfiConverterTypePaymentDetails = (() => {
2808
3192
  }
2809
3193
  case PaymentDetails_Tags.Withdraw:
2810
3194
  {
2811
- ordinalConverter.write(3, into);
3195
+ ordinalConverter.write(4, into);
2812
3196
  const inner = value.inner;
2813
3197
  FfiConverterString.write(inner.txId, into);
2814
3198
  return;
2815
3199
  }
2816
3200
  case PaymentDetails_Tags.Deposit:
2817
3201
  {
2818
- ordinalConverter.write(4, into);
3202
+ ordinalConverter.write(5, into);
2819
3203
  const inner = value.inner;
2820
3204
  FfiConverterString.write(inner.txId, into);
2821
3205
  return;
@@ -2831,10 +3215,18 @@ const FfiConverterTypePaymentDetails = (() => {
2831
3215
  {
2832
3216
  return ordinalConverter.allocationSize(1);
2833
3217
  }
2834
- case PaymentDetails_Tags.Lightning:
3218
+ case PaymentDetails_Tags.Token:
2835
3219
  {
2836
3220
  const inner = value.inner;
2837
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);
2838
3230
  size += FfiConverterOptionalString.allocationSize(inner.description);
2839
3231
  size += FfiConverterOptionalString.allocationSize(inner.preimage);
2840
3232
  size += FfiConverterString.allocationSize(inner.invoice);
@@ -2846,14 +3238,14 @@ const FfiConverterTypePaymentDetails = (() => {
2846
3238
  case PaymentDetails_Tags.Withdraw:
2847
3239
  {
2848
3240
  const inner = value.inner;
2849
- let size = ordinalConverter.allocationSize(3);
3241
+ let size = ordinalConverter.allocationSize(4);
2850
3242
  size += FfiConverterString.allocationSize(inner.txId);
2851
3243
  return size;
2852
3244
  }
2853
3245
  case PaymentDetails_Tags.Deposit:
2854
3246
  {
2855
3247
  const inner = value.inner;
2856
- let size = ordinalConverter.allocationSize(4);
3248
+ let size = ordinalConverter.allocationSize(5);
2857
3249
  size += FfiConverterString.allocationSize(inner.txId);
2858
3250
  return size;
2859
3251
  }
@@ -2867,9 +3259,10 @@ const FfiConverterTypePaymentDetails = (() => {
2867
3259
  export let PaymentMethod = /*#__PURE__*/function (PaymentMethod) {
2868
3260
  PaymentMethod[PaymentMethod["Lightning"] = 0] = "Lightning";
2869
3261
  PaymentMethod[PaymentMethod["Spark"] = 1] = "Spark";
2870
- PaymentMethod[PaymentMethod["Deposit"] = 2] = "Deposit";
2871
- PaymentMethod[PaymentMethod["Withdraw"] = 3] = "Withdraw";
2872
- 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";
2873
3266
  return PaymentMethod;
2874
3267
  }({});
2875
3268
  const FfiConverterTypePaymentMethod = (() => {
@@ -2882,10 +3275,12 @@ const FfiConverterTypePaymentMethod = (() => {
2882
3275
  case 2:
2883
3276
  return PaymentMethod.Spark;
2884
3277
  case 3:
2885
- return PaymentMethod.Deposit;
3278
+ return PaymentMethod.Token;
2886
3279
  case 4:
2887
- return PaymentMethod.Withdraw;
3280
+ return PaymentMethod.Deposit;
2888
3281
  case 5:
3282
+ return PaymentMethod.Withdraw;
3283
+ case 6:
2889
3284
  return PaymentMethod.Unknown;
2890
3285
  default:
2891
3286
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -2897,12 +3292,14 @@ const FfiConverterTypePaymentMethod = (() => {
2897
3292
  return ordinalConverter.write(1, into);
2898
3293
  case PaymentMethod.Spark:
2899
3294
  return ordinalConverter.write(2, into);
2900
- case PaymentMethod.Deposit:
3295
+ case PaymentMethod.Token:
2901
3296
  return ordinalConverter.write(3, into);
2902
- case PaymentMethod.Withdraw:
3297
+ case PaymentMethod.Deposit:
2903
3298
  return ordinalConverter.write(4, into);
2904
- case PaymentMethod.Unknown:
3299
+ case PaymentMethod.Withdraw:
2905
3300
  return ordinalConverter.write(5, into);
3301
+ case PaymentMethod.Unknown:
3302
+ return ordinalConverter.write(6, into);
2906
3303
  }
2907
3304
  }
2908
3305
  allocationSize(value) {
@@ -4097,7 +4494,8 @@ const FfiConverterTypeSendPaymentMethod = (() => {
4097
4494
  case 3:
4098
4495
  return new SendPaymentMethod.SparkAddress({
4099
4496
  address: FfiConverterString.read(from),
4100
- feeSats: FfiConverterUInt64.read(from)
4497
+ fee: FfiConverterTypeu128.read(from),
4498
+ tokenIdentifier: FfiConverterOptionalString.read(from)
4101
4499
  });
4102
4500
  default:
4103
4501
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -4127,7 +4525,8 @@ const FfiConverterTypeSendPaymentMethod = (() => {
4127
4525
  ordinalConverter.write(3, into);
4128
4526
  const inner = value.inner;
4129
4527
  FfiConverterString.write(inner.address, into);
4130
- FfiConverterUInt64.write(inner.feeSats, into);
4528
+ FfiConverterTypeu128.write(inner.fee, into);
4529
+ FfiConverterOptionalString.write(inner.tokenIdentifier, into);
4131
4530
  return;
4132
4531
  }
4133
4532
  default:
@@ -4159,7 +4558,8 @@ const FfiConverterTypeSendPaymentMethod = (() => {
4159
4558
  const inner = value.inner;
4160
4559
  let size = ordinalConverter.allocationSize(3);
4161
4560
  size += FfiConverterString.allocationSize(inner.address);
4162
- size += FfiConverterUInt64.allocationSize(inner.feeSats);
4561
+ size += FfiConverterTypeu128.allocationSize(inner.fee);
4562
+ size += FfiConverterOptionalString.allocationSize(inner.tokenIdentifier);
4163
4563
  return size;
4164
4564
  }
4165
4565
  default:
@@ -4694,6 +5094,9 @@ const FfiConverterTypeWaitForPaymentIdentifier = (() => {
4694
5094
  }
4695
5095
  return new FFIConverter();
4696
5096
  })();
5097
+
5098
+ // FfiConverter for Map<string, TokenBalance>
5099
+ const FfiConverterMapStringTypeTokenBalance = new FfiConverterMap(FfiConverterString, FfiConverterTypeTokenBalance);
4697
5100
  export class BitcoinChainServiceImpl extends UniffiAbstractObject {
4698
5101
  [uniffiTypeNameSymbol] = 'BitcoinChainServiceImpl';
4699
5102
  // No primary constructor declared for this class.
@@ -5073,6 +5476,28 @@ export class BreezSdk extends UniffiAbstractObject {
5073
5476
  }
5074
5477
  }
5075
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
+
5076
5501
  /**
5077
5502
  * List fiat currencies for which there is a known exchange rate,
5078
5503
  * sorted by the canonical name of the currency.
@@ -5162,11 +5587,6 @@ export class BreezSdk extends UniffiAbstractObject {
5162
5587
  throw __error;
5163
5588
  }
5164
5589
  }
5165
- pollLightningSendPayment(payment, sspId) {
5166
- uniffiCaller.rustCall(/*caller:*/callStatus => {
5167
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypePayment.lower(payment), FfiConverterString.lower(sspId), callStatus);
5168
- }, /*liftString:*/FfiConverterString.lift);
5169
- }
5170
5590
  async prepareLnurlPay(request, asyncOpts_) /*throws*/{
5171
5591
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
5172
5592
  try {
@@ -5206,23 +5626,6 @@ export class BreezSdk extends UniffiAbstractObject {
5206
5626
  throw __error;
5207
5627
  }
5208
5628
  }
5209
-
5210
- /**
5211
- * Attempts to recover a lightning address from the lnurl server.
5212
- */
5213
- async recoverLightningAddress(asyncOpts_) /*throws*/{
5214
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
5215
- try {
5216
- return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5217
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_recover_lightning_address(uniffiTypeBreezSdkObjectFactory.clonePointer(this));
5218
- }, /*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));
5219
- } catch (__error) {
5220
- if (uniffiIsDebug && __error instanceof Error) {
5221
- __error.stack = __stack;
5222
- }
5223
- throw __error;
5224
- }
5225
- }
5226
5629
  async refundDeposit(request, asyncOpts_) /*throws*/{
5227
5630
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
5228
5631
  try {
@@ -5274,32 +5677,6 @@ export class BreezSdk extends UniffiAbstractObject {
5274
5677
  throw __error;
5275
5678
  }
5276
5679
  }
5277
- async sendBitcoinAddress(address, feeQuote, request, asyncOpts_) /*throws*/{
5278
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
5279
- try {
5280
- return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5281
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_send_bitcoin_address(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypeBitcoinAddressDetails.lower(address), FfiConverterTypeSendOnchainFeeQuote.lower(feeQuote), FfiConverterTypeSendPaymentRequest.lower(request));
5282
- }, /*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));
5283
- } catch (__error) {
5284
- if (uniffiIsDebug && __error instanceof Error) {
5285
- __error.stack = __stack;
5286
- }
5287
- throw __error;
5288
- }
5289
- }
5290
- async sendBolt11Invoice(invoiceDetails, sparkTransferFeeSats, lightningFeeSats, request, asyncOpts_) /*throws*/{
5291
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
5292
- try {
5293
- return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5294
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_send_bolt11_invoice(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypeBolt11InvoiceDetails.lower(invoiceDetails), FfiConverterOptionalUInt64.lower(sparkTransferFeeSats), FfiConverterUInt64.lower(lightningFeeSats), FfiConverterTypeSendPaymentRequest.lower(request));
5295
- }, /*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));
5296
- } catch (__error) {
5297
- if (uniffiIsDebug && __error instanceof Error) {
5298
- __error.stack = __stack;
5299
- }
5300
- throw __error;
5301
- }
5302
- }
5303
5680
  async sendPayment(request, asyncOpts_) /*throws*/{
5304
5681
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
5305
5682
  try {
@@ -5313,32 +5690,6 @@ export class BreezSdk extends UniffiAbstractObject {
5313
5690
  throw __error;
5314
5691
  }
5315
5692
  }
5316
- async sendPaymentInternal(request, suppressPaymentEvent, asyncOpts_) /*throws*/{
5317
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
5318
- try {
5319
- return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5320
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment_internal(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterTypeSendPaymentRequest.lower(request), FfiConverterBool.lower(suppressPaymentEvent));
5321
- }, /*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));
5322
- } catch (__error) {
5323
- if (uniffiIsDebug && __error instanceof Error) {
5324
- __error.stack = __stack;
5325
- }
5326
- throw __error;
5327
- }
5328
- }
5329
- async sendSparkAddress(address, request, asyncOpts_) /*throws*/{
5330
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
5331
- try {
5332
- return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5333
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_send_spark_address(uniffiTypeBreezSdkObjectFactory.clonePointer(this), FfiConverterString.lower(address), FfiConverterTypeSendPaymentRequest.lower(request));
5334
- }, /*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));
5335
- } catch (__error) {
5336
- if (uniffiIsDebug && __error instanceof Error) {
5337
- __error.stack = __stack;
5338
- }
5339
- throw __error;
5340
- }
5341
- }
5342
5693
 
5343
5694
  /**
5344
5695
  * Synchronizes the wallet with the Spark network
@@ -5659,22 +6010,21 @@ export class StorageImpl extends UniffiAbstractObject {
5659
6010
  }
5660
6011
 
5661
6012
  /**
5662
- * Lists payments with pagination
6013
+ * Lists payments with optional filters and pagination
5663
6014
  *
5664
6015
  * # Arguments
5665
6016
  *
5666
- * * `offset` - Number of records to skip
5667
- * * `limit` - Maximum number of records to return
6017
+ * * `list_payments_request` - The request to list payments
5668
6018
  *
5669
6019
  * # Returns
5670
6020
  *
5671
6021
  * A vector of payments or a `StorageError`
5672
6022
  */
5673
- async listPayments(offset, limit, asyncOpts_) /*throws*/{
6023
+ async listPayments(request, asyncOpts_) /*throws*/{
5674
6024
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
5675
6025
  try {
5676
6026
  return await uniffiRustCallAsync(/*rustCaller:*/uniffiCaller, /*rustFutureFunc:*/() => {
5677
- 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));
5678
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));
5679
6029
  } catch (__error) {
5680
6030
  if (uniffiIsDebug && __error instanceof Error) {
@@ -6010,10 +6360,10 @@ const uniffiCallbackInterfaceStorage = {
6010
6360
  const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(/*makeCall:*/uniffiMakeCall, /*handleSuccess:*/uniffiHandleSuccess, /*handleError:*/uniffiHandleError, /*isErrorType:*/StorageError.instanceOf, /*lowerError:*/FfiConverterTypeStorageError.lower.bind(FfiConverterTypeStorageError), /*lowerString:*/FfiConverterString.lower);
6011
6361
  return UniffiResult.success(uniffiForeignFuture);
6012
6362
  },
6013
- listPayments: (uniffiHandle, offset, limit, uniffiFutureCallback, uniffiCallbackData) => {
6363
+ listPayments: (uniffiHandle, request, uniffiFutureCallback, uniffiCallbackData) => {
6014
6364
  const uniffiMakeCall = async signal => {
6015
6365
  const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
6016
- return await jsCallback.listPayments(FfiConverterOptionalUInt32.lift(offset), FfiConverterOptionalUInt32.lift(limit), {
6366
+ return await jsCallback.listPayments(FfiConverterTypeListPaymentsRequest.lift(request), {
6017
6367
  signal
6018
6368
  });
6019
6369
  };
@@ -6289,9 +6639,21 @@ const FfiConverterArrayTypeDepositInfo = new FfiConverterArray(FfiConverterTypeD
6289
6639
  // FfiConverter for Array<Payment>
6290
6640
  const FfiConverterArrayTypePayment = new FfiConverterArray(FfiConverterTypePayment);
6291
6641
 
6642
+ // FfiConverter for Array<TokenMetadata>
6643
+ const FfiConverterArrayTypeTokenMetadata = new FfiConverterArray(FfiConverterTypeTokenMetadata);
6644
+
6292
6645
  // FfiConverter for Array<Utxo>
6293
6646
  const FfiConverterArrayTypeUtxo = new FfiConverterArray(FfiConverterTypeUtxo);
6294
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
+
6295
6657
  // FfiConverter for DepositClaimError | undefined
6296
6658
  const FfiConverterOptionalTypeDepositClaimError = new FfiConverterOptional(FfiConverterTypeDepositClaimError);
6297
6659
 
@@ -6304,6 +6666,18 @@ const FfiConverterOptionalTypePaymentDetails = new FfiConverterOptional(FfiConve
6304
6666
  // FfiConverter for SendPaymentOptions | undefined
6305
6667
  const FfiConverterOptionalTypeSendPaymentOptions = new FfiConverterOptional(FfiConverterTypeSendPaymentOptions);
6306
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
+
6307
6681
  /**
6308
6682
  * This should be called before anything else.
6309
6683
  *
@@ -6373,6 +6747,9 @@ function uniffiEnsureInitialized() {
6373
6747
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment() !== 11540) {
6374
6748
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment');
6375
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
+ }
6376
6753
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies() !== 63366) {
6377
6754
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies');
6378
6755
  }
@@ -6388,9 +6765,6 @@ function uniffiEnsureInitialized() {
6388
6765
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay() !== 10147) {
6389
6766
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay');
6390
6767
  }
6391
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment() !== 57601) {
6392
- throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment');
6393
- }
6394
6768
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay() !== 37691) {
6395
6769
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay');
6396
6770
  }
@@ -6400,9 +6774,6 @@ function uniffiEnsureInitialized() {
6400
6774
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_receive_payment() !== 36984) {
6401
6775
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_receive_payment');
6402
6776
  }
6403
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_recover_lightning_address() !== 43367) {
6404
- throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_recover_lightning_address');
6405
- }
6406
6777
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_deposit() !== 33646) {
6407
6778
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_deposit');
6408
6779
  }
@@ -6412,21 +6783,9 @@ function uniffiEnsureInitialized() {
6412
6783
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener() !== 41066) {
6413
6784
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener');
6414
6785
  }
6415
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_bitcoin_address() !== 5926) {
6416
- throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_send_bitcoin_address');
6417
- }
6418
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_bolt11_invoice() !== 21785) {
6419
- throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_send_bolt11_invoice');
6420
- }
6421
6786
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment() !== 54349) {
6422
6787
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment');
6423
6788
  }
6424
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal() !== 37855) {
6425
- throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal');
6426
- }
6427
- if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_spark_address() !== 63147) {
6428
- throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_send_spark_address');
6429
- }
6430
6789
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet() !== 30368) {
6431
6790
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet');
6432
6791
  }
@@ -6460,7 +6819,7 @@ function uniffiEnsureInitialized() {
6460
6819
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_set_cached_item() !== 7970) {
6461
6820
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_set_cached_item');
6462
6821
  }
6463
- 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) {
6464
6823
  throw new UniffiInternalError.ApiChecksumMismatch('uniffi_breez_sdk_spark_checksum_method_storage_list_payments');
6465
6824
  }
6466
6825
  if (nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_insert_payment() !== 28075) {
@@ -6504,6 +6863,7 @@ function uniffiEnsureInitialized() {
6504
6863
  export default Object.freeze({
6505
6864
  initialize: uniffiEnsureInitialized,
6506
6865
  converters: {
6866
+ FfiConverterTypeAssetFilter,
6507
6867
  FfiConverterTypeBitcoinChainService,
6508
6868
  FfiConverterTypeBreezSdk,
6509
6869
  FfiConverterTypeCheckLightningAddressRequest,
@@ -6519,6 +6879,8 @@ export default Object.freeze({
6519
6879
  FfiConverterTypeGetInfoResponse,
6520
6880
  FfiConverterTypeGetPaymentRequest,
6521
6881
  FfiConverterTypeGetPaymentResponse,
6882
+ FfiConverterTypeGetTokensMetadataRequest,
6883
+ FfiConverterTypeGetTokensMetadataResponse,
6522
6884
  FfiConverterTypeKeySetType,
6523
6885
  FfiConverterTypeLightningAddressInfo,
6524
6886
  FfiConverterTypeListFiatCurrenciesResponse,
@@ -6561,12 +6923,15 @@ export default Object.freeze({
6561
6923
  FfiConverterTypeStorage,
6562
6924
  FfiConverterTypeSyncWalletRequest,
6563
6925
  FfiConverterTypeSyncWalletResponse,
6926
+ FfiConverterTypeTokenBalance,
6927
+ FfiConverterTypeTokenMetadata,
6564
6928
  FfiConverterTypeTxStatus,
6565
6929
  FfiConverterTypeUpdateDepositPayload,
6566
6930
  FfiConverterTypeUtxo,
6567
6931
  FfiConverterTypeWaitForPaymentIdentifier,
6568
6932
  FfiConverterTypeWaitForPaymentRequest,
6569
- FfiConverterTypeWaitForPaymentResponse
6933
+ FfiConverterTypeWaitForPaymentResponse,
6934
+ FfiConverterTypeu128
6570
6935
  }
6571
6936
  });
6572
6937
  //# sourceMappingURL=breez_sdk_spark.js.map