@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
@@ -61,6 +61,7 @@ import {
61
61
  FfiConverterBool,
62
62
  FfiConverterCallback,
63
63
  FfiConverterInt32,
64
+ FfiConverterMap,
64
65
  FfiConverterObject,
65
66
  FfiConverterObjectWithCallbacks,
66
67
  FfiConverterOptional,
@@ -865,6 +866,10 @@ export type GetInfoResponse = {
865
866
  * The balance in satoshis
866
867
  */
867
868
  balanceSats: /*u64*/ bigint;
869
+ /**
870
+ * The balances of the tokens in the wallet keyed by the token identifier
871
+ */
872
+ tokenBalances: Map<string, TokenBalance>;
868
873
  };
869
874
 
870
875
  /**
@@ -903,13 +908,20 @@ const FfiConverterTypeGetInfoResponse = (() => {
903
908
  read(from: RustBuffer): TypeName {
904
909
  return {
905
910
  balanceSats: FfiConverterUInt64.read(from),
911
+ tokenBalances: FfiConverterMapStringTypeTokenBalance.read(from),
906
912
  };
907
913
  }
908
914
  write(value: TypeName, into: RustBuffer): void {
909
915
  FfiConverterUInt64.write(value.balanceSats, into);
916
+ FfiConverterMapStringTypeTokenBalance.write(value.tokenBalances, into);
910
917
  }
911
918
  allocationSize(value: TypeName): number {
912
- return FfiConverterUInt64.allocationSize(value.balanceSats);
919
+ return (
920
+ FfiConverterUInt64.allocationSize(value.balanceSats) +
921
+ FfiConverterMapStringTypeTokenBalance.allocationSize(
922
+ value.tokenBalances
923
+ )
924
+ );
913
925
  }
914
926
  }
915
927
  return new FFIConverter();
@@ -1019,6 +1031,116 @@ const FfiConverterTypeGetPaymentResponse = (() => {
1019
1031
  return new FFIConverter();
1020
1032
  })();
1021
1033
 
1034
+ export type GetTokensMetadataRequest = {
1035
+ tokenIdentifiers: Array<string>;
1036
+ };
1037
+
1038
+ /**
1039
+ * Generated factory for {@link GetTokensMetadataRequest} record objects.
1040
+ */
1041
+ export const GetTokensMetadataRequest = (() => {
1042
+ const defaults = () => ({});
1043
+ const create = (() => {
1044
+ return uniffiCreateRecord<
1045
+ GetTokensMetadataRequest,
1046
+ ReturnType<typeof defaults>
1047
+ >(defaults);
1048
+ })();
1049
+ return Object.freeze({
1050
+ /**
1051
+ * Create a frozen instance of {@link GetTokensMetadataRequest}, with defaults specified
1052
+ * in Rust, in the {@link breez_sdk_spark} crate.
1053
+ */
1054
+ create,
1055
+
1056
+ /**
1057
+ * Create a frozen instance of {@link GetTokensMetadataRequest}, with defaults specified
1058
+ * in Rust, in the {@link breez_sdk_spark} crate.
1059
+ */
1060
+ new: create,
1061
+
1062
+ /**
1063
+ * Defaults specified in the {@link breez_sdk_spark} crate.
1064
+ */
1065
+ defaults: () =>
1066
+ Object.freeze(defaults()) as Partial<GetTokensMetadataRequest>,
1067
+ });
1068
+ })();
1069
+
1070
+ const FfiConverterTypeGetTokensMetadataRequest = (() => {
1071
+ type TypeName = GetTokensMetadataRequest;
1072
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1073
+ read(from: RustBuffer): TypeName {
1074
+ return {
1075
+ tokenIdentifiers: FfiConverterArrayString.read(from),
1076
+ };
1077
+ }
1078
+ write(value: TypeName, into: RustBuffer): void {
1079
+ FfiConverterArrayString.write(value.tokenIdentifiers, into);
1080
+ }
1081
+ allocationSize(value: TypeName): number {
1082
+ return FfiConverterArrayString.allocationSize(value.tokenIdentifiers);
1083
+ }
1084
+ }
1085
+ return new FFIConverter();
1086
+ })();
1087
+
1088
+ export type GetTokensMetadataResponse = {
1089
+ tokensMetadata: Array<TokenMetadata>;
1090
+ };
1091
+
1092
+ /**
1093
+ * Generated factory for {@link GetTokensMetadataResponse} record objects.
1094
+ */
1095
+ export const GetTokensMetadataResponse = (() => {
1096
+ const defaults = () => ({});
1097
+ const create = (() => {
1098
+ return uniffiCreateRecord<
1099
+ GetTokensMetadataResponse,
1100
+ ReturnType<typeof defaults>
1101
+ >(defaults);
1102
+ })();
1103
+ return Object.freeze({
1104
+ /**
1105
+ * Create a frozen instance of {@link GetTokensMetadataResponse}, with defaults specified
1106
+ * in Rust, in the {@link breez_sdk_spark} crate.
1107
+ */
1108
+ create,
1109
+
1110
+ /**
1111
+ * Create a frozen instance of {@link GetTokensMetadataResponse}, with defaults specified
1112
+ * in Rust, in the {@link breez_sdk_spark} crate.
1113
+ */
1114
+ new: create,
1115
+
1116
+ /**
1117
+ * Defaults specified in the {@link breez_sdk_spark} crate.
1118
+ */
1119
+ defaults: () =>
1120
+ Object.freeze(defaults()) as Partial<GetTokensMetadataResponse>,
1121
+ });
1122
+ })();
1123
+
1124
+ const FfiConverterTypeGetTokensMetadataResponse = (() => {
1125
+ type TypeName = GetTokensMetadataResponse;
1126
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1127
+ read(from: RustBuffer): TypeName {
1128
+ return {
1129
+ tokensMetadata: FfiConverterArrayTypeTokenMetadata.read(from),
1130
+ };
1131
+ }
1132
+ write(value: TypeName, into: RustBuffer): void {
1133
+ FfiConverterArrayTypeTokenMetadata.write(value.tokensMetadata, into);
1134
+ }
1135
+ allocationSize(value: TypeName): number {
1136
+ return FfiConverterArrayTypeTokenMetadata.allocationSize(
1137
+ value.tokensMetadata
1138
+ );
1139
+ }
1140
+ }
1141
+ return new FFIConverter();
1142
+ })();
1143
+
1022
1144
  export type LightningAddressInfo = {
1023
1145
  description: string;
1024
1146
  lightningAddress: string;
@@ -1206,9 +1328,20 @@ const FfiConverterTypeListFiatRatesResponse = (() => {
1206
1328
  })();
1207
1329
 
1208
1330
  /**
1209
- * Request to list payments with pagination
1331
+ * Request to list payments with optional filters and pagination
1210
1332
  */
1211
1333
  export type ListPaymentsRequest = {
1334
+ typeFilter: Array<PaymentType> | undefined;
1335
+ statusFilter: Array<PaymentStatus> | undefined;
1336
+ assetFilter: AssetFilter | undefined;
1337
+ /**
1338
+ * Only include payments created after this timestamp (inclusive)
1339
+ */
1340
+ fromTimestamp: /*u64*/ bigint | undefined;
1341
+ /**
1342
+ * Only include payments created before this timestamp (exclusive)
1343
+ */
1344
+ toTimestamp: /*u64*/ bigint | undefined;
1212
1345
  /**
1213
1346
  * Number of records to skip
1214
1347
  */
@@ -1217,13 +1350,23 @@ export type ListPaymentsRequest = {
1217
1350
  * Maximum number of records to return
1218
1351
  */
1219
1352
  limit: /*u32*/ number | undefined;
1353
+ sortAscending: boolean | undefined;
1220
1354
  };
1221
1355
 
1222
1356
  /**
1223
1357
  * Generated factory for {@link ListPaymentsRequest} record objects.
1224
1358
  */
1225
1359
  export const ListPaymentsRequest = (() => {
1226
- const defaults = () => ({ offset: undefined, limit: undefined });
1360
+ const defaults = () => ({
1361
+ typeFilter: undefined,
1362
+ statusFilter: undefined,
1363
+ assetFilter: undefined,
1364
+ fromTimestamp: undefined,
1365
+ toTimestamp: undefined,
1366
+ offset: undefined,
1367
+ limit: undefined,
1368
+ sortAscending: undefined,
1369
+ });
1227
1370
  const create = (() => {
1228
1371
  return uniffiCreateRecord<ListPaymentsRequest, ReturnType<typeof defaults>>(
1229
1372
  defaults
@@ -1254,18 +1397,43 @@ const FfiConverterTypeListPaymentsRequest = (() => {
1254
1397
  class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1255
1398
  read(from: RustBuffer): TypeName {
1256
1399
  return {
1400
+ typeFilter: FfiConverterOptionalArrayTypePaymentType.read(from),
1401
+ statusFilter: FfiConverterOptionalArrayTypePaymentStatus.read(from),
1402
+ assetFilter: FfiConverterOptionalTypeAssetFilter.read(from),
1403
+ fromTimestamp: FfiConverterOptionalUInt64.read(from),
1404
+ toTimestamp: FfiConverterOptionalUInt64.read(from),
1257
1405
  offset: FfiConverterOptionalUInt32.read(from),
1258
1406
  limit: FfiConverterOptionalUInt32.read(from),
1407
+ sortAscending: FfiConverterOptionalBool.read(from),
1259
1408
  };
1260
1409
  }
1261
1410
  write(value: TypeName, into: RustBuffer): void {
1411
+ FfiConverterOptionalArrayTypePaymentType.write(value.typeFilter, into);
1412
+ FfiConverterOptionalArrayTypePaymentStatus.write(
1413
+ value.statusFilter,
1414
+ into
1415
+ );
1416
+ FfiConverterOptionalTypeAssetFilter.write(value.assetFilter, into);
1417
+ FfiConverterOptionalUInt64.write(value.fromTimestamp, into);
1418
+ FfiConverterOptionalUInt64.write(value.toTimestamp, into);
1262
1419
  FfiConverterOptionalUInt32.write(value.offset, into);
1263
1420
  FfiConverterOptionalUInt32.write(value.limit, into);
1421
+ FfiConverterOptionalBool.write(value.sortAscending, into);
1264
1422
  }
1265
1423
  allocationSize(value: TypeName): number {
1266
1424
  return (
1425
+ FfiConverterOptionalArrayTypePaymentType.allocationSize(
1426
+ value.typeFilter
1427
+ ) +
1428
+ FfiConverterOptionalArrayTypePaymentStatus.allocationSize(
1429
+ value.statusFilter
1430
+ ) +
1431
+ FfiConverterOptionalTypeAssetFilter.allocationSize(value.assetFilter) +
1432
+ FfiConverterOptionalUInt64.allocationSize(value.fromTimestamp) +
1433
+ FfiConverterOptionalUInt64.allocationSize(value.toTimestamp) +
1267
1434
  FfiConverterOptionalUInt32.allocationSize(value.offset) +
1268
- FfiConverterOptionalUInt32.allocationSize(value.limit)
1435
+ FfiConverterOptionalUInt32.allocationSize(value.limit) +
1436
+ FfiConverterOptionalBool.allocationSize(value.sortAscending)
1269
1437
  );
1270
1438
  }
1271
1439
  }
@@ -1714,11 +1882,11 @@ export type Payment = {
1714
1882
  /**
1715
1883
  * Amount in satoshis
1716
1884
  */
1717
- amount: /*u64*/ bigint;
1885
+ amount: U128;
1718
1886
  /**
1719
1887
  * Fee paid in satoshis
1720
1888
  */
1721
- fees: /*u64*/ bigint;
1889
+ fees: U128;
1722
1890
  /**
1723
1891
  * Timestamp of when the payment was created
1724
1892
  */
@@ -1770,8 +1938,8 @@ const FfiConverterTypePayment = (() => {
1770
1938
  id: FfiConverterString.read(from),
1771
1939
  paymentType: FfiConverterTypePaymentType.read(from),
1772
1940
  status: FfiConverterTypePaymentStatus.read(from),
1773
- amount: FfiConverterUInt64.read(from),
1774
- fees: FfiConverterUInt64.read(from),
1941
+ amount: FfiConverterTypeu128.read(from),
1942
+ fees: FfiConverterTypeu128.read(from),
1775
1943
  timestamp: FfiConverterUInt64.read(from),
1776
1944
  method: FfiConverterTypePaymentMethod.read(from),
1777
1945
  details: FfiConverterOptionalTypePaymentDetails.read(from),
@@ -1781,8 +1949,8 @@ const FfiConverterTypePayment = (() => {
1781
1949
  FfiConverterString.write(value.id, into);
1782
1950
  FfiConverterTypePaymentType.write(value.paymentType, into);
1783
1951
  FfiConverterTypePaymentStatus.write(value.status, into);
1784
- FfiConverterUInt64.write(value.amount, into);
1785
- FfiConverterUInt64.write(value.fees, into);
1952
+ FfiConverterTypeu128.write(value.amount, into);
1953
+ FfiConverterTypeu128.write(value.fees, into);
1786
1954
  FfiConverterUInt64.write(value.timestamp, into);
1787
1955
  FfiConverterTypePaymentMethod.write(value.method, into);
1788
1956
  FfiConverterOptionalTypePaymentDetails.write(value.details, into);
@@ -1792,8 +1960,8 @@ const FfiConverterTypePayment = (() => {
1792
1960
  FfiConverterString.allocationSize(value.id) +
1793
1961
  FfiConverterTypePaymentType.allocationSize(value.paymentType) +
1794
1962
  FfiConverterTypePaymentStatus.allocationSize(value.status) +
1795
- FfiConverterUInt64.allocationSize(value.amount) +
1796
- FfiConverterUInt64.allocationSize(value.fees) +
1963
+ FfiConverterTypeu128.allocationSize(value.amount) +
1964
+ FfiConverterTypeu128.allocationSize(value.fees) +
1797
1965
  FfiConverterUInt64.allocationSize(value.timestamp) +
1798
1966
  FfiConverterTypePaymentMethod.allocationSize(value.method) +
1799
1967
  FfiConverterOptionalTypePaymentDetails.allocationSize(value.details)
@@ -2022,14 +2190,23 @@ const FfiConverterTypePrepareLnurlPayResponse = (() => {
2022
2190
 
2023
2191
  export type PrepareSendPaymentRequest = {
2024
2192
  paymentRequest: string;
2025
- amountSats: /*u64*/ bigint | undefined;
2193
+ /**
2194
+ * Amount to send. By default is denominated in sats.
2195
+ * If a token identifier is provided, the amount will be denominated in the token base units.
2196
+ */
2197
+ amount: U128 | undefined;
2198
+ /**
2199
+ * If provided, the payment will be for a token
2200
+ * May only be provided if the payment request is a spark address
2201
+ */
2202
+ tokenIdentifier: string | undefined;
2026
2203
  };
2027
2204
 
2028
2205
  /**
2029
2206
  * Generated factory for {@link PrepareSendPaymentRequest} record objects.
2030
2207
  */
2031
2208
  export const PrepareSendPaymentRequest = (() => {
2032
- const defaults = () => ({ amountSats: undefined });
2209
+ const defaults = () => ({ amount: undefined, tokenIdentifier: undefined });
2033
2210
  const create = (() => {
2034
2211
  return uniffiCreateRecord<
2035
2212
  PrepareSendPaymentRequest,
@@ -2063,17 +2240,20 @@ const FfiConverterTypePrepareSendPaymentRequest = (() => {
2063
2240
  read(from: RustBuffer): TypeName {
2064
2241
  return {
2065
2242
  paymentRequest: FfiConverterString.read(from),
2066
- amountSats: FfiConverterOptionalUInt64.read(from),
2243
+ amount: FfiConverterOptionalTypeu128.read(from),
2244
+ tokenIdentifier: FfiConverterOptionalString.read(from),
2067
2245
  };
2068
2246
  }
2069
2247
  write(value: TypeName, into: RustBuffer): void {
2070
2248
  FfiConverterString.write(value.paymentRequest, into);
2071
- FfiConverterOptionalUInt64.write(value.amountSats, into);
2249
+ FfiConverterOptionalTypeu128.write(value.amount, into);
2250
+ FfiConverterOptionalString.write(value.tokenIdentifier, into);
2072
2251
  }
2073
2252
  allocationSize(value: TypeName): number {
2074
2253
  return (
2075
2254
  FfiConverterString.allocationSize(value.paymentRequest) +
2076
- FfiConverterOptionalUInt64.allocationSize(value.amountSats)
2255
+ FfiConverterOptionalTypeu128.allocationSize(value.amount) +
2256
+ FfiConverterOptionalString.allocationSize(value.tokenIdentifier)
2077
2257
  );
2078
2258
  }
2079
2259
  }
@@ -2082,7 +2262,16 @@ const FfiConverterTypePrepareSendPaymentRequest = (() => {
2082
2262
 
2083
2263
  export type PrepareSendPaymentResponse = {
2084
2264
  paymentMethod: SendPaymentMethod;
2085
- amountSats: /*u64*/ bigint;
2265
+ /**
2266
+ * Amount to send. By default is denominated in sats.
2267
+ * If a token identifier is provided, the amount will be denominated in the token base units.
2268
+ */
2269
+ amount: U128;
2270
+ /**
2271
+ * The presence of this field indicates that the payment is for a token
2272
+ * If empty, it is a Bitcoin payment
2273
+ */
2274
+ tokenIdentifier: string | undefined;
2086
2275
  };
2087
2276
 
2088
2277
  /**
@@ -2123,17 +2312,20 @@ const FfiConverterTypePrepareSendPaymentResponse = (() => {
2123
2312
  read(from: RustBuffer): TypeName {
2124
2313
  return {
2125
2314
  paymentMethod: FfiConverterTypeSendPaymentMethod.read(from),
2126
- amountSats: FfiConverterUInt64.read(from),
2315
+ amount: FfiConverterTypeu128.read(from),
2316
+ tokenIdentifier: FfiConverterOptionalString.read(from),
2127
2317
  };
2128
2318
  }
2129
2319
  write(value: TypeName, into: RustBuffer): void {
2130
2320
  FfiConverterTypeSendPaymentMethod.write(value.paymentMethod, into);
2131
- FfiConverterUInt64.write(value.amountSats, into);
2321
+ FfiConverterTypeu128.write(value.amount, into);
2322
+ FfiConverterOptionalString.write(value.tokenIdentifier, into);
2132
2323
  }
2133
2324
  allocationSize(value: TypeName): number {
2134
2325
  return (
2135
2326
  FfiConverterTypeSendPaymentMethod.allocationSize(value.paymentMethod) +
2136
- FfiConverterUInt64.allocationSize(value.amountSats)
2327
+ FfiConverterTypeu128.allocationSize(value.amount) +
2328
+ FfiConverterOptionalString.allocationSize(value.tokenIdentifier)
2137
2329
  );
2138
2330
  }
2139
2331
  }
@@ -2788,6 +2980,148 @@ const FfiConverterTypeSyncWalletResponse = (() => {
2788
2980
  return new FFIConverter();
2789
2981
  })();
2790
2982
 
2983
+ export type TokenBalance = {
2984
+ balance: U128;
2985
+ tokenMetadata: TokenMetadata;
2986
+ };
2987
+
2988
+ /**
2989
+ * Generated factory for {@link TokenBalance} record objects.
2990
+ */
2991
+ export const TokenBalance = (() => {
2992
+ const defaults = () => ({});
2993
+ const create = (() => {
2994
+ return uniffiCreateRecord<TokenBalance, ReturnType<typeof defaults>>(
2995
+ defaults
2996
+ );
2997
+ })();
2998
+ return Object.freeze({
2999
+ /**
3000
+ * Create a frozen instance of {@link TokenBalance}, with defaults specified
3001
+ * in Rust, in the {@link breez_sdk_spark} crate.
3002
+ */
3003
+ create,
3004
+
3005
+ /**
3006
+ * Create a frozen instance of {@link TokenBalance}, with defaults specified
3007
+ * in Rust, in the {@link breez_sdk_spark} crate.
3008
+ */
3009
+ new: create,
3010
+
3011
+ /**
3012
+ * Defaults specified in the {@link breez_sdk_spark} crate.
3013
+ */
3014
+ defaults: () => Object.freeze(defaults()) as Partial<TokenBalance>,
3015
+ });
3016
+ })();
3017
+
3018
+ const FfiConverterTypeTokenBalance = (() => {
3019
+ type TypeName = TokenBalance;
3020
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
3021
+ read(from: RustBuffer): TypeName {
3022
+ return {
3023
+ balance: FfiConverterTypeu128.read(from),
3024
+ tokenMetadata: FfiConverterTypeTokenMetadata.read(from),
3025
+ };
3026
+ }
3027
+ write(value: TypeName, into: RustBuffer): void {
3028
+ FfiConverterTypeu128.write(value.balance, into);
3029
+ FfiConverterTypeTokenMetadata.write(value.tokenMetadata, into);
3030
+ }
3031
+ allocationSize(value: TypeName): number {
3032
+ return (
3033
+ FfiConverterTypeu128.allocationSize(value.balance) +
3034
+ FfiConverterTypeTokenMetadata.allocationSize(value.tokenMetadata)
3035
+ );
3036
+ }
3037
+ }
3038
+ return new FFIConverter();
3039
+ })();
3040
+
3041
+ export type TokenMetadata = {
3042
+ identifier: string;
3043
+ /**
3044
+ * Hex representation of the issuer public key
3045
+ */
3046
+ issuerPublicKey: string;
3047
+ name: string;
3048
+ ticker: string;
3049
+ /**
3050
+ * Number of decimals the token uses
3051
+ */
3052
+ decimals: /*u32*/ number;
3053
+ maxSupply: U128;
3054
+ isFreezable: boolean;
3055
+ };
3056
+
3057
+ /**
3058
+ * Generated factory for {@link TokenMetadata} record objects.
3059
+ */
3060
+ export const TokenMetadata = (() => {
3061
+ const defaults = () => ({});
3062
+ const create = (() => {
3063
+ return uniffiCreateRecord<TokenMetadata, ReturnType<typeof defaults>>(
3064
+ defaults
3065
+ );
3066
+ })();
3067
+ return Object.freeze({
3068
+ /**
3069
+ * Create a frozen instance of {@link TokenMetadata}, with defaults specified
3070
+ * in Rust, in the {@link breez_sdk_spark} crate.
3071
+ */
3072
+ create,
3073
+
3074
+ /**
3075
+ * Create a frozen instance of {@link TokenMetadata}, with defaults specified
3076
+ * in Rust, in the {@link breez_sdk_spark} crate.
3077
+ */
3078
+ new: create,
3079
+
3080
+ /**
3081
+ * Defaults specified in the {@link breez_sdk_spark} crate.
3082
+ */
3083
+ defaults: () => Object.freeze(defaults()) as Partial<TokenMetadata>,
3084
+ });
3085
+ })();
3086
+
3087
+ const FfiConverterTypeTokenMetadata = (() => {
3088
+ type TypeName = TokenMetadata;
3089
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
3090
+ read(from: RustBuffer): TypeName {
3091
+ return {
3092
+ identifier: FfiConverterString.read(from),
3093
+ issuerPublicKey: FfiConverterString.read(from),
3094
+ name: FfiConverterString.read(from),
3095
+ ticker: FfiConverterString.read(from),
3096
+ decimals: FfiConverterUInt32.read(from),
3097
+ maxSupply: FfiConverterTypeu128.read(from),
3098
+ isFreezable: FfiConverterBool.read(from),
3099
+ };
3100
+ }
3101
+ write(value: TypeName, into: RustBuffer): void {
3102
+ FfiConverterString.write(value.identifier, into);
3103
+ FfiConverterString.write(value.issuerPublicKey, into);
3104
+ FfiConverterString.write(value.name, into);
3105
+ FfiConverterString.write(value.ticker, into);
3106
+ FfiConverterUInt32.write(value.decimals, into);
3107
+ FfiConverterTypeu128.write(value.maxSupply, into);
3108
+ FfiConverterBool.write(value.isFreezable, into);
3109
+ }
3110
+ allocationSize(value: TypeName): number {
3111
+ return (
3112
+ FfiConverterString.allocationSize(value.identifier) +
3113
+ FfiConverterString.allocationSize(value.issuerPublicKey) +
3114
+ FfiConverterString.allocationSize(value.name) +
3115
+ FfiConverterString.allocationSize(value.ticker) +
3116
+ FfiConverterUInt32.allocationSize(value.decimals) +
3117
+ FfiConverterTypeu128.allocationSize(value.maxSupply) +
3118
+ FfiConverterBool.allocationSize(value.isFreezable)
3119
+ );
3120
+ }
3121
+ }
3122
+ return new FFIConverter();
3123
+ })();
3124
+
2791
3125
  export type TxStatus = {
2792
3126
  confirmed: boolean;
2793
3127
  blockHeight: /*u32*/ number | undefined;
@@ -2901,42 +3235,330 @@ const FfiConverterTypeUtxo = (() => {
2901
3235
  FfiConverterTypeTxStatus.write(value.status, into);
2902
3236
  }
2903
3237
  allocationSize(value: TypeName): number {
2904
- return (
2905
- FfiConverterString.allocationSize(value.txid) +
2906
- FfiConverterUInt32.allocationSize(value.vout) +
2907
- FfiConverterUInt64.allocationSize(value.value) +
2908
- FfiConverterTypeTxStatus.allocationSize(value.status)
2909
- );
3238
+ return (
3239
+ FfiConverterString.allocationSize(value.txid) +
3240
+ FfiConverterUInt32.allocationSize(value.vout) +
3241
+ FfiConverterUInt64.allocationSize(value.value) +
3242
+ FfiConverterTypeTxStatus.allocationSize(value.status)
3243
+ );
3244
+ }
3245
+ }
3246
+ return new FFIConverter();
3247
+ })();
3248
+
3249
+ export type WaitForPaymentRequest = {
3250
+ identifier: WaitForPaymentIdentifier;
3251
+ };
3252
+
3253
+ /**
3254
+ * Generated factory for {@link WaitForPaymentRequest} record objects.
3255
+ */
3256
+ export const WaitForPaymentRequest = (() => {
3257
+ const defaults = () => ({});
3258
+ const create = (() => {
3259
+ return uniffiCreateRecord<
3260
+ WaitForPaymentRequest,
3261
+ ReturnType<typeof defaults>
3262
+ >(defaults);
3263
+ })();
3264
+ return Object.freeze({
3265
+ /**
3266
+ * Create a frozen instance of {@link WaitForPaymentRequest}, with defaults specified
3267
+ * in Rust, in the {@link breez_sdk_spark} crate.
3268
+ */
3269
+ create,
3270
+
3271
+ /**
3272
+ * Create a frozen instance of {@link WaitForPaymentRequest}, with defaults specified
3273
+ * in Rust, in the {@link breez_sdk_spark} crate.
3274
+ */
3275
+ new: create,
3276
+
3277
+ /**
3278
+ * Defaults specified in the {@link breez_sdk_spark} crate.
3279
+ */
3280
+ defaults: () => Object.freeze(defaults()) as Partial<WaitForPaymentRequest>,
3281
+ });
3282
+ })();
3283
+
3284
+ const FfiConverterTypeWaitForPaymentRequest = (() => {
3285
+ type TypeName = WaitForPaymentRequest;
3286
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
3287
+ read(from: RustBuffer): TypeName {
3288
+ return {
3289
+ identifier: FfiConverterTypeWaitForPaymentIdentifier.read(from),
3290
+ };
3291
+ }
3292
+ write(value: TypeName, into: RustBuffer): void {
3293
+ FfiConverterTypeWaitForPaymentIdentifier.write(value.identifier, into);
3294
+ }
3295
+ allocationSize(value: TypeName): number {
3296
+ return FfiConverterTypeWaitForPaymentIdentifier.allocationSize(
3297
+ value.identifier
3298
+ );
3299
+ }
3300
+ }
3301
+ return new FFIConverter();
3302
+ })();
3303
+
3304
+ export type WaitForPaymentResponse = {
3305
+ payment: Payment;
3306
+ };
3307
+
3308
+ /**
3309
+ * Generated factory for {@link WaitForPaymentResponse} record objects.
3310
+ */
3311
+ export const WaitForPaymentResponse = (() => {
3312
+ const defaults = () => ({});
3313
+ const create = (() => {
3314
+ return uniffiCreateRecord<
3315
+ WaitForPaymentResponse,
3316
+ ReturnType<typeof defaults>
3317
+ >(defaults);
3318
+ })();
3319
+ return Object.freeze({
3320
+ /**
3321
+ * Create a frozen instance of {@link WaitForPaymentResponse}, with defaults specified
3322
+ * in Rust, in the {@link breez_sdk_spark} crate.
3323
+ */
3324
+ create,
3325
+
3326
+ /**
3327
+ * Create a frozen instance of {@link WaitForPaymentResponse}, with defaults specified
3328
+ * in Rust, in the {@link breez_sdk_spark} crate.
3329
+ */
3330
+ new: create,
3331
+
3332
+ /**
3333
+ * Defaults specified in the {@link breez_sdk_spark} crate.
3334
+ */
3335
+ defaults: () =>
3336
+ Object.freeze(defaults()) as Partial<WaitForPaymentResponse>,
3337
+ });
3338
+ })();
3339
+
3340
+ const FfiConverterTypeWaitForPaymentResponse = (() => {
3341
+ type TypeName = WaitForPaymentResponse;
3342
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
3343
+ read(from: RustBuffer): TypeName {
3344
+ return {
3345
+ payment: FfiConverterTypePayment.read(from),
3346
+ };
3347
+ }
3348
+ write(value: TypeName, into: RustBuffer): void {
3349
+ FfiConverterTypePayment.write(value.payment, into);
3350
+ }
3351
+ allocationSize(value: TypeName): number {
3352
+ return FfiConverterTypePayment.allocationSize(value.payment);
3353
+ }
3354
+ }
3355
+ return new FFIConverter();
3356
+ })();
3357
+
3358
+ const stringConverter = {
3359
+ stringToBytes: (s: string) =>
3360
+ uniffiCaller.rustCall((status) =>
3361
+ nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
3362
+ s,
3363
+ status
3364
+ )
3365
+ ),
3366
+ bytesToString: (ab: UniffiByteArray) =>
3367
+ uniffiCaller.rustCall((status) =>
3368
+ nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
3369
+ ab,
3370
+ status
3371
+ )
3372
+ ),
3373
+ stringByteLength: (s: string) =>
3374
+ uniffiCaller.rustCall((status) =>
3375
+ nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(
3376
+ s,
3377
+ status
3378
+ )
3379
+ ),
3380
+ };
3381
+ const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
3382
+
3383
+ /**
3384
+ * Typealias from the type name used in the UDL file to the custom type. This
3385
+ * is needed because the UDL type name is used in function/method signatures.
3386
+ */
3387
+ export type U128 = bigint;
3388
+
3389
+ // FfiConverter for U128
3390
+ const FfiConverterTypeu128 = (() => {
3391
+ type TsType = U128;
3392
+ type FfiType = Uint8Array;
3393
+ const intermediateConverter = FfiConverterString;
3394
+ class FFIConverter implements FfiConverter<FfiType, TsType> {
3395
+ lift(value: FfiType): TsType {
3396
+ const intermediate = intermediateConverter.lift(value);
3397
+ return BigInt(intermediate);
3398
+ }
3399
+ lower(value: TsType): FfiType {
3400
+ const intermediate = value.toString();
3401
+ return intermediateConverter.lower(intermediate);
3402
+ }
3403
+ read(from: RustBuffer): TsType {
3404
+ const intermediate = intermediateConverter.read(from);
3405
+ return BigInt(intermediate);
3406
+ }
3407
+ write(value: TsType, into: RustBuffer): void {
3408
+ const intermediate = value.toString();
3409
+ intermediateConverter.write(intermediate, into);
3410
+ }
3411
+ allocationSize(value: TsType): number {
3412
+ const intermediate = value.toString();
3413
+ return intermediateConverter.allocationSize(intermediate);
3414
+ }
3415
+ }
3416
+
3417
+ return new FFIConverter();
3418
+ })();
3419
+
3420
+ // Enum: AssetFilter
3421
+ export enum AssetFilter_Tags {
3422
+ Bitcoin = 'Bitcoin',
3423
+ Token = 'Token',
3424
+ }
3425
+ /**
3426
+ * A field of [`ListPaymentsRequest`] when listing payments filtered by asset
3427
+ */
3428
+ export const AssetFilter = (() => {
3429
+ type Bitcoin__interface = {
3430
+ tag: AssetFilter_Tags.Bitcoin;
3431
+ };
3432
+
3433
+ class Bitcoin_ extends UniffiEnum implements Bitcoin__interface {
3434
+ /**
3435
+ * @private
3436
+ * This field is private and should not be used, use `tag` instead.
3437
+ */
3438
+ readonly [uniffiTypeNameSymbol] = 'AssetFilter';
3439
+ readonly tag = AssetFilter_Tags.Bitcoin;
3440
+ constructor() {
3441
+ super('AssetFilter', 'Bitcoin');
3442
+ }
3443
+
3444
+ static new(): Bitcoin_ {
3445
+ return new Bitcoin_();
3446
+ }
3447
+
3448
+ static instanceOf(obj: any): obj is Bitcoin_ {
3449
+ return obj.tag === AssetFilter_Tags.Bitcoin;
3450
+ }
3451
+ }
3452
+
3453
+ type Token__interface = {
3454
+ tag: AssetFilter_Tags.Token;
3455
+ inner: Readonly<{ tokenIdentifier: string | undefined }>;
3456
+ };
3457
+
3458
+ class Token_ extends UniffiEnum implements Token__interface {
3459
+ /**
3460
+ * @private
3461
+ * This field is private and should not be used, use `tag` instead.
3462
+ */
3463
+ readonly [uniffiTypeNameSymbol] = 'AssetFilter';
3464
+ readonly tag = AssetFilter_Tags.Token;
3465
+ readonly inner: Readonly<{ tokenIdentifier: string | undefined }>;
3466
+ constructor(inner: {
3467
+ /**
3468
+ * Optional token identifier to filter by
3469
+ */ tokenIdentifier: string | undefined;
3470
+ }) {
3471
+ super('AssetFilter', 'Token');
3472
+ this.inner = Object.freeze(inner);
3473
+ }
3474
+
3475
+ static new(inner: {
3476
+ /**
3477
+ * Optional token identifier to filter by
3478
+ */ tokenIdentifier: string | undefined;
3479
+ }): Token_ {
3480
+ return new Token_(inner);
3481
+ }
3482
+
3483
+ static instanceOf(obj: any): obj is Token_ {
3484
+ return obj.tag === AssetFilter_Tags.Token;
3485
+ }
3486
+ }
3487
+
3488
+ function instanceOf(obj: any): obj is AssetFilter {
3489
+ return obj[uniffiTypeNameSymbol] === 'AssetFilter';
3490
+ }
3491
+
3492
+ return Object.freeze({
3493
+ instanceOf,
3494
+ Bitcoin: Bitcoin_,
3495
+ Token: Token_,
3496
+ });
3497
+ })();
3498
+
3499
+ /**
3500
+ * A field of [`ListPaymentsRequest`] when listing payments filtered by asset
3501
+ */
3502
+
3503
+ export type AssetFilter = InstanceType<
3504
+ (typeof AssetFilter)[keyof Omit<typeof AssetFilter, 'instanceOf'>]
3505
+ >;
3506
+
3507
+ // FfiConverter for enum AssetFilter
3508
+ const FfiConverterTypeAssetFilter = (() => {
3509
+ const ordinalConverter = FfiConverterInt32;
3510
+ type TypeName = AssetFilter;
3511
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
3512
+ read(from: RustBuffer): TypeName {
3513
+ switch (ordinalConverter.read(from)) {
3514
+ case 1:
3515
+ return new AssetFilter.Bitcoin();
3516
+ case 2:
3517
+ return new AssetFilter.Token({
3518
+ tokenIdentifier: FfiConverterOptionalString.read(from),
3519
+ });
3520
+ default:
3521
+ throw new UniffiInternalError.UnexpectedEnumCase();
3522
+ }
3523
+ }
3524
+ write(value: TypeName, into: RustBuffer): void {
3525
+ switch (value.tag) {
3526
+ case AssetFilter_Tags.Bitcoin: {
3527
+ ordinalConverter.write(1, into);
3528
+ return;
3529
+ }
3530
+ case AssetFilter_Tags.Token: {
3531
+ ordinalConverter.write(2, into);
3532
+ const inner = value.inner;
3533
+ FfiConverterOptionalString.write(inner.tokenIdentifier, into);
3534
+ return;
3535
+ }
3536
+ default:
3537
+ // Throwing from here means that AssetFilter_Tags hasn't matched an ordinal.
3538
+ throw new UniffiInternalError.UnexpectedEnumCase();
3539
+ }
3540
+ }
3541
+ allocationSize(value: TypeName): number {
3542
+ switch (value.tag) {
3543
+ case AssetFilter_Tags.Bitcoin: {
3544
+ return ordinalConverter.allocationSize(1);
3545
+ }
3546
+ case AssetFilter_Tags.Token: {
3547
+ const inner = value.inner;
3548
+ let size = ordinalConverter.allocationSize(2);
3549
+ size += FfiConverterOptionalString.allocationSize(
3550
+ inner.tokenIdentifier
3551
+ );
3552
+ return size;
3553
+ }
3554
+ default:
3555
+ throw new UniffiInternalError.UnexpectedEnumCase();
3556
+ }
2910
3557
  }
2911
3558
  }
2912
3559
  return new FFIConverter();
2913
3560
  })();
2914
3561
 
2915
- const stringConverter = {
2916
- stringToBytes: (s: string) =>
2917
- uniffiCaller.rustCall((status) =>
2918
- nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
2919
- s,
2920
- status
2921
- )
2922
- ),
2923
- bytesToString: (ab: UniffiByteArray) =>
2924
- uniffiCaller.rustCall((status) =>
2925
- nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
2926
- ab,
2927
- status
2928
- )
2929
- ),
2930
- stringByteLength: (s: string) =>
2931
- uniffiCaller.rustCall((status) =>
2932
- nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(
2933
- s,
2934
- status
2935
- )
2936
- ),
2937
- };
2938
- const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
2939
-
2940
3562
  // Error type: ChainServiceError
2941
3563
 
2942
3564
  // Enum: ChainServiceError
@@ -3618,6 +4240,7 @@ const FfiConverterTypeOnchainConfirmationSpeed = (() => {
3618
4240
  // Enum: PaymentDetails
3619
4241
  export enum PaymentDetails_Tags {
3620
4242
  Spark = 'Spark',
4243
+ Token = 'Token',
3621
4244
  Lightning = 'Lightning',
3622
4245
  Withdraw = 'Withdraw',
3623
4246
  Deposit = 'Deposit',
@@ -3647,6 +4270,33 @@ export const PaymentDetails = (() => {
3647
4270
  }
3648
4271
  }
3649
4272
 
4273
+ type Token__interface = {
4274
+ tag: PaymentDetails_Tags.Token;
4275
+ inner: Readonly<{ metadata: TokenMetadata; txHash: string }>;
4276
+ };
4277
+
4278
+ class Token_ extends UniffiEnum implements Token__interface {
4279
+ /**
4280
+ * @private
4281
+ * This field is private and should not be used, use `tag` instead.
4282
+ */
4283
+ readonly [uniffiTypeNameSymbol] = 'PaymentDetails';
4284
+ readonly tag = PaymentDetails_Tags.Token;
4285
+ readonly inner: Readonly<{ metadata: TokenMetadata; txHash: string }>;
4286
+ constructor(inner: { metadata: TokenMetadata; txHash: string }) {
4287
+ super('PaymentDetails', 'Token');
4288
+ this.inner = Object.freeze(inner);
4289
+ }
4290
+
4291
+ static new(inner: { metadata: TokenMetadata; txHash: string }): Token_ {
4292
+ return new Token_(inner);
4293
+ }
4294
+
4295
+ static instanceOf(obj: any): obj is Token_ {
4296
+ return obj.tag === PaymentDetails_Tags.Token;
4297
+ }
4298
+ }
4299
+
3650
4300
  type Lightning__interface = {
3651
4301
  tag: PaymentDetails_Tags.Lightning;
3652
4302
  inner: Readonly<{
@@ -3791,6 +4441,7 @@ export const PaymentDetails = (() => {
3791
4441
  return Object.freeze({
3792
4442
  instanceOf,
3793
4443
  Spark: Spark_,
4444
+ Token: Token_,
3794
4445
  Lightning: Lightning_,
3795
4446
  Withdraw: Withdraw_,
3796
4447
  Deposit: Deposit_,
@@ -3811,6 +4462,11 @@ const FfiConverterTypePaymentDetails = (() => {
3811
4462
  case 1:
3812
4463
  return new PaymentDetails.Spark();
3813
4464
  case 2:
4465
+ return new PaymentDetails.Token({
4466
+ metadata: FfiConverterTypeTokenMetadata.read(from),
4467
+ txHash: FfiConverterString.read(from),
4468
+ });
4469
+ case 3:
3814
4470
  return new PaymentDetails.Lightning({
3815
4471
  description: FfiConverterOptionalString.read(from),
3816
4472
  preimage: FfiConverterOptionalString.read(from),
@@ -3819,11 +4475,11 @@ const FfiConverterTypePaymentDetails = (() => {
3819
4475
  destinationPubkey: FfiConverterString.read(from),
3820
4476
  lnurlPayInfo: FfiConverterOptionalTypeLnurlPayInfo.read(from),
3821
4477
  });
3822
- case 3:
4478
+ case 4:
3823
4479
  return new PaymentDetails.Withdraw({
3824
4480
  txId: FfiConverterString.read(from),
3825
4481
  });
3826
- case 4:
4482
+ case 5:
3827
4483
  return new PaymentDetails.Deposit({
3828
4484
  txId: FfiConverterString.read(from),
3829
4485
  });
@@ -3837,9 +4493,16 @@ const FfiConverterTypePaymentDetails = (() => {
3837
4493
  ordinalConverter.write(1, into);
3838
4494
  return;
3839
4495
  }
3840
- case PaymentDetails_Tags.Lightning: {
4496
+ case PaymentDetails_Tags.Token: {
3841
4497
  ordinalConverter.write(2, into);
3842
4498
  const inner = value.inner;
4499
+ FfiConverterTypeTokenMetadata.write(inner.metadata, into);
4500
+ FfiConverterString.write(inner.txHash, into);
4501
+ return;
4502
+ }
4503
+ case PaymentDetails_Tags.Lightning: {
4504
+ ordinalConverter.write(3, into);
4505
+ const inner = value.inner;
3843
4506
  FfiConverterOptionalString.write(inner.description, into);
3844
4507
  FfiConverterOptionalString.write(inner.preimage, into);
3845
4508
  FfiConverterString.write(inner.invoice, into);
@@ -3849,13 +4512,13 @@ const FfiConverterTypePaymentDetails = (() => {
3849
4512
  return;
3850
4513
  }
3851
4514
  case PaymentDetails_Tags.Withdraw: {
3852
- ordinalConverter.write(3, into);
4515
+ ordinalConverter.write(4, into);
3853
4516
  const inner = value.inner;
3854
4517
  FfiConverterString.write(inner.txId, into);
3855
4518
  return;
3856
4519
  }
3857
4520
  case PaymentDetails_Tags.Deposit: {
3858
- ordinalConverter.write(4, into);
4521
+ ordinalConverter.write(5, into);
3859
4522
  const inner = value.inner;
3860
4523
  FfiConverterString.write(inner.txId, into);
3861
4524
  return;
@@ -3870,9 +4533,16 @@ const FfiConverterTypePaymentDetails = (() => {
3870
4533
  case PaymentDetails_Tags.Spark: {
3871
4534
  return ordinalConverter.allocationSize(1);
3872
4535
  }
3873
- case PaymentDetails_Tags.Lightning: {
4536
+ case PaymentDetails_Tags.Token: {
3874
4537
  const inner = value.inner;
3875
4538
  let size = ordinalConverter.allocationSize(2);
4539
+ size += FfiConverterTypeTokenMetadata.allocationSize(inner.metadata);
4540
+ size += FfiConverterString.allocationSize(inner.txHash);
4541
+ return size;
4542
+ }
4543
+ case PaymentDetails_Tags.Lightning: {
4544
+ const inner = value.inner;
4545
+ let size = ordinalConverter.allocationSize(3);
3876
4546
  size += FfiConverterOptionalString.allocationSize(inner.description);
3877
4547
  size += FfiConverterOptionalString.allocationSize(inner.preimage);
3878
4548
  size += FfiConverterString.allocationSize(inner.invoice);
@@ -3885,13 +4555,13 @@ const FfiConverterTypePaymentDetails = (() => {
3885
4555
  }
3886
4556
  case PaymentDetails_Tags.Withdraw: {
3887
4557
  const inner = value.inner;
3888
- let size = ordinalConverter.allocationSize(3);
4558
+ let size = ordinalConverter.allocationSize(4);
3889
4559
  size += FfiConverterString.allocationSize(inner.txId);
3890
4560
  return size;
3891
4561
  }
3892
4562
  case PaymentDetails_Tags.Deposit: {
3893
4563
  const inner = value.inner;
3894
- let size = ordinalConverter.allocationSize(4);
4564
+ let size = ordinalConverter.allocationSize(5);
3895
4565
  size += FfiConverterString.allocationSize(inner.txId);
3896
4566
  return size;
3897
4567
  }
@@ -3906,6 +4576,7 @@ const FfiConverterTypePaymentDetails = (() => {
3906
4576
  export enum PaymentMethod {
3907
4577
  Lightning,
3908
4578
  Spark,
4579
+ Token,
3909
4580
  Deposit,
3910
4581
  Withdraw,
3911
4582
  Unknown,
@@ -3922,10 +4593,12 @@ const FfiConverterTypePaymentMethod = (() => {
3922
4593
  case 2:
3923
4594
  return PaymentMethod.Spark;
3924
4595
  case 3:
3925
- return PaymentMethod.Deposit;
4596
+ return PaymentMethod.Token;
3926
4597
  case 4:
3927
- return PaymentMethod.Withdraw;
4598
+ return PaymentMethod.Deposit;
3928
4599
  case 5:
4600
+ return PaymentMethod.Withdraw;
4601
+ case 6:
3929
4602
  return PaymentMethod.Unknown;
3930
4603
  default:
3931
4604
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -3937,12 +4610,14 @@ const FfiConverterTypePaymentMethod = (() => {
3937
4610
  return ordinalConverter.write(1, into);
3938
4611
  case PaymentMethod.Spark:
3939
4612
  return ordinalConverter.write(2, into);
3940
- case PaymentMethod.Deposit:
4613
+ case PaymentMethod.Token:
3941
4614
  return ordinalConverter.write(3, into);
3942
- case PaymentMethod.Withdraw:
4615
+ case PaymentMethod.Deposit:
3943
4616
  return ordinalConverter.write(4, into);
3944
- case PaymentMethod.Unknown:
4617
+ case PaymentMethod.Withdraw:
3945
4618
  return ordinalConverter.write(5, into);
4619
+ case PaymentMethod.Unknown:
4620
+ return ordinalConverter.write(6, into);
3946
4621
  }
3947
4622
  }
3948
4623
  allocationSize(value: TypeName): number {
@@ -5403,7 +6078,11 @@ export const SendPaymentMethod = (() => {
5403
6078
 
5404
6079
  type SparkAddress__interface = {
5405
6080
  tag: SendPaymentMethod_Tags.SparkAddress;
5406
- inner: Readonly<{ address: string; feeSats: /*u64*/ bigint }>;
6081
+ inner: Readonly<{
6082
+ address: string;
6083
+ fee: U128;
6084
+ tokenIdentifier: string | undefined;
6085
+ }>;
5407
6086
  };
5408
6087
 
5409
6088
  class SparkAddress_ extends UniffiEnum implements SparkAddress__interface {
@@ -5413,15 +6092,36 @@ export const SendPaymentMethod = (() => {
5413
6092
  */
5414
6093
  readonly [uniffiTypeNameSymbol] = 'SendPaymentMethod';
5415
6094
  readonly tag = SendPaymentMethod_Tags.SparkAddress;
5416
- readonly inner: Readonly<{ address: string; feeSats: /*u64*/ bigint }>;
5417
- constructor(inner: { address: string; feeSats: /*u64*/ bigint }) {
6095
+ readonly inner: Readonly<{
6096
+ address: string;
6097
+ fee: U128;
6098
+ tokenIdentifier: string | undefined;
6099
+ }>;
6100
+ constructor(inner: {
6101
+ address: string;
6102
+ /**
6103
+ * Fee to pay for the transaction
6104
+ * Denominated in sats if token identifier is empty, otherwise in the token base units
6105
+ */ fee: U128;
6106
+ /**
6107
+ * The presence of this field indicates that the payment is for a token
6108
+ * If empty, it is a Bitcoin payment
6109
+ */ tokenIdentifier: string | undefined;
6110
+ }) {
5418
6111
  super('SendPaymentMethod', 'SparkAddress');
5419
6112
  this.inner = Object.freeze(inner);
5420
6113
  }
5421
6114
 
5422
6115
  static new(inner: {
5423
6116
  address: string;
5424
- feeSats: /*u64*/ bigint;
6117
+ /**
6118
+ * Fee to pay for the transaction
6119
+ * Denominated in sats if token identifier is empty, otherwise in the token base units
6120
+ */ fee: U128;
6121
+ /**
6122
+ * The presence of this field indicates that the payment is for a token
6123
+ * If empty, it is a Bitcoin payment
6124
+ */ tokenIdentifier: string | undefined;
5425
6125
  }): SparkAddress_ {
5426
6126
  return new SparkAddress_(inner);
5427
6127
  }
@@ -5468,7 +6168,8 @@ const FfiConverterTypeSendPaymentMethod = (() => {
5468
6168
  case 3:
5469
6169
  return new SendPaymentMethod.SparkAddress({
5470
6170
  address: FfiConverterString.read(from),
5471
- feeSats: FfiConverterUInt64.read(from),
6171
+ fee: FfiConverterTypeu128.read(from),
6172
+ tokenIdentifier: FfiConverterOptionalString.read(from),
5472
6173
  });
5473
6174
  default:
5474
6175
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -5498,7 +6199,8 @@ const FfiConverterTypeSendPaymentMethod = (() => {
5498
6199
  ordinalConverter.write(3, into);
5499
6200
  const inner = value.inner;
5500
6201
  FfiConverterString.write(inner.address, into);
5501
- FfiConverterUInt64.write(inner.feeSats, into);
6202
+ FfiConverterTypeu128.write(inner.fee, into);
6203
+ FfiConverterOptionalString.write(inner.tokenIdentifier, into);
5502
6204
  return;
5503
6205
  }
5504
6206
  default:
@@ -5535,7 +6237,10 @@ const FfiConverterTypeSendPaymentMethod = (() => {
5535
6237
  const inner = value.inner;
5536
6238
  let size = ordinalConverter.allocationSize(3);
5537
6239
  size += FfiConverterString.allocationSize(inner.address);
5538
- size += FfiConverterUInt64.allocationSize(inner.feeSats);
6240
+ size += FfiConverterTypeu128.allocationSize(inner.fee);
6241
+ size += FfiConverterOptionalString.allocationSize(
6242
+ inner.tokenIdentifier
6243
+ );
5539
6244
  return size;
5540
6245
  }
5541
6246
  default:
@@ -5586,7 +6291,10 @@ export const SendPaymentOptions = (() => {
5586
6291
 
5587
6292
  type Bolt11Invoice__interface = {
5588
6293
  tag: SendPaymentOptions_Tags.Bolt11Invoice;
5589
- inner: Readonly<{ preferSpark: boolean }>;
6294
+ inner: Readonly<{
6295
+ preferSpark: boolean;
6296
+ completionTimeoutSecs: /*u32*/ number | undefined;
6297
+ }>;
5590
6298
  };
5591
6299
 
5592
6300
  class Bolt11Invoice_ extends UniffiEnum implements Bolt11Invoice__interface {
@@ -5596,13 +6304,28 @@ export const SendPaymentOptions = (() => {
5596
6304
  */
5597
6305
  readonly [uniffiTypeNameSymbol] = 'SendPaymentOptions';
5598
6306
  readonly tag = SendPaymentOptions_Tags.Bolt11Invoice;
5599
- readonly inner: Readonly<{ preferSpark: boolean }>;
5600
- constructor(inner: { preferSpark: boolean }) {
6307
+ readonly inner: Readonly<{
6308
+ preferSpark: boolean;
6309
+ completionTimeoutSecs: /*u32*/ number | undefined;
6310
+ }>;
6311
+ constructor(inner: {
6312
+ preferSpark: boolean;
6313
+ /**
6314
+ * If set, the function will return the payment if it is still pending after this
6315
+ * number of seconds. If unset, the function will return immediately after initiating the payment.
6316
+ */ completionTimeoutSecs: /*u32*/ number | undefined;
6317
+ }) {
5601
6318
  super('SendPaymentOptions', 'Bolt11Invoice');
5602
6319
  this.inner = Object.freeze(inner);
5603
6320
  }
5604
6321
 
5605
- static new(inner: { preferSpark: boolean }): Bolt11Invoice_ {
6322
+ static new(inner: {
6323
+ preferSpark: boolean;
6324
+ /**
6325
+ * If set, the function will return the payment if it is still pending after this
6326
+ * number of seconds. If unset, the function will return immediately after initiating the payment.
6327
+ */ completionTimeoutSecs: /*u32*/ number | undefined;
6328
+ }): Bolt11Invoice_ {
5606
6329
  return new Bolt11Invoice_(inner);
5607
6330
  }
5608
6331
 
@@ -5644,6 +6367,7 @@ const FfiConverterTypeSendPaymentOptions = (() => {
5644
6367
  case 2:
5645
6368
  return new SendPaymentOptions.Bolt11Invoice({
5646
6369
  preferSpark: FfiConverterBool.read(from),
6370
+ completionTimeoutSecs: FfiConverterOptionalUInt32.read(from),
5647
6371
  });
5648
6372
  default:
5649
6373
  throw new UniffiInternalError.UnexpectedEnumCase();
@@ -5664,6 +6388,7 @@ const FfiConverterTypeSendPaymentOptions = (() => {
5664
6388
  ordinalConverter.write(2, into);
5665
6389
  const inner = value.inner;
5666
6390
  FfiConverterBool.write(inner.preferSpark, into);
6391
+ FfiConverterOptionalUInt32.write(inner.completionTimeoutSecs, into);
5667
6392
  return;
5668
6393
  }
5669
6394
  default:
@@ -5685,6 +6410,9 @@ const FfiConverterTypeSendPaymentOptions = (() => {
5685
6410
  const inner = value.inner;
5686
6411
  let size = ordinalConverter.allocationSize(2);
5687
6412
  size += FfiConverterBool.allocationSize(inner.preferSpark);
6413
+ size += FfiConverterOptionalUInt32.allocationSize(
6414
+ inner.completionTimeoutSecs
6415
+ );
5688
6416
  return size;
5689
6417
  }
5690
6418
  default:
@@ -6054,6 +6782,153 @@ const FfiConverterTypeUpdateDepositPayload = (() => {
6054
6782
  return new FFIConverter();
6055
6783
  })();
6056
6784
 
6785
+ // Enum: WaitForPaymentIdentifier
6786
+ export enum WaitForPaymentIdentifier_Tags {
6787
+ PaymentId = 'PaymentId',
6788
+ PaymentRequest = 'PaymentRequest',
6789
+ }
6790
+ export const WaitForPaymentIdentifier = (() => {
6791
+ type PaymentId__interface = {
6792
+ tag: WaitForPaymentIdentifier_Tags.PaymentId;
6793
+ inner: Readonly<[string]>;
6794
+ };
6795
+
6796
+ class PaymentId_ extends UniffiEnum implements PaymentId__interface {
6797
+ /**
6798
+ * @private
6799
+ * This field is private and should not be used, use `tag` instead.
6800
+ */
6801
+ readonly [uniffiTypeNameSymbol] = 'WaitForPaymentIdentifier';
6802
+ readonly tag = WaitForPaymentIdentifier_Tags.PaymentId;
6803
+ readonly inner: Readonly<[string]>;
6804
+ constructor(v0: string) {
6805
+ super('WaitForPaymentIdentifier', 'PaymentId');
6806
+ this.inner = Object.freeze([v0]);
6807
+ }
6808
+
6809
+ static new(v0: string): PaymentId_ {
6810
+ return new PaymentId_(v0);
6811
+ }
6812
+
6813
+ static instanceOf(obj: any): obj is PaymentId_ {
6814
+ return obj.tag === WaitForPaymentIdentifier_Tags.PaymentId;
6815
+ }
6816
+ }
6817
+
6818
+ type PaymentRequest__interface = {
6819
+ tag: WaitForPaymentIdentifier_Tags.PaymentRequest;
6820
+ inner: Readonly<[string]>;
6821
+ };
6822
+
6823
+ class PaymentRequest_
6824
+ extends UniffiEnum
6825
+ implements PaymentRequest__interface
6826
+ {
6827
+ /**
6828
+ * @private
6829
+ * This field is private and should not be used, use `tag` instead.
6830
+ */
6831
+ readonly [uniffiTypeNameSymbol] = 'WaitForPaymentIdentifier';
6832
+ readonly tag = WaitForPaymentIdentifier_Tags.PaymentRequest;
6833
+ readonly inner: Readonly<[string]>;
6834
+ constructor(v0: string) {
6835
+ super('WaitForPaymentIdentifier', 'PaymentRequest');
6836
+ this.inner = Object.freeze([v0]);
6837
+ }
6838
+
6839
+ static new(v0: string): PaymentRequest_ {
6840
+ return new PaymentRequest_(v0);
6841
+ }
6842
+
6843
+ static instanceOf(obj: any): obj is PaymentRequest_ {
6844
+ return obj.tag === WaitForPaymentIdentifier_Tags.PaymentRequest;
6845
+ }
6846
+ }
6847
+
6848
+ function instanceOf(obj: any): obj is WaitForPaymentIdentifier {
6849
+ return obj[uniffiTypeNameSymbol] === 'WaitForPaymentIdentifier';
6850
+ }
6851
+
6852
+ return Object.freeze({
6853
+ instanceOf,
6854
+ PaymentId: PaymentId_,
6855
+ PaymentRequest: PaymentRequest_,
6856
+ });
6857
+ })();
6858
+
6859
+ export type WaitForPaymentIdentifier = InstanceType<
6860
+ (typeof WaitForPaymentIdentifier)[keyof Omit<
6861
+ typeof WaitForPaymentIdentifier,
6862
+ 'instanceOf'
6863
+ >]
6864
+ >;
6865
+
6866
+ // FfiConverter for enum WaitForPaymentIdentifier
6867
+ const FfiConverterTypeWaitForPaymentIdentifier = (() => {
6868
+ const ordinalConverter = FfiConverterInt32;
6869
+ type TypeName = WaitForPaymentIdentifier;
6870
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
6871
+ read(from: RustBuffer): TypeName {
6872
+ switch (ordinalConverter.read(from)) {
6873
+ case 1:
6874
+ return new WaitForPaymentIdentifier.PaymentId(
6875
+ FfiConverterString.read(from)
6876
+ );
6877
+ case 2:
6878
+ return new WaitForPaymentIdentifier.PaymentRequest(
6879
+ FfiConverterString.read(from)
6880
+ );
6881
+ default:
6882
+ throw new UniffiInternalError.UnexpectedEnumCase();
6883
+ }
6884
+ }
6885
+ write(value: TypeName, into: RustBuffer): void {
6886
+ switch (value.tag) {
6887
+ case WaitForPaymentIdentifier_Tags.PaymentId: {
6888
+ ordinalConverter.write(1, into);
6889
+ const inner = value.inner;
6890
+ FfiConverterString.write(inner[0], into);
6891
+ return;
6892
+ }
6893
+ case WaitForPaymentIdentifier_Tags.PaymentRequest: {
6894
+ ordinalConverter.write(2, into);
6895
+ const inner = value.inner;
6896
+ FfiConverterString.write(inner[0], into);
6897
+ return;
6898
+ }
6899
+ default:
6900
+ // Throwing from here means that WaitForPaymentIdentifier_Tags hasn't matched an ordinal.
6901
+ throw new UniffiInternalError.UnexpectedEnumCase();
6902
+ }
6903
+ }
6904
+ allocationSize(value: TypeName): number {
6905
+ switch (value.tag) {
6906
+ case WaitForPaymentIdentifier_Tags.PaymentId: {
6907
+ const inner = value.inner;
6908
+ let size = ordinalConverter.allocationSize(1);
6909
+ size += FfiConverterString.allocationSize(inner[0]);
6910
+ return size;
6911
+ }
6912
+ case WaitForPaymentIdentifier_Tags.PaymentRequest: {
6913
+ const inner = value.inner;
6914
+ let size = ordinalConverter.allocationSize(2);
6915
+ size += FfiConverterString.allocationSize(inner[0]);
6916
+ return size;
6917
+ }
6918
+ default:
6919
+ throw new UniffiInternalError.UnexpectedEnumCase();
6920
+ }
6921
+ }
6922
+ }
6923
+ return new FFIConverter();
6924
+ })();
6925
+
6926
+ // FfiConverter for Map<string, TokenBalance>
6927
+ const FfiConverterMapStringTypeTokenBalance = new FfiConverterMap(
6928
+ FfiConverterString,
6929
+ FfiConverterTypeTokenBalance
6930
+ );
6931
+
6057
6932
  export interface BitcoinChainService {
6058
6933
  getAddressUtxos(
6059
6934
  address: string,
@@ -6569,7 +7444,7 @@ export interface BreezSdkInterface {
6569
7444
  *
6570
7445
  * Result containing either success or an `SdkError` if the background task couldn't be stopped
6571
7446
  */
6572
- disconnect() /*throws*/ : void;
7447
+ disconnect(asyncOpts_?: { signal: AbortSignal }) /*throws*/ : Promise<void>;
6573
7448
  /**
6574
7449
  * Returns the balance of the wallet in satoshis
6575
7450
  */
@@ -6584,6 +7459,18 @@ export interface BreezSdkInterface {
6584
7459
  request: GetPaymentRequest,
6585
7460
  asyncOpts_?: { signal: AbortSignal }
6586
7461
  ) /*throws*/ : Promise<GetPaymentResponse>;
7462
+ /**
7463
+ * Returns the metadata for the given token identifiers.
7464
+ *
7465
+ * Results are not guaranteed to be in the same order as the input token identifiers.
7466
+ *
7467
+ * If the metadata is not found locally in cache, it will be queried from
7468
+ * the Spark network and then cached.
7469
+ */
7470
+ getTokensMetadata(
7471
+ request: GetTokensMetadataRequest,
7472
+ asyncOpts_?: { signal: AbortSignal }
7473
+ ) /*throws*/ : Promise<GetTokensMetadataResponse>;
6587
7474
  /**
6588
7475
  * List fiat currencies for which there is a known exchange rate,
6589
7476
  * sorted by the canonical name of the currency.
@@ -6625,7 +7512,6 @@ export interface BreezSdkInterface {
6625
7512
  request: LnurlPayRequest,
6626
7513
  asyncOpts_?: { signal: AbortSignal }
6627
7514
  ) /*throws*/ : Promise<LnurlPayResponse>;
6628
- pollLightningSendPayment(payment: Payment, sspId: string): void;
6629
7515
  prepareLnurlPay(
6630
7516
  request: PrepareLnurlPayRequest,
6631
7517
  asyncOpts_?: { signal: AbortSignal }
@@ -6638,12 +7524,6 @@ export interface BreezSdkInterface {
6638
7524
  request: ReceivePaymentRequest,
6639
7525
  asyncOpts_?: { signal: AbortSignal }
6640
7526
  ) /*throws*/ : Promise<ReceivePaymentResponse>;
6641
- /**
6642
- * Attempts to recover a lightning address from the lnurl server.
6643
- */
6644
- recoverLightningAddress(asyncOpts_?: {
6645
- signal: AbortSignal;
6646
- }) /*throws*/ : Promise<LightningAddressInfo | undefined>;
6647
7527
  refundDeposit(
6648
7528
  request: RefundDepositRequest,
6649
7529
  asyncOpts_?: { signal: AbortSignal }
@@ -6671,11 +7551,6 @@ export interface BreezSdkInterface {
6671
7551
  request: SendPaymentRequest,
6672
7552
  asyncOpts_?: { signal: AbortSignal }
6673
7553
  ) /*throws*/ : Promise<SendPaymentResponse>;
6674
- sendPaymentInternal(
6675
- request: SendPaymentRequest,
6676
- suppressPaymentEvent: boolean,
6677
- asyncOpts_?: { signal: AbortSignal }
6678
- ) /*throws*/ : Promise<SendPaymentResponse>;
6679
7554
  /**
6680
7555
  * Synchronizes the wallet with the Spark network
6681
7556
  */
@@ -6683,6 +7558,10 @@ export interface BreezSdkInterface {
6683
7558
  request: SyncWalletRequest,
6684
7559
  asyncOpts_?: { signal: AbortSignal }
6685
7560
  ) /*throws*/ : Promise<SyncWalletResponse>;
7561
+ waitForPayment(
7562
+ request: WaitForPaymentRequest,
7563
+ asyncOpts_?: { signal: AbortSignal }
7564
+ ) /*throws*/ : Promise<WaitForPaymentResponse>;
6686
7565
  }
6687
7566
 
6688
7567
  /**
@@ -6870,19 +7749,39 @@ export class BreezSdk
6870
7749
  *
6871
7750
  * Result containing either success or an `SdkError` if the background task couldn't be stopped
6872
7751
  */
6873
- public disconnect(): void /*throws*/ {
6874
- uniffiCaller.rustCallWithError(
6875
- /*liftError:*/ FfiConverterTypeSdkError.lift.bind(
6876
- FfiConverterTypeSdkError
6877
- ),
6878
- /*caller:*/ (callStatus) => {
6879
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_disconnect(
6880
- uniffiTypeBreezSdkObjectFactory.clonePointer(this),
6881
- callStatus
6882
- );
6883
- },
6884
- /*liftString:*/ FfiConverterString.lift
6885
- );
7752
+ public async disconnect(asyncOpts_?: {
7753
+ signal: AbortSignal;
7754
+ }): Promise<void> /*throws*/ {
7755
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
7756
+ try {
7757
+ return await uniffiRustCallAsync(
7758
+ /*rustCaller:*/ uniffiCaller,
7759
+ /*rustFutureFunc:*/ () => {
7760
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_disconnect(
7761
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this)
7762
+ );
7763
+ },
7764
+ /*pollFunc:*/ nativeModule()
7765
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_void,
7766
+ /*cancelFunc:*/ nativeModule()
7767
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_void,
7768
+ /*completeFunc:*/ nativeModule()
7769
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_void,
7770
+ /*freeFunc:*/ nativeModule()
7771
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_void,
7772
+ /*liftFunc:*/ (_v) => {},
7773
+ /*liftString:*/ FfiConverterString.lift,
7774
+ /*asyncOpts:*/ asyncOpts_,
7775
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
7776
+ FfiConverterTypeSdkError
7777
+ )
7778
+ );
7779
+ } catch (__error: any) {
7780
+ if (uniffiIsDebug && __error instanceof Error) {
7781
+ __error.stack = __stack;
7782
+ }
7783
+ throw __error;
7784
+ }
6886
7785
  }
6887
7786
 
6888
7787
  /**
@@ -7003,6 +7902,53 @@ export class BreezSdk
7003
7902
  }
7004
7903
  }
7005
7904
 
7905
+ /**
7906
+ * Returns the metadata for the given token identifiers.
7907
+ *
7908
+ * Results are not guaranteed to be in the same order as the input token identifiers.
7909
+ *
7910
+ * If the metadata is not found locally in cache, it will be queried from
7911
+ * the Spark network and then cached.
7912
+ */
7913
+ public async getTokensMetadata(
7914
+ request: GetTokensMetadataRequest,
7915
+ asyncOpts_?: { signal: AbortSignal }
7916
+ ): Promise<GetTokensMetadataResponse> /*throws*/ {
7917
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
7918
+ try {
7919
+ return await uniffiRustCallAsync(
7920
+ /*rustCaller:*/ uniffiCaller,
7921
+ /*rustFutureFunc:*/ () => {
7922
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_get_tokens_metadata(
7923
+ uniffiTypeBreezSdkObjectFactory.clonePointer(this),
7924
+ FfiConverterTypeGetTokensMetadataRequest.lower(request)
7925
+ );
7926
+ },
7927
+ /*pollFunc:*/ nativeModule()
7928
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
7929
+ /*cancelFunc:*/ nativeModule()
7930
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
7931
+ /*completeFunc:*/ nativeModule()
7932
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
7933
+ /*freeFunc:*/ nativeModule()
7934
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
7935
+ /*liftFunc:*/ FfiConverterTypeGetTokensMetadataResponse.lift.bind(
7936
+ FfiConverterTypeGetTokensMetadataResponse
7937
+ ),
7938
+ /*liftString:*/ FfiConverterString.lift,
7939
+ /*asyncOpts:*/ asyncOpts_,
7940
+ /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
7941
+ FfiConverterTypeSdkError
7942
+ )
7943
+ );
7944
+ } catch (__error: any) {
7945
+ if (uniffiIsDebug && __error instanceof Error) {
7946
+ __error.stack = __stack;
7947
+ }
7948
+ throw __error;
7949
+ }
7950
+ }
7951
+
7006
7952
  /**
7007
7953
  * List fiat currencies for which there is a known exchange rate,
7008
7954
  * sorted by the canonical name of the currency.
@@ -7217,20 +8163,6 @@ export class BreezSdk
7217
8163
  }
7218
8164
  }
7219
8165
 
7220
- public pollLightningSendPayment(payment: Payment, sspId: string): void {
7221
- uniffiCaller.rustCall(
7222
- /*caller:*/ (callStatus) => {
7223
- nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment(
7224
- uniffiTypeBreezSdkObjectFactory.clonePointer(this),
7225
- FfiConverterTypePayment.lower(payment),
7226
- FfiConverterString.lower(sspId),
7227
- callStatus
7228
- );
7229
- },
7230
- /*liftString:*/ FfiConverterString.lift
7231
- );
7232
- }
7233
-
7234
8166
  public async prepareLnurlPay(
7235
8167
  request: PrepareLnurlPayRequest,
7236
8168
  asyncOpts_?: { signal: AbortSignal }
@@ -7348,46 +8280,6 @@ export class BreezSdk
7348
8280
  }
7349
8281
  }
7350
8282
 
7351
- /**
7352
- * Attempts to recover a lightning address from the lnurl server.
7353
- */
7354
- public async recoverLightningAddress(asyncOpts_?: {
7355
- signal: AbortSignal;
7356
- }): Promise<LightningAddressInfo | undefined> /*throws*/ {
7357
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
7358
- try {
7359
- return await uniffiRustCallAsync(
7360
- /*rustCaller:*/ uniffiCaller,
7361
- /*rustFutureFunc:*/ () => {
7362
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_recover_lightning_address(
7363
- uniffiTypeBreezSdkObjectFactory.clonePointer(this)
7364
- );
7365
- },
7366
- /*pollFunc:*/ nativeModule()
7367
- .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
7368
- /*cancelFunc:*/ nativeModule()
7369
- .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
7370
- /*completeFunc:*/ nativeModule()
7371
- .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
7372
- /*freeFunc:*/ nativeModule()
7373
- .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
7374
- /*liftFunc:*/ FfiConverterOptionalTypeLightningAddressInfo.lift.bind(
7375
- FfiConverterOptionalTypeLightningAddressInfo
7376
- ),
7377
- /*liftString:*/ FfiConverterString.lift,
7378
- /*asyncOpts:*/ asyncOpts_,
7379
- /*errorHandler:*/ FfiConverterTypeSdkError.lift.bind(
7380
- FfiConverterTypeSdkError
7381
- )
7382
- );
7383
- } catch (__error: any) {
7384
- if (uniffiIsDebug && __error instanceof Error) {
7385
- __error.stack = __stack;
7386
- }
7387
- throw __error;
7388
- }
7389
- }
7390
-
7391
8283
  public async refundDeposit(
7392
8284
  request: RefundDepositRequest,
7393
8285
  asyncOpts_?: { signal: AbortSignal }
@@ -7550,20 +8442,21 @@ export class BreezSdk
7550
8442
  }
7551
8443
  }
7552
8444
 
7553
- public async sendPaymentInternal(
7554
- request: SendPaymentRequest,
7555
- suppressPaymentEvent: boolean,
8445
+ /**
8446
+ * Synchronizes the wallet with the Spark network
8447
+ */
8448
+ public async syncWallet(
8449
+ request: SyncWalletRequest,
7556
8450
  asyncOpts_?: { signal: AbortSignal }
7557
- ): Promise<SendPaymentResponse> /*throws*/ {
8451
+ ): Promise<SyncWalletResponse> /*throws*/ {
7558
8452
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
7559
8453
  try {
7560
8454
  return await uniffiRustCallAsync(
7561
8455
  /*rustCaller:*/ uniffiCaller,
7562
8456
  /*rustFutureFunc:*/ () => {
7563
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment_internal(
8457
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(
7564
8458
  uniffiTypeBreezSdkObjectFactory.clonePointer(this),
7565
- FfiConverterTypeSendPaymentRequest.lower(request),
7566
- FfiConverterBool.lower(suppressPaymentEvent)
8459
+ FfiConverterTypeSyncWalletRequest.lower(request)
7567
8460
  );
7568
8461
  },
7569
8462
  /*pollFunc:*/ nativeModule()
@@ -7574,8 +8467,8 @@ export class BreezSdk
7574
8467
  .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
7575
8468
  /*freeFunc:*/ nativeModule()
7576
8469
  .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
7577
- /*liftFunc:*/ FfiConverterTypeSendPaymentResponse.lift.bind(
7578
- FfiConverterTypeSendPaymentResponse
8470
+ /*liftFunc:*/ FfiConverterTypeSyncWalletResponse.lift.bind(
8471
+ FfiConverterTypeSyncWalletResponse
7579
8472
  ),
7580
8473
  /*liftString:*/ FfiConverterString.lift,
7581
8474
  /*asyncOpts:*/ asyncOpts_,
@@ -7591,21 +8484,18 @@ export class BreezSdk
7591
8484
  }
7592
8485
  }
7593
8486
 
7594
- /**
7595
- * Synchronizes the wallet with the Spark network
7596
- */
7597
- public async syncWallet(
7598
- request: SyncWalletRequest,
8487
+ public async waitForPayment(
8488
+ request: WaitForPaymentRequest,
7599
8489
  asyncOpts_?: { signal: AbortSignal }
7600
- ): Promise<SyncWalletResponse> /*throws*/ {
8490
+ ): Promise<WaitForPaymentResponse> /*throws*/ {
7601
8491
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
7602
8492
  try {
7603
8493
  return await uniffiRustCallAsync(
7604
8494
  /*rustCaller:*/ uniffiCaller,
7605
8495
  /*rustFutureFunc:*/ () => {
7606
- return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(
8496
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_breezsdk_wait_for_payment(
7607
8497
  uniffiTypeBreezSdkObjectFactory.clonePointer(this),
7608
- FfiConverterTypeSyncWalletRequest.lower(request)
8498
+ FfiConverterTypeWaitForPaymentRequest.lower(request)
7609
8499
  );
7610
8500
  },
7611
8501
  /*pollFunc:*/ nativeModule()
@@ -7616,8 +8506,8 @@ export class BreezSdk
7616
8506
  .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
7617
8507
  /*freeFunc:*/ nativeModule()
7618
8508
  .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
7619
- /*liftFunc:*/ FfiConverterTypeSyncWalletResponse.lift.bind(
7620
- FfiConverterTypeSyncWalletResponse
8509
+ /*liftFunc:*/ FfiConverterTypeWaitForPaymentResponse.lift.bind(
8510
+ FfiConverterTypeWaitForPaymentResponse
7621
8511
  ),
7622
8512
  /*liftString:*/ FfiConverterString.lift,
7623
8513
  /*asyncOpts:*/ asyncOpts_,
@@ -8149,20 +9039,18 @@ export interface Storage {
8149
9039
  asyncOpts_?: { signal: AbortSignal }
8150
9040
  ) /*throws*/ : Promise<void>;
8151
9041
  /**
8152
- * Lists payments with pagination
9042
+ * Lists payments with optional filters and pagination
8153
9043
  *
8154
9044
  * # Arguments
8155
9045
  *
8156
- * * `offset` - Number of records to skip
8157
- * * `limit` - Maximum number of records to return
9046
+ * * `list_payments_request` - The request to list payments
8158
9047
  *
8159
9048
  * # Returns
8160
9049
  *
8161
9050
  * A vector of payments or a `StorageError`
8162
9051
  */
8163
9052
  listPayments(
8164
- offset: /*u32*/ number | undefined,
8165
- limit: /*u32*/ number | undefined,
9053
+ request: ListPaymentsRequest,
8166
9054
  asyncOpts_?: { signal: AbortSignal }
8167
9055
  ) /*throws*/ : Promise<Array<Payment>>;
8168
9056
  /**
@@ -8211,6 +9099,19 @@ export interface Storage {
8211
9099
  id: string,
8212
9100
  asyncOpts_?: { signal: AbortSignal }
8213
9101
  ) /*throws*/ : Promise<Payment>;
9102
+ /**
9103
+ * Gets a payment by its invoice
9104
+ * # Arguments
9105
+ *
9106
+ * * `invoice` - The invoice of the payment to retrieve
9107
+ * # Returns
9108
+ *
9109
+ * The payment if found or None if not found
9110
+ */
9111
+ getPaymentByInvoice(
9112
+ invoice: string,
9113
+ asyncOpts_?: { signal: AbortSignal }
9114
+ ) /*throws*/ : Promise<Payment | undefined>;
8214
9115
  /**
8215
9116
  * Add a deposit to storage
8216
9117
  * # Arguments
@@ -8405,20 +9306,18 @@ export class StorageImpl extends UniffiAbstractObject implements Storage {
8405
9306
  }
8406
9307
 
8407
9308
  /**
8408
- * Lists payments with pagination
9309
+ * Lists payments with optional filters and pagination
8409
9310
  *
8410
9311
  * # Arguments
8411
9312
  *
8412
- * * `offset` - Number of records to skip
8413
- * * `limit` - Maximum number of records to return
9313
+ * * `list_payments_request` - The request to list payments
8414
9314
  *
8415
9315
  * # Returns
8416
9316
  *
8417
9317
  * A vector of payments or a `StorageError`
8418
9318
  */
8419
9319
  public async listPayments(
8420
- offset: /*u32*/ number | undefined,
8421
- limit: /*u32*/ number | undefined,
9320
+ request: ListPaymentsRequest,
8422
9321
  asyncOpts_?: { signal: AbortSignal }
8423
9322
  ): Promise<Array<Payment>> /*throws*/ {
8424
9323
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -8428,8 +9327,7 @@ export class StorageImpl extends UniffiAbstractObject implements Storage {
8428
9327
  /*rustFutureFunc:*/ () => {
8429
9328
  return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_list_payments(
8430
9329
  uniffiTypeStorageImplObjectFactory.clonePointer(this),
8431
- FfiConverterOptionalUInt32.lower(offset),
8432
- FfiConverterOptionalUInt32.lower(limit)
9330
+ FfiConverterTypeListPaymentsRequest.lower(request)
8433
9331
  );
8434
9332
  },
8435
9333
  /*pollFunc:*/ nativeModule()
@@ -8605,6 +9503,54 @@ export class StorageImpl extends UniffiAbstractObject implements Storage {
8605
9503
  }
8606
9504
  }
8607
9505
 
9506
+ /**
9507
+ * Gets a payment by its invoice
9508
+ * # Arguments
9509
+ *
9510
+ * * `invoice` - The invoice of the payment to retrieve
9511
+ * # Returns
9512
+ *
9513
+ * The payment if found or None if not found
9514
+ */
9515
+ public async getPaymentByInvoice(
9516
+ invoice: string,
9517
+ asyncOpts_?: { signal: AbortSignal }
9518
+ ): Promise<Payment | undefined> /*throws*/ {
9519
+ const __stack = uniffiIsDebug ? new Error().stack : undefined;
9520
+ try {
9521
+ return await uniffiRustCallAsync(
9522
+ /*rustCaller:*/ uniffiCaller,
9523
+ /*rustFutureFunc:*/ () => {
9524
+ return nativeModule().ubrn_uniffi_breez_sdk_spark_fn_method_storage_get_payment_by_invoice(
9525
+ uniffiTypeStorageImplObjectFactory.clonePointer(this),
9526
+ FfiConverterString.lower(invoice)
9527
+ );
9528
+ },
9529
+ /*pollFunc:*/ nativeModule()
9530
+ .ubrn_ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
9531
+ /*cancelFunc:*/ nativeModule()
9532
+ .ubrn_ffi_breez_sdk_spark_rust_future_cancel_rust_buffer,
9533
+ /*completeFunc:*/ nativeModule()
9534
+ .ubrn_ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
9535
+ /*freeFunc:*/ nativeModule()
9536
+ .ubrn_ffi_breez_sdk_spark_rust_future_free_rust_buffer,
9537
+ /*liftFunc:*/ FfiConverterOptionalTypePayment.lift.bind(
9538
+ FfiConverterOptionalTypePayment
9539
+ ),
9540
+ /*liftString:*/ FfiConverterString.lift,
9541
+ /*asyncOpts:*/ asyncOpts_,
9542
+ /*errorHandler:*/ FfiConverterTypeStorageError.lift.bind(
9543
+ FfiConverterTypeStorageError
9544
+ )
9545
+ );
9546
+ } catch (__error: any) {
9547
+ if (uniffiIsDebug && __error instanceof Error) {
9548
+ __error.stack = __stack;
9549
+ }
9550
+ throw __error;
9551
+ }
9552
+ }
9553
+
8608
9554
  /**
8609
9555
  * Add a deposit to storage
8610
9556
  * # Arguments
@@ -9029,8 +9975,7 @@ const uniffiCallbackInterfaceStorage: {
9029
9975
  },
9030
9976
  listPayments: (
9031
9977
  uniffiHandle: bigint,
9032
- offset: Uint8Array,
9033
- limit: Uint8Array,
9978
+ request: Uint8Array,
9034
9979
  uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
9035
9980
  uniffiCallbackData: bigint
9036
9981
  ) => {
@@ -9039,8 +9984,7 @@ const uniffiCallbackInterfaceStorage: {
9039
9984
  ): Promise<Array<Payment>> => {
9040
9985
  const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
9041
9986
  return await jsCallback.listPayments(
9042
- FfiConverterOptionalUInt32.lift(offset),
9043
- FfiConverterOptionalUInt32.lift(limit),
9987
+ FfiConverterTypeListPaymentsRequest.lift(request),
9044
9988
  { signal }
9045
9989
  );
9046
9990
  };
@@ -9204,6 +10148,52 @@ const uniffiCallbackInterfaceStorage: {
9204
10148
  );
9205
10149
  return UniffiResult.success(uniffiForeignFuture);
9206
10150
  },
10151
+ getPaymentByInvoice: (
10152
+ uniffiHandle: bigint,
10153
+ invoice: Uint8Array,
10154
+ uniffiFutureCallback: UniffiForeignFutureCompleteRustBuffer,
10155
+ uniffiCallbackData: bigint
10156
+ ) => {
10157
+ const uniffiMakeCall = async (
10158
+ signal: AbortSignal
10159
+ ): Promise<Payment | undefined> => {
10160
+ const jsCallback = FfiConverterTypeStorage.lift(uniffiHandle);
10161
+ return await jsCallback.getPaymentByInvoice(
10162
+ FfiConverterString.lift(invoice),
10163
+ { signal }
10164
+ );
10165
+ };
10166
+ const uniffiHandleSuccess = (returnValue: Payment | undefined) => {
10167
+ uniffiFutureCallback(
10168
+ uniffiCallbackData,
10169
+ /* UniffiForeignFutureStructRustBuffer */ {
10170
+ returnValue: FfiConverterOptionalTypePayment.lower(returnValue),
10171
+ callStatus: uniffiCaller.createCallStatus(),
10172
+ }
10173
+ );
10174
+ };
10175
+ const uniffiHandleError = (code: number, errorBuf: UniffiByteArray) => {
10176
+ uniffiFutureCallback(
10177
+ uniffiCallbackData,
10178
+ /* UniffiForeignFutureStructRustBuffer */ {
10179
+ returnValue: /*empty*/ new Uint8Array(0),
10180
+ // TODO create callstatus with error.
10181
+ callStatus: { code, errorBuf },
10182
+ }
10183
+ );
10184
+ };
10185
+ const uniffiForeignFuture = uniffiTraitInterfaceCallAsyncWithError(
10186
+ /*makeCall:*/ uniffiMakeCall,
10187
+ /*handleSuccess:*/ uniffiHandleSuccess,
10188
+ /*handleError:*/ uniffiHandleError,
10189
+ /*isErrorType:*/ StorageError.instanceOf,
10190
+ /*lowerError:*/ FfiConverterTypeStorageError.lower.bind(
10191
+ FfiConverterTypeStorageError
10192
+ ),
10193
+ /*lowerString:*/ FfiConverterString.lower
10194
+ );
10195
+ return UniffiResult.success(uniffiForeignFuture);
10196
+ },
9207
10197
  addDeposit: (
9208
10198
  uniffiHandle: bigint,
9209
10199
  txid: Uint8Array,
@@ -9427,6 +10417,11 @@ const FfiConverterOptionalTypeLnurlPayInfo = new FfiConverterOptional(
9427
10417
  FfiConverterTypeLnurlPayInfo
9428
10418
  );
9429
10419
 
10420
+ // FfiConverter for Payment | undefined
10421
+ const FfiConverterOptionalTypePayment = new FfiConverterOptional(
10422
+ FfiConverterTypePayment
10423
+ );
10424
+
9430
10425
  // FfiConverter for string | undefined
9431
10426
  const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
9432
10427
 
@@ -9454,9 +10449,27 @@ const FfiConverterArrayTypePayment = new FfiConverterArray(
9454
10449
  FfiConverterTypePayment
9455
10450
  );
9456
10451
 
10452
+ // FfiConverter for Array<TokenMetadata>
10453
+ const FfiConverterArrayTypeTokenMetadata = new FfiConverterArray(
10454
+ FfiConverterTypeTokenMetadata
10455
+ );
10456
+
9457
10457
  // FfiConverter for Array<Utxo>
9458
10458
  const FfiConverterArrayTypeUtxo = new FfiConverterArray(FfiConverterTypeUtxo);
9459
10459
 
10460
+ // FfiConverter for Array<string>
10461
+ const FfiConverterArrayString = new FfiConverterArray(FfiConverterString);
10462
+
10463
+ // FfiConverter for U128 | undefined
10464
+ const FfiConverterOptionalTypeu128 = new FfiConverterOptional(
10465
+ FfiConverterTypeu128
10466
+ );
10467
+
10468
+ // FfiConverter for AssetFilter | undefined
10469
+ const FfiConverterOptionalTypeAssetFilter = new FfiConverterOptional(
10470
+ FfiConverterTypeAssetFilter
10471
+ );
10472
+
9460
10473
  // FfiConverter for DepositClaimError | undefined
9461
10474
  const FfiConverterOptionalTypeDepositClaimError = new FfiConverterOptional(
9462
10475
  FfiConverterTypeDepositClaimError
@@ -9477,6 +10490,26 @@ const FfiConverterOptionalTypeSendPaymentOptions = new FfiConverterOptional(
9477
10490
  FfiConverterTypeSendPaymentOptions
9478
10491
  );
9479
10492
 
10493
+ // FfiConverter for Array<PaymentStatus>
10494
+ const FfiConverterArrayTypePaymentStatus = new FfiConverterArray(
10495
+ FfiConverterTypePaymentStatus
10496
+ );
10497
+
10498
+ // FfiConverter for Array<PaymentType>
10499
+ const FfiConverterArrayTypePaymentType = new FfiConverterArray(
10500
+ FfiConverterTypePaymentType
10501
+ );
10502
+
10503
+ // FfiConverter for Array<PaymentStatus> | undefined
10504
+ const FfiConverterOptionalArrayTypePaymentStatus = new FfiConverterOptional(
10505
+ FfiConverterArrayTypePaymentStatus
10506
+ );
10507
+
10508
+ // FfiConverter for Array<PaymentType> | undefined
10509
+ const FfiConverterOptionalArrayTypePaymentType = new FfiConverterOptional(
10510
+ FfiConverterArrayTypePaymentType
10511
+ );
10512
+
9480
10513
  /**
9481
10514
  * This should be called before anything else.
9482
10515
  *
@@ -9603,7 +10636,7 @@ function uniffiEnsureInitialized() {
9603
10636
  }
9604
10637
  if (
9605
10638
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_disconnect() !==
9606
- 30986
10639
+ 330
9607
10640
  ) {
9608
10641
  throw new UniffiInternalError.ApiChecksumMismatch(
9609
10642
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_disconnect'
@@ -9633,6 +10666,14 @@ function uniffiEnsureInitialized() {
9633
10666
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment'
9634
10667
  );
9635
10668
  }
10669
+ if (
10670
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_get_tokens_metadata() !==
10671
+ 40125
10672
+ ) {
10673
+ throw new UniffiInternalError.ApiChecksumMismatch(
10674
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_get_tokens_metadata'
10675
+ );
10676
+ }
9636
10677
  if (
9637
10678
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies() !==
9638
10679
  63366
@@ -9673,14 +10714,6 @@ function uniffiEnsureInitialized() {
9673
10714
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay'
9674
10715
  );
9675
10716
  }
9676
- if (
9677
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment() !==
9678
- 57601
9679
- ) {
9680
- throw new UniffiInternalError.ApiChecksumMismatch(
9681
- 'uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment'
9682
- );
9683
- }
9684
10717
  if (
9685
10718
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay() !==
9686
10719
  37691
@@ -9705,14 +10738,6 @@ function uniffiEnsureInitialized() {
9705
10738
  'uniffi_breez_sdk_spark_checksum_method_breezsdk_receive_payment'
9706
10739
  );
9707
10740
  }
9708
- if (
9709
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_recover_lightning_address() !==
9710
- 43367
9711
- ) {
9712
- throw new UniffiInternalError.ApiChecksumMismatch(
9713
- 'uniffi_breez_sdk_spark_checksum_method_breezsdk_recover_lightning_address'
9714
- );
9715
- }
9716
10741
  if (
9717
10742
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_deposit() !==
9718
10743
  33646
@@ -9746,19 +10771,19 @@ function uniffiEnsureInitialized() {
9746
10771
  );
9747
10772
  }
9748
10773
  if (
9749
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal() !==
9750
- 37855
10774
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet() !==
10775
+ 30368
9751
10776
  ) {
9752
10777
  throw new UniffiInternalError.ApiChecksumMismatch(
9753
- 'uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal'
10778
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet'
9754
10779
  );
9755
10780
  }
9756
10781
  if (
9757
- nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet() !==
9758
- 30368
10782
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment() !==
10783
+ 64922
9759
10784
  ) {
9760
10785
  throw new UniffiInternalError.ApiChecksumMismatch(
9761
- 'uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet'
10786
+ 'uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment'
9762
10787
  );
9763
10788
  }
9764
10789
  if (
@@ -9835,7 +10860,7 @@ function uniffiEnsureInitialized() {
9835
10860
  }
9836
10861
  if (
9837
10862
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_list_payments() !==
9838
- 35678
10863
+ 19728
9839
10864
  ) {
9840
10865
  throw new UniffiInternalError.ApiChecksumMismatch(
9841
10866
  'uniffi_breez_sdk_spark_checksum_method_storage_list_payments'
@@ -9865,9 +10890,17 @@ function uniffiEnsureInitialized() {
9865
10890
  'uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_id'
9866
10891
  );
9867
10892
  }
10893
+ if (
10894
+ nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_invoice() !==
10895
+ 57075
10896
+ ) {
10897
+ throw new UniffiInternalError.ApiChecksumMismatch(
10898
+ 'uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_invoice'
10899
+ );
10900
+ }
9868
10901
  if (
9869
10902
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_add_deposit() !==
9870
- 55082
10903
+ 60240
9871
10904
  ) {
9872
10905
  throw new UniffiInternalError.ApiChecksumMismatch(
9873
10906
  'uniffi_breez_sdk_spark_checksum_method_storage_add_deposit'
@@ -9875,7 +10908,7 @@ function uniffiEnsureInitialized() {
9875
10908
  }
9876
10909
  if (
9877
10910
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_delete_deposit() !==
9878
- 13111
10911
+ 60586
9879
10912
  ) {
9880
10913
  throw new UniffiInternalError.ApiChecksumMismatch(
9881
10914
  'uniffi_breez_sdk_spark_checksum_method_storage_delete_deposit'
@@ -9883,7 +10916,7 @@ function uniffiEnsureInitialized() {
9883
10916
  }
9884
10917
  if (
9885
10918
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_list_deposits() !==
9886
- 22806
10919
+ 54118
9887
10920
  ) {
9888
10921
  throw new UniffiInternalError.ApiChecksumMismatch(
9889
10922
  'uniffi_breez_sdk_spark_checksum_method_storage_list_deposits'
@@ -9891,7 +10924,7 @@ function uniffiEnsureInitialized() {
9891
10924
  }
9892
10925
  if (
9893
10926
  nativeModule().ubrn_uniffi_breez_sdk_spark_checksum_method_storage_update_deposit() !==
9894
- 48478
10927
+ 39803
9895
10928
  ) {
9896
10929
  throw new UniffiInternalError.ApiChecksumMismatch(
9897
10930
  'uniffi_breez_sdk_spark_checksum_method_storage_update_deposit'
@@ -9931,6 +10964,7 @@ function uniffiEnsureInitialized() {
9931
10964
  export default Object.freeze({
9932
10965
  initialize: uniffiEnsureInitialized,
9933
10966
  converters: {
10967
+ FfiConverterTypeAssetFilter,
9934
10968
  FfiConverterTypeBitcoinChainService,
9935
10969
  FfiConverterTypeBreezSdk,
9936
10970
  FfiConverterTypeCheckLightningAddressRequest,
@@ -9946,6 +10980,8 @@ export default Object.freeze({
9946
10980
  FfiConverterTypeGetInfoResponse,
9947
10981
  FfiConverterTypeGetPaymentRequest,
9948
10982
  FfiConverterTypeGetPaymentResponse,
10983
+ FfiConverterTypeGetTokensMetadataRequest,
10984
+ FfiConverterTypeGetTokensMetadataResponse,
9949
10985
  FfiConverterTypeKeySetType,
9950
10986
  FfiConverterTypeLightningAddressInfo,
9951
10987
  FfiConverterTypeListFiatCurrenciesResponse,
@@ -9988,8 +11024,14 @@ export default Object.freeze({
9988
11024
  FfiConverterTypeStorage,
9989
11025
  FfiConverterTypeSyncWalletRequest,
9990
11026
  FfiConverterTypeSyncWalletResponse,
11027
+ FfiConverterTypeTokenBalance,
11028
+ FfiConverterTypeTokenMetadata,
9991
11029
  FfiConverterTypeTxStatus,
9992
11030
  FfiConverterTypeUpdateDepositPayload,
9993
11031
  FfiConverterTypeUtxo,
11032
+ FfiConverterTypeWaitForPaymentIdentifier,
11033
+ FfiConverterTypeWaitForPaymentRequest,
11034
+ FfiConverterTypeWaitForPaymentResponse,
11035
+ FfiConverterTypeu128,
9994
11036
  },
9995
11037
  });