@breeztech/breez-sdk-spark-react-native 0.3.2 → 0.3.3

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 +147 -0
  2. package/cpp/generated/breez_sdk_spark.hpp +18 -0
  3. package/lib/commonjs/generated/breez_sdk_common.js +64 -274
  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 +589 -24
  7. package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -1
  8. package/lib/module/generated/breez_sdk_common.js +63 -273
  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 +588 -23
  12. package/lib/module/generated/breez_sdk_spark.js.map +1 -1
  13. package/lib/typescript/commonjs/src/generated/breez_sdk_common.d.ts +79 -183
  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 +6 -0
  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 +571 -19
  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 +79 -183
  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 +6 -0
  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 +571 -19
  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 +118 -373
  27. package/src/generated/breez_sdk_spark-ffi.ts +15 -0
  28. package/src/generated/breez_sdk_spark.ts +1076 -41
@@ -1,4 +1,4 @@
1
- import { type BitcoinAddressDetails, type Bolt11InvoiceDetails, type ExternalInputParser, type FiatCurrency, type FiatService, type LnurlPayRequestDetails, type Rate, type RestClient, InputType, SuccessAction, SuccessActionProcessed } from './breez_sdk_common';
1
+ import { type BitcoinAddressDetails, type Bolt11InvoiceDetails, type ExternalInputParser, type FiatCurrency, type FiatService, type LnurlPayRequestDetails, type LnurlWithdrawRequestDetails, type Rate, type RestClient, type SparkInvoiceDetails, InputType, SuccessAction, SuccessActionProcessed } from './breez_sdk_common';
2
2
  import { type UniffiByteArray, type UniffiRustArcPtr, type UnsafeMutableRawPointer, FfiConverterObject, FfiConverterObjectWithCallbacks, RustBuffer, UniffiAbstractObject, destructorGuardSymbol, pointerLiteralSymbol, uniffiTypeNameSymbol } from 'uniffi-bindgen-react-native';
3
3
  /**
4
4
  * Connects to the Spark network using the provided configuration and mnemonic.
@@ -53,6 +53,61 @@ export declare const CheckLightningAddressRequest: Readonly<{
53
53
  */
54
54
  defaults: () => Partial<CheckLightningAddressRequest>;
55
55
  }>;
56
+ export type CheckMessageRequest = {
57
+ /**
58
+ * The message that was signed
59
+ */
60
+ message: string;
61
+ /**
62
+ * The public key that signed the message
63
+ */
64
+ pubkey: string;
65
+ /**
66
+ * The DER or compact hex encoded signature
67
+ */
68
+ signature: string;
69
+ };
70
+ /**
71
+ * Generated factory for {@link CheckMessageRequest} record objects.
72
+ */
73
+ export declare const CheckMessageRequest: Readonly<{
74
+ /**
75
+ * Create a frozen instance of {@link CheckMessageRequest}, with defaults specified
76
+ * in Rust, in the {@link breez_sdk_spark} crate.
77
+ */
78
+ create: (partial: Partial<CheckMessageRequest> & Required<Omit<CheckMessageRequest, never>>) => CheckMessageRequest;
79
+ /**
80
+ * Create a frozen instance of {@link CheckMessageRequest}, with defaults specified
81
+ * in Rust, in the {@link breez_sdk_spark} crate.
82
+ */
83
+ new: (partial: Partial<CheckMessageRequest> & Required<Omit<CheckMessageRequest, never>>) => CheckMessageRequest;
84
+ /**
85
+ * Defaults specified in the {@link breez_sdk_spark} crate.
86
+ */
87
+ defaults: () => Partial<CheckMessageRequest>;
88
+ }>;
89
+ export type CheckMessageResponse = {
90
+ isValid: boolean;
91
+ };
92
+ /**
93
+ * Generated factory for {@link CheckMessageResponse} record objects.
94
+ */
95
+ export declare const CheckMessageResponse: Readonly<{
96
+ /**
97
+ * Create a frozen instance of {@link CheckMessageResponse}, with defaults specified
98
+ * in Rust, in the {@link breez_sdk_spark} crate.
99
+ */
100
+ create: (partial: Partial<CheckMessageResponse> & Required<Omit<CheckMessageResponse, never>>) => CheckMessageResponse;
101
+ /**
102
+ * Create a frozen instance of {@link CheckMessageResponse}, with defaults specified
103
+ * in Rust, in the {@link breez_sdk_spark} crate.
104
+ */
105
+ new: (partial: Partial<CheckMessageResponse> & Required<Omit<CheckMessageResponse, never>>) => CheckMessageResponse;
106
+ /**
107
+ * Defaults specified in the {@link breez_sdk_spark} crate.
108
+ */
109
+ defaults: () => Partial<CheckMessageResponse>;
110
+ }>;
56
111
  export type ClaimDepositRequest = {
57
112
  txid: string;
58
113
  vout: number;
@@ -635,6 +690,90 @@ export declare const LnurlPayResponse: Readonly<{
635
690
  */
636
691
  defaults: () => Partial<LnurlPayResponse>;
637
692
  }>;
693
+ /**
694
+ * Represents the withdraw LNURL info
695
+ */
696
+ export type LnurlWithdrawInfo = {
697
+ withdrawUrl: string;
698
+ };
699
+ /**
700
+ * Generated factory for {@link LnurlWithdrawInfo} record objects.
701
+ */
702
+ export declare const LnurlWithdrawInfo: Readonly<{
703
+ /**
704
+ * Create a frozen instance of {@link LnurlWithdrawInfo}, with defaults specified
705
+ * in Rust, in the {@link breez_sdk_spark} crate.
706
+ */
707
+ create: (partial: Partial<LnurlWithdrawInfo> & Required<Omit<LnurlWithdrawInfo, never>>) => LnurlWithdrawInfo;
708
+ /**
709
+ * Create a frozen instance of {@link LnurlWithdrawInfo}, with defaults specified
710
+ * in Rust, in the {@link breez_sdk_spark} crate.
711
+ */
712
+ new: (partial: Partial<LnurlWithdrawInfo> & Required<Omit<LnurlWithdrawInfo, never>>) => LnurlWithdrawInfo;
713
+ /**
714
+ * Defaults specified in the {@link breez_sdk_spark} crate.
715
+ */
716
+ defaults: () => Partial<LnurlWithdrawInfo>;
717
+ }>;
718
+ export type LnurlWithdrawRequest = {
719
+ /**
720
+ * The amount to withdraw in satoshis
721
+ * Must be within the min and max withdrawable limits
722
+ */
723
+ amountSats: bigint;
724
+ withdrawRequest: LnurlWithdrawRequestDetails;
725
+ /**
726
+ * If set, the function will return the payment if it is still pending after this
727
+ * number of seconds. If unset, the function will return immediately after
728
+ * initiating the LNURL withdraw.
729
+ */
730
+ completionTimeoutSecs: /*u32*/ number | undefined;
731
+ };
732
+ /**
733
+ * Generated factory for {@link LnurlWithdrawRequest} record objects.
734
+ */
735
+ export declare const LnurlWithdrawRequest: Readonly<{
736
+ /**
737
+ * Create a frozen instance of {@link LnurlWithdrawRequest}, with defaults specified
738
+ * in Rust, in the {@link breez_sdk_spark} crate.
739
+ */
740
+ create: (partial: Partial<LnurlWithdrawRequest> & Required<Omit<LnurlWithdrawRequest, "completionTimeoutSecs">>) => LnurlWithdrawRequest;
741
+ /**
742
+ * Create a frozen instance of {@link LnurlWithdrawRequest}, with defaults specified
743
+ * in Rust, in the {@link breez_sdk_spark} crate.
744
+ */
745
+ new: (partial: Partial<LnurlWithdrawRequest> & Required<Omit<LnurlWithdrawRequest, "completionTimeoutSecs">>) => LnurlWithdrawRequest;
746
+ /**
747
+ * Defaults specified in the {@link breez_sdk_spark} crate.
748
+ */
749
+ defaults: () => Partial<LnurlWithdrawRequest>;
750
+ }>;
751
+ export type LnurlWithdrawResponse = {
752
+ /**
753
+ * The Lightning invoice generated for the LNURL withdraw
754
+ */
755
+ paymentRequest: string;
756
+ payment: Payment | undefined;
757
+ };
758
+ /**
759
+ * Generated factory for {@link LnurlWithdrawResponse} record objects.
760
+ */
761
+ export declare const LnurlWithdrawResponse: Readonly<{
762
+ /**
763
+ * Create a frozen instance of {@link LnurlWithdrawResponse}, with defaults specified
764
+ * in Rust, in the {@link breez_sdk_spark} crate.
765
+ */
766
+ create: (partial: Partial<LnurlWithdrawResponse> & Required<Omit<LnurlWithdrawResponse, never>>) => LnurlWithdrawResponse;
767
+ /**
768
+ * Create a frozen instance of {@link LnurlWithdrawResponse}, with defaults specified
769
+ * in Rust, in the {@link breez_sdk_spark} crate.
770
+ */
771
+ new: (partial: Partial<LnurlWithdrawResponse> & Required<Omit<LnurlWithdrawResponse, never>>) => LnurlWithdrawResponse;
772
+ /**
773
+ * Defaults specified in the {@link breez_sdk_spark} crate.
774
+ */
775
+ defaults: () => Partial<LnurlWithdrawResponse>;
776
+ }>;
638
777
  export type LogEntry = {
639
778
  line: string;
640
779
  level: string;
@@ -720,6 +859,7 @@ export declare const Payment: Readonly<{
720
859
  */
721
860
  export type PaymentMetadata = {
722
861
  lnurlPayInfo: LnurlPayInfo | undefined;
862
+ lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
723
863
  lnurlDescription: string | undefined;
724
864
  };
725
865
  /**
@@ -914,7 +1054,11 @@ export declare const ReceivePaymentRequest: Readonly<{
914
1054
  }>;
915
1055
  export type ReceivePaymentResponse = {
916
1056
  paymentRequest: string;
917
- feeSats: bigint;
1057
+ /**
1058
+ * Fee to pay to receive the payment
1059
+ * Denominated in sats or token base units
1060
+ */
1061
+ fee: U128;
918
1062
  };
919
1063
  /**
920
1064
  * Generated factory for {@link ReceivePaymentResponse} record objects.
@@ -1100,6 +1244,87 @@ export declare const SendPaymentResponse: Readonly<{
1100
1244
  */
1101
1245
  defaults: () => Partial<SendPaymentResponse>;
1102
1246
  }>;
1247
+ export type SignMessageRequest = {
1248
+ message: string;
1249
+ /**
1250
+ * If true, the signature will be encoded in compact format instead of DER format
1251
+ */
1252
+ compact: boolean;
1253
+ };
1254
+ /**
1255
+ * Generated factory for {@link SignMessageRequest} record objects.
1256
+ */
1257
+ export declare const SignMessageRequest: Readonly<{
1258
+ /**
1259
+ * Create a frozen instance of {@link SignMessageRequest}, with defaults specified
1260
+ * in Rust, in the {@link breez_sdk_spark} crate.
1261
+ */
1262
+ create: (partial: Partial<SignMessageRequest> & Required<Omit<SignMessageRequest, never>>) => SignMessageRequest;
1263
+ /**
1264
+ * Create a frozen instance of {@link SignMessageRequest}, with defaults specified
1265
+ * in Rust, in the {@link breez_sdk_spark} crate.
1266
+ */
1267
+ new: (partial: Partial<SignMessageRequest> & Required<Omit<SignMessageRequest, never>>) => SignMessageRequest;
1268
+ /**
1269
+ * Defaults specified in the {@link breez_sdk_spark} crate.
1270
+ */
1271
+ defaults: () => Partial<SignMessageRequest>;
1272
+ }>;
1273
+ export type SignMessageResponse = {
1274
+ pubkey: string;
1275
+ /**
1276
+ * The DER or compact hex encoded signature
1277
+ */
1278
+ signature: string;
1279
+ };
1280
+ /**
1281
+ * Generated factory for {@link SignMessageResponse} record objects.
1282
+ */
1283
+ export declare const SignMessageResponse: Readonly<{
1284
+ /**
1285
+ * Create a frozen instance of {@link SignMessageResponse}, with defaults specified
1286
+ * in Rust, in the {@link breez_sdk_spark} crate.
1287
+ */
1288
+ create: (partial: Partial<SignMessageResponse> & Required<Omit<SignMessageResponse, never>>) => SignMessageResponse;
1289
+ /**
1290
+ * Create a frozen instance of {@link SignMessageResponse}, with defaults specified
1291
+ * in Rust, in the {@link breez_sdk_spark} crate.
1292
+ */
1293
+ new: (partial: Partial<SignMessageResponse> & Required<Omit<SignMessageResponse, never>>) => SignMessageResponse;
1294
+ /**
1295
+ * Defaults specified in the {@link breez_sdk_spark} crate.
1296
+ */
1297
+ defaults: () => Partial<SignMessageResponse>;
1298
+ }>;
1299
+ export type SparkInvoicePaymentDetails = {
1300
+ /**
1301
+ * Represents the spark invoice description
1302
+ */
1303
+ description: string | undefined;
1304
+ /**
1305
+ * The raw spark invoice string
1306
+ */
1307
+ invoice: string;
1308
+ };
1309
+ /**
1310
+ * Generated factory for {@link SparkInvoicePaymentDetails} record objects.
1311
+ */
1312
+ export declare const SparkInvoicePaymentDetails: Readonly<{
1313
+ /**
1314
+ * Create a frozen instance of {@link SparkInvoicePaymentDetails}, with defaults specified
1315
+ * in Rust, in the {@link breez_sdk_spark} crate.
1316
+ */
1317
+ create: (partial: Partial<SparkInvoicePaymentDetails> & Required<Omit<SparkInvoicePaymentDetails, never>>) => SparkInvoicePaymentDetails;
1318
+ /**
1319
+ * Create a frozen instance of {@link SparkInvoicePaymentDetails}, with defaults specified
1320
+ * in Rust, in the {@link breez_sdk_spark} crate.
1321
+ */
1322
+ new: (partial: Partial<SparkInvoicePaymentDetails> & Required<Omit<SparkInvoicePaymentDetails, never>>) => SparkInvoicePaymentDetails;
1323
+ /**
1324
+ * Defaults specified in the {@link breez_sdk_spark} crate.
1325
+ */
1326
+ defaults: () => Partial<SparkInvoicePaymentDetails>;
1327
+ }>;
1103
1328
  /**
1104
1329
  * Request to sync the wallet with the Spark network
1105
1330
  */
@@ -1864,16 +2089,30 @@ export declare enum PaymentDetails_Tags {
1864
2089
  export declare const PaymentDetails: Readonly<{
1865
2090
  instanceOf: (obj: any) => obj is PaymentDetails;
1866
2091
  Spark: {
1867
- new (): {
2092
+ new (inner: {
2093
+ /**
2094
+ * The invoice details if the payment fulfilled a spark invoice
2095
+ */ invoiceDetails: SparkInvoicePaymentDetails | undefined;
2096
+ }): {
1868
2097
  readonly tag: PaymentDetails_Tags.Spark;
2098
+ readonly inner: Readonly<{
2099
+ invoiceDetails: SparkInvoicePaymentDetails | undefined;
2100
+ }>;
1869
2101
  /**
1870
2102
  * @private
1871
2103
  * This field is private and should not be used, use `tag` instead.
1872
2104
  */
1873
2105
  readonly [uniffiTypeNameSymbol]: "PaymentDetails";
1874
2106
  };
1875
- "new"(): {
2107
+ "new"(inner: {
2108
+ /**
2109
+ * The invoice details if the payment fulfilled a spark invoice
2110
+ */ invoiceDetails: SparkInvoicePaymentDetails | undefined;
2111
+ }): {
1876
2112
  readonly tag: PaymentDetails_Tags.Spark;
2113
+ readonly inner: Readonly<{
2114
+ invoiceDetails: SparkInvoicePaymentDetails | undefined;
2115
+ }>;
1877
2116
  /**
1878
2117
  * @private
1879
2118
  * This field is private and should not be used, use `tag` instead.
@@ -1882,6 +2121,9 @@ export declare const PaymentDetails: Readonly<{
1882
2121
  };
1883
2122
  instanceOf(obj: any): obj is {
1884
2123
  readonly tag: PaymentDetails_Tags.Spark;
2124
+ readonly inner: Readonly<{
2125
+ invoiceDetails: SparkInvoicePaymentDetails | undefined;
2126
+ }>;
1885
2127
  /**
1886
2128
  * @private
1887
2129
  * This field is private and should not be used, use `tag` instead.
@@ -1893,11 +2135,15 @@ export declare const PaymentDetails: Readonly<{
1893
2135
  new (inner: {
1894
2136
  metadata: TokenMetadata;
1895
2137
  txHash: string;
2138
+ /**
2139
+ * The invoice details if the payment fulfilled a spark invoice
2140
+ */ invoiceDetails: SparkInvoicePaymentDetails | undefined;
1896
2141
  }): {
1897
2142
  readonly tag: PaymentDetails_Tags.Token;
1898
2143
  readonly inner: Readonly<{
1899
2144
  metadata: TokenMetadata;
1900
2145
  txHash: string;
2146
+ invoiceDetails: SparkInvoicePaymentDetails | undefined;
1901
2147
  }>;
1902
2148
  /**
1903
2149
  * @private
@@ -1908,11 +2154,15 @@ export declare const PaymentDetails: Readonly<{
1908
2154
  "new"(inner: {
1909
2155
  metadata: TokenMetadata;
1910
2156
  txHash: string;
2157
+ /**
2158
+ * The invoice details if the payment fulfilled a spark invoice
2159
+ */ invoiceDetails: SparkInvoicePaymentDetails | undefined;
1911
2160
  }): {
1912
2161
  readonly tag: PaymentDetails_Tags.Token;
1913
2162
  readonly inner: Readonly<{
1914
2163
  metadata: TokenMetadata;
1915
2164
  txHash: string;
2165
+ invoiceDetails: SparkInvoicePaymentDetails | undefined;
1916
2166
  }>;
1917
2167
  /**
1918
2168
  * @private
@@ -1925,6 +2175,7 @@ export declare const PaymentDetails: Readonly<{
1925
2175
  readonly inner: Readonly<{
1926
2176
  metadata: TokenMetadata;
1927
2177
  txHash: string;
2178
+ invoiceDetails: SparkInvoicePaymentDetails | undefined;
1928
2179
  }>;
1929
2180
  /**
1930
2181
  * @private
@@ -1955,6 +2206,9 @@ export declare const PaymentDetails: Readonly<{
1955
2206
  /**
1956
2207
  * Lnurl payment information if this was an lnurl payment.
1957
2208
  */ lnurlPayInfo: LnurlPayInfo | undefined;
2209
+ /**
2210
+ * Lnurl withdrawal information if this was an lnurl payment.
2211
+ */ lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
1958
2212
  }): {
1959
2213
  readonly tag: PaymentDetails_Tags.Lightning;
1960
2214
  readonly inner: Readonly<{
@@ -1964,6 +2218,7 @@ export declare const PaymentDetails: Readonly<{
1964
2218
  paymentHash: string;
1965
2219
  destinationPubkey: string;
1966
2220
  lnurlPayInfo: LnurlPayInfo | undefined;
2221
+ lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
1967
2222
  }>;
1968
2223
  /**
1969
2224
  * @private
@@ -1992,6 +2247,9 @@ export declare const PaymentDetails: Readonly<{
1992
2247
  /**
1993
2248
  * Lnurl payment information if this was an lnurl payment.
1994
2249
  */ lnurlPayInfo: LnurlPayInfo | undefined;
2250
+ /**
2251
+ * Lnurl withdrawal information if this was an lnurl payment.
2252
+ */ lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
1995
2253
  }): {
1996
2254
  readonly tag: PaymentDetails_Tags.Lightning;
1997
2255
  readonly inner: Readonly<{
@@ -2001,6 +2259,7 @@ export declare const PaymentDetails: Readonly<{
2001
2259
  paymentHash: string;
2002
2260
  destinationPubkey: string;
2003
2261
  lnurlPayInfo: LnurlPayInfo | undefined;
2262
+ lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
2004
2263
  }>;
2005
2264
  /**
2006
2265
  * @private
@@ -2017,6 +2276,7 @@ export declare const PaymentDetails: Readonly<{
2017
2276
  paymentHash: string;
2018
2277
  destinationPubkey: string;
2019
2278
  lnurlPayInfo: LnurlPayInfo | undefined;
2279
+ lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
2020
2280
  }>;
2021
2281
  /**
2022
2282
  * @private
@@ -2390,12 +2650,12 @@ export declare const ProvisionalPaymentDetails: Readonly<{
2390
2650
  Spark: {
2391
2651
  new (inner: {
2392
2652
  /**
2393
- * Spark receiver address
2394
- */ receiverAddress: string;
2653
+ * Spark pay request being paid (either a Spark address or a Spark invoice)
2654
+ */ payRequest: string;
2395
2655
  }): {
2396
2656
  readonly tag: ProvisionalPaymentDetails_Tags.Spark;
2397
2657
  readonly inner: Readonly<{
2398
- receiverAddress: string;
2658
+ payRequest: string;
2399
2659
  }>;
2400
2660
  /**
2401
2661
  * @private
@@ -2405,12 +2665,12 @@ export declare const ProvisionalPaymentDetails: Readonly<{
2405
2665
  };
2406
2666
  "new"(inner: {
2407
2667
  /**
2408
- * Spark receiver address
2409
- */ receiverAddress: string;
2668
+ * Spark pay request being paid (either a Spark address or a Spark invoice)
2669
+ */ payRequest: string;
2410
2670
  }): {
2411
2671
  readonly tag: ProvisionalPaymentDetails_Tags.Spark;
2412
2672
  readonly inner: Readonly<{
2413
- receiverAddress: string;
2673
+ payRequest: string;
2414
2674
  }>;
2415
2675
  /**
2416
2676
  * @private
@@ -2421,7 +2681,7 @@ export declare const ProvisionalPaymentDetails: Readonly<{
2421
2681
  instanceOf(obj: any): obj is {
2422
2682
  readonly tag: ProvisionalPaymentDetails_Tags.Spark;
2423
2683
  readonly inner: Readonly<{
2424
- receiverAddress: string;
2684
+ payRequest: string;
2425
2685
  }>;
2426
2686
  /**
2427
2687
  * @private
@@ -2436,13 +2696,13 @@ export declare const ProvisionalPaymentDetails: Readonly<{
2436
2696
  * Token identifier
2437
2697
  */ tokenId: string;
2438
2698
  /**
2439
- * Spark receiver address
2440
- */ receiverAddress: string;
2699
+ * Spark pay request being paid (either a Spark address or a Spark invoice)
2700
+ */ payRequest: string;
2441
2701
  }): {
2442
2702
  readonly tag: ProvisionalPaymentDetails_Tags.Token;
2443
2703
  readonly inner: Readonly<{
2444
2704
  tokenId: string;
2445
- receiverAddress: string;
2705
+ payRequest: string;
2446
2706
  }>;
2447
2707
  /**
2448
2708
  * @private
@@ -2455,13 +2715,13 @@ export declare const ProvisionalPaymentDetails: Readonly<{
2455
2715
  * Token identifier
2456
2716
  */ tokenId: string;
2457
2717
  /**
2458
- * Spark receiver address
2459
- */ receiverAddress: string;
2718
+ * Spark pay request being paid (either a Spark address or a Spark invoice)
2719
+ */ payRequest: string;
2460
2720
  }): {
2461
2721
  readonly tag: ProvisionalPaymentDetails_Tags.Token;
2462
2722
  readonly inner: Readonly<{
2463
2723
  tokenId: string;
2464
- receiverAddress: string;
2724
+ payRequest: string;
2465
2725
  }>;
2466
2726
  /**
2467
2727
  * @private
@@ -2473,7 +2733,7 @@ export declare const ProvisionalPaymentDetails: Readonly<{
2473
2733
  readonly tag: ProvisionalPaymentDetails_Tags.Token;
2474
2734
  readonly inner: Readonly<{
2475
2735
  tokenId: string;
2476
- receiverAddress: string;
2736
+ payRequest: string;
2477
2737
  }>;
2478
2738
  /**
2479
2739
  * @private
@@ -2486,6 +2746,7 @@ export declare const ProvisionalPaymentDetails: Readonly<{
2486
2746
  export type ProvisionalPaymentDetails = InstanceType<(typeof ProvisionalPaymentDetails)[keyof Omit<typeof ProvisionalPaymentDetails, 'instanceOf'>]>;
2487
2747
  export declare enum ReceivePaymentMethod_Tags {
2488
2748
  SparkAddress = "SparkAddress",
2749
+ SparkInvoice = "SparkInvoice",
2489
2750
  BitcoinAddress = "BitcoinAddress",
2490
2751
  Bolt11Invoice = "Bolt11Invoice"
2491
2752
  }
@@ -2517,6 +2778,87 @@ export declare const ReceivePaymentMethod: Readonly<{
2517
2778
  readonly [uniffiTypeNameSymbol]: "ReceivePaymentMethod";
2518
2779
  };
2519
2780
  };
2781
+ SparkInvoice: {
2782
+ new (inner: {
2783
+ /**
2784
+ * Amount to receive. Denominated in sats if token identifier is empty, otherwise in the token base units
2785
+ */ amount: U128 | undefined;
2786
+ /**
2787
+ * The presence of this field indicates that the payment is for a token
2788
+ * If empty, it is a Bitcoin payment
2789
+ */ tokenIdentifier: string | undefined;
2790
+ /**
2791
+ * The expiry time of the invoice in seconds since the Unix epoch
2792
+ */ expiryTime: /*u64*/ bigint | undefined;
2793
+ /**
2794
+ * A description to embed in the invoice.
2795
+ */ description: string | undefined;
2796
+ /**
2797
+ * If set, the invoice may only be fulfilled by a payer with this public key
2798
+ */ senderPublicKey: string | undefined;
2799
+ }): {
2800
+ readonly tag: ReceivePaymentMethod_Tags.SparkInvoice;
2801
+ readonly inner: Readonly<{
2802
+ amount: U128 | undefined;
2803
+ tokenIdentifier: string | undefined;
2804
+ expiryTime: /*u64*/ bigint | undefined;
2805
+ description: string | undefined;
2806
+ senderPublicKey: string | undefined;
2807
+ }>;
2808
+ /**
2809
+ * @private
2810
+ * This field is private and should not be used, use `tag` instead.
2811
+ */
2812
+ readonly [uniffiTypeNameSymbol]: "ReceivePaymentMethod";
2813
+ };
2814
+ "new"(inner: {
2815
+ /**
2816
+ * Amount to receive. Denominated in sats if token identifier is empty, otherwise in the token base units
2817
+ */ amount: U128 | undefined;
2818
+ /**
2819
+ * The presence of this field indicates that the payment is for a token
2820
+ * If empty, it is a Bitcoin payment
2821
+ */ tokenIdentifier: string | undefined;
2822
+ /**
2823
+ * The expiry time of the invoice in seconds since the Unix epoch
2824
+ */ expiryTime: /*u64*/ bigint | undefined;
2825
+ /**
2826
+ * A description to embed in the invoice.
2827
+ */ description: string | undefined;
2828
+ /**
2829
+ * If set, the invoice may only be fulfilled by a payer with this public key
2830
+ */ senderPublicKey: string | undefined;
2831
+ }): {
2832
+ readonly tag: ReceivePaymentMethod_Tags.SparkInvoice;
2833
+ readonly inner: Readonly<{
2834
+ amount: U128 | undefined;
2835
+ tokenIdentifier: string | undefined;
2836
+ expiryTime: /*u64*/ bigint | undefined;
2837
+ description: string | undefined;
2838
+ senderPublicKey: string | undefined;
2839
+ }>;
2840
+ /**
2841
+ * @private
2842
+ * This field is private and should not be used, use `tag` instead.
2843
+ */
2844
+ readonly [uniffiTypeNameSymbol]: "ReceivePaymentMethod";
2845
+ };
2846
+ instanceOf(obj: any): obj is {
2847
+ readonly tag: ReceivePaymentMethod_Tags.SparkInvoice;
2848
+ readonly inner: Readonly<{
2849
+ amount: U128 | undefined;
2850
+ tokenIdentifier: string | undefined;
2851
+ expiryTime: /*u64*/ bigint | undefined;
2852
+ description: string | undefined;
2853
+ senderPublicKey: string | undefined;
2854
+ }>;
2855
+ /**
2856
+ * @private
2857
+ * This field is private and should not be used, use `tag` instead.
2858
+ */
2859
+ readonly [uniffiTypeNameSymbol]: "ReceivePaymentMethod";
2860
+ };
2861
+ };
2520
2862
  BitcoinAddress: {
2521
2863
  new (): {
2522
2864
  readonly tag: ReceivePaymentMethod_Tags.BitcoinAddress;
@@ -3684,7 +4026,8 @@ export type Seed = InstanceType<(typeof Seed)[keyof Omit<typeof Seed, 'instanceO
3684
4026
  export declare enum SendPaymentMethod_Tags {
3685
4027
  BitcoinAddress = "BitcoinAddress",
3686
4028
  Bolt11Invoice = "Bolt11Invoice",
3687
- SparkAddress = "SparkAddress"
4029
+ SparkAddress = "SparkAddress",
4030
+ SparkInvoice = "SparkInvoice"
3688
4031
  }
3689
4032
  export declare const SendPaymentMethod: Readonly<{
3690
4033
  instanceOf: (obj: any) => obj is SendPaymentMethod;
@@ -3842,6 +4185,67 @@ export declare const SendPaymentMethod: Readonly<{
3842
4185
  readonly [uniffiTypeNameSymbol]: "SendPaymentMethod";
3843
4186
  };
3844
4187
  };
4188
+ SparkInvoice: {
4189
+ new (inner: {
4190
+ sparkInvoiceDetails: SparkInvoiceDetails;
4191
+ /**
4192
+ * Fee to pay for the transaction
4193
+ * Denominated in sats if token identifier is empty, otherwise in the token base units
4194
+ */ fee: U128;
4195
+ /**
4196
+ * The presence of this field indicates that the payment is for a token
4197
+ * If empty, it is a Bitcoin payment
4198
+ */ tokenIdentifier: string | undefined;
4199
+ }): {
4200
+ readonly tag: SendPaymentMethod_Tags.SparkInvoice;
4201
+ readonly inner: Readonly<{
4202
+ sparkInvoiceDetails: SparkInvoiceDetails;
4203
+ fee: U128;
4204
+ tokenIdentifier: string | undefined;
4205
+ }>;
4206
+ /**
4207
+ * @private
4208
+ * This field is private and should not be used, use `tag` instead.
4209
+ */
4210
+ readonly [uniffiTypeNameSymbol]: "SendPaymentMethod";
4211
+ };
4212
+ "new"(inner: {
4213
+ sparkInvoiceDetails: SparkInvoiceDetails;
4214
+ /**
4215
+ * Fee to pay for the transaction
4216
+ * Denominated in sats if token identifier is empty, otherwise in the token base units
4217
+ */ fee: U128;
4218
+ /**
4219
+ * The presence of this field indicates that the payment is for a token
4220
+ * If empty, it is a Bitcoin payment
4221
+ */ tokenIdentifier: string | undefined;
4222
+ }): {
4223
+ readonly tag: SendPaymentMethod_Tags.SparkInvoice;
4224
+ readonly inner: Readonly<{
4225
+ sparkInvoiceDetails: SparkInvoiceDetails;
4226
+ fee: U128;
4227
+ tokenIdentifier: string | undefined;
4228
+ }>;
4229
+ /**
4230
+ * @private
4231
+ * This field is private and should not be used, use `tag` instead.
4232
+ */
4233
+ readonly [uniffiTypeNameSymbol]: "SendPaymentMethod";
4234
+ };
4235
+ instanceOf(obj: any): obj is {
4236
+ readonly tag: SendPaymentMethod_Tags.SparkInvoice;
4237
+ readonly inner: Readonly<{
4238
+ sparkInvoiceDetails: SparkInvoiceDetails;
4239
+ fee: U128;
4240
+ tokenIdentifier: string | undefined;
4241
+ }>;
4242
+ /**
4243
+ * @private
4244
+ * This field is private and should not be used, use `tag` instead.
4245
+ */
4246
+ readonly [uniffiTypeNameSymbol]: "SendPaymentMethod";
4247
+ };
4248
+ };
3845
4249
  }>;
3846
4250
  export type SendPaymentMethod = InstanceType<(typeof SendPaymentMethod)[keyof Omit<typeof SendPaymentMethod, 'instanceOf'>]>;
3847
4251
  export declare enum SendPaymentOptions_Tags {
@@ -4385,6 +4789,14 @@ export interface BreezSdkInterface {
4385
4789
  checkLightningAddressAvailable(req: CheckLightningAddressRequest, asyncOpts_?: {
4386
4790
  signal: AbortSignal;
4387
4791
  }): Promise<boolean>;
4792
+ /**
4793
+ * Verifies a message signature against the provided public key. The message
4794
+ * is SHA256 hashed before verification. The signature can be hex encoded
4795
+ * in either DER or compact format.
4796
+ */
4797
+ checkMessage(request: CheckMessageRequest, asyncOpts_?: {
4798
+ signal: AbortSignal;
4799
+ }): Promise<CheckMessageResponse>;
4388
4800
  claimDeposit(request: ClaimDepositRequest, asyncOpts_?: {
4389
4801
  signal: AbortSignal;
4390
4802
  }): Promise<ClaimDepositResponse>;
@@ -4465,6 +4877,36 @@ export interface BreezSdkInterface {
4465
4877
  lnurlPay(request: LnurlPayRequest, asyncOpts_?: {
4466
4878
  signal: AbortSignal;
4467
4879
  }): Promise<LnurlPayResponse>;
4880
+ /**
4881
+ * Performs an LNURL withdraw operation for the amount of satoshis to
4882
+ * withdraw and the LNURL withdraw request details. The LNURL withdraw request
4883
+ * details can be obtained from calling [`BreezSdk::parse`].
4884
+ *
4885
+ * The method generates a Lightning invoice for the withdraw amount, stores
4886
+ * the LNURL withdraw metadata, and performs the LNURL withdraw using the generated
4887
+ * invoice.
4888
+ *
4889
+ * If the `completion_timeout_secs` parameter is provided and greater than 0, the
4890
+ * method will wait for the payment to be completed within that period. If the
4891
+ * withdraw is completed within the timeout, the `payment` field in the response
4892
+ * will be set with the payment details. If the `completion_timeout_secs`
4893
+ * parameter is not provided or set to 0, the method will not wait for the payment
4894
+ * to be completed. If the withdraw is not completed within the
4895
+ * timeout, the `payment` field will be empty.
4896
+ *
4897
+ * # Arguments
4898
+ *
4899
+ * * `request` - The LNURL withdraw request
4900
+ *
4901
+ * # Returns
4902
+ *
4903
+ * Result containing either:
4904
+ * * `LnurlWithdrawResponse` - The payment details if the withdraw request was successful
4905
+ * * `SdkError` - If there was an error during the withdraw process
4906
+ */
4907
+ lnurlWithdraw(request: LnurlWithdrawRequest, asyncOpts_?: {
4908
+ signal: AbortSignal;
4909
+ }): Promise<LnurlWithdrawResponse>;
4468
4910
  parse(input: string, asyncOpts_?: {
4469
4911
  signal: AbortSignal;
4470
4912
  }): Promise<InputType>;
@@ -4500,6 +4942,14 @@ export interface BreezSdkInterface {
4500
4942
  sendPayment(request: SendPaymentRequest, asyncOpts_?: {
4501
4943
  signal: AbortSignal;
4502
4944
  }): Promise<SendPaymentResponse>;
4945
+ /**
4946
+ * Signs a message with the wallet's identity key. The message is SHA256
4947
+ * hashed before signing. The returned signature will be hex encoded in
4948
+ * DER format by default, or compact format if specified.
4949
+ */
4950
+ signMessage(request: SignMessageRequest, asyncOpts_?: {
4951
+ signal: AbortSignal;
4952
+ }): Promise<SignMessageResponse>;
4503
4953
  /**
4504
4954
  * Synchronizes the wallet with the Spark network
4505
4955
  */
@@ -4536,6 +4986,14 @@ export declare class BreezSdk extends UniffiAbstractObject implements BreezSdkIn
4536
4986
  checkLightningAddressAvailable(req: CheckLightningAddressRequest, asyncOpts_?: {
4537
4987
  signal: AbortSignal;
4538
4988
  }): Promise<boolean>;
4989
+ /**
4990
+ * Verifies a message signature against the provided public key. The message
4991
+ * is SHA256 hashed before verification. The signature can be hex encoded
4992
+ * in either DER or compact format.
4993
+ */
4994
+ checkMessage(request: CheckMessageRequest, asyncOpts_?: {
4995
+ signal: AbortSignal;
4996
+ }): Promise<CheckMessageResponse>;
4539
4997
  claimDeposit(request: ClaimDepositRequest, asyncOpts_?: {
4540
4998
  signal: AbortSignal;
4541
4999
  }): Promise<ClaimDepositResponse>;
@@ -4616,6 +5074,36 @@ export declare class BreezSdk extends UniffiAbstractObject implements BreezSdkIn
4616
5074
  lnurlPay(request: LnurlPayRequest, asyncOpts_?: {
4617
5075
  signal: AbortSignal;
4618
5076
  }): Promise<LnurlPayResponse>;
5077
+ /**
5078
+ * Performs an LNURL withdraw operation for the amount of satoshis to
5079
+ * withdraw and the LNURL withdraw request details. The LNURL withdraw request
5080
+ * details can be obtained from calling [`BreezSdk::parse`].
5081
+ *
5082
+ * The method generates a Lightning invoice for the withdraw amount, stores
5083
+ * the LNURL withdraw metadata, and performs the LNURL withdraw using the generated
5084
+ * invoice.
5085
+ *
5086
+ * If the `completion_timeout_secs` parameter is provided and greater than 0, the
5087
+ * method will wait for the payment to be completed within that period. If the
5088
+ * withdraw is completed within the timeout, the `payment` field in the response
5089
+ * will be set with the payment details. If the `completion_timeout_secs`
5090
+ * parameter is not provided or set to 0, the method will not wait for the payment
5091
+ * to be completed. If the withdraw is not completed within the
5092
+ * timeout, the `payment` field will be empty.
5093
+ *
5094
+ * # Arguments
5095
+ *
5096
+ * * `request` - The LNURL withdraw request
5097
+ *
5098
+ * # Returns
5099
+ *
5100
+ * Result containing either:
5101
+ * * `LnurlWithdrawResponse` - The payment details if the withdraw request was successful
5102
+ * * `SdkError` - If there was an error during the withdraw process
5103
+ */
5104
+ lnurlWithdraw(request: LnurlWithdrawRequest, asyncOpts_?: {
5105
+ signal: AbortSignal;
5106
+ }): Promise<LnurlWithdrawResponse>;
4619
5107
  parse(input: string, asyncOpts_?: {
4620
5108
  signal: AbortSignal;
4621
5109
  }): Promise<InputType>;
@@ -4651,6 +5139,14 @@ export declare class BreezSdk extends UniffiAbstractObject implements BreezSdkIn
4651
5139
  sendPayment(request: SendPaymentRequest, asyncOpts_?: {
4652
5140
  signal: AbortSignal;
4653
5141
  }): Promise<SendPaymentResponse>;
5142
+ /**
5143
+ * Signs a message with the wallet's identity key. The message is SHA256
5144
+ * hashed before signing. The returned signature will be hex encoded in
5145
+ * DER format by default, or compact format if specified.
5146
+ */
5147
+ signMessage(request: SignMessageRequest, asyncOpts_?: {
5148
+ signal: AbortSignal;
5149
+ }): Promise<SignMessageResponse>;
4654
5150
  /**
4655
5151
  * Synchronizes the wallet with the Spark network
4656
5152
  */
@@ -5136,6 +5632,20 @@ declare const _default: Readonly<{
5136
5632
  lift(value: UniffiByteArray): CheckLightningAddressRequest;
5137
5633
  lower(value: CheckLightningAddressRequest): UniffiByteArray;
5138
5634
  };
5635
+ FfiConverterTypeCheckMessageRequest: {
5636
+ read(from: RustBuffer): CheckMessageRequest;
5637
+ write(value: CheckMessageRequest, into: RustBuffer): void;
5638
+ allocationSize(value: CheckMessageRequest): number;
5639
+ lift(value: UniffiByteArray): CheckMessageRequest;
5640
+ lower(value: CheckMessageRequest): UniffiByteArray;
5641
+ };
5642
+ FfiConverterTypeCheckMessageResponse: {
5643
+ read(from: RustBuffer): CheckMessageResponse;
5644
+ write(value: CheckMessageResponse, into: RustBuffer): void;
5645
+ allocationSize(value: CheckMessageResponse): number;
5646
+ lift(value: UniffiByteArray): CheckMessageResponse;
5647
+ lower(value: CheckMessageResponse): UniffiByteArray;
5648
+ };
5139
5649
  FfiConverterTypeClaimDepositRequest: {
5140
5650
  read(from: RustBuffer): ClaimDepositRequest;
5141
5651
  write(value: ClaimDepositRequest, into: RustBuffer): void;
@@ -5311,6 +5821,27 @@ declare const _default: Readonly<{
5311
5821
  lift(value: UniffiByteArray): LnurlPayResponse;
5312
5822
  lower(value: LnurlPayResponse): UniffiByteArray;
5313
5823
  };
5824
+ FfiConverterTypeLnurlWithdrawInfo: {
5825
+ read(from: RustBuffer): LnurlWithdrawInfo;
5826
+ write(value: LnurlWithdrawInfo, into: RustBuffer): void;
5827
+ allocationSize(value: LnurlWithdrawInfo): number;
5828
+ lift(value: UniffiByteArray): LnurlWithdrawInfo;
5829
+ lower(value: LnurlWithdrawInfo): UniffiByteArray;
5830
+ };
5831
+ FfiConverterTypeLnurlWithdrawRequest: {
5832
+ read(from: RustBuffer): LnurlWithdrawRequest;
5833
+ write(value: LnurlWithdrawRequest, into: RustBuffer): void;
5834
+ allocationSize(value: LnurlWithdrawRequest): number;
5835
+ lift(value: UniffiByteArray): LnurlWithdrawRequest;
5836
+ lower(value: LnurlWithdrawRequest): UniffiByteArray;
5837
+ };
5838
+ FfiConverterTypeLnurlWithdrawResponse: {
5839
+ read(from: RustBuffer): LnurlWithdrawResponse;
5840
+ write(value: LnurlWithdrawResponse, into: RustBuffer): void;
5841
+ allocationSize(value: LnurlWithdrawResponse): number;
5842
+ lift(value: UniffiByteArray): LnurlWithdrawResponse;
5843
+ lower(value: LnurlWithdrawResponse): UniffiByteArray;
5844
+ };
5314
5845
  FfiConverterTypeLogEntry: {
5315
5846
  read(from: RustBuffer): LogEntry;
5316
5847
  write(value: LogEntry, into: RustBuffer): void;
@@ -5516,6 +6047,27 @@ declare const _default: Readonly<{
5516
6047
  lift(value: UniffiByteArray): SendPaymentResponse;
5517
6048
  lower(value: SendPaymentResponse): UniffiByteArray;
5518
6049
  };
6050
+ FfiConverterTypeSignMessageRequest: {
6051
+ read(from: RustBuffer): SignMessageRequest;
6052
+ write(value: SignMessageRequest, into: RustBuffer): void;
6053
+ allocationSize(value: SignMessageRequest): number;
6054
+ lift(value: UniffiByteArray): SignMessageRequest;
6055
+ lower(value: SignMessageRequest): UniffiByteArray;
6056
+ };
6057
+ FfiConverterTypeSignMessageResponse: {
6058
+ read(from: RustBuffer): SignMessageResponse;
6059
+ write(value: SignMessageResponse, into: RustBuffer): void;
6060
+ allocationSize(value: SignMessageResponse): number;
6061
+ lift(value: UniffiByteArray): SignMessageResponse;
6062
+ lower(value: SignMessageResponse): UniffiByteArray;
6063
+ };
6064
+ FfiConverterTypeSparkInvoicePaymentDetails: {
6065
+ read(from: RustBuffer): SparkInvoicePaymentDetails;
6066
+ write(value: SparkInvoicePaymentDetails, into: RustBuffer): void;
6067
+ allocationSize(value: SparkInvoicePaymentDetails): number;
6068
+ lift(value: UniffiByteArray): SparkInvoicePaymentDetails;
6069
+ lower(value: SparkInvoicePaymentDetails): UniffiByteArray;
6070
+ };
5519
6071
  FfiConverterTypeStorage: FfiConverterObjectWithCallbacks<Storage>;
5520
6072
  FfiConverterTypeSyncWalletRequest: {
5521
6073
  read(from: RustBuffer): SyncWalletRequest;