@breeztech/breez-sdk-spark 0.8.2 → 0.9.0

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