@breeztech/breez-sdk-spark 0.8.0-dev1 → 0.8.3-dev1

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.
@@ -1,16 +1,16 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function connectWithSigner(config: Config, signer: ExternalSigner, storage_dir: string): Promise<BreezSdk>;
4
- export function connect(request: ConnectRequest): Promise<BreezSdk>;
5
3
  export function defaultExternalSigner(mnemonic: string, passphrase: string | null | undefined, network: Network, key_set_config?: KeySetConfig | null): DefaultSigner;
4
+ export function connect(request: ConnectRequest): Promise<BreezSdk>;
6
5
  export function initLogging(logger: Logger, filter?: string | null): Promise<void>;
6
+ export function connectWithSigner(config: Config, signer: ExternalSigner, storage_dir: string): Promise<BreezSdk>;
7
+ export function defaultConfig(network: Network): Config;
7
8
  /**
8
9
  * Creates a default external signer from a mnemonic phrase.
9
10
  *
10
11
  * This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
11
12
  */
12
13
  export function getSparkStatus(): Promise<SparkStatus>;
13
- export function defaultConfig(network: Network): Config;
14
14
  /**
15
15
  * Entry point invoked by JavaScript in a worker.
16
16
  */
@@ -53,11 +53,12 @@ export interface BitcoinChainService {
53
53
  recommendedFees(): Promise<RecommendedFees>;
54
54
  }
55
55
 
56
- export interface Utxo {
57
- txid: string;
58
- vout: number;
59
- value: number;
60
- status: TxStatus;
56
+ export interface RecommendedFees {
57
+ fastestFee: number;
58
+ halfHourFee: number;
59
+ hourFee: number;
60
+ economyFee: number;
61
+ minimumFee: number;
61
62
  }
62
63
 
63
64
  export interface TxStatus {
@@ -68,31 +69,17 @@ export interface TxStatus {
68
69
 
69
70
  export type ChainApiType = "esplora" | "mempoolSpace";
70
71
 
71
- export interface RecommendedFees {
72
- fastestFee: number;
73
- halfHourFee: number;
74
- hourFee: number;
75
- economyFee: number;
76
- minimumFee: number;
72
+ export interface Utxo {
73
+ txid: string;
74
+ vout: number;
75
+ value: number;
76
+ status: TxStatus;
77
77
  }
78
78
 
79
79
  export interface PaymentObserver {
80
80
  beforeSend: (payments: ProvisionalPayment[]) => Promise<void>;
81
81
  }
82
82
 
83
- export interface SyncWalletRequest {}
84
-
85
- export interface UnversionedRecordChange {
86
- id: RecordId;
87
- schemaVersion: string;
88
- updatedFields: Map<string, string>;
89
- }
90
-
91
- export interface SparkHtlcOptions {
92
- paymentHash: string;
93
- expiryDurationSecs: number;
94
- }
95
-
96
83
  export interface Bolt11InvoiceDetails {
97
84
  amountMsat?: number;
98
85
  description?: string;
@@ -108,224 +95,276 @@ export interface Bolt11InvoiceDetails {
108
95
  timestamp: number;
109
96
  }
110
97
 
111
- export type PaymentStatus = "completed" | "pending" | "failed";
98
+ export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
112
99
 
113
- export interface AesSuccessActionData {
114
- description: string;
115
- ciphertext: string;
116
- iv: string;
100
+ export interface CheckMessageRequest {
101
+ message: string;
102
+ pubkey: string;
103
+ signature: string;
117
104
  }
118
105
 
119
- export interface ReceivePaymentResponse {
120
- paymentRequest: string;
121
- fee: bigint;
106
+ export interface FiatCurrency {
107
+ id: string;
108
+ info: CurrencyInfo;
122
109
  }
123
110
 
124
- export type DepositClaimError = { type: "maxDepositClaimFeeExceeded"; tx: string; vout: number; maxFee?: Fee; requiredFeeSats: number; requiredFeeRateSatPerVbyte: number } | { type: "missingUtxo"; tx: string; vout: number } | { type: "generic"; message: string };
125
-
126
- export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: string; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress" } | { type: "bolt11Invoice"; description: string; amountSats?: number; expirySecs?: number };
111
+ export interface KeySetConfig {
112
+ keySetType: KeySetType;
113
+ useAddressIndex: boolean;
114
+ accountNumber?: number;
115
+ }
127
116
 
128
- export interface BuyBitcoinRequest {
129
- lockedAmountSat?: number;
130
- redirectUrl?: string;
117
+ export interface SendOnchainSpeedFeeQuote {
118
+ userFeeSat: number;
119
+ l1BroadcastFeeSat: number;
131
120
  }
132
121
 
133
- export interface ConnectRequest {
134
- config: Config;
135
- seed: Seed;
136
- storageDir: string;
122
+ export interface Bolt12InvoiceRequestDetails {}
123
+
124
+ export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
125
+
126
+ export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
127
+
128
+ export interface SendPaymentRequest {
129
+ prepareResponse: PrepareSendPaymentResponse;
130
+ options?: SendPaymentOptions;
131
+ idempotencyKey?: string;
137
132
  }
138
133
 
139
- export interface LightningAddressDetails {
140
- address: string;
141
- payRequest: LnurlPayRequestDetails;
134
+ export interface SendPaymentResponse {
135
+ payment: Payment;
142
136
  }
143
137
 
144
- export interface LocalizedName {
145
- locale: string;
146
- name: string;
138
+ export interface IncomingChange {
139
+ newState: Record;
140
+ oldState?: Record;
147
141
  }
148
142
 
149
- export interface PrepareSendPaymentResponse {
150
- paymentMethod: SendPaymentMethod;
143
+ export interface ConversionStep {
144
+ paymentId: string;
151
145
  amount: bigint;
152
- tokenIdentifier?: string;
153
- conversionEstimate?: ConversionEstimate;
154
- feePolicy: FeePolicy;
146
+ fee: bigint;
147
+ method: PaymentMethod;
148
+ tokenMetadata?: TokenMetadata;
155
149
  }
156
150
 
157
- export interface TokenBalance {
158
- balance: bigint;
159
- tokenMetadata: TokenMetadata;
151
+ export interface ConversionInfo {
152
+ poolId: string;
153
+ conversionId: string;
154
+ status: ConversionStatus;
155
+ fee?: string;
156
+ purpose?: ConversionPurpose;
157
+ }
158
+
159
+ export interface CurrencyInfo {
160
+ name: string;
161
+ fractionSize: number;
162
+ spacing?: number;
163
+ symbol?: Symbol;
164
+ uniqSymbol?: Symbol;
165
+ localizedName: LocalizedName[];
166
+ localeOverrides: LocaleOverrides[];
160
167
  }
161
168
 
162
169
  export type OptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
163
170
 
164
- export interface SetLnurlMetadataItem {
165
- paymentHash: string;
166
- senderComment?: string;
167
- nostrZapRequest?: string;
168
- nostrZapReceipt?: string;
171
+ export interface TokenMetadata {
172
+ identifier: string;
173
+ issuerPublicKey: string;
174
+ name: string;
175
+ ticker: string;
176
+ decimals: number;
177
+ maxSupply: string;
178
+ isFreezable: boolean;
169
179
  }
170
180
 
171
- export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
181
+ export type SdkEvent = { type: "synced" } | { type: "unclaimedDeposits"; unclaimedDeposits: DepositInfo[] } | { type: "claimedDeposits"; claimedDeposits: DepositInfo[] } | { type: "paymentSucceeded"; payment: Payment } | { type: "paymentPending"; payment: Payment } | { type: "paymentFailed"; payment: Payment } | { type: "optimization"; optimizationEvent: OptimizationEvent };
172
182
 
173
- export interface SparkStatus {
174
- status: ServiceStatus;
175
- lastUpdated: number;
176
- }
183
+ export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
177
184
 
178
- export interface UrlSuccessActionData {
179
- description: string;
180
- url: string;
181
- matchesCallbackDomain: boolean;
185
+ export interface Bolt12OfferBlindedPath {
186
+ blindedHops: string[];
182
187
  }
183
188
 
184
189
  export interface CheckMessageResponse {
185
190
  isValid: boolean;
186
191
  }
187
192
 
188
- export interface GetInfoResponse {
189
- identityPubkey: string;
190
- balanceSats: number;
191
- tokenBalances: Map<string, TokenBalance>;
193
+ export interface Bip21Details {
194
+ amountSat?: number;
195
+ assetId?: string;
196
+ uri: string;
197
+ extras: Bip21Extra[];
198
+ label?: string;
199
+ message?: string;
200
+ paymentMethods: InputType[];
192
201
  }
193
202
 
194
- export interface ListUnclaimedDepositsRequest {}
195
-
196
- export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
203
+ export interface SparkStatus {
204
+ status: ServiceStatus;
205
+ lastUpdated: number;
206
+ }
197
207
 
198
- export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
208
+ export interface LnurlWithdrawRequest {
209
+ amountSats: number;
210
+ withdrawRequest: LnurlWithdrawRequestDetails;
211
+ completionTimeoutSecs?: number;
212
+ }
199
213
 
200
- export type SdkEvent = { type: "synced" } | { type: "unclaimedDeposits"; unclaimedDeposits: DepositInfo[] } | { type: "claimedDeposits"; claimedDeposits: DepositInfo[] } | { type: "paymentSucceeded"; payment: Payment } | { type: "paymentPending"; payment: Payment } | { type: "paymentFailed"; payment: Payment } | { type: "optimization"; optimizationEvent: OptimizationEvent };
214
+ export interface RecordId {
215
+ type: string;
216
+ dataId: string;
217
+ }
201
218
 
202
- export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" };
219
+ export interface SparkAddressDetails {
220
+ address: string;
221
+ identityPublicKey: string;
222
+ network: BitcoinNetwork;
223
+ source: PaymentRequestSource;
224
+ }
203
225
 
204
- export interface LnurlPayRequestDetails {
205
- callback: string;
206
- minSendable: number;
207
- maxSendable: number;
208
- metadataStr: string;
209
- commentAllowed: number;
210
- domain: string;
211
- url: string;
212
- address?: string;
213
- allowsNostr?: boolean;
214
- nostrPubkey?: string;
226
+ export interface PrepareSendPaymentRequest {
227
+ paymentRequest: string;
228
+ amount?: bigint;
229
+ tokenIdentifier?: string;
230
+ conversionOptions?: ConversionOptions;
231
+ feePolicy?: FeePolicy;
215
232
  }
216
233
 
217
- export interface SyncWalletResponse {}
234
+ export interface LocaleOverrides {
235
+ locale: string;
236
+ spacing?: number;
237
+ symbol: Symbol;
238
+ }
218
239
 
219
- export type PaymentType = "send" | "receive";
240
+ export interface Bolt12Invoice {
241
+ invoice: string;
242
+ source: PaymentRequestSource;
243
+ }
220
244
 
221
- export interface LnurlWithdrawResponse {
222
- paymentRequest: string;
223
- payment?: Payment;
245
+ export interface Symbol {
246
+ grapheme?: string;
247
+ template?: string;
248
+ rtl?: boolean;
249
+ position?: number;
224
250
  }
225
251
 
226
- export interface Bolt12Offer {
227
- offer: string;
228
- source: PaymentRequestSource;
252
+ export interface PrepareLnurlPayRequest {
253
+ amountSats: number;
254
+ comment?: string;
255
+ payRequest: LnurlPayRequestDetails;
256
+ validateSuccessActionUrl?: boolean;
257
+ conversionOptions?: ConversionOptions;
258
+ feePolicy?: FeePolicy;
229
259
  }
230
260
 
231
- export interface LnurlPayRequest {
232
- prepareResponse: PrepareLnurlPayResponse;
233
- idempotencyKey?: string;
261
+ export interface UserSettings {
262
+ sparkPrivateModeEnabled: boolean;
234
263
  }
235
264
 
236
- export interface MessageSuccessActionData {
237
- message: string;
265
+ export interface ClaimDepositResponse {
266
+ payment: Payment;
238
267
  }
239
268
 
240
- export interface SignMessageResponse {
241
- pubkey: string;
242
- signature: string;
269
+ export interface OptimizationConfig {
270
+ autoEnabled: boolean;
271
+ multiplicity: number;
243
272
  }
244
273
 
245
- export interface Credentials {
246
- username: string;
247
- password: string;
274
+ export interface LocalizedName {
275
+ locale: string;
276
+ name: string;
248
277
  }
249
278
 
250
- export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
279
+ export interface SyncWalletRequest {}
251
280
 
252
- export interface Bolt12OfferDetails {
253
- absoluteExpiry?: number;
254
- chains: string[];
255
- description?: string;
256
- issuer?: string;
257
- minAmount?: Amount;
258
- offer: Bolt12Offer;
259
- paths: Bolt12OfferBlindedPath[];
260
- signingPubkey?: string;
281
+ export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" | "major";
282
+
283
+ export interface LnurlWithdrawRequestDetails {
284
+ callback: string;
285
+ k1: string;
286
+ defaultDescription: string;
287
+ minWithdrawable: number;
288
+ maxWithdrawable: number;
261
289
  }
262
290
 
263
- export interface LightningAddressInfo {
264
- description: string;
265
- lightningAddress: string;
266
- lnurl: LnurlInfo;
267
- username: string;
291
+ export interface Payment {
292
+ id: string;
293
+ paymentType: PaymentType;
294
+ status: PaymentStatus;
295
+ amount: bigint;
296
+ fees: bigint;
297
+ timestamp: number;
298
+ method: PaymentMethod;
299
+ details?: PaymentDetails;
300
+ conversionDetails?: ConversionDetails;
268
301
  }
269
302
 
270
- export type AesSuccessActionDataResult = { type: "decrypted"; data: AesSuccessActionDataDecrypted } | { type: "errorStatus"; reason: string };
303
+ export interface GetTokensMetadataRequest {
304
+ tokenIdentifiers: string[];
305
+ }
271
306
 
272
- export interface CurrencyInfo {
273
- name: string;
274
- fractionSize: number;
275
- spacing?: number;
276
- symbol?: Symbol;
277
- uniqSymbol?: Symbol;
278
- localizedName: LocalizedName[];
279
- localeOverrides: LocaleOverrides[];
307
+ export interface UnversionedRecordChange {
308
+ id: RecordId;
309
+ schemaVersion: string;
310
+ updatedFields: Map<string, string>;
280
311
  }
281
312
 
282
- export interface ReceivePaymentRequest {
283
- paymentMethod: ReceivePaymentMethod;
313
+ export interface ClaimHtlcPaymentResponse {
314
+ payment: Payment;
284
315
  }
285
316
 
286
- export interface GetTokensMetadataResponse {
287
- tokensMetadata: TokenMetadata[];
317
+ export interface LnurlPayRequest {
318
+ prepareResponse: PrepareLnurlPayResponse;
319
+ idempotencyKey?: string;
288
320
  }
289
321
 
290
- export interface SendOnchainSpeedFeeQuote {
291
- userFeeSat: number;
292
- l1BroadcastFeeSat: number;
322
+ export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: string; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: string; tokenIdentifier?: string };
323
+
324
+ export interface FetchConversionLimitsRequest {
325
+ conversionType: ConversionType;
326
+ tokenIdentifier?: string;
293
327
  }
294
328
 
295
- export interface LnurlPayInfo {
296
- lnAddress?: string;
297
- comment?: string;
298
- domain?: string;
299
- metadata?: string;
300
- processedSuccessAction?: SuccessActionProcessed;
301
- rawSuccessAction?: SuccessAction;
329
+ export interface Rate {
330
+ coin: string;
331
+ value: number;
302
332
  }
303
333
 
304
- export interface PrepareLnurlPayResponse {
305
- amountSats: number;
306
- comment?: string;
307
- payRequest: LnurlPayRequestDetails;
308
- feeSats: number;
309
- invoiceDetails: Bolt11InvoiceDetails;
310
- successAction?: SuccessAction;
311
- conversionEstimate?: ConversionEstimate;
312
- feePolicy: FeePolicy;
334
+ export type TokenTransactionType = "transfer" | "mint" | "burn";
335
+
336
+ export interface SilentPaymentAddressDetails {
337
+ address: string;
338
+ network: BitcoinNetwork;
339
+ source: PaymentRequestSource;
313
340
  }
314
341
 
315
- export interface LogEntry {
316
- line: string;
317
- level: string;
342
+ export type Network = "mainnet" | "regtest";
343
+
344
+ export interface ConversionEstimate {
345
+ options: ConversionOptions;
346
+ amount: bigint;
347
+ fee: bigint;
318
348
  }
319
349
 
320
- export interface GetPaymentResponse {
321
- payment: Payment;
350
+ export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
351
+
352
+ export interface PaymentMetadata {
353
+ parentPaymentId?: string;
354
+ lnurlPayInfo?: LnurlPayInfo;
355
+ lnurlWithdrawInfo?: LnurlWithdrawInfo;
356
+ lnurlDescription?: string;
357
+ conversionInfo?: ConversionInfo;
322
358
  }
323
359
 
324
- export interface GetInfoRequest {
325
- ensureSynced?: boolean;
360
+ export interface ClaimHtlcPaymentRequest {
361
+ preimage: string;
326
362
  }
327
363
 
328
- export interface CheckLightningAddressRequest {
364
+ export interface LightningAddressInfo {
365
+ description: string;
366
+ lightningAddress: string;
367
+ lnurl: LnurlInfo;
329
368
  username: string;
330
369
  }
331
370
 
@@ -336,49 +375,77 @@ export interface Record {
336
375
  data: Map<string, string>;
337
376
  }
338
377
 
339
- export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
378
+ export interface Bolt11Invoice {
379
+ bolt11: string;
380
+ source: PaymentRequestSource;
381
+ }
340
382
 
341
- export interface ConversionOptions {
342
- conversionType: ConversionType;
343
- maxSlippageBps?: number;
344
- completionTimeoutSecs?: number;
383
+ export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
384
+
385
+ export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
386
+
387
+ export interface Credentials {
388
+ username: string;
389
+ password: string;
345
390
  }
346
391
 
347
- export interface LnurlPayResponse {
348
- payment: Payment;
349
- successAction?: SuccessActionProcessed;
392
+ export interface BuyBitcoinRequest {
393
+ lockedAmountSat?: number;
394
+ redirectUrl?: string;
350
395
  }
351
396
 
352
- export interface RecordId {
353
- type: string;
354
- dataId: string;
397
+ export interface GetInfoResponse {
398
+ identityPubkey: string;
399
+ balanceSats: number;
400
+ tokenBalances: Map<string, TokenBalance>;
355
401
  }
356
402
 
357
- export interface PrepareSendPaymentRequest {
358
- paymentRequest: string;
359
- amount?: bigint;
360
- tokenIdentifier?: string;
361
- conversionOptions?: ConversionOptions;
362
- feePolicy?: FeePolicy;
403
+ export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
404
+
405
+ export interface Bip21Extra {
406
+ key: string;
407
+ value: string;
363
408
  }
364
409
 
365
- export interface FetchConversionLimitsResponse {
366
- minFromAmount?: bigint;
367
- minToAmount?: bigint;
410
+ export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
411
+
412
+ export interface LnurlAuthRequestDetails {
413
+ k1: string;
414
+ action?: string;
415
+ domain: string;
416
+ url: string;
368
417
  }
369
418
 
370
- export interface RecordChange {
371
- id: RecordId;
372
- schemaVersion: string;
373
- updatedFields: Map<string, string>;
374
- revision: number;
419
+ export type InputType = ({ type: "bitcoinAddress" } & BitcoinAddressDetails) | ({ type: "bolt11Invoice" } & Bolt11InvoiceDetails) | ({ type: "bolt12Invoice" } & Bolt12InvoiceDetails) | ({ type: "bolt12Offer" } & Bolt12OfferDetails) | ({ type: "lightningAddress" } & LightningAddressDetails) | ({ type: "lnurlPay" } & LnurlPayRequestDetails) | ({ type: "silentPaymentAddress" } & SilentPaymentAddressDetails) | ({ type: "lnurlAuth" } & LnurlAuthRequestDetails) | ({ type: "url" } & string) | ({ type: "bip21" } & Bip21Details) | ({ type: "bolt12InvoiceRequest" } & Bolt12InvoiceRequestDetails) | ({ type: "lnurlWithdraw" } & LnurlWithdrawRequestDetails) | ({ type: "sparkAddress" } & SparkAddressDetails) | ({ type: "sparkInvoice" } & SparkInvoiceDetails);
420
+
421
+ export type ConversionStatus = "completed" | "refundNeeded" | "refunded";
422
+
423
+ export interface LogEntry {
424
+ line: string;
425
+ level: string;
375
426
  }
376
427
 
377
- export type TokenTransactionType = "transfer" | "mint" | "burn";
428
+ export interface ListUnclaimedDepositsResponse {
429
+ deposits: DepositInfo[];
430
+ }
378
431
 
379
- export interface FetchConversionLimitsRequest {
380
- conversionType: ConversionType;
381
- tokenIdentifier?: string;
432
+ export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
433
+
434
+ export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
435
+
436
+ export interface Bolt12InvoiceDetails {
437
+ amountMsat: number;
438
+ invoice: Bolt12Invoice;
439
+ }
440
+
441
+ export interface ReceivePaymentResponse {
442
+ paymentRequest: string;
443
+ fee: bigint;
444
+ }
445
+
446
+ export interface LnurlWithdrawResponse {
447
+ paymentRequest: string;
448
+ payment?: Payment;
382
449
  }
383
450
 
384
451
  export interface PaymentRequestSource {
@@ -386,98 +453,124 @@ export interface PaymentRequestSource {
386
453
  bip353Address?: string;
387
454
  }
388
455
 
389
- export type ConversionStatus = "completed" | "refundNeeded" | "refunded";
390
-
391
- export interface UpdateUserSettingsRequest {
392
- sparkPrivateModeEnabled?: boolean;
456
+ export interface PrepareLnurlPayResponse {
457
+ amountSats: number;
458
+ comment?: string;
459
+ payRequest: LnurlPayRequestDetails;
460
+ feeSats: number;
461
+ invoiceDetails: Bolt11InvoiceDetails;
462
+ successAction?: SuccessAction;
463
+ conversionEstimate?: ConversionEstimate;
464
+ feePolicy: FeePolicy;
393
465
  }
394
466
 
395
- export interface Bolt11RouteHint {
396
- hops: Bolt11RouteHintHop[];
467
+ export interface AesSuccessActionData {
468
+ description: string;
469
+ ciphertext: string;
470
+ iv: string;
397
471
  }
398
472
 
399
- export interface LnurlInfo {
400
- url: string;
401
- bech32: string;
473
+ export interface Config {
474
+ apiKey?: string;
475
+ network: Network;
476
+ syncIntervalSecs: number;
477
+ maxDepositClaimFee?: MaxFee;
478
+ lnurlDomain?: string;
479
+ preferSparkOverLightning: boolean;
480
+ externalInputParsers?: ExternalInputParser[];
481
+ useDefaultExternalInputParsers: boolean;
482
+ realTimeSyncServerUrl?: string;
483
+ privateEnabledDefault: boolean;
484
+ optimizationConfig: OptimizationConfig;
485
+ stableBalanceConfig?: StableBalanceConfig;
402
486
  }
403
487
 
404
- export interface SparkInvoiceDetails {
405
- invoice: string;
406
- identityPublicKey: string;
407
- network: BitcoinNetwork;
408
- amount?: string;
409
- tokenIdentifier?: string;
410
- expiryTime?: number;
411
- description?: string;
412
- senderPublicKey?: string;
488
+ export interface ClaimDepositRequest {
489
+ txid: string;
490
+ vout: number;
491
+ maxFee?: MaxFee;
413
492
  }
414
493
 
415
- export interface BuyBitcoinResponse {
416
- url: string;
494
+ export interface ListFiatCurrenciesResponse {
495
+ currencies: FiatCurrency[];
417
496
  }
418
497
 
419
- export interface ListPaymentsResponse {
420
- payments: Payment[];
498
+ export interface Bolt11RouteHintHop {
499
+ srcNodeId: string;
500
+ shortChannelId: string;
501
+ feesBaseMsat: number;
502
+ feesProportionalMillionths: number;
503
+ cltvExpiryDelta: number;
504
+ htlcMinimumMsat?: number;
505
+ htlcMaximumMsat?: number;
421
506
  }
422
507
 
423
- export interface Bip21Details {
424
- amountSat?: number;
425
- assetId?: string;
426
- uri: string;
427
- extras: Bip21Extra[];
428
- label?: string;
429
- message?: string;
430
- paymentMethods: InputType[];
431
- }
508
+ export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
432
509
 
433
- export interface BitcoinAddressDetails {
434
- address: string;
435
- network: BitcoinNetwork;
436
- source: PaymentRequestSource;
437
- }
510
+ export type DepositClaimError = { type: "maxDepositClaimFeeExceeded"; tx: string; vout: number; maxFee?: Fee; requiredFeeSats: number; requiredFeeRateSatPerVbyte: number } | { type: "missingUtxo"; tx: string; vout: number } | { type: "generic"; message: string };
438
511
 
439
- export interface Rate {
440
- coin: string;
441
- value: number;
512
+ export interface OptimizationProgress {
513
+ isRunning: boolean;
514
+ currentRound: number;
515
+ totalRounds: number;
442
516
  }
443
517
 
444
- export interface ConversionEstimate {
445
- options: ConversionOptions;
518
+ export interface PrepareSendPaymentResponse {
519
+ paymentMethod: SendPaymentMethod;
446
520
  amount: bigint;
447
- fee: bigint;
521
+ tokenIdentifier?: string;
522
+ conversionEstimate?: ConversionEstimate;
523
+ feePolicy: FeePolicy;
448
524
  }
449
525
 
450
- export interface RegisterLightningAddressRequest {
451
- username: string;
452
- description?: string;
526
+ export interface SignMessageRequest {
527
+ message: string;
528
+ compact: boolean;
453
529
  }
454
530
 
455
- export interface Bolt12InvoiceRequestDetails {}
456
-
457
- export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails; conversionInfo?: ConversionInfo } | { type: "token"; metadata: TokenMetadata; txHash: string; txType: TokenTransactionType; invoiceDetails?: SparkInvoicePaymentDetails; conversionInfo?: ConversionInfo } | { type: "lightning"; description?: string; preimage?: string; invoice: string; paymentHash: string; destinationPubkey: string; lnurlPayInfo?: LnurlPayInfo; lnurlWithdrawInfo?: LnurlWithdrawInfo; lnurlReceiveMetadata?: LnurlReceiveMetadata } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string };
531
+ export interface UrlSuccessActionData {
532
+ description: string;
533
+ url: string;
534
+ matchesCallbackDomain: boolean;
535
+ }
458
536
 
459
- export interface DepositInfo {
460
- txid: string;
461
- vout: number;
462
- amountSats: number;
463
- refundTx?: string;
464
- refundTxId?: string;
465
- claimError?: DepositClaimError;
537
+ export interface StableBalanceConfig {
538
+ tokenIdentifier: string;
539
+ thresholdSats?: number;
540
+ maxSlippageBps?: number;
541
+ reservedSats?: number;
466
542
  }
467
543
 
468
- export interface ClaimDepositResponse {
469
- payment: Payment;
544
+ export interface GetInfoRequest {
545
+ ensureSynced?: boolean;
470
546
  }
471
547
 
472
- export interface GetPaymentRequest {
473
- paymentId: string;
548
+ export interface LnurlPayRequestDetails {
549
+ callback: string;
550
+ minSendable: number;
551
+ maxSendable: number;
552
+ metadataStr: string;
553
+ commentAllowed: number;
554
+ domain: string;
555
+ url: string;
556
+ address?: string;
557
+ allowsNostr?: boolean;
558
+ nostrPubkey?: string;
474
559
  }
475
560
 
476
- export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
561
+ export interface GetTokensMetadataResponse {
562
+ tokensMetadata: TokenMetadata[];
563
+ }
477
564
 
478
- export interface Bip21Extra {
479
- key: string;
480
- value: string;
565
+ export interface SparkInvoiceDetails {
566
+ invoice: string;
567
+ identityPublicKey: string;
568
+ network: BitcoinNetwork;
569
+ amount?: string;
570
+ tokenIdentifier?: string;
571
+ expiryTime?: number;
572
+ description?: string;
573
+ senderPublicKey?: string;
481
574
  }
482
575
 
483
576
  export interface OutgoingChange {
@@ -485,20 +578,13 @@ export interface OutgoingChange {
485
578
  parent?: Record;
486
579
  }
487
580
 
488
- export interface LocaleOverrides {
489
- locale: string;
490
- spacing?: number;
491
- symbol: Symbol;
492
- }
493
-
494
- export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
495
-
496
- export interface ClaimHtlcPaymentResponse {
497
- payment: Payment;
498
- }
499
-
500
- export interface SendPaymentResponse {
501
- payment: Payment;
581
+ export interface LnurlPayInfo {
582
+ lnAddress?: string;
583
+ comment?: string;
584
+ domain?: string;
585
+ metadata?: string;
586
+ processedSuccessAction?: SuccessActionProcessed;
587
+ rawSuccessAction?: SuccessAction;
502
588
  }
503
589
 
504
590
  export interface RefundDepositRequest {
@@ -508,210 +594,165 @@ export interface RefundDepositRequest {
508
594
  fee: Fee;
509
595
  }
510
596
 
511
- export interface SignMessageRequest {
512
- message: string;
513
- compact: boolean;
597
+ export interface Bolt12Offer {
598
+ offer: string;
599
+ source: PaymentRequestSource;
514
600
  }
515
601
 
516
- export interface AesSuccessActionDataDecrypted {
517
- description: string;
518
- plaintext: string;
519
- }
602
+ export interface ListUnclaimedDepositsRequest {}
520
603
 
521
- export interface Bolt12InvoiceDetails {
522
- amountMsat: number;
523
- invoice: Bolt12Invoice;
604
+ export interface BitcoinAddressDetails {
605
+ address: string;
606
+ network: BitcoinNetwork;
607
+ source: PaymentRequestSource;
524
608
  }
525
609
 
526
- export interface Payment {
527
- id: string;
528
- paymentType: PaymentType;
529
- status: PaymentStatus;
530
- amount: bigint;
531
- fees: bigint;
532
- timestamp: number;
533
- method: PaymentMethod;
534
- details?: PaymentDetails;
535
- conversionDetails?: ConversionDetails;
610
+ export interface ListPaymentsRequest {
611
+ typeFilter?: PaymentType[];
612
+ statusFilter?: PaymentStatus[];
613
+ assetFilter?: AssetFilter;
614
+ paymentDetailsFilter?: PaymentDetailsFilter[];
615
+ fromTimestamp?: number;
616
+ toTimestamp?: number;
617
+ offset?: number;
618
+ limit?: number;
619
+ sortAscending?: boolean;
536
620
  }
537
621
 
538
- export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
539
-
540
- export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
541
-
542
- export interface OptimizationConfig {
543
- autoEnabled: boolean;
544
- multiplicity: number;
622
+ export interface CheckLightningAddressRequest {
623
+ username: string;
545
624
  }
546
625
 
547
- export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" | "major";
548
-
549
- export interface Bolt12Invoice {
550
- invoice: string;
551
- source: PaymentRequestSource;
626
+ export interface RefundDepositResponse {
627
+ txId: string;
628
+ txHex: string;
552
629
  }
553
630
 
554
- export interface OptimizationProgress {
555
- isRunning: boolean;
556
- currentRound: number;
557
- totalRounds: number;
558
- }
631
+ export interface SyncWalletResponse {}
559
632
 
560
- export interface SparkHtlcDetails {
561
- paymentHash: string;
562
- preimage?: string;
563
- expiryTime: number;
564
- status: SparkHtlcStatus;
633
+ export interface UpdateUserSettingsRequest {
634
+ sparkPrivateModeEnabled?: boolean;
565
635
  }
566
636
 
567
- export interface LnurlErrorDetails {
568
- reason: string;
637
+ export interface LnurlReceiveMetadata {
638
+ nostrZapRequest?: string;
639
+ nostrZapReceipt?: string;
640
+ senderComment?: string;
569
641
  }
570
642
 
571
- export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
643
+ export type PaymentStatus = "completed" | "pending" | "failed";
572
644
 
573
- export interface UserSettings {
574
- sparkPrivateModeEnabled: boolean;
645
+ export interface FetchConversionLimitsResponse {
646
+ minFromAmount?: bigint;
647
+ minToAmount?: bigint;
575
648
  }
576
649
 
577
- export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
578
-
579
- export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
580
-
581
- export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
582
-
583
- export interface Bolt11Invoice {
584
- bolt11: string;
585
- source: PaymentRequestSource;
650
+ export interface GetPaymentResponse {
651
+ payment: Payment;
586
652
  }
587
653
 
588
- export interface ListFiatRatesResponse {
589
- rates: Rate[];
654
+ export interface ListPaymentsResponse {
655
+ payments: Payment[];
590
656
  }
591
657
 
592
- export interface GetTokensMetadataRequest {
593
- tokenIdentifiers: string[];
594
- }
658
+ export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: string; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress" } | { type: "bolt11Invoice"; description: string; amountSats?: number; expirySecs?: number; paymentHash?: string };
595
659
 
596
- export interface RefundDepositResponse {
597
- txId: string;
598
- txHex: string;
660
+ export interface ReceivePaymentRequest {
661
+ paymentMethod: ReceivePaymentMethod;
599
662
  }
600
663
 
601
- export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: string; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: string; tokenIdentifier?: string };
602
-
603
- export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
604
-
605
- export interface KeySetConfig {
606
- keySetType: KeySetType;
607
- useAddressIndex: boolean;
608
- accountNumber?: number;
664
+ export interface SparkHtlcDetails {
665
+ paymentHash: string;
666
+ preimage?: string;
667
+ expiryTime: number;
668
+ status: SparkHtlcStatus;
609
669
  }
610
670
 
611
- export interface ListUnclaimedDepositsResponse {
612
- deposits: DepositInfo[];
671
+ export interface ExternalInputParser {
672
+ providerId: string;
673
+ inputRegex: string;
674
+ parserUrl: string;
613
675
  }
614
676
 
615
- export interface SilentPaymentAddressDetails {
616
- address: string;
617
- network: BitcoinNetwork;
618
- source: PaymentRequestSource;
619
- }
677
+ export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
620
678
 
621
- export interface PaymentMetadata {
622
- parentPaymentId?: string;
623
- lnurlPayInfo?: LnurlPayInfo;
624
- lnurlWithdrawInfo?: LnurlWithdrawInfo;
625
- lnurlDescription?: string;
626
- conversionInfo?: ConversionInfo;
679
+ export interface SparkHtlcOptions {
680
+ paymentHash: string;
681
+ expiryDurationSecs: number;
627
682
  }
628
683
 
629
- export interface Config {
630
- apiKey?: string;
631
- network: Network;
632
- syncIntervalSecs: number;
633
- maxDepositClaimFee?: MaxFee;
634
- lnurlDomain?: string;
635
- preferSparkOverLightning: boolean;
636
- externalInputParsers?: ExternalInputParser[];
637
- useDefaultExternalInputParsers: boolean;
638
- realTimeSyncServerUrl?: string;
639
- privateEnabledDefault: boolean;
640
- optimizationConfig: OptimizationConfig;
684
+ export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
685
+
686
+ export interface DepositInfo {
687
+ txid: string;
688
+ vout: number;
689
+ amountSats: number;
690
+ refundTx?: string;
691
+ refundTxId?: string;
692
+ claimError?: DepositClaimError;
641
693
  }
642
694
 
643
- export interface LnurlWithdrawRequestDetails {
644
- callback: string;
645
- k1: string;
646
- defaultDescription: string;
647
- minWithdrawable: number;
648
- maxWithdrawable: number;
695
+ export interface LnurlErrorDetails {
696
+ reason: string;
649
697
  }
650
698
 
651
- export interface ConversionDetails {
652
- from: ConversionStep;
653
- to: ConversionStep;
699
+ export interface TokenBalance {
700
+ balance: bigint;
701
+ tokenMetadata: TokenMetadata;
654
702
  }
655
703
 
656
- export interface Bolt11RouteHintHop {
657
- srcNodeId: string;
658
- shortChannelId: string;
659
- feesBaseMsat: number;
660
- feesProportionalMillionths: number;
661
- cltvExpiryDelta: number;
662
- htlcMinimumMsat?: number;
663
- htlcMaximumMsat?: number;
704
+ export interface GetPaymentRequest {
705
+ paymentId: string;
664
706
  }
665
707
 
666
- export interface CheckMessageRequest {
667
- message: string;
708
+ export interface SignMessageResponse {
668
709
  pubkey: string;
669
710
  signature: string;
670
711
  }
671
712
 
672
- export interface FiatCurrency {
673
- id: string;
674
- info: CurrencyInfo;
713
+ export interface BuyBitcoinResponse {
714
+ url: string;
675
715
  }
676
716
 
677
- export interface Bolt12OfferBlindedPath {
678
- blindedHops: string[];
679
- }
717
+ export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
680
718
 
681
- export interface SparkInvoicePaymentDetails {
682
- description?: string;
683
- invoice: string;
719
+ export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
720
+
721
+ export interface Bolt11RouteHint {
722
+ hops: Bolt11RouteHintHop[];
684
723
  }
685
724
 
686
- export type FeePolicy = "feesExcluded" | "feesIncluded";
725
+ export interface ProvisionalPayment {
726
+ paymentId: string;
727
+ amount: bigint;
728
+ details: ProvisionalPaymentDetails;
729
+ }
687
730
 
688
- export interface SendPaymentRequest {
689
- prepareResponse: PrepareSendPaymentResponse;
690
- options?: SendPaymentOptions;
691
- idempotencyKey?: string;
731
+ export interface LnurlPayResponse {
732
+ payment: Payment;
733
+ successAction?: SuccessActionProcessed;
692
734
  }
693
735
 
694
- export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
736
+ export interface LnurlWithdrawInfo {
737
+ withdrawUrl: string;
738
+ }
695
739
 
696
- export interface SparkAddressDetails {
697
- address: string;
698
- identityPublicKey: string;
699
- network: BitcoinNetwork;
700
- source: PaymentRequestSource;
740
+ export interface ConversionDetails {
741
+ from: ConversionStep;
742
+ to: ConversionStep;
701
743
  }
702
744
 
703
- export interface ClaimHtlcPaymentRequest {
704
- preimage: string;
745
+ export interface ConnectRequest {
746
+ config: Config;
747
+ seed: Seed;
748
+ storageDir: string;
705
749
  }
706
750
 
707
- export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType };
708
-
709
- export interface ConversionStep {
710
- paymentId: string;
711
- amount: bigint;
712
- fee: bigint;
713
- method: PaymentMethod;
714
- tokenMetadata?: TokenMetadata;
751
+ export interface SetLnurlMetadataItem {
752
+ paymentHash: string;
753
+ senderComment?: string;
754
+ nostrZapRequest?: string;
755
+ nostrZapReceipt?: string;
715
756
  }
716
757
 
717
758
  export interface SendOnchainFeeQuote {
@@ -722,125 +763,75 @@ export interface SendOnchainFeeQuote {
722
763
  speedSlow: SendOnchainSpeedFeeQuote;
723
764
  }
724
765
 
725
- export interface LnurlWithdrawRequest {
726
- amountSats: number;
727
- withdrawRequest: LnurlWithdrawRequestDetails;
728
- completionTimeoutSecs?: number;
729
- }
730
-
731
- export interface ExternalInputParser {
732
- providerId: string;
733
- inputRegex: string;
734
- parserUrl: string;
735
- }
736
-
737
- export interface ClaimDepositRequest {
738
- txid: string;
739
- vout: number;
740
- maxFee?: MaxFee;
766
+ export interface RecordChange {
767
+ id: RecordId;
768
+ schemaVersion: string;
769
+ updatedFields: Map<string, string>;
770
+ localRevision: number;
741
771
  }
742
772
 
743
- export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
744
-
745
- export interface Symbol {
746
- grapheme?: string;
747
- template?: string;
748
- rtl?: boolean;
749
- position?: number;
773
+ export interface Bolt12OfferDetails {
774
+ absoluteExpiry?: number;
775
+ chains: string[];
776
+ description?: string;
777
+ issuer?: string;
778
+ minAmount?: Amount;
779
+ offer: Bolt12Offer;
780
+ paths: Bolt12OfferBlindedPath[];
781
+ signingPubkey?: string;
750
782
  }
751
783
 
752
- export interface TokenMetadata {
753
- identifier: string;
754
- issuerPublicKey: string;
755
- name: string;
756
- ticker: string;
757
- decimals: number;
758
- maxSupply: string;
759
- isFreezable: boolean;
784
+ export interface LightningAddressDetails {
785
+ address: string;
786
+ payRequest: LnurlPayRequestDetails;
760
787
  }
761
788
 
762
- export interface ConversionInfo {
763
- poolId: string;
764
- conversionId: string;
765
- status: ConversionStatus;
766
- fee?: string;
767
- purpose?: ConversionPurpose;
768
- }
789
+ export type AesSuccessActionDataResult = { type: "decrypted"; data: AesSuccessActionDataDecrypted } | { type: "errorStatus"; reason: string };
769
790
 
770
- export interface ListFiatCurrenciesResponse {
771
- currencies: FiatCurrency[];
791
+ export interface AesSuccessActionDataDecrypted {
792
+ description: string;
793
+ plaintext: string;
772
794
  }
773
795
 
774
- export interface PrepareLnurlPayRequest {
775
- amountSats: number;
776
- comment?: string;
777
- payRequest: LnurlPayRequestDetails;
778
- validateSuccessActionUrl?: boolean;
779
- conversionOptions?: ConversionOptions;
780
- feePolicy?: FeePolicy;
781
- }
796
+ export type FeePolicy = "feesExcluded" | "feesIncluded";
782
797
 
783
- export interface LnurlAuthRequestDetails {
784
- k1: string;
785
- action?: string;
786
- domain: string;
798
+ export interface LnurlInfo {
787
799
  url: string;
800
+ bech32: string;
788
801
  }
789
802
 
790
- export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
791
-
792
- export type InputType = ({ type: "bitcoinAddress" } & BitcoinAddressDetails) | ({ type: "bolt11Invoice" } & Bolt11InvoiceDetails) | ({ type: "bolt12Invoice" } & Bolt12InvoiceDetails) | ({ type: "bolt12Offer" } & Bolt12OfferDetails) | ({ type: "lightningAddress" } & LightningAddressDetails) | ({ type: "lnurlPay" } & LnurlPayRequestDetails) | ({ type: "silentPaymentAddress" } & SilentPaymentAddressDetails) | ({ type: "lnurlAuth" } & LnurlAuthRequestDetails) | ({ type: "url" } & string) | ({ type: "bip21" } & Bip21Details) | ({ type: "bolt12InvoiceRequest" } & Bolt12InvoiceRequestDetails) | ({ type: "lnurlWithdraw" } & LnurlWithdrawRequestDetails) | ({ type: "sparkAddress" } & SparkAddressDetails) | ({ type: "sparkInvoice" } & SparkInvoiceDetails);
803
+ export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
793
804
 
794
- export interface LnurlWithdrawInfo {
795
- withdrawUrl: string;
805
+ export interface ConversionOptions {
806
+ conversionType: ConversionType;
807
+ maxSlippageBps?: number;
808
+ completionTimeoutSecs?: number;
796
809
  }
797
810
 
798
- export interface LnurlReceiveMetadata {
799
- nostrZapRequest?: string;
800
- nostrZapReceipt?: string;
801
- senderComment?: string;
811
+ export interface SparkInvoicePaymentDetails {
812
+ description?: string;
813
+ invoice: string;
802
814
  }
803
815
 
804
- export interface ListPaymentsRequest {
805
- typeFilter?: PaymentType[];
806
- statusFilter?: PaymentStatus[];
807
- assetFilter?: AssetFilter;
808
- paymentDetailsFilter?: PaymentDetailsFilter[];
809
- fromTimestamp?: number;
810
- toTimestamp?: number;
811
- offset?: number;
812
- limit?: number;
813
- sortAscending?: boolean;
814
- }
816
+ export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
815
817
 
816
- export interface ProvisionalPayment {
817
- paymentId: string;
818
- amount: bigint;
819
- details: ProvisionalPaymentDetails;
818
+ export interface RegisterLightningAddressRequest {
819
+ username: string;
820
+ description?: string;
820
821
  }
821
822
 
822
- export type Network = "mainnet" | "regtest";
823
-
824
- export interface IncomingChange {
825
- newState: Record;
826
- oldState?: Record;
827
- }
823
+ export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails; conversionInfo?: ConversionInfo } | { type: "token"; metadata: TokenMetadata; txHash: string; txType: TokenTransactionType; invoiceDetails?: SparkInvoicePaymentDetails; conversionInfo?: ConversionInfo } | { type: "lightning"; description?: string; invoice: string; destinationPubkey: string; htlcDetails: SparkHtlcDetails; lnurlPayInfo?: LnurlPayInfo; lnurlWithdrawInfo?: LnurlWithdrawInfo; lnurlReceiveMetadata?: LnurlReceiveMetadata } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string };
828
824
 
829
- export interface FreezeIssuerTokenRequest {
830
- address: string;
825
+ export interface ListFiatRatesResponse {
826
+ rates: Rate[];
831
827
  }
832
828
 
833
- export interface FreezeIssuerTokenResponse {
834
- impactedOutputIds: string[];
835
- impactedTokenAmount: bigint;
836
- }
829
+ export type PaymentType = "send" | "receive";
837
830
 
838
- export interface BurnIssuerTokenRequest {
839
- amount: bigint;
840
- }
831
+ export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" } | { type: "autoConversion" };
841
832
 
842
- export interface MintIssuerTokenRequest {
843
- amount: bigint;
833
+ export interface MessageSuccessActionData {
834
+ message: string;
844
835
  }
845
836
 
846
837
  export interface UnfreezeIssuerTokenRequest {
@@ -860,6 +851,23 @@ export interface UnfreezeIssuerTokenResponse {
860
851
  impactedTokenAmount: bigint;
861
852
  }
862
853
 
854
+ export interface FreezeIssuerTokenResponse {
855
+ impactedOutputIds: string[];
856
+ impactedTokenAmount: bigint;
857
+ }
858
+
859
+ export interface BurnIssuerTokenRequest {
860
+ amount: bigint;
861
+ }
862
+
863
+ export interface FreezeIssuerTokenRequest {
864
+ address: string;
865
+ }
866
+
867
+ export interface MintIssuerTokenRequest {
868
+ amount: bigint;
869
+ }
870
+
863
871
  export interface ExternalSigner {
864
872
  identityPublicKey(): PublicKeyBytes;
865
873
  derivePublicKey(path: string): Promise<PublicKeyBytes>;
@@ -883,18 +891,40 @@ export interface ExternalSigner {
883
891
  hmacSha256(message: Uint8Array, path: string): Promise<HashedMessageBytes>;
884
892
  }
885
893
 
894
+ export interface ExternalScalar {
895
+ bytes: number[];
896
+ }
897
+
886
898
  export interface ExternalVerifiableSecretShare {
887
899
  secretShare: ExternalSecretShare;
888
900
  proofs: number[][];
889
901
  }
890
902
 
891
- export interface RecoverableEcdsaSignatureBytes {
903
+ export interface ExternalEncryptedSecret {
904
+ ciphertext: number[];
905
+ }
906
+
907
+ export interface SchnorrSignatureBytes {
892
908
  bytes: number[];
893
909
  }
894
910
 
895
- export type ExternalSecretSource = { type: "derived"; nodeId: ExternalTreeNodeId } | { type: "encrypted"; key: ExternalEncryptedSecret };
911
+ export type ExternalSecretToSplit = { type: "secretSource"; source: ExternalSecretSource } | { type: "preimage"; data: number[] };
896
912
 
897
- export interface HashedMessageBytes {
913
+ export interface ExternalIdentifier {
914
+ bytes: number[];
915
+ }
916
+
917
+ export interface ExternalSignFrostRequest {
918
+ message: number[];
919
+ publicKey: number[];
920
+ secret: ExternalSecretSource;
921
+ verifyingKey: number[];
922
+ selfNonceCommitment: ExternalFrostCommitments;
923
+ statechainCommitments: IdentifierCommitmentPair[];
924
+ adaptorPublicKey?: number[];
925
+ }
926
+
927
+ export interface SecretBytes {
898
928
  bytes: number[];
899
929
  }
900
930
 
@@ -903,7 +933,16 @@ export interface IdentifierCommitmentPair {
903
933
  commitment: ExternalSigningCommitments;
904
934
  }
905
935
 
906
- export interface ExternalScalar {
936
+ export interface IdentifierSignaturePair {
937
+ identifier: ExternalIdentifier;
938
+ signature: ExternalFrostSignatureShare;
939
+ }
940
+
941
+ export interface HashedMessageBytes {
942
+ bytes: number[];
943
+ }
944
+
945
+ export interface ExternalFrostSignatureShare {
907
946
  bytes: number[];
908
947
  }
909
948
 
@@ -919,20 +958,20 @@ export interface ExternalAggregateFrostRequest {
919
958
  adaptorPublicKey?: number[];
920
959
  }
921
960
 
922
- export interface ExternalIdentifier {
923
- bytes: number[];
924
- }
961
+ export type ExternalSecretSource = { type: "derived"; nodeId: ExternalTreeNodeId } | { type: "encrypted"; key: ExternalEncryptedSecret };
925
962
 
926
- export interface MessageBytes {
963
+ export interface PublicKeyBytes {
927
964
  bytes: number[];
928
965
  }
929
966
 
930
- export interface EcdsaSignatureBytes {
931
- bytes: number[];
967
+ export interface ExternalFrostCommitments {
968
+ hidingCommitment: number[];
969
+ bindingCommitment: number[];
970
+ noncesCiphertext: number[];
932
971
  }
933
972
 
934
- export interface ExternalEncryptedSecret {
935
- ciphertext: number[];
973
+ export interface RecoverableEcdsaSignatureBytes {
974
+ bytes: number[];
936
975
  }
937
976
 
938
977
  export interface IdentifierPublicKeyPair {
@@ -940,48 +979,17 @@ export interface IdentifierPublicKeyPair {
940
979
  publicKey: number[];
941
980
  }
942
981
 
943
- export interface ExternalSignFrostRequest {
944
- message: number[];
945
- publicKey: number[];
946
- secret: ExternalSecretSource;
947
- verifyingKey: number[];
948
- selfNonceCommitment: ExternalFrostCommitments;
949
- statechainCommitments: IdentifierCommitmentPair[];
950
- adaptorPublicKey?: number[];
951
- }
952
-
953
982
  export interface ExternalSecretShare {
954
983
  threshold: number;
955
984
  index: ExternalScalar;
956
985
  share: ExternalScalar;
957
986
  }
958
987
 
959
- export interface PublicKeyBytes {
960
- bytes: number[];
961
- }
962
-
963
- export interface ExternalTreeNodeId {
964
- id: string;
965
- }
966
-
967
- export interface SecretBytes {
988
+ export interface EcdsaSignatureBytes {
968
989
  bytes: number[];
969
990
  }
970
991
 
971
- export type ExternalSecretToSplit = { type: "secretSource"; source: ExternalSecretSource } | { type: "preimage"; data: number[] };
972
-
973
- export interface ExternalFrostCommitments {
974
- hidingCommitment: number[];
975
- bindingCommitment: number[];
976
- noncesCiphertext: number[];
977
- }
978
-
979
- export interface IdentifierSignaturePair {
980
- identifier: ExternalIdentifier;
981
- signature: ExternalFrostSignatureShare;
982
- }
983
-
984
- export interface SchnorrSignatureBytes {
992
+ export interface MessageBytes {
985
993
  bytes: number[];
986
994
  }
987
995
 
@@ -994,8 +1002,8 @@ export interface ExternalSigningCommitments {
994
1002
  binding: number[];
995
1003
  }
996
1004
 
997
- export interface ExternalFrostSignatureShare {
998
- bytes: number[];
1005
+ export interface ExternalTreeNodeId {
1006
+ id: string;
999
1007
  }
1000
1008
 
1001
1009
  export interface Storage {
@@ -1019,7 +1027,6 @@ export interface Storage {
1019
1027
  syncGetLastRevision: () => Promise<number>;
1020
1028
  syncInsertIncomingRecords: (records: Record[]) => Promise<void>;
1021
1029
  syncDeleteIncomingRecord: (record: Record) => Promise<void>;
1022
- syncRebasePendingOutgoingRecords: (revision: number) => Promise<void>;
1023
1030
  syncGetIncomingRecords: (limit: number) => Promise<IncomingChange[]>;
1024
1031
  syncGetLatestOutgoingChange: () => Promise<OutgoingChange | null>;
1025
1032
  syncUpdateRecordFromIncoming: (record: Record) => Promise<void>;
@@ -1259,9 +1266,9 @@ export interface InitOutput {
1259
1266
  readonly __externref_drop_slice: (a: number, b: number) => void;
1260
1267
  readonly __wbindgen_export_7: WebAssembly.Table;
1261
1268
  readonly __externref_table_dealloc: (a: number) => void;
1262
- readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf2ef52c8a8b47594: (a: number, b: number) => void;
1263
- readonly closure1078_externref_shim: (a: number, b: number, c: any) => void;
1264
- readonly closure671_externref_shim: (a: number, b: number, c: any, d: any) => void;
1269
+ readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h127c718764a2a72f: (a: number, b: number) => void;
1270
+ readonly closure1090_externref_shim: (a: number, b: number, c: any) => void;
1271
+ readonly closure670_externref_shim: (a: number, b: number, c: any, d: any) => void;
1265
1272
  readonly __wbindgen_start: () => void;
1266
1273
  }
1267
1274