@breeztech/breez-sdk-spark 0.11.0-dev5 → 0.12.1

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.
@@ -16,10 +16,10 @@ export function defaultPostgresStorageConfig(connection_string: string): Postgre
16
16
  */
17
17
  export function getSparkStatus(): Promise<SparkStatus>;
18
18
  export function connectWithSigner(config: Config, signer: ExternalSigner, storage_dir: string): Promise<BreezSdk>;
19
- export function defaultConfig(network: Network): Config;
20
- export function defaultExternalSigner(mnemonic: string, passphrase: string | null | undefined, network: Network, key_set_config?: KeySetConfig | null): DefaultSigner;
21
19
  export function connect(request: ConnectRequest): Promise<BreezSdk>;
20
+ export function defaultConfig(network: Network): Config;
22
21
  export function initLogging(logger: Logger, filter?: string | null): Promise<void>;
22
+ export function defaultExternalSigner(mnemonic: string, passphrase: string | null | undefined, network: Network, key_set_config?: KeySetConfig | null): DefaultSigner;
23
23
  /**
24
24
  * Entry point invoked by JavaScript in a worker.
25
25
  */
@@ -127,6 +127,14 @@ export interface BitcoinChainService {
127
127
  recommendedFees(): Promise<RecommendedFees>;
128
128
  }
129
129
 
130
+ export interface TxStatus {
131
+ confirmed: boolean;
132
+ blockHeight?: number;
133
+ blockTime?: number;
134
+ }
135
+
136
+ export type ChainApiType = "esplora" | "mempoolSpace";
137
+
130
138
  export interface RecommendedFees {
131
139
  fastestFee: number;
132
140
  halfHourFee: number;
@@ -135,8 +143,6 @@ export interface RecommendedFees {
135
143
  minimumFee: number;
136
144
  }
137
145
 
138
- export type ChainApiType = "esplora" | "mempoolSpace";
139
-
140
146
  export interface Utxo {
141
147
  txid: string;
142
148
  vout: number;
@@ -144,41 +150,48 @@ export interface Utxo {
144
150
  status: TxStatus;
145
151
  }
146
152
 
147
- export interface TxStatus {
148
- confirmed: boolean;
149
- blockHeight?: number;
150
- blockTime?: number;
151
- }
152
-
153
153
  export interface PaymentObserver {
154
154
  beforeSend: (payments: ProvisionalPayment[]) => Promise<void>;
155
155
  }
156
156
 
157
- export interface FiatCurrency {
158
- id: string;
159
- info: CurrencyInfo;
160
- }
161
-
162
- export interface SilentPaymentAddressDetails {
157
+ export interface BitcoinAddressDetails {
163
158
  address: string;
164
159
  network: BitcoinNetwork;
165
160
  source: PaymentRequestSource;
166
161
  }
167
162
 
168
- export interface SparkAddressDetails {
169
- address: string;
170
- identityPublicKey: string;
171
- network: BitcoinNetwork;
172
- source: PaymentRequestSource;
163
+ export interface GetPaymentResponse {
164
+ payment: Payment;
173
165
  }
174
166
 
175
- export interface LnurlPayInfo {
176
- lnAddress?: string;
167
+ export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
168
+
169
+ export interface ListPaymentsRequest {
170
+ typeFilter?: PaymentType[];
171
+ statusFilter?: PaymentStatus[];
172
+ assetFilter?: AssetFilter;
173
+ paymentDetailsFilter?: PaymentDetailsFilter[];
174
+ fromTimestamp?: number;
175
+ toTimestamp?: number;
176
+ offset?: number;
177
+ limit?: number;
178
+ sortAscending?: boolean;
179
+ }
180
+
181
+ export interface ReceivePaymentResponse {
182
+ paymentRequest: string;
183
+ fee: bigint;
184
+ }
185
+
186
+ export type Network = "mainnet" | "regtest";
187
+
188
+ export interface PrepareLnurlPayRequest {
189
+ amountSats: number;
177
190
  comment?: string;
178
- domain?: string;
179
- metadata?: string;
180
- processedSuccessAction?: SuccessActionProcessed;
181
- rawSuccessAction?: SuccessAction;
191
+ payRequest: LnurlPayRequestDetails;
192
+ validateSuccessActionUrl?: boolean;
193
+ conversionOptions?: ConversionOptions;
194
+ feePolicy?: FeePolicy;
182
195
  }
183
196
 
184
197
  export interface ConversionOptions {
@@ -187,104 +200,71 @@ export interface ConversionOptions {
187
200
  completionTimeoutSecs?: number;
188
201
  }
189
202
 
190
- export interface Bolt12OfferBlindedPath {
191
- blindedHops: string[];
192
- }
193
-
194
- export interface GetPaymentRequest {
195
- paymentId: string;
203
+ export interface UpdateContactRequest {
204
+ id: string;
205
+ name: string;
206
+ paymentIdentifier: string;
196
207
  }
197
208
 
198
- 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 };
199
-
200
- export interface FetchConversionLimitsRequest {
201
- conversionType: ConversionType;
202
- tokenIdentifier?: string;
209
+ export interface GetInfoRequest {
210
+ ensureSynced?: boolean;
203
211
  }
204
212
 
205
- export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
206
-
207
- export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" | "major";
208
-
209
- export type Network = "mainnet" | "regtest";
210
-
211
- export type FeePolicy = "feesExcluded" | "feesIncluded";
213
+ 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 };
212
214
 
213
- export interface LnurlInfo {
214
- url: string;
215
- bech32: string;
215
+ export interface RecordId {
216
+ type: string;
217
+ dataId: string;
216
218
  }
217
219
 
218
- export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
219
-
220
- export interface FetchConversionLimitsResponse {
221
- minFromAmount?: bigint;
222
- minToAmount?: bigint;
220
+ export interface CheckMessageResponse {
221
+ isValid: boolean;
223
222
  }
224
223
 
225
- export interface ConnectRequest {
226
- config: Config;
227
- seed: Seed;
228
- storageDir: string;
229
- }
224
+ export type PaymentStatus = "completed" | "pending" | "failed";
230
225
 
231
- export interface LnurlPayRequest {
232
- prepareResponse: PrepareLnurlPayResponse;
233
- idempotencyKey?: string;
226
+ export interface BuyBitcoinRequest {
227
+ lockedAmountSat?: number;
228
+ redirectUrl?: string;
234
229
  }
235
230
 
236
- export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
237
-
238
- export interface Bolt11InvoiceDetails {
239
- amountMsat?: number;
240
- description?: string;
241
- descriptionHash?: string;
242
- expiry: number;
243
- invoice: Bolt11Invoice;
244
- minFinalCltvExpiryDelta: number;
245
- network: BitcoinNetwork;
246
- payeePubkey: string;
247
- paymentHash: string;
248
- paymentSecret: string;
249
- routingHints: Bolt11RouteHint[];
250
- timestamp: number;
231
+ export interface RefundDepositResponse {
232
+ txId: string;
233
+ txHex: string;
251
234
  }
252
235
 
253
- export interface KeySetConfig {
254
- keySetType: KeySetType;
255
- useAddressIndex: boolean;
256
- accountNumber?: number;
257
- }
236
+ export type FeePolicy = "feesExcluded" | "feesIncluded";
258
237
 
259
- export interface Bolt11RouteHint {
260
- hops: Bolt11RouteHintHop[];
238
+ export interface FiatCurrency {
239
+ id: string;
240
+ info: CurrencyInfo;
261
241
  }
262
242
 
263
- export interface ProvisionalPayment {
264
- paymentId: string;
243
+ export interface PrepareSendPaymentResponse {
244
+ paymentMethod: SendPaymentMethod;
265
245
  amount: bigint;
266
- details: ProvisionalPaymentDetails;
246
+ tokenIdentifier?: string;
247
+ conversionEstimate?: ConversionEstimate;
248
+ feePolicy: FeePolicy;
267
249
  }
268
250
 
269
- export interface UpdateContactRequest {
270
- id: string;
271
- name: string;
272
- paymentIdentifier: string;
251
+ export interface StableBalanceConfig {
252
+ tokenIdentifier: string;
253
+ thresholdSats?: number;
254
+ maxSlippageBps?: number;
255
+ reservedSats?: number;
273
256
  }
274
257
 
275
- export interface ConversionStep {
276
- paymentId: string;
258
+ export interface Payment {
259
+ id: string;
260
+ paymentType: PaymentType;
261
+ status: PaymentStatus;
277
262
  amount: bigint;
278
- fee: bigint;
263
+ fees: bigint;
264
+ timestamp: number;
279
265
  method: PaymentMethod;
280
- tokenMetadata?: TokenMetadata;
281
- }
282
-
283
- export type AesSuccessActionDataResult = { type: "decrypted"; data: AesSuccessActionDataDecrypted } | { type: "errorStatus"; reason: string };
284
-
285
- export interface Bolt12Offer {
286
- offer: string;
287
- source: PaymentRequestSource;
266
+ details?: PaymentDetails;
267
+ conversionDetails?: ConversionDetails;
288
268
  }
289
269
 
290
270
  export interface ConversionInfo {
@@ -295,194 +275,210 @@ export interface ConversionInfo {
295
275
  purpose?: ConversionPurpose;
296
276
  }
297
277
 
298
- export interface DepositInfo {
299
- txid: string;
300
- vout: number;
301
- amountSats: number;
302
- refundTx?: string;
303
- refundTxId?: string;
304
- claimError?: DepositClaimError;
305
- }
306
-
307
- export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
278
+ export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
308
279
 
309
- export interface IncomingChange {
310
- newState: Record;
311
- oldState?: Record;
280
+ export interface Bolt12Invoice {
281
+ invoice: string;
282
+ source: PaymentRequestSource;
312
283
  }
313
284
 
314
- export interface ConversionEstimate {
315
- options: ConversionOptions;
316
- amount: bigint;
317
- fee: bigint;
285
+ export interface Bip21Details {
286
+ amountSat?: number;
287
+ assetId?: string;
288
+ uri: string;
289
+ extras: Bip21Extra[];
290
+ label?: string;
291
+ message?: string;
292
+ paymentMethods: InputType[];
318
293
  }
319
294
 
320
- export interface ListUnclaimedDepositsRequest {}
295
+ export type PaymentType = "send" | "receive";
321
296
 
322
- export type OptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
297
+ export interface GetTokensMetadataResponse {
298
+ tokensMetadata: TokenMetadata[];
299
+ }
323
300
 
324
- 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 };
301
+ export interface LightningAddressInfo {
302
+ description: string;
303
+ lightningAddress: string;
304
+ lnurl: LnurlInfo;
305
+ username: string;
306
+ }
325
307
 
326
- export interface RecordId {
327
- type: string;
328
- dataId: string;
308
+ export interface UrlSuccessActionData {
309
+ description: string;
310
+ url: string;
311
+ matchesCallbackDomain: boolean;
329
312
  }
330
313
 
331
- export interface Contact {
332
- id: string;
333
- name: string;
334
- paymentIdentifier: string;
335
- createdAt: number;
336
- updatedAt: number;
314
+ export interface ProvisionalPayment {
315
+ paymentId: string;
316
+ amount: bigint;
317
+ details: ProvisionalPaymentDetails;
337
318
  }
338
319
 
339
- export interface BuyBitcoinRequest {
340
- lockedAmountSat?: number;
341
- redirectUrl?: string;
320
+ export interface Record {
321
+ id: RecordId;
322
+ revision: number;
323
+ schemaVersion: string;
324
+ data: Map<string, string>;
342
325
  }
343
326
 
344
- export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
327
+ export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
345
328
 
346
- export interface SparkInvoiceDetails {
347
- invoice: string;
348
- identityPublicKey: string;
349
- network: BitcoinNetwork;
350
- amount?: string;
351
- tokenIdentifier?: string;
352
- expiryTime?: number;
353
- description?: string;
354
- senderPublicKey?: string;
329
+ export type AesSuccessActionDataResult = { type: "decrypted"; data: AesSuccessActionDataDecrypted } | { type: "errorStatus"; reason: string };
330
+
331
+ export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
332
+
333
+ export interface GetInfoResponse {
334
+ identityPubkey: string;
335
+ balanceSats: number;
336
+ tokenBalances: Map<string, TokenBalance>;
355
337
  }
356
338
 
357
- export interface SparkInvoicePaymentDetails {
358
- description?: string;
359
- invoice: string;
339
+ export interface OutgoingChange {
340
+ change: RecordChange;
341
+ parent?: Record;
360
342
  }
361
343
 
362
- 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);
344
+ export interface AesSuccessActionDataDecrypted {
345
+ description: string;
346
+ plaintext: string;
347
+ }
363
348
 
364
- export interface UserSettings {
365
- sparkPrivateModeEnabled: boolean;
349
+ export interface FetchConversionLimitsResponse {
350
+ minFromAmount?: bigint;
351
+ minToAmount?: bigint;
366
352
  }
367
353
 
368
- export interface Symbol {
369
- grapheme?: string;
370
- template?: string;
371
- rtl?: boolean;
372
- position?: number;
354
+ export interface LnurlInfo {
355
+ url: string;
356
+ bech32: string;
373
357
  }
374
358
 
375
- export interface SendOnchainFeeQuote {
376
- id: string;
377
- expiresAt: number;
378
- speedFast: SendOnchainSpeedFeeQuote;
379
- speedMedium: SendOnchainSpeedFeeQuote;
380
- speedSlow: SendOnchainSpeedFeeQuote;
359
+ export interface Bolt12OfferDetails {
360
+ absoluteExpiry?: number;
361
+ chains: string[];
362
+ description?: string;
363
+ issuer?: string;
364
+ minAmount?: Amount;
365
+ offer: Bolt12Offer;
366
+ paths: Bolt12OfferBlindedPath[];
367
+ signingPubkey?: string;
381
368
  }
382
369
 
383
- export interface ListFiatCurrenciesResponse {
384
- currencies: FiatCurrency[];
370
+ export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
371
+
372
+ export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
373
+
374
+ export type StoragePaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[]; hasLnurlPreimage?: boolean };
375
+
376
+ export interface SparkHtlcOptions {
377
+ paymentHash: string;
378
+ expiryDurationSecs: number;
385
379
  }
386
380
 
387
- export interface GetPaymentResponse {
388
- payment: Payment;
381
+ export interface ConnectRequest {
382
+ config: Config;
383
+ seed: Seed;
384
+ storageDir: string;
389
385
  }
390
386
 
391
- export interface LnurlPayRequestDetails {
392
- callback: string;
393
- minSendable: number;
394
- maxSendable: number;
395
- metadataStr: string;
396
- commentAllowed: number;
397
- domain: string;
398
- url: string;
399
- address?: string;
400
- allowsNostr?: boolean;
401
- nostrPubkey?: string;
387
+ export interface LnurlWithdrawResponse {
388
+ paymentRequest: string;
389
+ payment?: Payment;
402
390
  }
403
391
 
404
- export interface SendOnchainSpeedFeeQuote {
405
- userFeeSat: number;
406
- l1BroadcastFeeSat: number;
392
+ export interface SendPaymentResponse {
393
+ payment: Payment;
407
394
  }
408
395
 
409
- export interface LightningAddressInfo {
410
- description: string;
411
- lightningAddress: string;
412
- lnurl: LnurlInfo;
413
- username: string;
396
+ export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" | "major";
397
+
398
+ export interface Bolt11RouteHint {
399
+ hops: Bolt11RouteHintHop[];
414
400
  }
415
401
 
416
- export interface Credentials {
402
+ export interface CheckLightningAddressRequest {
417
403
  username: string;
418
- password: string;
419
404
  }
420
405
 
421
- export interface CurrencyInfo {
422
- name: string;
423
- fractionSize: number;
424
- spacing?: number;
425
- symbol?: Symbol;
426
- uniqSymbol?: Symbol;
427
- localizedName: LocalizedName[];
428
- localeOverrides: LocaleOverrides[];
406
+ export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
407
+
408
+ export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
409
+
410
+ export interface SparkInvoiceDetails {
411
+ invoice: string;
412
+ identityPublicKey: string;
413
+ network: BitcoinNetwork;
414
+ amount?: string;
415
+ tokenIdentifier?: string;
416
+ expiryTime?: number;
417
+ description?: string;
418
+ senderPublicKey?: string;
429
419
  }
430
420
 
431
- export interface PrepareLnurlPayResponse {
432
- amountSats: number;
433
- comment?: string;
434
- payRequest: LnurlPayRequestDetails;
435
- feeSats: number;
436
- invoiceDetails: Bolt11InvoiceDetails;
437
- successAction?: SuccessAction;
438
- conversionEstimate?: ConversionEstimate;
439
- feePolicy: FeePolicy;
421
+ export interface KeySetConfig {
422
+ keySetType: KeySetType;
423
+ useAddressIndex: boolean;
424
+ accountNumber?: number;
425
+ }
426
+
427
+ export interface AesSuccessActionData {
428
+ description: string;
429
+ ciphertext: string;
430
+ iv: string;
440
431
  }
441
432
 
442
433
  export interface SyncWalletResponse {}
443
434
 
444
- export interface SetLnurlMetadataItem {
445
- paymentHash: string;
446
- senderComment?: string;
447
- nostrZapRequest?: string;
448
- nostrZapReceipt?: string;
449
- preimage?: string;
435
+ export interface GetPaymentRequest {
436
+ paymentId: string;
450
437
  }
451
438
 
452
- export interface Bolt11Invoice {
453
- bolt11: string;
454
- source: PaymentRequestSource;
455
- }
439
+ export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
456
440
 
457
- export interface PrepareLnurlPayRequest {
458
- amountSats: number;
459
- comment?: string;
460
- payRequest: LnurlPayRequestDetails;
461
- validateSuccessActionUrl?: boolean;
462
- conversionOptions?: ConversionOptions;
463
- feePolicy?: FeePolicy;
441
+ export interface ListFiatRatesResponse {
442
+ rates: Rate[];
464
443
  }
465
444
 
466
- export interface ListPaymentsResponse {
467
- payments: Payment[];
445
+ export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
446
+
447
+ export interface Credentials {
448
+ username: string;
449
+ password: string;
468
450
  }
469
451
 
470
- export interface RefundDepositResponse {
471
- txId: string;
472
- txHex: string;
452
+ export interface SignMessageRequest {
453
+ message: string;
454
+ compact: boolean;
473
455
  }
474
456
 
475
- export interface GetInfoRequest {
476
- ensureSynced?: boolean;
457
+ export interface SparkHtlcDetails {
458
+ paymentHash: string;
459
+ preimage?: string;
460
+ expiryTime: number;
461
+ status: SparkHtlcStatus;
477
462
  }
478
463
 
479
- export interface CheckMessageResponse {
480
- isValid: boolean;
464
+ export interface LnurlPayRequest {
465
+ prepareResponse: PrepareLnurlPayResponse;
466
+ idempotencyKey?: string;
481
467
  }
482
468
 
483
- export interface ReceivePaymentResponse {
484
- paymentRequest: string;
485
- fee: bigint;
469
+ export interface Bolt11InvoiceDetails {
470
+ amountMsat?: number;
471
+ description?: string;
472
+ descriptionHash?: string;
473
+ expiry: number;
474
+ invoice: Bolt11Invoice;
475
+ minFinalCltvExpiryDelta: number;
476
+ network: BitcoinNetwork;
477
+ payeePubkey: string;
478
+ paymentHash: string;
479
+ paymentSecret: string;
480
+ routingHints: Bolt11RouteHint[];
481
+ timestamp: number;
486
482
  }
487
483
 
488
484
  export interface PaymentRequestSource {
@@ -490,164 +486,205 @@ export interface PaymentRequestSource {
490
486
  bip353Address?: string;
491
487
  }
492
488
 
493
- 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 } | { type: "lightningAddressChanged"; lightningAddress?: LightningAddressInfo };
489
+ export interface LocalizedName {
490
+ locale: string;
491
+ name: string;
492
+ }
494
493
 
495
- export interface LnurlPayResponse {
496
- payment: Payment;
497
- successAction?: SuccessActionProcessed;
494
+ export interface Symbol {
495
+ grapheme?: string;
496
+ template?: string;
497
+ rtl?: boolean;
498
+ position?: number;
498
499
  }
499
500
 
500
- export interface LnurlReceiveMetadata {
501
- nostrZapRequest?: string;
502
- nostrZapReceipt?: string;
503
- senderComment?: string;
501
+ export interface LightningAddressDetails {
502
+ address: string;
503
+ payRequest: LnurlPayRequestDetails;
504
504
  }
505
505
 
506
- export interface AesSuccessActionData {
507
- description: string;
508
- ciphertext: string;
509
- iv: string;
506
+ export interface RecordChange {
507
+ id: RecordId;
508
+ schemaVersion: string;
509
+ updatedFields: Map<string, string>;
510
+ localRevision: number;
510
511
  }
511
512
 
512
- export type StoragePaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[]; hasLnurlPreimage?: boolean };
513
+ export interface Bolt11Invoice {
514
+ bolt11: string;
515
+ source: PaymentRequestSource;
516
+ }
513
517
 
514
- export interface LnurlWithdrawRequest {
515
- amountSats: number;
516
- withdrawRequest: LnurlWithdrawRequestDetails;
517
- completionTimeoutSecs?: number;
518
+ export interface ClaimHtlcPaymentRequest {
519
+ preimage: string;
520
+ }
521
+
522
+ export interface GetTokensMetadataRequest {
523
+ tokenIdentifiers: string[];
518
524
  }
519
525
 
526
+ 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 };
527
+
520
528
  export interface LnurlErrorDetails {
521
529
  reason: string;
522
530
  }
523
531
 
524
- export interface Bolt12Invoice {
525
- invoice: string;
532
+ export interface SparkAddressDetails {
533
+ address: string;
534
+ identityPublicKey: string;
535
+ network: BitcoinNetwork;
526
536
  source: PaymentRequestSource;
527
537
  }
528
538
 
529
- export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
530
-
531
- export type TokenTransactionType = "transfer" | "mint" | "burn";
539
+ export interface ReceivePaymentRequest {
540
+ paymentMethod: ReceivePaymentMethod;
541
+ }
532
542
 
533
- export interface LnurlWithdrawRequestDetails {
534
- callback: string;
535
- k1: string;
536
- defaultDescription: string;
537
- minWithdrawable: number;
538
- maxWithdrawable: number;
543
+ export interface SendOnchainSpeedFeeQuote {
544
+ userFeeSat: number;
545
+ l1BroadcastFeeSat: number;
539
546
  }
540
547
 
541
- export interface PaymentMetadata {
542
- parentPaymentId?: string;
543
- lnurlPayInfo?: LnurlPayInfo;
544
- lnurlWithdrawInfo?: LnurlWithdrawInfo;
545
- lnurlDescription?: string;
546
- conversionInfo?: ConversionInfo;
548
+ export interface Bolt11RouteHintHop {
549
+ srcNodeId: string;
550
+ shortChannelId: string;
551
+ feesBaseMsat: number;
552
+ feesProportionalMillionths: number;
553
+ cltvExpiryDelta: number;
554
+ htlcMinimumMsat?: number;
555
+ htlcMaximumMsat?: number;
547
556
  }
548
557
 
549
- export interface ClaimHtlcPaymentRequest {
550
- preimage: string;
558
+ export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
559
+
560
+ export interface ConversionDetails {
561
+ from: ConversionStep;
562
+ to: ConversionStep;
551
563
  }
552
564
 
553
- export interface UrlSuccessActionData {
554
- description: string;
555
- url: string;
556
- matchesCallbackDomain: boolean;
565
+ export interface ConversionEstimate {
566
+ options: ConversionOptions;
567
+ amount: bigint;
568
+ fee: bigint;
557
569
  }
558
570
 
559
- export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
571
+ export interface PrepareSendPaymentRequest {
572
+ paymentRequest: string;
573
+ amount?: bigint;
574
+ tokenIdentifier?: string;
575
+ conversionOptions?: ConversionOptions;
576
+ feePolicy?: FeePolicy;
577
+ }
560
578
 
561
- export interface SendPaymentResponse {
579
+ export interface ClaimDepositResponse {
562
580
  payment: Payment;
563
581
  }
564
582
 
565
- export interface ListFiatRatesResponse {
566
- rates: Rate[];
583
+ export interface RefundDepositRequest {
584
+ txid: string;
585
+ vout: number;
586
+ destinationAddress: string;
587
+ fee: Fee;
567
588
  }
568
589
 
569
- export interface SyncWalletRequest {}
590
+ export interface ListFiatCurrenciesResponse {
591
+ currencies: FiatCurrency[];
592
+ }
570
593
 
571
- export interface ConversionDetails {
572
- from: ConversionStep;
573
- to: ConversionStep;
594
+ export interface OptimizationConfig {
595
+ autoEnabled: boolean;
596
+ multiplicity: number;
574
597
  }
575
598
 
576
- export interface MessageSuccessActionData {
577
- message: string;
599
+ export interface StorageListPaymentsRequest {
600
+ typeFilter?: PaymentType[];
601
+ statusFilter?: PaymentStatus[];
602
+ assetFilter?: AssetFilter;
603
+ paymentDetailsFilter?: StoragePaymentDetailsFilter[];
604
+ fromTimestamp?: number;
605
+ toTimestamp?: number;
606
+ offset?: number;
607
+ limit?: number;
608
+ sortAscending?: boolean;
578
609
  }
579
610
 
580
- export interface OptimizationProgress {
581
- isRunning: boolean;
582
- currentRound: number;
583
- totalRounds: number;
611
+ export interface LogEntry {
612
+ line: string;
613
+ level: string;
584
614
  }
585
615
 
586
- export interface RecordChange {
587
- id: RecordId;
588
- schemaVersion: string;
589
- updatedFields: Map<string, string>;
590
- localRevision: number;
616
+ export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
617
+
618
+ export interface ConversionStep {
619
+ paymentId: string;
620
+ amount: bigint;
621
+ fee: bigint;
622
+ method: PaymentMethod;
623
+ tokenMetadata?: TokenMetadata;
591
624
  }
592
625
 
593
- export interface Bolt11RouteHintHop {
594
- srcNodeId: string;
595
- shortChannelId: string;
596
- feesBaseMsat: number;
597
- feesProportionalMillionths: number;
598
- cltvExpiryDelta: number;
599
- htlcMinimumMsat?: number;
600
- htlcMaximumMsat?: number;
626
+ export interface Bolt12OfferBlindedPath {
627
+ blindedHops: string[];
601
628
  }
602
629
 
603
- export interface LocalizedName {
604
- locale: string;
605
- name: string;
630
+ 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 };
631
+
632
+ export interface LnurlWithdrawRequest {
633
+ amountSats: number;
634
+ withdrawRequest: LnurlWithdrawRequestDetails;
635
+ completionTimeoutSecs?: number;
606
636
  }
607
637
 
608
- export interface Bip21Details {
609
- amountSat?: number;
610
- assetId?: string;
611
- uri: string;
612
- extras: Bip21Extra[];
613
- label?: string;
614
- message?: string;
615
- paymentMethods: InputType[];
638
+ export interface ClaimDepositRequest {
639
+ txid: string;
640
+ vout: number;
641
+ maxFee?: MaxFee;
616
642
  }
617
643
 
618
- export interface Record {
619
- id: RecordId;
620
- revision: number;
621
- schemaVersion: string;
622
- data: Map<string, string>;
644
+ export interface Rate {
645
+ coin: string;
646
+ value: number;
623
647
  }
624
648
 
625
- export interface ListUnclaimedDepositsResponse {
626
- deposits: DepositInfo[];
649
+ export interface Bolt12InvoiceDetails {
650
+ amountMsat: number;
651
+ invoice: Bolt12Invoice;
627
652
  }
628
653
 
629
- export interface ClaimDepositResponse {
630
- payment: Payment;
654
+ export interface ListPaymentsResponse {
655
+ payments: Payment[];
631
656
  }
632
657
 
633
- export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
658
+ export interface LnurlPayInfo {
659
+ lnAddress?: string;
660
+ comment?: string;
661
+ domain?: string;
662
+ metadata?: string;
663
+ processedSuccessAction?: SuccessActionProcessed;
664
+ rawSuccessAction?: SuccessAction;
665
+ }
634
666
 
635
- export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
667
+ export interface IncomingChange {
668
+ newState: Record;
669
+ oldState?: Record;
670
+ }
636
671
 
637
- export interface Rate {
638
- coin: string;
639
- value: number;
672
+ export interface UserSettings {
673
+ sparkPrivateModeEnabled: boolean;
640
674
  }
641
675
 
642
- export interface PrepareSendPaymentRequest {
643
- paymentRequest: string;
644
- amount?: bigint;
645
- tokenIdentifier?: string;
646
- conversionOptions?: ConversionOptions;
647
- feePolicy?: FeePolicy;
676
+ export interface DepositInfo {
677
+ txid: string;
678
+ vout: number;
679
+ amountSats: number;
680
+ refundTx?: string;
681
+ refundTxId?: string;
682
+ claimError?: DepositClaimError;
648
683
  }
649
684
 
650
- export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" } | { type: "autoConversion" };
685
+ export interface UpdateUserSettingsRequest {
686
+ sparkPrivateModeEnabled?: boolean;
687
+ }
651
688
 
652
689
  export interface Config {
653
690
  apiKey?: string;
@@ -673,289 +710,252 @@ export interface Config {
673
710
  supportLnurlVerify: boolean;
674
711
  }
675
712
 
676
- export interface SparkStatus {
677
- status: ServiceStatus;
678
- lastUpdated: number;
713
+ export interface TokenMetadata {
714
+ identifier: string;
715
+ issuerPublicKey: string;
716
+ name: string;
717
+ ticker: string;
718
+ decimals: number;
719
+ maxSupply: string;
720
+ isFreezable: boolean;
679
721
  }
680
722
 
681
- export interface Bip21Extra {
682
- key: string;
683
- value: string;
723
+ export interface CheckMessageRequest {
724
+ message: string;
725
+ pubkey: string;
726
+ signature: string;
684
727
  }
685
728
 
686
- export interface SendPaymentRequest {
687
- prepareResponse: PrepareSendPaymentResponse;
688
- options?: SendPaymentOptions;
689
- idempotencyKey?: string;
690
- }
729
+ 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 } | { type: "lightningAddressChanged"; lightningAddress?: LightningAddressInfo };
691
730
 
692
- export interface Bolt12InvoiceDetails {
693
- amountMsat: number;
694
- invoice: Bolt12Invoice;
731
+ export interface LnurlPayRequestDetails {
732
+ callback: string;
733
+ minSendable: number;
734
+ maxSendable: number;
735
+ metadataStr: string;
736
+ commentAllowed: number;
737
+ domain: string;
738
+ url: string;
739
+ address?: string;
740
+ allowsNostr?: boolean;
741
+ nostrPubkey?: string;
695
742
  }
696
743
 
697
- export interface UnversionedRecordChange {
698
- id: RecordId;
699
- schemaVersion: string;
700
- updatedFields: Map<string, string>;
744
+ export interface OptimizationProgress {
745
+ isRunning: boolean;
746
+ currentRound: number;
747
+ totalRounds: number;
701
748
  }
702
749
 
703
- export interface GetInfoResponse {
704
- identityPubkey: string;
705
- balanceSats: number;
706
- tokenBalances: Map<string, TokenBalance>;
750
+ export interface LnurlAuthRequestDetails {
751
+ k1: string;
752
+ action?: string;
753
+ domain: string;
754
+ url: string;
707
755
  }
708
756
 
709
- export interface Bolt12InvoiceRequestDetails {}
710
-
711
- export interface PrepareSendPaymentResponse {
712
- paymentMethod: SendPaymentMethod;
713
- amount: bigint;
714
- tokenIdentifier?: string;
715
- conversionEstimate?: ConversionEstimate;
716
- feePolicy: FeePolicy;
757
+ export interface PaymentMetadata {
758
+ parentPaymentId?: string;
759
+ lnurlPayInfo?: LnurlPayInfo;
760
+ lnurlWithdrawInfo?: LnurlWithdrawInfo;
761
+ lnurlDescription?: string;
762
+ conversionInfo?: ConversionInfo;
717
763
  }
718
764
 
719
- export interface BuyBitcoinResponse {
720
- url: string;
765
+ export interface LnurlWithdrawRequestDetails {
766
+ callback: string;
767
+ k1: string;
768
+ defaultDescription: string;
769
+ minWithdrawable: number;
770
+ maxWithdrawable: number;
721
771
  }
722
772
 
723
- export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
773
+ export type OptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
724
774
 
725
- export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
775
+ export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
726
776
 
727
- export interface CheckLightningAddressRequest {
728
- username: string;
777
+ export interface Contact {
778
+ id: string;
779
+ name: string;
780
+ paymentIdentifier: string;
781
+ createdAt: number;
782
+ updatedAt: number;
729
783
  }
730
784
 
731
- 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 };
732
-
733
785
  export interface ListContactsRequest {
734
786
  offset?: number;
735
787
  limit?: number;
736
788
  }
737
789
 
738
- export interface SignMessageResponse {
739
- pubkey: string;
740
- signature: string;
741
- }
790
+ export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
742
791
 
743
- export interface StorageListPaymentsRequest {
744
- typeFilter?: PaymentType[];
745
- statusFilter?: PaymentStatus[];
746
- assetFilter?: AssetFilter;
747
- paymentDetailsFilter?: StoragePaymentDetailsFilter[];
748
- fromTimestamp?: number;
749
- toTimestamp?: number;
750
- offset?: number;
751
- limit?: number;
752
- sortAscending?: boolean;
792
+ export interface BuyBitcoinResponse {
793
+ url: string;
753
794
  }
754
795
 
755
- 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 };
796
+ export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
756
797
 
757
- export interface LightningAddressDetails {
758
- address: string;
759
- payRequest: LnurlPayRequestDetails;
798
+ export interface Bip21Extra {
799
+ key: string;
800
+ value: string;
760
801
  }
761
802
 
762
- export type PaymentStatus = "completed" | "pending" | "failed";
803
+ 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);
763
804
 
764
- export interface CheckMessageRequest {
765
- message: string;
766
- pubkey: string;
767
- signature: string;
805
+ export interface Bolt12Offer {
806
+ offer: string;
807
+ source: PaymentRequestSource;
768
808
  }
769
809
 
770
- export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
771
-
772
- export interface RefundDepositRequest {
773
- txid: string;
774
- vout: number;
775
- destinationAddress: string;
776
- fee: Fee;
777
- }
810
+ 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 };
778
811
 
779
- export interface ExternalInputParser {
780
- providerId: string;
781
- inputRegex: string;
782
- parserUrl: string;
812
+ export interface SendPaymentRequest {
813
+ prepareResponse: PrepareSendPaymentResponse;
814
+ options?: SendPaymentOptions;
815
+ idempotencyKey?: string;
783
816
  }
784
817
 
785
- export interface RegisterLightningAddressRequest {
786
- username: string;
787
- description?: string;
818
+ export interface UnversionedRecordChange {
819
+ id: RecordId;
820
+ schemaVersion: string;
821
+ updatedFields: Map<string, string>;
788
822
  }
789
823
 
790
- export interface Payment {
791
- id: string;
792
- paymentType: PaymentType;
793
- status: PaymentStatus;
794
- amount: bigint;
795
- fees: bigint;
796
- timestamp: number;
797
- method: PaymentMethod;
798
- details?: PaymentDetails;
799
- conversionDetails?: ConversionDetails;
824
+ export interface MessageSuccessActionData {
825
+ message: string;
800
826
  }
801
827
 
802
- export interface SparkHtlcOptions {
803
- paymentHash: string;
804
- expiryDurationSecs: number;
805
- }
828
+ export interface Bolt12InvoiceRequestDetails {}
806
829
 
807
- export interface GetTokensMetadataResponse {
808
- tokensMetadata: TokenMetadata[];
830
+ export interface TokenBalance {
831
+ balance: bigint;
832
+ tokenMetadata: TokenMetadata;
809
833
  }
810
834
 
811
- export type ConversionStatus = "completed" | "refundNeeded" | "refunded";
812
-
813
- export interface LocaleOverrides {
814
- locale: string;
815
- spacing?: number;
816
- symbol: Symbol;
835
+ export interface FetchConversionLimitsRequest {
836
+ conversionType: ConversionType;
837
+ tokenIdentifier?: string;
817
838
  }
818
839
 
819
- export interface Bolt12OfferDetails {
820
- absoluteExpiry?: number;
821
- chains: string[];
822
- description?: string;
823
- issuer?: string;
824
- minAmount?: Amount;
825
- offer: Bolt12Offer;
826
- paths: Bolt12OfferBlindedPath[];
827
- signingPubkey?: string;
828
- }
840
+ export interface SyncWalletRequest {}
829
841
 
830
- export interface LnurlWithdrawResponse {
831
- paymentRequest: string;
832
- payment?: Payment;
842
+ export interface ExternalInputParser {
843
+ providerId: string;
844
+ inputRegex: string;
845
+ parserUrl: string;
833
846
  }
834
847
 
835
- export interface ListPaymentsRequest {
836
- typeFilter?: PaymentType[];
837
- statusFilter?: PaymentStatus[];
838
- assetFilter?: AssetFilter;
839
- paymentDetailsFilter?: PaymentDetailsFilter[];
840
- fromTimestamp?: number;
841
- toTimestamp?: number;
842
- offset?: number;
843
- limit?: number;
844
- sortAscending?: boolean;
848
+ export interface CurrencyInfo {
849
+ name: string;
850
+ fractionSize: number;
851
+ spacing?: number;
852
+ symbol?: Symbol;
853
+ uniqSymbol?: Symbol;
854
+ localizedName: LocalizedName[];
855
+ localeOverrides: LocaleOverrides[];
845
856
  }
846
857
 
847
- export interface GetTokensMetadataRequest {
848
- tokenIdentifiers: string[];
858
+ export interface LnurlPayResponse {
859
+ payment: Payment;
860
+ successAction?: SuccessActionProcessed;
849
861
  }
850
862
 
851
- export type PaymentType = "send" | "receive";
863
+ export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
852
864
 
853
- export interface ClaimDepositRequest {
854
- txid: string;
855
- vout: number;
856
- maxFee?: MaxFee;
865
+ export interface AddContactRequest {
866
+ name: string;
867
+ paymentIdentifier: string;
857
868
  }
858
869
 
859
- export interface SparkHtlcDetails {
870
+ export interface SetLnurlMetadataItem {
860
871
  paymentHash: string;
861
- preimage?: string;
862
- expiryTime: number;
863
- status: SparkHtlcStatus;
864
- }
865
-
866
- export interface TokenBalance {
867
- balance: bigint;
868
- tokenMetadata: TokenMetadata;
869
- }
870
-
871
- export interface LnurlAuthRequestDetails {
872
- k1: string;
873
- action?: string;
874
- domain: string;
875
- url: string;
872
+ senderComment?: string;
873
+ nostrZapRequest?: string;
874
+ nostrZapReceipt?: string;
875
+ preimage?: string;
876
876
  }
877
877
 
878
- export interface AddContactRequest {
879
- name: string;
880
- paymentIdentifier: string;
878
+ export interface SparkInvoicePaymentDetails {
879
+ description?: string;
880
+ invoice: string;
881
881
  }
882
882
 
883
- export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
884
-
885
- export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
883
+ export interface LocaleOverrides {
884
+ locale: string;
885
+ spacing?: number;
886
+ symbol: Symbol;
887
+ }
886
888
 
887
- export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
889
+ export type ConversionStatus = "completed" | "refundNeeded" | "refunded";
888
890
 
889
- export interface LnurlWithdrawInfo {
890
- withdrawUrl: string;
891
+ export interface LnurlReceiveMetadata {
892
+ nostrZapRequest?: string;
893
+ nostrZapReceipt?: string;
894
+ senderComment?: string;
891
895
  }
892
896
 
893
- export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
894
-
895
- export interface BitcoinAddressDetails {
897
+ export interface SilentPaymentAddressDetails {
896
898
  address: string;
897
899
  network: BitcoinNetwork;
898
900
  source: PaymentRequestSource;
899
901
  }
900
902
 
901
- export interface ClaimHtlcPaymentResponse {
902
- payment: Payment;
903
- }
903
+ export type TokenTransactionType = "transfer" | "mint" | "burn";
904
904
 
905
- export interface SignMessageRequest {
906
- message: string;
907
- compact: boolean;
905
+ export interface ListUnclaimedDepositsResponse {
906
+ deposits: DepositInfo[];
908
907
  }
909
908
 
910
- export interface ReceivePaymentRequest {
911
- paymentMethod: ReceivePaymentMethod;
909
+ export interface RegisterLightningAddressRequest {
910
+ username: string;
911
+ description?: string;
912
912
  }
913
913
 
914
- export interface OutgoingChange {
915
- change: RecordChange;
916
- parent?: Record;
917
- }
914
+ export interface ListUnclaimedDepositsRequest {}
918
915
 
919
- export interface StableBalanceConfig {
920
- tokenIdentifier: string;
921
- thresholdSats?: number;
922
- maxSlippageBps?: number;
923
- reservedSats?: number;
916
+ export interface LnurlWithdrawInfo {
917
+ withdrawUrl: string;
924
918
  }
925
919
 
926
- export interface OptimizationConfig {
927
- autoEnabled: boolean;
928
- multiplicity: number;
920
+ export interface SendOnchainFeeQuote {
921
+ id: string;
922
+ expiresAt: number;
923
+ speedFast: SendOnchainSpeedFeeQuote;
924
+ speedMedium: SendOnchainSpeedFeeQuote;
925
+ speedSlow: SendOnchainSpeedFeeQuote;
929
926
  }
930
927
 
931
- export interface UpdateUserSettingsRequest {
932
- sparkPrivateModeEnabled?: boolean;
928
+ export interface SparkStatus {
929
+ status: ServiceStatus;
930
+ lastUpdated: number;
933
931
  }
934
932
 
935
- export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
933
+ export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
936
934
 
937
- export interface LogEntry {
938
- line: string;
939
- level: string;
940
- }
935
+ export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" } | { type: "autoConversion" };
941
936
 
942
- export interface TokenMetadata {
943
- identifier: string;
944
- issuerPublicKey: string;
945
- name: string;
946
- ticker: string;
947
- decimals: number;
948
- maxSupply: string;
949
- isFreezable: boolean;
937
+ export interface ClaimHtlcPaymentResponse {
938
+ payment: Payment;
950
939
  }
951
940
 
952
- export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
941
+ export interface SignMessageResponse {
942
+ pubkey: string;
943
+ signature: string;
944
+ }
953
945
 
954
- export interface AesSuccessActionDataDecrypted {
955
- description: string;
956
- plaintext: string;
946
+ export interface PrepareLnurlPayResponse {
947
+ amountSats: number;
948
+ comment?: string;
949
+ payRequest: LnurlPayRequestDetails;
950
+ feeSats: number;
951
+ invoiceDetails: Bolt11InvoiceDetails;
952
+ successAction?: SuccessAction;
953
+ conversionEstimate?: ConversionEstimate;
954
+ feePolicy: FeePolicy;
957
955
  }
958
956
 
957
+ export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
958
+
959
959
  /**
960
960
  * Interface for passkey PRF (Pseudo-Random Function) operations.
961
961
  *
@@ -1008,6 +1008,11 @@ export interface PasskeyPrfProvider {
1008
1008
  isPrfAvailable(): Promise<boolean>;
1009
1009
  }
1010
1010
 
1011
+ export interface UnfreezeIssuerTokenResponse {
1012
+ impactedOutputIds: string[];
1013
+ impactedTokenAmount: bigint;
1014
+ }
1015
+
1011
1016
  export interface CreateIssuerTokenRequest {
1012
1017
  name: string;
1013
1018
  ticker: string;
@@ -1020,17 +1025,16 @@ export interface MintIssuerTokenRequest {
1020
1025
  amount: bigint;
1021
1026
  }
1022
1027
 
1023
- export interface UnfreezeIssuerTokenResponse {
1024
- impactedOutputIds: string[];
1025
- impactedTokenAmount: bigint;
1028
+ export interface BurnIssuerTokenRequest {
1029
+ amount: bigint;
1026
1030
  }
1027
1031
 
1028
- export interface FreezeIssuerTokenRequest {
1032
+ export interface UnfreezeIssuerTokenRequest {
1029
1033
  address: string;
1030
1034
  }
1031
1035
 
1032
- export interface BurnIssuerTokenRequest {
1033
- amount: bigint;
1036
+ export interface FreezeIssuerTokenRequest {
1037
+ address: string;
1034
1038
  }
1035
1039
 
1036
1040
  export interface FreezeIssuerTokenResponse {
@@ -1038,10 +1042,6 @@ export interface FreezeIssuerTokenResponse {
1038
1042
  impactedTokenAmount: bigint;
1039
1043
  }
1040
1044
 
1041
- export interface UnfreezeIssuerTokenRequest {
1042
- address: string;
1043
- }
1044
-
1045
1045
  export interface ExternalSigner {
1046
1046
  identityPublicKey(): PublicKeyBytes;
1047
1047
  derivePublicKey(path: string): Promise<PublicKeyBytes>;
@@ -1065,28 +1065,23 @@ export interface ExternalSigner {
1065
1065
  hmacSha256(message: Uint8Array, path: string): Promise<HashedMessageBytes>;
1066
1066
  }
1067
1067
 
1068
- export interface MessageBytes {
1069
- bytes: number[];
1068
+ export interface ExternalTreeNodeId {
1069
+ id: string;
1070
1070
  }
1071
1071
 
1072
- export interface ExternalEncryptedSecret {
1073
- ciphertext: number[];
1072
+ export interface ExternalSecretShare {
1073
+ threshold: number;
1074
+ index: ExternalScalar;
1075
+ share: ExternalScalar;
1074
1076
  }
1075
1077
 
1076
- export interface ExternalSignFrostRequest {
1077
- message: number[];
1078
- publicKey: number[];
1079
- secret: ExternalSecretSource;
1080
- verifyingKey: number[];
1081
- selfNonceCommitment: ExternalFrostCommitments;
1082
- statechainCommitments: IdentifierCommitmentPair[];
1083
- adaptorPublicKey?: number[];
1078
+ export interface EcdsaSignatureBytes {
1079
+ bytes: number[];
1084
1080
  }
1085
1081
 
1086
- export type ExternalSecretToSplit = { type: "secretSource"; source: ExternalSecretSource } | { type: "preimage"; data: number[] };
1087
-
1088
- export interface SecretBytes {
1089
- bytes: number[];
1082
+ export interface ExternalSigningCommitments {
1083
+ hiding: number[];
1084
+ binding: number[];
1090
1085
  }
1091
1086
 
1092
1087
  export interface IdentifierCommitmentPair {
@@ -1094,10 +1089,8 @@ export interface IdentifierCommitmentPair {
1094
1089
  commitment: ExternalSigningCommitments;
1095
1090
  }
1096
1091
 
1097
- export interface ExternalSecretShare {
1098
- threshold: number;
1099
- index: ExternalScalar;
1100
- share: ExternalScalar;
1092
+ export interface ExternalIdentifier {
1093
+ bytes: number[];
1101
1094
  }
1102
1095
 
1103
1096
  export interface ExternalVerifiableSecretShare {
@@ -1105,48 +1098,34 @@ export interface ExternalVerifiableSecretShare {
1105
1098
  proofs: number[][];
1106
1099
  }
1107
1100
 
1108
- export interface ExternalIdentifier {
1109
- bytes: number[];
1110
- }
1111
-
1112
1101
  export interface IdentifierPublicKeyPair {
1113
1102
  identifier: ExternalIdentifier;
1114
1103
  publicKey: number[];
1115
1104
  }
1116
1105
 
1117
- export interface ExternalAggregateFrostRequest {
1118
- message: number[];
1119
- statechainSignatures: IdentifierSignaturePair[];
1120
- statechainPublicKeys: IdentifierPublicKeyPair[];
1121
- verifyingKey: number[];
1122
- statechainCommitments: IdentifierCommitmentPair[];
1123
- selfCommitment: ExternalSigningCommitments;
1124
- publicKey: number[];
1125
- selfSignature: ExternalFrostSignatureShare;
1126
- adaptorPublicKey?: number[];
1127
- }
1128
-
1129
- export interface ExternalSigningCommitments {
1130
- hiding: number[];
1131
- binding: number[];
1106
+ export interface ExternalEncryptedSecret {
1107
+ ciphertext: number[];
1132
1108
  }
1133
1109
 
1134
- export interface IdentifierSignaturePair {
1135
- identifier: ExternalIdentifier;
1136
- signature: ExternalFrostSignatureShare;
1110
+ export interface ExternalScalar {
1111
+ bytes: number[];
1137
1112
  }
1138
1113
 
1139
1114
  export interface RecoverableEcdsaSignatureBytes {
1140
1115
  bytes: number[];
1141
1116
  }
1142
1117
 
1143
- export type ExternalSecretSource = { type: "derived"; nodeId: ExternalTreeNodeId } | { type: "encrypted"; key: ExternalEncryptedSecret };
1118
+ export type ExternalSecretToSplit = { type: "secretSource"; source: ExternalSecretSource } | { type: "preimage"; data: number[] };
1144
1119
 
1145
- export interface ExternalFrostSignature {
1120
+ export interface MessageBytes {
1146
1121
  bytes: number[];
1147
1122
  }
1148
1123
 
1149
- export interface ExternalFrostSignatureShare {
1124
+ export interface SecretBytes {
1125
+ bytes: number[];
1126
+ }
1127
+
1128
+ export interface PublicKeyBytes {
1150
1129
  bytes: number[];
1151
1130
  }
1152
1131
 
@@ -1156,30 +1135,65 @@ export interface ExternalFrostCommitments {
1156
1135
  noncesCiphertext: number[];
1157
1136
  }
1158
1137
 
1159
- export interface EcdsaSignatureBytes {
1138
+ export interface ExternalFrostSignatureShare {
1160
1139
  bytes: number[];
1161
1140
  }
1162
1141
 
1163
- export interface ExternalTreeNodeId {
1164
- id: string;
1142
+ export interface ExternalAggregateFrostRequest {
1143
+ message: number[];
1144
+ statechainSignatures: IdentifierSignaturePair[];
1145
+ statechainPublicKeys: IdentifierPublicKeyPair[];
1146
+ verifyingKey: number[];
1147
+ statechainCommitments: IdentifierCommitmentPair[];
1148
+ selfCommitment: ExternalSigningCommitments;
1149
+ publicKey: number[];
1150
+ selfSignature: ExternalFrostSignatureShare;
1151
+ adaptorPublicKey?: number[];
1165
1152
  }
1166
1153
 
1167
1154
  export interface SchnorrSignatureBytes {
1168
1155
  bytes: number[];
1169
1156
  }
1170
1157
 
1158
+ export type ExternalSecretSource = { type: "derived"; nodeId: ExternalTreeNodeId } | { type: "encrypted"; key: ExternalEncryptedSecret };
1159
+
1171
1160
  export interface HashedMessageBytes {
1172
1161
  bytes: number[];
1173
1162
  }
1174
1163
 
1175
- export interface ExternalScalar {
1176
- bytes: number[];
1164
+ export interface ExternalSignFrostRequest {
1165
+ message: number[];
1166
+ publicKey: number[];
1167
+ secret: ExternalSecretSource;
1168
+ verifyingKey: number[];
1169
+ selfNonceCommitment: ExternalFrostCommitments;
1170
+ statechainCommitments: IdentifierCommitmentPair[];
1171
+ adaptorPublicKey?: number[];
1177
1172
  }
1178
1173
 
1179
- export interface PublicKeyBytes {
1174
+ export interface ExternalFrostSignature {
1180
1175
  bytes: number[];
1181
1176
  }
1182
1177
 
1178
+ export interface IdentifierSignaturePair {
1179
+ identifier: ExternalIdentifier;
1180
+ signature: ExternalFrostSignatureShare;
1181
+ }
1182
+
1183
+ /**
1184
+ * A wallet derived from a passkey.
1185
+ */
1186
+ export interface Wallet {
1187
+ /**
1188
+ * The derived seed.
1189
+ */
1190
+ seed: Seed;
1191
+ /**
1192
+ * The label used for derivation.
1193
+ */
1194
+ label: string;
1195
+ }
1196
+
1183
1197
  /**
1184
1198
  * Nostr relay configuration for passkey label operations.
1185
1199
  *
@@ -1197,20 +1211,6 @@ export interface NostrRelayConfig {
1197
1211
  timeoutSecs?: number;
1198
1212
  }
1199
1213
 
1200
- /**
1201
- * A wallet derived from a passkey.
1202
- */
1203
- export interface Wallet {
1204
- /**
1205
- * The derived seed.
1206
- */
1207
- seed: Seed;
1208
- /**
1209
- * The label used for derivation.
1210
- */
1211
- label: string;
1212
- }
1213
-
1214
1214
  export interface Storage {
1215
1215
  getCachedItem: (key: string) => Promise<string | null>;
1216
1216
  setCachedItem: (key: string, value: string) => Promise<void>;