@breeztech/breez-sdk-spark-react-native 0.3.1 → 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 +710 -48
  2. package/cpp/generated/breez_sdk_spark.hpp +51 -7
  3. package/lib/commonjs/generated/breez_sdk_common.js +115 -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 +1165 -67
  7. package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -1
  8. package/lib/module/generated/breez_sdk_common.js +114 -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 +1163 -65
  12. package/lib/module/generated/breez_sdk_spark.js.map +1 -1
  13. package/lib/typescript/commonjs/src/generated/breez_sdk_common.d.ts +123 -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 +21 -2
  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 +1082 -77
  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 +123 -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 +21 -2
  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 +1082 -77
  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 +194 -373
  27. package/src/generated/breez_sdk_spark-ffi.ts +55 -2
  28. package/src/generated/breez_sdk_spark.ts +2090 -218
@@ -1,4 +1,4 @@
1
- import { type BitcoinAddressDetails, type Bolt11InvoiceDetails, 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.
@@ -17,9 +17,6 @@ export declare function connect(request: ConnectRequest, asyncOpts_?: {
17
17
  export declare function defaultConfig(network: Network): Config;
18
18
  export declare function defaultStorage(dataDir: string): Storage;
19
19
  export declare function initLogging(logDir: string | undefined, appLogger: Logger | undefined, logFilter: string | undefined): void;
20
- export declare function parse(input: string, asyncOpts_?: {
21
- signal: AbortSignal;
22
- }): Promise<InputType>;
23
20
  /**
24
21
  * Trait for event listeners
25
22
  */
@@ -56,6 +53,61 @@ export declare const CheckLightningAddressRequest: Readonly<{
56
53
  */
57
54
  defaults: () => Partial<CheckLightningAddressRequest>;
58
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
+ }>;
59
111
  export type ClaimDepositRequest = {
60
112
  txid: string;
61
113
  vout: number;
@@ -117,6 +169,18 @@ export type Config = {
117
169
  * but is at the cost of privacy.
118
170
  */
119
171
  preferSparkOverLightning: boolean;
172
+ /**
173
+ * A set of external input parsers that are used by [`BreezSdk::parse`](crate::sdk::BreezSdk::parse) when the input
174
+ * is not recognized. See [`ExternalInputParser`] for more details on how to configure
175
+ * external parsing.
176
+ */
177
+ externalInputParsers: Array<ExternalInputParser> | undefined;
178
+ /**
179
+ * The SDK includes some default external input parsers
180
+ * ([`DEFAULT_EXTERNAL_INPUT_PARSERS`]).
181
+ * Set this to false in order to prevent their use.
182
+ */
183
+ useDefaultExternalInputParsers: boolean;
120
184
  };
121
185
  /**
122
186
  * Generated factory for {@link Config} record objects.
@@ -626,6 +690,90 @@ export declare const LnurlPayResponse: Readonly<{
626
690
  */
627
691
  defaults: () => Partial<LnurlPayResponse>;
628
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
+ }>;
629
777
  export type LogEntry = {
630
778
  line: string;
631
779
  level: string;
@@ -666,11 +814,11 @@ export type Payment = {
666
814
  */
667
815
  status: PaymentStatus;
668
816
  /**
669
- * Amount in satoshis
817
+ * Amount in satoshis or token base units
670
818
  */
671
819
  amount: U128;
672
820
  /**
673
- * Fee paid in satoshis
821
+ * Fee paid in satoshis or token base units
674
822
  */
675
823
  fees: U128;
676
824
  /**
@@ -711,6 +859,7 @@ export declare const Payment: Readonly<{
711
859
  */
712
860
  export type PaymentMetadata = {
713
861
  lnurlPayInfo: LnurlPayInfo | undefined;
862
+ lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
714
863
  lnurlDescription: string | undefined;
715
864
  };
716
865
  /**
@@ -848,6 +997,39 @@ export declare const PrepareSendPaymentResponse: Readonly<{
848
997
  */
849
998
  defaults: () => Partial<PrepareSendPaymentResponse>;
850
999
  }>;
1000
+ export type ProvisionalPayment = {
1001
+ /**
1002
+ * Unique identifier for the payment
1003
+ */
1004
+ paymentId: string;
1005
+ /**
1006
+ * Amount in satoshis or token base units
1007
+ */
1008
+ amount: U128;
1009
+ /**
1010
+ * Details of the payment
1011
+ */
1012
+ details: ProvisionalPaymentDetails;
1013
+ };
1014
+ /**
1015
+ * Generated factory for {@link ProvisionalPayment} record objects.
1016
+ */
1017
+ export declare const ProvisionalPayment: Readonly<{
1018
+ /**
1019
+ * Create a frozen instance of {@link ProvisionalPayment}, with defaults specified
1020
+ * in Rust, in the {@link breez_sdk_spark} crate.
1021
+ */
1022
+ create: (partial: Partial<ProvisionalPayment> & Required<Omit<ProvisionalPayment, never>>) => ProvisionalPayment;
1023
+ /**
1024
+ * Create a frozen instance of {@link ProvisionalPayment}, with defaults specified
1025
+ * in Rust, in the {@link breez_sdk_spark} crate.
1026
+ */
1027
+ new: (partial: Partial<ProvisionalPayment> & Required<Omit<ProvisionalPayment, never>>) => ProvisionalPayment;
1028
+ /**
1029
+ * Defaults specified in the {@link breez_sdk_spark} crate.
1030
+ */
1031
+ defaults: () => Partial<ProvisionalPayment>;
1032
+ }>;
851
1033
  export type ReceivePaymentRequest = {
852
1034
  paymentMethod: ReceivePaymentMethod;
853
1035
  };
@@ -872,7 +1054,11 @@ export declare const ReceivePaymentRequest: Readonly<{
872
1054
  }>;
873
1055
  export type ReceivePaymentResponse = {
874
1056
  paymentRequest: string;
875
- feeSats: bigint;
1057
+ /**
1058
+ * Fee to pay to receive the payment
1059
+ * Denominated in sats or token base units
1060
+ */
1061
+ fee: U128;
876
1062
  };
877
1063
  /**
878
1064
  * Generated factory for {@link ReceivePaymentResponse} record objects.
@@ -1058,6 +1244,87 @@ export declare const SendPaymentResponse: Readonly<{
1058
1244
  */
1059
1245
  defaults: () => Partial<SendPaymentResponse>;
1060
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
+ }>;
1061
1328
  /**
1062
1329
  * Request to sync the wallet with the Spark network
1063
1330
  */
@@ -1822,16 +2089,30 @@ export declare enum PaymentDetails_Tags {
1822
2089
  export declare const PaymentDetails: Readonly<{
1823
2090
  instanceOf: (obj: any) => obj is PaymentDetails;
1824
2091
  Spark: {
1825
- new (): {
2092
+ new (inner: {
2093
+ /**
2094
+ * The invoice details if the payment fulfilled a spark invoice
2095
+ */ invoiceDetails: SparkInvoicePaymentDetails | undefined;
2096
+ }): {
1826
2097
  readonly tag: PaymentDetails_Tags.Spark;
2098
+ readonly inner: Readonly<{
2099
+ invoiceDetails: SparkInvoicePaymentDetails | undefined;
2100
+ }>;
1827
2101
  /**
1828
2102
  * @private
1829
2103
  * This field is private and should not be used, use `tag` instead.
1830
2104
  */
1831
2105
  readonly [uniffiTypeNameSymbol]: "PaymentDetails";
1832
2106
  };
1833
- "new"(): {
2107
+ "new"(inner: {
2108
+ /**
2109
+ * The invoice details if the payment fulfilled a spark invoice
2110
+ */ invoiceDetails: SparkInvoicePaymentDetails | undefined;
2111
+ }): {
1834
2112
  readonly tag: PaymentDetails_Tags.Spark;
2113
+ readonly inner: Readonly<{
2114
+ invoiceDetails: SparkInvoicePaymentDetails | undefined;
2115
+ }>;
1835
2116
  /**
1836
2117
  * @private
1837
2118
  * This field is private and should not be used, use `tag` instead.
@@ -1840,6 +2121,9 @@ export declare const PaymentDetails: Readonly<{
1840
2121
  };
1841
2122
  instanceOf(obj: any): obj is {
1842
2123
  readonly tag: PaymentDetails_Tags.Spark;
2124
+ readonly inner: Readonly<{
2125
+ invoiceDetails: SparkInvoicePaymentDetails | undefined;
2126
+ }>;
1843
2127
  /**
1844
2128
  * @private
1845
2129
  * This field is private and should not be used, use `tag` instead.
@@ -1851,11 +2135,15 @@ export declare const PaymentDetails: Readonly<{
1851
2135
  new (inner: {
1852
2136
  metadata: TokenMetadata;
1853
2137
  txHash: string;
2138
+ /**
2139
+ * The invoice details if the payment fulfilled a spark invoice
2140
+ */ invoiceDetails: SparkInvoicePaymentDetails | undefined;
1854
2141
  }): {
1855
2142
  readonly tag: PaymentDetails_Tags.Token;
1856
2143
  readonly inner: Readonly<{
1857
2144
  metadata: TokenMetadata;
1858
2145
  txHash: string;
2146
+ invoiceDetails: SparkInvoicePaymentDetails | undefined;
1859
2147
  }>;
1860
2148
  /**
1861
2149
  * @private
@@ -1866,11 +2154,15 @@ export declare const PaymentDetails: Readonly<{
1866
2154
  "new"(inner: {
1867
2155
  metadata: TokenMetadata;
1868
2156
  txHash: string;
2157
+ /**
2158
+ * The invoice details if the payment fulfilled a spark invoice
2159
+ */ invoiceDetails: SparkInvoicePaymentDetails | undefined;
1869
2160
  }): {
1870
2161
  readonly tag: PaymentDetails_Tags.Token;
1871
2162
  readonly inner: Readonly<{
1872
2163
  metadata: TokenMetadata;
1873
2164
  txHash: string;
2165
+ invoiceDetails: SparkInvoicePaymentDetails | undefined;
1874
2166
  }>;
1875
2167
  /**
1876
2168
  * @private
@@ -1883,6 +2175,7 @@ export declare const PaymentDetails: Readonly<{
1883
2175
  readonly inner: Readonly<{
1884
2176
  metadata: TokenMetadata;
1885
2177
  txHash: string;
2178
+ invoiceDetails: SparkInvoicePaymentDetails | undefined;
1886
2179
  }>;
1887
2180
  /**
1888
2181
  * @private
@@ -1913,6 +2206,9 @@ export declare const PaymentDetails: Readonly<{
1913
2206
  /**
1914
2207
  * Lnurl payment information if this was an lnurl payment.
1915
2208
  */ lnurlPayInfo: LnurlPayInfo | undefined;
2209
+ /**
2210
+ * Lnurl withdrawal information if this was an lnurl payment.
2211
+ */ lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
1916
2212
  }): {
1917
2213
  readonly tag: PaymentDetails_Tags.Lightning;
1918
2214
  readonly inner: Readonly<{
@@ -1922,6 +2218,7 @@ export declare const PaymentDetails: Readonly<{
1922
2218
  paymentHash: string;
1923
2219
  destinationPubkey: string;
1924
2220
  lnurlPayInfo: LnurlPayInfo | undefined;
2221
+ lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
1925
2222
  }>;
1926
2223
  /**
1927
2224
  * @private
@@ -1950,6 +2247,9 @@ export declare const PaymentDetails: Readonly<{
1950
2247
  /**
1951
2248
  * Lnurl payment information if this was an lnurl payment.
1952
2249
  */ lnurlPayInfo: LnurlPayInfo | undefined;
2250
+ /**
2251
+ * Lnurl withdrawal information if this was an lnurl payment.
2252
+ */ lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
1953
2253
  }): {
1954
2254
  readonly tag: PaymentDetails_Tags.Lightning;
1955
2255
  readonly inner: Readonly<{
@@ -1959,6 +2259,7 @@ export declare const PaymentDetails: Readonly<{
1959
2259
  paymentHash: string;
1960
2260
  destinationPubkey: string;
1961
2261
  lnurlPayInfo: LnurlPayInfo | undefined;
2262
+ lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
1962
2263
  }>;
1963
2264
  /**
1964
2265
  * @private
@@ -1972,137 +2273,480 @@ export declare const PaymentDetails: Readonly<{
1972
2273
  description: string | undefined;
1973
2274
  preimage: string | undefined;
1974
2275
  invoice: string;
1975
- paymentHash: string;
1976
- destinationPubkey: string;
1977
- lnurlPayInfo: LnurlPayInfo | undefined;
2276
+ paymentHash: string;
2277
+ destinationPubkey: string;
2278
+ lnurlPayInfo: LnurlPayInfo | undefined;
2279
+ lnurlWithdrawInfo: LnurlWithdrawInfo | undefined;
2280
+ }>;
2281
+ /**
2282
+ * @private
2283
+ * This field is private and should not be used, use `tag` instead.
2284
+ */
2285
+ readonly [uniffiTypeNameSymbol]: "PaymentDetails";
2286
+ };
2287
+ };
2288
+ Withdraw: {
2289
+ new (inner: {
2290
+ txId: string;
2291
+ }): {
2292
+ readonly tag: PaymentDetails_Tags.Withdraw;
2293
+ readonly inner: Readonly<{
2294
+ txId: string;
2295
+ }>;
2296
+ /**
2297
+ * @private
2298
+ * This field is private and should not be used, use `tag` instead.
2299
+ */
2300
+ readonly [uniffiTypeNameSymbol]: "PaymentDetails";
2301
+ };
2302
+ "new"(inner: {
2303
+ txId: string;
2304
+ }): {
2305
+ readonly tag: PaymentDetails_Tags.Withdraw;
2306
+ readonly inner: Readonly<{
2307
+ txId: string;
2308
+ }>;
2309
+ /**
2310
+ * @private
2311
+ * This field is private and should not be used, use `tag` instead.
2312
+ */
2313
+ readonly [uniffiTypeNameSymbol]: "PaymentDetails";
2314
+ };
2315
+ instanceOf(obj: any): obj is {
2316
+ readonly tag: PaymentDetails_Tags.Withdraw;
2317
+ readonly inner: Readonly<{
2318
+ txId: string;
2319
+ }>;
2320
+ /**
2321
+ * @private
2322
+ * This field is private and should not be used, use `tag` instead.
2323
+ */
2324
+ readonly [uniffiTypeNameSymbol]: "PaymentDetails";
2325
+ };
2326
+ };
2327
+ Deposit: {
2328
+ new (inner: {
2329
+ txId: string;
2330
+ }): {
2331
+ readonly tag: PaymentDetails_Tags.Deposit;
2332
+ readonly inner: Readonly<{
2333
+ txId: string;
2334
+ }>;
2335
+ /**
2336
+ * @private
2337
+ * This field is private and should not be used, use `tag` instead.
2338
+ */
2339
+ readonly [uniffiTypeNameSymbol]: "PaymentDetails";
2340
+ };
2341
+ "new"(inner: {
2342
+ txId: string;
2343
+ }): {
2344
+ readonly tag: PaymentDetails_Tags.Deposit;
2345
+ readonly inner: Readonly<{
2346
+ txId: string;
2347
+ }>;
2348
+ /**
2349
+ * @private
2350
+ * This field is private and should not be used, use `tag` instead.
2351
+ */
2352
+ readonly [uniffiTypeNameSymbol]: "PaymentDetails";
2353
+ };
2354
+ instanceOf(obj: any): obj is {
2355
+ readonly tag: PaymentDetails_Tags.Deposit;
2356
+ readonly inner: Readonly<{
2357
+ txId: string;
2358
+ }>;
2359
+ /**
2360
+ * @private
2361
+ * This field is private and should not be used, use `tag` instead.
2362
+ */
2363
+ readonly [uniffiTypeNameSymbol]: "PaymentDetails";
2364
+ };
2365
+ };
2366
+ }>;
2367
+ export type PaymentDetails = InstanceType<(typeof PaymentDetails)[keyof Omit<typeof PaymentDetails, 'instanceOf'>]>;
2368
+ export declare enum PaymentMethod {
2369
+ Lightning = 0,
2370
+ Spark = 1,
2371
+ Token = 2,
2372
+ Deposit = 3,
2373
+ Withdraw = 4,
2374
+ Unknown = 5
2375
+ }
2376
+ export declare enum PaymentObserverError_Tags {
2377
+ ServiceConnectivity = "ServiceConnectivity",
2378
+ Generic = "Generic"
2379
+ }
2380
+ export declare const PaymentObserverError: Readonly<{
2381
+ instanceOf: (obj: any) => obj is PaymentObserverError;
2382
+ ServiceConnectivity: {
2383
+ new (v0: string): {
2384
+ readonly tag: PaymentObserverError_Tags.ServiceConnectivity;
2385
+ readonly inner: Readonly<[string]>;
2386
+ /**
2387
+ * @private
2388
+ * This field is private and should not be used, use `tag` instead.
2389
+ */
2390
+ readonly [uniffiTypeNameSymbol]: "PaymentObserverError";
2391
+ name: string;
2392
+ message: string;
2393
+ stack?: string;
2394
+ cause?: unknown;
2395
+ };
2396
+ "new"(v0: string): {
2397
+ readonly tag: PaymentObserverError_Tags.ServiceConnectivity;
2398
+ readonly inner: Readonly<[string]>;
2399
+ /**
2400
+ * @private
2401
+ * This field is private and should not be used, use `tag` instead.
2402
+ */
2403
+ readonly [uniffiTypeNameSymbol]: "PaymentObserverError";
2404
+ name: string;
2405
+ message: string;
2406
+ stack?: string;
2407
+ cause?: unknown;
2408
+ };
2409
+ instanceOf(obj: any): obj is {
2410
+ readonly tag: PaymentObserverError_Tags.ServiceConnectivity;
2411
+ readonly inner: Readonly<[string]>;
2412
+ /**
2413
+ * @private
2414
+ * This field is private and should not be used, use `tag` instead.
2415
+ */
2416
+ readonly [uniffiTypeNameSymbol]: "PaymentObserverError";
2417
+ name: string;
2418
+ message: string;
2419
+ stack?: string;
2420
+ cause?: unknown;
2421
+ };
2422
+ hasInner(obj: any): obj is {
2423
+ readonly tag: PaymentObserverError_Tags.ServiceConnectivity;
2424
+ readonly inner: Readonly<[string]>;
2425
+ /**
2426
+ * @private
2427
+ * This field is private and should not be used, use `tag` instead.
2428
+ */
2429
+ readonly [uniffiTypeNameSymbol]: "PaymentObserverError";
2430
+ name: string;
2431
+ message: string;
2432
+ stack?: string;
2433
+ cause?: unknown;
2434
+ };
2435
+ getInner(obj: {
2436
+ readonly tag: PaymentObserverError_Tags.ServiceConnectivity;
2437
+ readonly inner: Readonly<[string]>;
2438
+ /**
2439
+ * @private
2440
+ * This field is private and should not be used, use `tag` instead.
2441
+ */
2442
+ readonly [uniffiTypeNameSymbol]: "PaymentObserverError";
2443
+ name: string;
2444
+ message: string;
2445
+ stack?: string;
2446
+ cause?: unknown;
2447
+ }): Readonly<[string]>;
2448
+ isError(error: unknown): error is Error;
2449
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2450
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
2451
+ stackTraceLimit: number;
2452
+ };
2453
+ Generic: {
2454
+ new (v0: string): {
2455
+ readonly tag: PaymentObserverError_Tags.Generic;
2456
+ readonly inner: Readonly<[string]>;
2457
+ /**
2458
+ * @private
2459
+ * This field is private and should not be used, use `tag` instead.
2460
+ */
2461
+ readonly [uniffiTypeNameSymbol]: "PaymentObserverError";
2462
+ name: string;
2463
+ message: string;
2464
+ stack?: string;
2465
+ cause?: unknown;
2466
+ };
2467
+ "new"(v0: string): {
2468
+ readonly tag: PaymentObserverError_Tags.Generic;
2469
+ readonly inner: Readonly<[string]>;
2470
+ /**
2471
+ * @private
2472
+ * This field is private and should not be used, use `tag` instead.
2473
+ */
2474
+ readonly [uniffiTypeNameSymbol]: "PaymentObserverError";
2475
+ name: string;
2476
+ message: string;
2477
+ stack?: string;
2478
+ cause?: unknown;
2479
+ };
2480
+ instanceOf(obj: any): obj is {
2481
+ readonly tag: PaymentObserverError_Tags.Generic;
2482
+ readonly inner: Readonly<[string]>;
2483
+ /**
2484
+ * @private
2485
+ * This field is private and should not be used, use `tag` instead.
2486
+ */
2487
+ readonly [uniffiTypeNameSymbol]: "PaymentObserverError";
2488
+ name: string;
2489
+ message: string;
2490
+ stack?: string;
2491
+ cause?: unknown;
2492
+ };
2493
+ hasInner(obj: any): obj is {
2494
+ readonly tag: PaymentObserverError_Tags.Generic;
2495
+ readonly inner: Readonly<[string]>;
2496
+ /**
2497
+ * @private
2498
+ * This field is private and should not be used, use `tag` instead.
2499
+ */
2500
+ readonly [uniffiTypeNameSymbol]: "PaymentObserverError";
2501
+ name: string;
2502
+ message: string;
2503
+ stack?: string;
2504
+ cause?: unknown;
2505
+ };
2506
+ getInner(obj: {
2507
+ readonly tag: PaymentObserverError_Tags.Generic;
2508
+ readonly inner: Readonly<[string]>;
2509
+ /**
2510
+ * @private
2511
+ * This field is private and should not be used, use `tag` instead.
2512
+ */
2513
+ readonly [uniffiTypeNameSymbol]: "PaymentObserverError";
2514
+ name: string;
2515
+ message: string;
2516
+ stack?: string;
2517
+ cause?: unknown;
2518
+ }): Readonly<[string]>;
2519
+ isError(error: unknown): error is Error;
2520
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
2521
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
2522
+ stackTraceLimit: number;
2523
+ };
2524
+ }>;
2525
+ export type PaymentObserverError = InstanceType<(typeof PaymentObserverError)[keyof Omit<typeof PaymentObserverError, 'instanceOf'>]>;
2526
+ /**
2527
+ * The status of a payment
2528
+ */
2529
+ export declare enum PaymentStatus {
2530
+ /**
2531
+ * Payment is completed successfully
2532
+ */
2533
+ Completed = 0,
2534
+ /**
2535
+ * Payment is in progress
2536
+ */
2537
+ Pending = 1,
2538
+ /**
2539
+ * Payment has failed
2540
+ */
2541
+ Failed = 2
2542
+ }
2543
+ /**
2544
+ * The type of payment
2545
+ */
2546
+ export declare enum PaymentType {
2547
+ /**
2548
+ * Payment sent from this wallet
2549
+ */
2550
+ Send = 0,
2551
+ /**
2552
+ * Payment received to this wallet
2553
+ */
2554
+ Receive = 1
2555
+ }
2556
+ export declare enum ProvisionalPaymentDetails_Tags {
2557
+ Bitcoin = "Bitcoin",
2558
+ Lightning = "Lightning",
2559
+ Spark = "Spark",
2560
+ Token = "Token"
2561
+ }
2562
+ export declare const ProvisionalPaymentDetails: Readonly<{
2563
+ instanceOf: (obj: any) => obj is ProvisionalPaymentDetails;
2564
+ Bitcoin: {
2565
+ new (inner: {
2566
+ /**
2567
+ * Onchain Bitcoin address
2568
+ */ withdrawalAddress: string;
2569
+ }): {
2570
+ readonly tag: ProvisionalPaymentDetails_Tags.Bitcoin;
2571
+ readonly inner: Readonly<{
2572
+ withdrawalAddress: string;
2573
+ }>;
2574
+ /**
2575
+ * @private
2576
+ * This field is private and should not be used, use `tag` instead.
2577
+ */
2578
+ readonly [uniffiTypeNameSymbol]: "ProvisionalPaymentDetails";
2579
+ };
2580
+ "new"(inner: {
2581
+ /**
2582
+ * Onchain Bitcoin address
2583
+ */ withdrawalAddress: string;
2584
+ }): {
2585
+ readonly tag: ProvisionalPaymentDetails_Tags.Bitcoin;
2586
+ readonly inner: Readonly<{
2587
+ withdrawalAddress: string;
2588
+ }>;
2589
+ /**
2590
+ * @private
2591
+ * This field is private and should not be used, use `tag` instead.
2592
+ */
2593
+ readonly [uniffiTypeNameSymbol]: "ProvisionalPaymentDetails";
2594
+ };
2595
+ instanceOf(obj: any): obj is {
2596
+ readonly tag: ProvisionalPaymentDetails_Tags.Bitcoin;
2597
+ readonly inner: Readonly<{
2598
+ withdrawalAddress: string;
2599
+ }>;
2600
+ /**
2601
+ * @private
2602
+ * This field is private and should not be used, use `tag` instead.
2603
+ */
2604
+ readonly [uniffiTypeNameSymbol]: "ProvisionalPaymentDetails";
2605
+ };
2606
+ };
2607
+ Lightning: {
2608
+ new (inner: {
2609
+ /**
2610
+ * BOLT11 invoice
2611
+ */ invoice: string;
2612
+ }): {
2613
+ readonly tag: ProvisionalPaymentDetails_Tags.Lightning;
2614
+ readonly inner: Readonly<{
2615
+ invoice: string;
2616
+ }>;
2617
+ /**
2618
+ * @private
2619
+ * This field is private and should not be used, use `tag` instead.
2620
+ */
2621
+ readonly [uniffiTypeNameSymbol]: "ProvisionalPaymentDetails";
2622
+ };
2623
+ "new"(inner: {
2624
+ /**
2625
+ * BOLT11 invoice
2626
+ */ invoice: string;
2627
+ }): {
2628
+ readonly tag: ProvisionalPaymentDetails_Tags.Lightning;
2629
+ readonly inner: Readonly<{
2630
+ invoice: string;
2631
+ }>;
2632
+ /**
2633
+ * @private
2634
+ * This field is private and should not be used, use `tag` instead.
2635
+ */
2636
+ readonly [uniffiTypeNameSymbol]: "ProvisionalPaymentDetails";
2637
+ };
2638
+ instanceOf(obj: any): obj is {
2639
+ readonly tag: ProvisionalPaymentDetails_Tags.Lightning;
2640
+ readonly inner: Readonly<{
2641
+ invoice: string;
1978
2642
  }>;
1979
2643
  /**
1980
2644
  * @private
1981
2645
  * This field is private and should not be used, use `tag` instead.
1982
2646
  */
1983
- readonly [uniffiTypeNameSymbol]: "PaymentDetails";
2647
+ readonly [uniffiTypeNameSymbol]: "ProvisionalPaymentDetails";
1984
2648
  };
1985
2649
  };
1986
- Withdraw: {
2650
+ Spark: {
1987
2651
  new (inner: {
1988
- txId: string;
2652
+ /**
2653
+ * Spark pay request being paid (either a Spark address or a Spark invoice)
2654
+ */ payRequest: string;
1989
2655
  }): {
1990
- readonly tag: PaymentDetails_Tags.Withdraw;
2656
+ readonly tag: ProvisionalPaymentDetails_Tags.Spark;
1991
2657
  readonly inner: Readonly<{
1992
- txId: string;
2658
+ payRequest: string;
1993
2659
  }>;
1994
2660
  /**
1995
2661
  * @private
1996
2662
  * This field is private and should not be used, use `tag` instead.
1997
2663
  */
1998
- readonly [uniffiTypeNameSymbol]: "PaymentDetails";
2664
+ readonly [uniffiTypeNameSymbol]: "ProvisionalPaymentDetails";
1999
2665
  };
2000
2666
  "new"(inner: {
2001
- txId: string;
2667
+ /**
2668
+ * Spark pay request being paid (either a Spark address or a Spark invoice)
2669
+ */ payRequest: string;
2002
2670
  }): {
2003
- readonly tag: PaymentDetails_Tags.Withdraw;
2671
+ readonly tag: ProvisionalPaymentDetails_Tags.Spark;
2004
2672
  readonly inner: Readonly<{
2005
- txId: string;
2673
+ payRequest: string;
2006
2674
  }>;
2007
2675
  /**
2008
2676
  * @private
2009
2677
  * This field is private and should not be used, use `tag` instead.
2010
2678
  */
2011
- readonly [uniffiTypeNameSymbol]: "PaymentDetails";
2679
+ readonly [uniffiTypeNameSymbol]: "ProvisionalPaymentDetails";
2012
2680
  };
2013
2681
  instanceOf(obj: any): obj is {
2014
- readonly tag: PaymentDetails_Tags.Withdraw;
2682
+ readonly tag: ProvisionalPaymentDetails_Tags.Spark;
2015
2683
  readonly inner: Readonly<{
2016
- txId: string;
2684
+ payRequest: string;
2017
2685
  }>;
2018
2686
  /**
2019
2687
  * @private
2020
2688
  * This field is private and should not be used, use `tag` instead.
2021
2689
  */
2022
- readonly [uniffiTypeNameSymbol]: "PaymentDetails";
2690
+ readonly [uniffiTypeNameSymbol]: "ProvisionalPaymentDetails";
2023
2691
  };
2024
2692
  };
2025
- Deposit: {
2693
+ Token: {
2026
2694
  new (inner: {
2027
- txId: string;
2695
+ /**
2696
+ * Token identifier
2697
+ */ tokenId: string;
2698
+ /**
2699
+ * Spark pay request being paid (either a Spark address or a Spark invoice)
2700
+ */ payRequest: string;
2028
2701
  }): {
2029
- readonly tag: PaymentDetails_Tags.Deposit;
2702
+ readonly tag: ProvisionalPaymentDetails_Tags.Token;
2030
2703
  readonly inner: Readonly<{
2031
- txId: string;
2704
+ tokenId: string;
2705
+ payRequest: string;
2032
2706
  }>;
2033
2707
  /**
2034
2708
  * @private
2035
2709
  * This field is private and should not be used, use `tag` instead.
2036
2710
  */
2037
- readonly [uniffiTypeNameSymbol]: "PaymentDetails";
2711
+ readonly [uniffiTypeNameSymbol]: "ProvisionalPaymentDetails";
2038
2712
  };
2039
2713
  "new"(inner: {
2040
- txId: string;
2714
+ /**
2715
+ * Token identifier
2716
+ */ tokenId: string;
2717
+ /**
2718
+ * Spark pay request being paid (either a Spark address or a Spark invoice)
2719
+ */ payRequest: string;
2041
2720
  }): {
2042
- readonly tag: PaymentDetails_Tags.Deposit;
2721
+ readonly tag: ProvisionalPaymentDetails_Tags.Token;
2043
2722
  readonly inner: Readonly<{
2044
- txId: string;
2723
+ tokenId: string;
2724
+ payRequest: string;
2045
2725
  }>;
2046
2726
  /**
2047
2727
  * @private
2048
2728
  * This field is private and should not be used, use `tag` instead.
2049
2729
  */
2050
- readonly [uniffiTypeNameSymbol]: "PaymentDetails";
2730
+ readonly [uniffiTypeNameSymbol]: "ProvisionalPaymentDetails";
2051
2731
  };
2052
2732
  instanceOf(obj: any): obj is {
2053
- readonly tag: PaymentDetails_Tags.Deposit;
2733
+ readonly tag: ProvisionalPaymentDetails_Tags.Token;
2054
2734
  readonly inner: Readonly<{
2055
- txId: string;
2735
+ tokenId: string;
2736
+ payRequest: string;
2056
2737
  }>;
2057
2738
  /**
2058
2739
  * @private
2059
2740
  * This field is private and should not be used, use `tag` instead.
2060
2741
  */
2061
- readonly [uniffiTypeNameSymbol]: "PaymentDetails";
2742
+ readonly [uniffiTypeNameSymbol]: "ProvisionalPaymentDetails";
2062
2743
  };
2063
2744
  };
2064
2745
  }>;
2065
- export type PaymentDetails = InstanceType<(typeof PaymentDetails)[keyof Omit<typeof PaymentDetails, 'instanceOf'>]>;
2066
- export declare enum PaymentMethod {
2067
- Lightning = 0,
2068
- Spark = 1,
2069
- Token = 2,
2070
- Deposit = 3,
2071
- Withdraw = 4,
2072
- Unknown = 5
2073
- }
2074
- /**
2075
- * The status of a payment
2076
- */
2077
- export declare enum PaymentStatus {
2078
- /**
2079
- * Payment is completed successfully
2080
- */
2081
- Completed = 0,
2082
- /**
2083
- * Payment is in progress
2084
- */
2085
- Pending = 1,
2086
- /**
2087
- * Payment has failed
2088
- */
2089
- Failed = 2
2090
- }
2091
- /**
2092
- * The type of payment
2093
- */
2094
- export declare enum PaymentType {
2095
- /**
2096
- * Payment sent from this wallet
2097
- */
2098
- Send = 0,
2099
- /**
2100
- * Payment received to this wallet
2101
- */
2102
- Receive = 1
2103
- }
2746
+ export type ProvisionalPaymentDetails = InstanceType<(typeof ProvisionalPaymentDetails)[keyof Omit<typeof ProvisionalPaymentDetails, 'instanceOf'>]>;
2104
2747
  export declare enum ReceivePaymentMethod_Tags {
2105
2748
  SparkAddress = "SparkAddress",
2749
+ SparkInvoice = "SparkInvoice",
2106
2750
  BitcoinAddress = "BitcoinAddress",
2107
2751
  Bolt11Invoice = "Bolt11Invoice"
2108
2752
  }
@@ -2134,6 +2778,87 @@ export declare const ReceivePaymentMethod: Readonly<{
2134
2778
  readonly [uniffiTypeNameSymbol]: "ReceivePaymentMethod";
2135
2779
  };
2136
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
+ };
2137
2862
  BitcoinAddress: {
2138
2863
  new (): {
2139
2864
  readonly tag: ReceivePaymentMethod_Tags.BitcoinAddress;
@@ -3301,7 +4026,8 @@ export type Seed = InstanceType<(typeof Seed)[keyof Omit<typeof Seed, 'instanceO
3301
4026
  export declare enum SendPaymentMethod_Tags {
3302
4027
  BitcoinAddress = "BitcoinAddress",
3303
4028
  Bolt11Invoice = "Bolt11Invoice",
3304
- SparkAddress = "SparkAddress"
4029
+ SparkAddress = "SparkAddress",
4030
+ SparkInvoice = "SparkInvoice"
3305
4031
  }
3306
4032
  export declare const SendPaymentMethod: Readonly<{
3307
4033
  instanceOf: (obj: any) => obj is SendPaymentMethod;
@@ -3459,6 +4185,67 @@ export declare const SendPaymentMethod: Readonly<{
3459
4185
  readonly [uniffiTypeNameSymbol]: "SendPaymentMethod";
3460
4186
  };
3461
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
+ };
3462
4249
  }>;
3463
4250
  export type SendPaymentMethod = InstanceType<(typeof SendPaymentMethod)[keyof Omit<typeof SendPaymentMethod, 'instanceOf'>]>;
3464
4251
  export declare enum SendPaymentOptions_Tags {
@@ -4002,6 +4789,14 @@ export interface BreezSdkInterface {
4002
4789
  checkLightningAddressAvailable(req: CheckLightningAddressRequest, asyncOpts_?: {
4003
4790
  signal: AbortSignal;
4004
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>;
4005
4800
  claimDeposit(request: ClaimDepositRequest, asyncOpts_?: {
4006
4801
  signal: AbortSignal;
4007
4802
  }): Promise<ClaimDepositResponse>;
@@ -4082,6 +4877,39 @@ export interface BreezSdkInterface {
4082
4877
  lnurlPay(request: LnurlPayRequest, asyncOpts_?: {
4083
4878
  signal: AbortSignal;
4084
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>;
4910
+ parse(input: string, asyncOpts_?: {
4911
+ signal: AbortSignal;
4912
+ }): Promise<InputType>;
4085
4913
  prepareLnurlPay(request: PrepareLnurlPayRequest, asyncOpts_?: {
4086
4914
  signal: AbortSignal;
4087
4915
  }): Promise<PrepareLnurlPayResponse>;
@@ -4114,6 +4942,14 @@ export interface BreezSdkInterface {
4114
4942
  sendPayment(request: SendPaymentRequest, asyncOpts_?: {
4115
4943
  signal: AbortSignal;
4116
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>;
4117
4953
  /**
4118
4954
  * Synchronizes the wallet with the Spark network
4119
4955
  */
@@ -4150,6 +4986,14 @@ export declare class BreezSdk extends UniffiAbstractObject implements BreezSdkIn
4150
4986
  checkLightningAddressAvailable(req: CheckLightningAddressRequest, asyncOpts_?: {
4151
4987
  signal: AbortSignal;
4152
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>;
4153
4997
  claimDeposit(request: ClaimDepositRequest, asyncOpts_?: {
4154
4998
  signal: AbortSignal;
4155
4999
  }): Promise<ClaimDepositResponse>;
@@ -4230,6 +5074,39 @@ export declare class BreezSdk extends UniffiAbstractObject implements BreezSdkIn
4230
5074
  lnurlPay(request: LnurlPayRequest, asyncOpts_?: {
4231
5075
  signal: AbortSignal;
4232
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>;
5107
+ parse(input: string, asyncOpts_?: {
5108
+ signal: AbortSignal;
5109
+ }): Promise<InputType>;
4233
5110
  prepareLnurlPay(request: PrepareLnurlPayRequest, asyncOpts_?: {
4234
5111
  signal: AbortSignal;
4235
5112
  }): Promise<PrepareLnurlPayResponse>;
@@ -4262,6 +5139,14 @@ export declare class BreezSdk extends UniffiAbstractObject implements BreezSdkIn
4262
5139
  sendPayment(request: SendPaymentRequest, asyncOpts_?: {
4263
5140
  signal: AbortSignal;
4264
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>;
4265
5150
  /**
4266
5151
  * Synchronizes the wallet with the Spark network
4267
5152
  */
@@ -4277,6 +5162,39 @@ export declare class BreezSdk extends UniffiAbstractObject implements BreezSdkIn
4277
5162
  uniffiDestroy(): void;
4278
5163
  static instanceOf(obj: any): obj is BreezSdk;
4279
5164
  }
5165
+ /**
5166
+ * This interface is used to observe outgoing payments before Lightning, Spark and onchain Bitcoin payments.
5167
+ * If the implementation returns an error, the payment is cancelled.
5168
+ */
5169
+ export interface PaymentObserver {
5170
+ /**
5171
+ * Called before Lightning, Spark or onchain Bitcoin payments are made
5172
+ */
5173
+ beforeSend(payments: Array<ProvisionalPayment>, asyncOpts_?: {
5174
+ signal: AbortSignal;
5175
+ }): Promise<void>;
5176
+ }
5177
+ /**
5178
+ * This interface is used to observe outgoing payments before Lightning, Spark and onchain Bitcoin payments.
5179
+ * If the implementation returns an error, the payment is cancelled.
5180
+ */
5181
+ export declare class PaymentObserverImpl extends UniffiAbstractObject implements PaymentObserver {
5182
+ readonly [uniffiTypeNameSymbol] = "PaymentObserverImpl";
5183
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
5184
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
5185
+ private constructor();
5186
+ /**
5187
+ * Called before Lightning, Spark or onchain Bitcoin payments are made
5188
+ */
5189
+ beforeSend(payments: Array<ProvisionalPayment>, asyncOpts_?: {
5190
+ signal: AbortSignal;
5191
+ }): Promise<void>;
5192
+ /**
5193
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
5194
+ */
5195
+ uniffiDestroy(): void;
5196
+ static instanceOf(obj: any): obj is PaymentObserverImpl;
5197
+ }
4280
5198
  /**
4281
5199
  * Builder for creating `BreezSdk` instances with customizable components.
4282
5200
  */
@@ -4315,6 +5233,14 @@ export interface SdkBuilderInterface {
4315
5233
  withLnurlClient(lnurlClient: RestClient, asyncOpts_?: {
4316
5234
  signal: AbortSignal;
4317
5235
  }): Promise<void>;
5236
+ /**
5237
+ * Sets the payment observer to be used by the SDK.
5238
+ * Arguments:
5239
+ * - `payment_observer`: The payment observer to be used.
5240
+ */
5241
+ withPaymentObserver(paymentObserver: PaymentObserver, asyncOpts_?: {
5242
+ signal: AbortSignal;
5243
+ }): Promise<void>;
4318
5244
  /**
4319
5245
  * Sets the REST chain service to be used by the SDK.
4320
5246
  * Arguments:
@@ -4374,6 +5300,14 @@ export declare class SdkBuilder extends UniffiAbstractObject implements SdkBuild
4374
5300
  withLnurlClient(lnurlClient: RestClient, asyncOpts_?: {
4375
5301
  signal: AbortSignal;
4376
5302
  }): Promise<void>;
5303
+ /**
5304
+ * Sets the payment observer to be used by the SDK.
5305
+ * Arguments:
5306
+ * - `payment_observer`: The payment observer to be used.
5307
+ */
5308
+ withPaymentObserver(paymentObserver: PaymentObserver, asyncOpts_?: {
5309
+ signal: AbortSignal;
5310
+ }): Promise<void>;
4377
5311
  /**
4378
5312
  * Sets the REST chain service to be used by the SDK.
4379
5313
  * Arguments:
@@ -4698,6 +5632,20 @@ declare const _default: Readonly<{
4698
5632
  lift(value: UniffiByteArray): CheckLightningAddressRequest;
4699
5633
  lower(value: CheckLightningAddressRequest): UniffiByteArray;
4700
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
+ };
4701
5649
  FfiConverterTypeClaimDepositRequest: {
4702
5650
  read(from: RustBuffer): ClaimDepositRequest;
4703
5651
  write(value: ClaimDepositRequest, into: RustBuffer): void;
@@ -4873,6 +5821,27 @@ declare const _default: Readonly<{
4873
5821
  lift(value: UniffiByteArray): LnurlPayResponse;
4874
5822
  lower(value: LnurlPayResponse): UniffiByteArray;
4875
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
+ };
4876
5845
  FfiConverterTypeLogEntry: {
4877
5846
  read(from: RustBuffer): LogEntry;
4878
5847
  write(value: LogEntry, into: RustBuffer): void;
@@ -4922,6 +5891,7 @@ declare const _default: Readonly<{
4922
5891
  lift(value: UniffiByteArray): PaymentMethod;
4923
5892
  lower(value: PaymentMethod): UniffiByteArray;
4924
5893
  };
5894
+ FfiConverterTypePaymentObserver: FfiConverterObjectWithCallbacks<PaymentObserver>;
4925
5895
  FfiConverterTypePaymentStatus: {
4926
5896
  read(from: RustBuffer): PaymentStatus;
4927
5897
  write(value: PaymentStatus, into: RustBuffer): void;
@@ -4964,6 +5934,20 @@ declare const _default: Readonly<{
4964
5934
  lift(value: UniffiByteArray): PrepareSendPaymentResponse;
4965
5935
  lower(value: PrepareSendPaymentResponse): UniffiByteArray;
4966
5936
  };
5937
+ FfiConverterTypeProvisionalPayment: {
5938
+ read(from: RustBuffer): ProvisionalPayment;
5939
+ write(value: ProvisionalPayment, into: RustBuffer): void;
5940
+ allocationSize(value: ProvisionalPayment): number;
5941
+ lift(value: UniffiByteArray): ProvisionalPayment;
5942
+ lower(value: ProvisionalPayment): UniffiByteArray;
5943
+ };
5944
+ FfiConverterTypeProvisionalPaymentDetails: {
5945
+ read(from: RustBuffer): ProvisionalPaymentDetails;
5946
+ write(value: ProvisionalPaymentDetails, into: RustBuffer): void;
5947
+ allocationSize(value: ProvisionalPaymentDetails): number;
5948
+ lift(value: UniffiByteArray): ProvisionalPaymentDetails;
5949
+ lower(value: ProvisionalPaymentDetails): UniffiByteArray;
5950
+ };
4967
5951
  FfiConverterTypeReceivePaymentMethod: {
4968
5952
  read(from: RustBuffer): ReceivePaymentMethod;
4969
5953
  write(value: ReceivePaymentMethod, into: RustBuffer): void;
@@ -5063,6 +6047,27 @@ declare const _default: Readonly<{
5063
6047
  lift(value: UniffiByteArray): SendPaymentResponse;
5064
6048
  lower(value: SendPaymentResponse): UniffiByteArray;
5065
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
+ };
5066
6071
  FfiConverterTypeStorage: FfiConverterObjectWithCallbacks<Storage>;
5067
6072
  FfiConverterTypeSyncWalletRequest: {
5068
6073
  read(from: RustBuffer): SyncWalletRequest;