@breeztech/breez-sdk-spark 0.13.2-dev5 → 0.13.5

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.
@@ -9,17 +9,17 @@
9
9
  * - `recycleTimeoutSecs`: 10 (10 seconds idle before disconnect)
10
10
  */
11
11
  export function defaultPostgresStorageConfig(connection_string: string): PostgresStorageConfig;
12
+ export function defaultConfig(network: Network): Config;
13
+ export function connect(request: ConnectRequest): Promise<BreezSdk>;
14
+ export function defaultExternalSigner(mnemonic: string, passphrase: string | null | undefined, network: Network, key_set_config?: KeySetConfig | null): DefaultSigner;
15
+ export function initLogging(logger: Logger, filter?: string | null): Promise<void>;
12
16
  /**
13
17
  * Creates a default external signer from a mnemonic phrase.
14
18
  *
15
19
  * This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
16
20
  */
17
21
  export function getSparkStatus(): Promise<SparkStatus>;
18
- export function defaultConfig(network: Network): Config;
19
- export function initLogging(logger: Logger, filter?: string | null): Promise<void>;
20
- export function connect(request: ConnectRequest): Promise<BreezSdk>;
21
22
  export function connectWithSigner(config: Config, signer: ExternalSigner, storage_dir: string): Promise<BreezSdk>;
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
  */
@@ -66,7 +66,7 @@ export interface TreeStore {
66
66
  addLeaves: (leaves: TreeNode[]) => Promise<void>;
67
67
  getLeaves: () => Promise<Leaves>;
68
68
  setLeaves: (leaves: TreeNode[], missingLeaves: TreeNode[], refreshStartedAtMs: number) => Promise<void>;
69
- cancelReservation: (id: string) => Promise<void>;
69
+ cancelReservation: (id: string, leavesToKeep: TreeNode[]) => Promise<void>;
70
70
  finalizeReservation: (id: string, newLeaves: TreeNode[] | null) => Promise<void>;
71
71
  tryReserveLeaves: (targetAmounts: TargetAmounts | null, exactOnly: boolean, purpose: string) => Promise<ReserveResult>;
72
72
  now: () => Promise<number>;
@@ -206,13 +206,6 @@ export interface TxStatus {
206
206
 
207
207
  export type ChainApiType = "esplora" | "mempoolSpace";
208
208
 
209
- export interface Utxo {
210
- txid: string;
211
- vout: number;
212
- value: number;
213
- status: TxStatus;
214
- }
215
-
216
209
  export interface RecommendedFees {
217
210
  fastestFee: number;
218
211
  halfHourFee: number;
@@ -221,17 +214,34 @@ export interface RecommendedFees {
221
214
  minimumFee: number;
222
215
  }
223
216
 
217
+ export interface Utxo {
218
+ txid: string;
219
+ vout: number;
220
+ value: number;
221
+ status: TxStatus;
222
+ }
223
+
224
224
  export interface PaymentObserver {
225
225
  beforeSend: (payments: ProvisionalPayment[]) => Promise<void>;
226
226
  }
227
227
 
228
- export interface ListFiatCurrenciesResponse {
229
- currencies: FiatCurrency[];
228
+ export interface CurrencyInfo {
229
+ name: string;
230
+ fractionSize: number;
231
+ spacing?: number;
232
+ symbol?: Symbol;
233
+ uniqSymbol?: Symbol;
234
+ localizedName: LocalizedName[];
235
+ localeOverrides: LocaleOverrides[];
230
236
  }
231
237
 
232
- export interface FiatCurrency {
233
- id: string;
234
- info: CurrencyInfo;
238
+ export interface SignMessageRequest {
239
+ message: string;
240
+ compact: boolean;
241
+ }
242
+
243
+ export interface GetPaymentRequest {
244
+ paymentId: string;
235
245
  }
236
246
 
237
247
  export interface PaymentMetadata {
@@ -243,17 +253,41 @@ export interface PaymentMetadata {
243
253
  conversionStatus?: ConversionStatus;
244
254
  }
245
255
 
246
- export interface LnurlWithdrawRequest {
247
- amountSats: number;
248
- withdrawRequest: LnurlWithdrawRequestDetails;
249
- completionTimeoutSecs?: number;
256
+ export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: string; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress"; newAddress?: boolean } | { type: "bolt11Invoice"; description: string; amountSats?: number; expirySecs?: number; paymentHash?: string };
257
+
258
+ export interface AesSuccessActionDataDecrypted {
259
+ description: string;
260
+ plaintext: string;
250
261
  }
251
262
 
252
- export interface Symbol {
253
- grapheme?: string;
254
- template?: string;
255
- rtl?: boolean;
256
- position?: number;
263
+ export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
264
+
265
+ export interface ConversionDetails {
266
+ status: ConversionStatus;
267
+ from?: ConversionStep;
268
+ to?: ConversionStep;
269
+ }
270
+
271
+ export interface OutgoingChange {
272
+ change: RecordChange;
273
+ parent?: Record;
274
+ }
275
+
276
+ export interface KeySetConfig {
277
+ keySetType: KeySetType;
278
+ useAddressIndex: boolean;
279
+ accountNumber?: number;
280
+ }
281
+
282
+ export interface LnurlInfo {
283
+ url: string;
284
+ bech32: string;
285
+ }
286
+
287
+ export interface RegisterWebhookRequest {
288
+ url: string;
289
+ secret: string;
290
+ eventTypes: WebhookEventType[];
257
291
  }
258
292
 
259
293
  export interface PrepareLnurlPayResponse {
@@ -267,17 +301,54 @@ export interface PrepareLnurlPayResponse {
267
301
  feePolicy: FeePolicy;
268
302
  }
269
303
 
270
- export interface FetchConversionLimitsResponse {
271
- minFromAmount?: bigint;
272
- minToAmount?: bigint;
304
+ export interface LightningAddressDetails {
305
+ address: string;
306
+ payRequest: LnurlPayRequestDetails;
273
307
  }
274
308
 
275
- export interface KeySetConfig {
276
- keySetType: KeySetType;
277
- useAddressIndex: boolean;
278
- accountNumber?: number;
309
+ export interface Payment {
310
+ id: string;
311
+ paymentType: PaymentType;
312
+ status: PaymentStatus;
313
+ amount: bigint;
314
+ fees: bigint;
315
+ timestamp: number;
316
+ method: PaymentMethod;
317
+ details?: PaymentDetails;
318
+ conversionDetails?: ConversionDetails;
319
+ }
320
+
321
+ export interface RefundDepositRequest {
322
+ txid: string;
323
+ vout: number;
324
+ destinationAddress: string;
325
+ fee: Fee;
326
+ }
327
+
328
+ export interface SignMessageResponse {
329
+ pubkey: string;
330
+ signature: string;
331
+ }
332
+
333
+ export interface ListPaymentsRequest {
334
+ typeFilter?: PaymentType[];
335
+ statusFilter?: PaymentStatus[];
336
+ assetFilter?: AssetFilter;
337
+ paymentDetailsFilter?: PaymentDetailsFilter[];
338
+ fromTimestamp?: number;
339
+ toTimestamp?: number;
340
+ offset?: number;
341
+ limit?: number;
342
+ sortAscending?: boolean;
343
+ }
344
+
345
+ export interface Bolt11Invoice {
346
+ bolt11: string;
347
+ source: PaymentRequestSource;
279
348
  }
280
349
 
350
+ export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
351
+
281
352
  export interface LightningAddressInfo {
282
353
  description: string;
283
354
  lightningAddress: string;
@@ -285,39 +356,89 @@ export interface LightningAddressInfo {
285
356
  username: string;
286
357
  }
287
358
 
288
- export interface LnurlPayInfo {
289
- lnAddress?: string;
290
- comment?: string;
291
- domain?: string;
292
- metadata?: string;
293
- processedSuccessAction?: SuccessActionProcessed;
294
- rawSuccessAction?: SuccessAction;
359
+ export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
360
+
361
+ export interface Bolt11RouteHint {
362
+ hops: Bolt11RouteHintHop[];
363
+ }
364
+
365
+ export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" | "major";
366
+
367
+ export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
368
+
369
+ export interface SendOnchainFeeQuote {
370
+ id: string;
371
+ expiresAt: number;
372
+ speedFast: SendOnchainSpeedFeeQuote;
373
+ speedMedium: SendOnchainSpeedFeeQuote;
374
+ speedSlow: SendOnchainSpeedFeeQuote;
295
375
  }
296
376
 
377
+ export type ConversionStatus = "pending" | "completed" | "failed" | "refundNeeded" | "refunded";
378
+
379
+ export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
380
+
297
381
  export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
298
382
 
299
- export interface Bolt12InvoiceRequestDetails {}
383
+ export interface Bip21Extra {
384
+ key: string;
385
+ value: string;
386
+ }
300
387
 
301
- export interface RegisterLightningAddressRequest {
388
+ export interface Credentials {
302
389
  username: string;
303
- description?: string;
390
+ password: string;
304
391
  }
305
392
 
306
- export interface BuyBitcoinResponse {
307
- url: string;
393
+ export interface FiatCurrency {
394
+ id: string;
395
+ info: CurrencyInfo;
308
396
  }
309
397
 
310
- export interface GetPaymentRequest {
311
- paymentId: string;
398
+ export interface LocalizedName {
399
+ locale: string;
400
+ name: string;
312
401
  }
313
402
 
314
- export interface SparkStatus {
315
- status: ServiceStatus;
316
- lastUpdated: number;
403
+ export interface SendPaymentResponse {
404
+ payment: Payment;
317
405
  }
318
406
 
319
- export interface ClaimHtlcPaymentRequest {
320
- preimage: string;
407
+ export interface Config {
408
+ apiKey?: string;
409
+ network: Network;
410
+ syncIntervalSecs: number;
411
+ maxDepositClaimFee?: MaxFee;
412
+ lnurlDomain?: string;
413
+ preferSparkOverLightning: boolean;
414
+ externalInputParsers?: ExternalInputParser[];
415
+ useDefaultExternalInputParsers: boolean;
416
+ realTimeSyncServerUrl?: string;
417
+ privateEnabledDefault: boolean;
418
+ optimizationConfig: OptimizationConfig;
419
+ stableBalanceConfig?: StableBalanceConfig;
420
+ /**
421
+ * Maximum number of concurrent transfer claims.
422
+ *
423
+ * Controls how many pending Spark transfers can be claimed in parallel.
424
+ * Default is 4. Increase for server environments with high incoming
425
+ * payment volume to improve throughput.
426
+ */
427
+ maxConcurrentClaims: number;
428
+ sparkConfig?: SparkConfig;
429
+ }
430
+
431
+ export interface Bolt12OfferBlindedPath {
432
+ blindedHops: string[];
433
+ }
434
+
435
+ export interface ListContactsRequest {
436
+ offset?: number;
437
+ limit?: number;
438
+ }
439
+
440
+ export interface ReceivePaymentRequest {
441
+ paymentMethod: ReceivePaymentMethod;
321
442
  }
322
443
 
323
444
  export interface AesSuccessActionData {
@@ -326,277 +447,178 @@ export interface AesSuccessActionData {
326
447
  iv: string;
327
448
  }
328
449
 
329
- export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
450
+ 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);
330
451
 
331
- export interface SparkInvoiceDetails {
332
- invoice: string;
333
- identityPublicKey: string;
334
- network: BitcoinNetwork;
335
- amount?: string;
336
- tokenIdentifier?: string;
337
- expiryTime?: number;
338
- description?: string;
339
- senderPublicKey?: string;
452
+ export type BuyBitcoinRequest = { type: "moonpay"; lockedAmountSat?: number; redirectUrl?: string } | { type: "cashApp"; amountSats?: number };
453
+
454
+ export interface SetLnurlMetadataItem {
455
+ paymentHash: string;
456
+ senderComment?: string;
457
+ nostrZapRequest?: string;
458
+ nostrZapReceipt?: string;
340
459
  }
341
460
 
342
- export interface AddContactRequest {
343
- name: string;
344
- paymentIdentifier: string;
461
+ export interface Rate {
462
+ coin: string;
463
+ value: number;
345
464
  }
346
465
 
347
- export type TokenTransactionType = "transfer" | "mint" | "burn";
466
+ export interface GetTokensMetadataResponse {
467
+ tokensMetadata: TokenMetadata[];
468
+ }
348
469
 
349
- export interface Bip21Details {
350
- amountSat?: number;
351
- assetId?: string;
352
- uri: string;
353
- extras: Bip21Extra[];
354
- label?: string;
355
- message?: string;
356
- paymentMethods: InputType[];
357
- }
358
-
359
- export interface LogEntry {
360
- line: string;
361
- level: string;
362
- }
363
-
364
- export interface MessageSuccessActionData {
365
- message: string;
366
- }
367
-
368
- export interface UpdateUserSettingsRequest {
369
- sparkPrivateModeEnabled?: boolean;
370
- stableBalanceActiveLabel?: StableBalanceActiveLabel;
371
- }
372
-
373
- export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
374
-
375
- export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
376
-
377
- export interface SyncWalletRequest {}
470
+ 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 };
378
471
 
379
- export interface DepositInfo {
380
- txid: string;
381
- vout: number;
382
- amountSats: number;
383
- isMature: boolean;
384
- refundTx?: string;
385
- refundTxId?: string;
386
- claimError?: DepositClaimError;
387
- }
472
+ export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
388
473
 
389
- export interface ListPaymentsRequest {
390
- typeFilter?: PaymentType[];
391
- statusFilter?: PaymentStatus[];
392
- assetFilter?: AssetFilter;
393
- paymentDetailsFilter?: PaymentDetailsFilter[];
394
- fromTimestamp?: number;
395
- toTimestamp?: number;
396
- offset?: number;
397
- limit?: number;
398
- sortAscending?: boolean;
474
+ export interface GetInfoRequest {
475
+ ensureSynced?: boolean;
399
476
  }
400
477
 
401
- export interface CurrencyInfo {
478
+ export interface UpdateContactRequest {
479
+ id: string;
402
480
  name: string;
403
- fractionSize: number;
404
- spacing?: number;
405
- symbol?: Symbol;
406
- uniqSymbol?: Symbol;
407
- localizedName: LocalizedName[];
408
- localeOverrides: LocaleOverrides[];
481
+ paymentIdentifier: string;
409
482
  }
410
483
 
411
- export interface UnregisterWebhookRequest {
412
- webhookId: string;
484
+ export interface TokenBalance {
485
+ balance: bigint;
486
+ tokenMetadata: TokenMetadata;
413
487
  }
414
488
 
415
- export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
416
-
417
- export interface SparkSigningOperator {
418
- id: number;
419
- identifier: string;
420
- address: string;
421
- identityPublicKey: string;
489
+ export interface ReceivePaymentResponse {
490
+ paymentRequest: string;
491
+ fee: bigint;
422
492
  }
423
493
 
424
- export interface ConversionStep {
425
- paymentId: string;
426
- amount: bigint;
427
- fee: bigint;
428
- method: PaymentMethod;
429
- tokenMetadata?: TokenMetadata;
430
- amountAdjustment?: AmountAdjustmentReason;
494
+ export interface LnurlPayInfo {
495
+ lnAddress?: string;
496
+ comment?: string;
497
+ domain?: string;
498
+ metadata?: string;
499
+ processedSuccessAction?: SuccessActionProcessed;
500
+ rawSuccessAction?: SuccessAction;
431
501
  }
432
502
 
433
- export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
503
+ export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
434
504
 
435
- export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
505
+ export interface ClaimHtlcPaymentRequest {
506
+ preimage: string;
507
+ }
436
508
 
437
- export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
509
+ export type StoragePaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
438
510
 
439
- export interface GetTokensMetadataRequest {
440
- tokenIdentifiers: string[];
511
+ export interface UrlSuccessActionData {
512
+ description: string;
513
+ url: string;
514
+ matchesCallbackDomain: boolean;
441
515
  }
442
516
 
443
- export interface LightningAddressDetails {
517
+ export type OptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
518
+
519
+ export interface BitcoinAddressDetails {
444
520
  address: string;
445
- payRequest: LnurlPayRequestDetails;
521
+ network: BitcoinNetwork;
522
+ source: PaymentRequestSource;
446
523
  }
447
524
 
448
- export interface ListContactsRequest {
449
- offset?: number;
450
- limit?: number;
525
+ export interface FetchConversionLimitsResponse {
526
+ minFromAmount?: bigint;
527
+ minToAmount?: bigint;
451
528
  }
452
529
 
453
530
  export type StableBalanceActiveLabel = { type: "set"; label: string } | { type: "unset" };
454
531
 
455
- export interface CheckMessageRequest {
456
- message: string;
457
- pubkey: string;
458
- signature: string;
532
+ export interface UnregisterWebhookRequest {
533
+ webhookId: string;
459
534
  }
460
535
 
461
- export interface ListUnclaimedDepositsRequest {}
462
-
463
- export interface Bolt11Invoice {
464
- bolt11: string;
465
- source: PaymentRequestSource;
466
- }
536
+ export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
467
537
 
468
- export type ConversionStatus = "pending" | "completed" | "failed" | "refundNeeded" | "refunded";
538
+ export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
469
539
 
470
- export interface TokenBalance {
471
- balance: bigint;
472
- tokenMetadata: TokenMetadata;
540
+ export interface UnversionedRecordChange {
541
+ id: RecordId;
542
+ schemaVersion: string;
543
+ updatedFields: Map<string, string>;
473
544
  }
474
545
 
475
- export interface TokenMetadata {
476
- identifier: string;
477
- issuerPublicKey: string;
546
+ export interface AddContactRequest {
478
547
  name: string;
479
- ticker: string;
480
- decimals: number;
481
- maxSupply: string;
482
- isFreezable: boolean;
548
+ paymentIdentifier: string;
483
549
  }
484
550
 
485
- export interface Bolt12Offer {
486
- offer: string;
487
- source: PaymentRequestSource;
488
- }
551
+ export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
489
552
 
490
- export interface Config {
491
- apiKey?: string;
492
- network: Network;
493
- syncIntervalSecs: number;
494
- maxDepositClaimFee?: MaxFee;
495
- lnurlDomain?: string;
496
- preferSparkOverLightning: boolean;
497
- externalInputParsers?: ExternalInputParser[];
498
- useDefaultExternalInputParsers: boolean;
499
- realTimeSyncServerUrl?: string;
500
- privateEnabledDefault: boolean;
501
- optimizationConfig: OptimizationConfig;
502
- stableBalanceConfig?: StableBalanceConfig;
503
- /**
504
- * Maximum number of concurrent transfer claims.
505
- *
506
- * Controls how many pending Spark transfers can be claimed in parallel.
507
- * Default is 4. Increase for server environments with high incoming
508
- * payment volume to improve throughput.
509
- */
510
- maxConcurrentClaims: number;
511
- sparkConfig?: SparkConfig;
553
+ export interface Bolt11RouteHintHop {
554
+ srcNodeId: string;
555
+ shortChannelId: string;
556
+ feesBaseMsat: number;
557
+ feesProportionalMillionths: number;
558
+ cltvExpiryDelta: number;
559
+ htlcMinimumMsat?: number;
560
+ htlcMaximumMsat?: number;
512
561
  }
513
562
 
514
- export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
515
-
516
- export type AmountAdjustmentReason = "flooredToMinLimit" | "increasedToAvoidDust";
563
+ export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
517
564
 
518
- export interface ProvisionalPayment {
519
- paymentId: string;
520
- amount: bigint;
521
- details: ProvisionalPaymentDetails;
565
+ export interface ClaimHtlcPaymentResponse {
566
+ payment: Payment;
522
567
  }
523
568
 
524
- export interface FetchConversionLimitsRequest {
525
- conversionType: ConversionType;
526
- tokenIdentifier?: string;
569
+ export interface SparkStatus {
570
+ status: ServiceStatus;
571
+ lastUpdated: number;
527
572
  }
528
573
 
529
- export interface SignMessageResponse {
530
- pubkey: string;
531
- signature: string;
574
+ export interface ConnectRequest {
575
+ config: Config;
576
+ seed: Seed;
577
+ storageDir: string;
532
578
  }
533
579
 
534
- export interface StableBalanceConfig {
535
- tokens: StableBalanceToken[];
536
- defaultActiveLabel?: string;
537
- thresholdSats?: number;
538
- maxSlippageBps?: number;
539
- }
580
+ export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
540
581
 
541
- export interface ConversionEstimate {
542
- options: ConversionOptions;
543
- amountIn: bigint;
544
- amountOut: bigint;
545
- fee: bigint;
546
- amountAdjustment?: AmountAdjustmentReason;
547
- }
582
+ 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 };
548
583
 
549
- export interface LnurlErrorDetails {
550
- reason: string;
584
+ export interface LogEntry {
585
+ line: string;
586
+ level: string;
551
587
  }
552
588
 
553
- export interface GetPaymentResponse {
554
- payment: Payment;
589
+ export interface UserSettings {
590
+ sparkPrivateModeEnabled: boolean;
591
+ stableBalanceActiveLabel?: string;
555
592
  }
556
593
 
557
- export interface LnurlPayRequestDetails {
558
- callback: string;
559
- minSendable: number;
560
- maxSendable: number;
561
- metadataStr: string;
562
- commentAllowed: number;
563
- domain: string;
564
- url: string;
565
- address?: string;
566
- allowsNostr?: boolean;
567
- nostrPubkey?: string;
594
+ export interface StableBalanceToken {
595
+ label: string;
596
+ tokenIdentifier: string;
568
597
  }
569
598
 
570
- export interface BitcoinAddressDetails {
571
- address: string;
572
- network: BitcoinNetwork;
573
- source: PaymentRequestSource;
599
+ export interface OptimizationProgress {
600
+ isRunning: boolean;
601
+ currentRound: number;
602
+ totalRounds: number;
574
603
  }
575
604
 
576
- export interface SparkInvoicePaymentDetails {
577
- description?: string;
578
- invoice: string;
605
+ export interface ListUnclaimedDepositsResponse {
606
+ deposits: DepositInfo[];
579
607
  }
580
608
 
581
- export interface IncomingChange {
582
- newState: Record;
583
- oldState?: Record;
584
- }
609
+ 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 } | { type: "newDeposits"; newDeposits: DepositInfo[] };
585
610
 
586
- export interface CheckMessageResponse {
587
- isValid: boolean;
611
+ export interface StableBalanceConfig {
612
+ tokens: StableBalanceToken[];
613
+ defaultActiveLabel?: string;
614
+ thresholdSats?: number;
615
+ maxSlippageBps?: number;
588
616
  }
589
617
 
590
- export interface Payment {
591
- id: string;
592
- paymentType: PaymentType;
593
- status: PaymentStatus;
594
- amount: bigint;
595
- fees: bigint;
596
- timestamp: number;
597
- method: PaymentMethod;
598
- details?: PaymentDetails;
599
- conversionDetails?: ConversionDetails;
618
+ export interface SilentPaymentAddressDetails {
619
+ address: string;
620
+ network: BitcoinNetwork;
621
+ source: PaymentRequestSource;
600
622
  }
601
623
 
602
624
  export interface LnurlAuthRequestDetails {
@@ -612,18 +634,15 @@ export interface LnurlReceiveMetadata {
612
634
  senderComment?: string;
613
635
  }
614
636
 
615
- export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
616
-
617
- export interface Webhook {
618
- id: string;
619
- url: string;
620
- eventTypes: WebhookEventType[];
621
- }
622
-
623
637
  export type AesSuccessActionDataResult = { type: "decrypted"; data: AesSuccessActionDataDecrypted } | { type: "errorStatus"; reason: string };
624
638
 
625
- export interface ListPaymentsResponse {
626
- payments: Payment[];
639
+ export interface ConversionInfo {
640
+ poolId: string;
641
+ conversionId: string;
642
+ status: ConversionStatus;
643
+ fee?: string;
644
+ purpose?: ConversionPurpose;
645
+ amountAdjustment?: AmountAdjustmentReason;
627
646
  }
628
647
 
629
648
  export interface LnurlPayRequest {
@@ -631,142 +650,90 @@ export interface LnurlPayRequest {
631
650
  idempotencyKey?: string;
632
651
  }
633
652
 
634
- export interface ClaimDepositResponse {
635
- payment: Payment;
653
+ export interface Bolt11InvoiceDetails {
654
+ amountMsat?: number;
655
+ description?: string;
656
+ descriptionHash?: string;
657
+ expiry: number;
658
+ invoice: Bolt11Invoice;
659
+ minFinalCltvExpiryDelta: number;
660
+ network: BitcoinNetwork;
661
+ payeePubkey: string;
662
+ paymentHash: string;
663
+ paymentSecret: string;
664
+ routingHints: Bolt11RouteHint[];
665
+ timestamp: number;
636
666
  }
637
667
 
638
- export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" | "major";
639
-
640
- export interface Bolt11RouteHintHop {
641
- srcNodeId: string;
642
- shortChannelId: string;
643
- feesBaseMsat: number;
644
- feesProportionalMillionths: number;
645
- cltvExpiryDelta: number;
646
- htlcMinimumMsat?: number;
647
- htlcMaximumMsat?: number;
668
+ export interface RefundDepositResponse {
669
+ txId: string;
670
+ txHex: string;
648
671
  }
649
672
 
650
- export interface LnurlInfo {
651
- url: string;
652
- bech32: string;
673
+ export interface Bolt12InvoiceDetails {
674
+ amountMsat: number;
675
+ invoice: Bolt12Invoice;
653
676
  }
654
677
 
655
- export type PaymentType = "send" | "receive";
656
-
657
- export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
658
-
659
- export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
660
-
661
- export interface SendOnchainFeeQuote {
662
- id: string;
663
- expiresAt: number;
664
- speedFast: SendOnchainSpeedFeeQuote;
665
- speedMedium: SendOnchainSpeedFeeQuote;
666
- speedSlow: SendOnchainSpeedFeeQuote;
678
+ export interface ListFiatCurrenciesResponse {
679
+ currencies: FiatCurrency[];
667
680
  }
668
681
 
669
- export interface ListUnclaimedDepositsResponse {
670
- deposits: DepositInfo[];
682
+ export interface SparkInvoicePaymentDetails {
683
+ description?: string;
684
+ invoice: string;
671
685
  }
672
686
 
673
- export type WebhookEventType = { type: "lightningReceiveFinished" } | { type: "lightningSendFinished" } | { type: "coopExitFinished" } | { type: "staticDepositFinished" } | ({ type: "unknown" } & string);
687
+ export type PaymentType = "send" | "receive";
674
688
 
675
- export interface ConversionDetails {
676
- status: ConversionStatus;
677
- from?: ConversionStep;
678
- to?: ConversionStep;
689
+ export interface LnurlWithdrawInfo {
690
+ withdrawUrl: string;
679
691
  }
680
692
 
681
- export interface PrepareLnurlPayRequest {
682
- amount: bigint;
683
- comment?: string;
684
- payRequest: LnurlPayRequestDetails;
685
- validateSuccessActionUrl?: boolean;
693
+ export interface FetchConversionLimitsRequest {
694
+ conversionType: ConversionType;
686
695
  tokenIdentifier?: string;
687
- conversionOptions?: ConversionOptions;
688
- feePolicy?: FeePolicy;
689
696
  }
690
697
 
691
- export interface UnversionedRecordChange {
692
- id: RecordId;
693
- schemaVersion: string;
694
- updatedFields: Map<string, string>;
698
+ export interface IncomingChange {
699
+ newState: Record;
700
+ oldState?: Record;
695
701
  }
696
702
 
697
- export interface SparkSspConfig {
698
- baseUrl: string;
699
- identityPublicKey: string;
700
- schemaEndpoint?: string;
703
+ export interface LnurlPayRequestDetails {
704
+ callback: string;
705
+ minSendable: number;
706
+ maxSendable: number;
707
+ metadataStr: string;
708
+ commentAllowed: number;
709
+ domain: string;
710
+ url: string;
711
+ address?: string;
712
+ allowsNostr?: boolean;
713
+ nostrPubkey?: string;
701
714
  }
702
715
 
703
- export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
704
-
705
- export type PaymentStatus = "completed" | "pending" | "failed";
706
-
707
- export interface Bolt12InvoiceDetails {
708
- amountMsat: number;
709
- invoice: Bolt12Invoice;
716
+ export interface UpdateUserSettingsRequest {
717
+ sparkPrivateModeEnabled?: boolean;
718
+ stableBalanceActiveLabel?: StableBalanceActiveLabel;
710
719
  }
711
720
 
712
- export interface Bolt11RouteHint {
713
- hops: Bolt11RouteHintHop[];
721
+ export interface MessageSuccessActionData {
722
+ message: string;
714
723
  }
715
724
 
716
- export interface ReceivePaymentResponse {
717
- paymentRequest: string;
725
+ export interface ConversionStep {
726
+ paymentId: string;
727
+ amount: bigint;
718
728
  fee: bigint;
729
+ method: PaymentMethod;
730
+ tokenMetadata?: TokenMetadata;
731
+ amountAdjustment?: AmountAdjustmentReason;
719
732
  }
720
733
 
721
- export interface SparkHtlcDetails {
722
- paymentHash: string;
723
- preimage?: string;
724
- expiryTime: number;
725
- status: SparkHtlcStatus;
726
- }
727
-
728
- export interface Bip21Extra {
729
- key: string;
730
- value: string;
731
- }
732
-
733
- export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
734
-
735
- export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
736
-
737
- export interface ExternalInputParser {
738
- providerId: string;
739
- inputRegex: string;
740
- parserUrl: string;
741
- }
742
-
743
- export interface ConversionOptions {
744
- conversionType: ConversionType;
745
- maxSlippageBps?: number;
746
- completionTimeoutSecs?: number;
747
- }
748
-
749
- export interface LocalizedName {
750
- locale: string;
751
- name: string;
752
- }
753
-
754
- export interface PrepareSendPaymentRequest {
755
- paymentRequest: string;
756
- amount?: bigint;
757
- tokenIdentifier?: string;
758
- conversionOptions?: ConversionOptions;
759
- feePolicy?: FeePolicy;
760
- }
761
-
762
- export type BuyBitcoinRequest = { type: "moonpay"; lockedAmountSat?: number; redirectUrl?: string } | { type: "cashApp"; amountSats?: number };
763
-
764
- export type Network = "mainnet" | "regtest";
765
-
766
- export type StoragePaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
767
-
768
- export interface GetInfoRequest {
769
- ensureSynced?: boolean;
734
+ export interface SendOnchainSpeedFeeQuote {
735
+ userFeeSat: number;
736
+ l1BroadcastFeeSat: number;
770
737
  }
771
738
 
772
739
  export interface StorageListPaymentsRequest {
@@ -781,34 +748,11 @@ export interface StorageListPaymentsRequest {
781
748
  sortAscending?: boolean;
782
749
  }
783
750
 
784
- export interface RegisterWebhookRequest {
785
- url: string;
786
- secret: string;
787
- eventTypes: WebhookEventType[];
788
- }
789
-
790
- 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 };
791
-
792
- export interface SetLnurlMetadataItem {
793
- paymentHash: string;
794
- senderComment?: string;
795
- nostrZapRequest?: string;
796
- nostrZapReceipt?: string;
797
- }
798
-
799
- export interface RefundDepositRequest {
800
- txid: string;
801
- vout: number;
802
- destinationAddress: string;
803
- fee: Fee;
804
- }
805
-
806
- export interface LnurlWithdrawRequestDetails {
807
- callback: string;
808
- k1: string;
809
- defaultDescription: string;
810
- minWithdrawable: number;
811
- maxWithdrawable: number;
751
+ export interface SparkHtlcDetails {
752
+ paymentHash: string;
753
+ preimage?: string;
754
+ expiryTime: number;
755
+ status: SparkHtlcStatus;
812
756
  }
813
757
 
814
758
  export interface Contact {
@@ -819,185 +763,222 @@ export interface Contact {
819
763
  updatedAt: number;
820
764
  }
821
765
 
822
- export interface OutgoingChange {
823
- change: RecordChange;
824
- parent?: Record;
766
+ export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
767
+
768
+ export interface BuyBitcoinResponse {
769
+ url: string;
825
770
  }
826
771
 
827
- export interface ListFiatRatesResponse {
828
- rates: Rate[];
772
+ export interface SparkSigningOperator {
773
+ id: number;
774
+ identifier: string;
775
+ address: string;
776
+ identityPublicKey: string;
829
777
  }
830
778
 
831
- export interface AesSuccessActionDataDecrypted {
832
- description: string;
833
- plaintext: string;
779
+ export interface Bolt12OfferDetails {
780
+ absoluteExpiry?: number;
781
+ chains: string[];
782
+ description?: string;
783
+ issuer?: string;
784
+ minAmount?: Amount;
785
+ offer: Bolt12Offer;
786
+ paths: Bolt12OfferBlindedPath[];
787
+ signingPubkey?: string;
834
788
  }
835
789
 
836
- export interface RecordId {
837
- type: string;
838
- dataId: string;
790
+ export interface GetInfoResponse {
791
+ identityPubkey: string;
792
+ balanceSats: number;
793
+ tokenBalances: Map<string, TokenBalance>;
839
794
  }
840
795
 
841
- export interface StableBalanceToken {
842
- label: string;
843
- tokenIdentifier: string;
796
+ export interface SparkAddressDetails {
797
+ address: string;
798
+ identityPublicKey: string;
799
+ network: BitcoinNetwork;
800
+ source: PaymentRequestSource;
844
801
  }
845
802
 
846
- export interface LnurlPayResponse {
803
+ export interface LnurlWithdrawResponse {
804
+ paymentRequest: string;
805
+ payment?: Payment;
806
+ }
807
+
808
+ export interface GetPaymentResponse {
847
809
  payment: Payment;
848
- successAction?: SuccessActionProcessed;
849
810
  }
850
811
 
851
- export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" } | { type: "autoConversion" };
812
+ export type FeePolicy = "feesExcluded" | "feesIncluded";
852
813
 
853
- export interface CheckLightningAddressRequest {
854
- username: string;
855
- }
814
+ export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
856
815
 
857
- 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);
816
+ export interface Bolt12Offer {
817
+ offer: string;
818
+ source: PaymentRequestSource;
819
+ }
858
820
 
859
- export interface UserSettings {
860
- sparkPrivateModeEnabled: boolean;
861
- stableBalanceActiveLabel?: string;
821
+ export interface LnurlWithdrawRequestDetails {
822
+ callback: string;
823
+ k1: string;
824
+ defaultDescription: string;
825
+ minWithdrawable: number;
826
+ maxWithdrawable: number;
862
827
  }
863
828
 
864
- export interface UrlSuccessActionData {
865
- description: string;
866
- url: string;
867
- matchesCallbackDomain: boolean;
829
+ export interface PaymentRequestSource {
830
+ bip21Uri?: string;
831
+ bip353Address?: string;
868
832
  }
869
833
 
870
- export type FeePolicy = "feesExcluded" | "feesIncluded";
834
+ export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
871
835
 
872
- export interface LocaleOverrides {
873
- locale: string;
874
- spacing?: number;
875
- symbol: Symbol;
836
+ export interface OptimizationConfig {
837
+ autoEnabled: boolean;
838
+ multiplicity: number;
876
839
  }
877
840
 
878
- export interface SignMessageRequest {
879
- message: string;
880
- compact: boolean;
841
+ export interface ClaimDepositRequest {
842
+ txid: string;
843
+ vout: number;
844
+ maxFee?: MaxFee;
881
845
  }
882
846
 
883
- export interface SendPaymentRequest {
884
- prepareResponse: PrepareSendPaymentResponse;
885
- options?: SendPaymentOptions;
886
- idempotencyKey?: string;
847
+ export interface CheckMessageResponse {
848
+ isValid: boolean;
887
849
  }
888
850
 
889
- export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
890
-
891
- export interface SendOnchainSpeedFeeQuote {
892
- userFeeSat: number;
893
- l1BroadcastFeeSat: number;
894
- }
851
+ export interface ListUnclaimedDepositsRequest {}
895
852
 
896
- export interface SendPaymentResponse {
853
+ export interface ClaimDepositResponse {
897
854
  payment: Payment;
898
855
  }
899
856
 
900
- export interface ConnectRequest {
901
- config: Config;
902
- seed: Seed;
903
- storageDir: string;
904
- }
857
+ export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" } | { type: "autoConversion" };
905
858
 
906
- export interface RegisterWebhookResponse {
907
- webhookId: string;
859
+ export interface LnurlErrorDetails {
860
+ reason: string;
908
861
  }
909
862
 
910
- export interface RefundDepositResponse {
911
- txId: string;
912
- txHex: string;
863
+ export interface SparkSspConfig {
864
+ baseUrl: string;
865
+ identityPublicKey: string;
866
+ schemaEndpoint?: string;
913
867
  }
914
868
 
915
- export interface Bolt12OfferDetails {
916
- absoluteExpiry?: number;
917
- chains: string[];
918
- description?: string;
919
- issuer?: string;
920
- minAmount?: Amount;
921
- offer: Bolt12Offer;
922
- paths: Bolt12OfferBlindedPath[];
923
- signingPubkey?: string;
869
+ export type Network = "mainnet" | "regtest";
870
+
871
+ export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
872
+
873
+ export interface Symbol {
874
+ grapheme?: string;
875
+ template?: string;
876
+ rtl?: boolean;
877
+ position?: number;
924
878
  }
925
879
 
926
- export interface PaymentRequestSource {
927
- bip21Uri?: string;
928
- bip353Address?: string;
880
+ export interface CheckMessageRequest {
881
+ message: string;
882
+ pubkey: string;
883
+ signature: string;
929
884
  }
930
885
 
931
- export interface LnurlWithdrawResponse {
932
- paymentRequest: string;
933
- payment?: Payment;
886
+ export interface RecordId {
887
+ type: string;
888
+ dataId: string;
934
889
  }
935
890
 
936
- export interface ConversionInfo {
937
- poolId: string;
938
- conversionId: string;
939
- status: ConversionStatus;
940
- fee?: string;
941
- purpose?: ConversionPurpose;
942
- amountAdjustment?: AmountAdjustmentReason;
891
+ export interface PrepareSendPaymentResponse {
892
+ paymentMethod: SendPaymentMethod;
893
+ amount: bigint;
894
+ tokenIdentifier?: string;
895
+ conversionEstimate?: ConversionEstimate;
896
+ feePolicy: FeePolicy;
943
897
  }
944
898
 
945
- export interface UpdateContactRequest {
946
- id: string;
947
- name: string;
948
- paymentIdentifier: string;
899
+ export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
900
+
901
+ export interface CheckLightningAddressRequest {
902
+ username: string;
949
903
  }
950
904
 
951
- export interface OptimizationConfig {
952
- autoEnabled: boolean;
953
- multiplicity: number;
905
+ export interface Bolt12Invoice {
906
+ invoice: string;
907
+ source: PaymentRequestSource;
954
908
  }
955
909
 
956
- export interface LnurlWithdrawInfo {
957
- withdrawUrl: string;
910
+ export interface Bip21Details {
911
+ amountSat?: number;
912
+ assetId?: string;
913
+ uri: string;
914
+ extras: Bip21Extra[];
915
+ label?: string;
916
+ message?: string;
917
+ paymentMethods: InputType[];
958
918
  }
959
919
 
960
- export interface SparkAddressDetails {
961
- address: string;
962
- identityPublicKey: string;
963
- network: BitcoinNetwork;
964
- source: PaymentRequestSource;
920
+ export interface LocaleOverrides {
921
+ locale: string;
922
+ spacing?: number;
923
+ symbol: Symbol;
965
924
  }
966
925
 
967
- export interface Rate {
968
- coin: string;
969
- value: number;
926
+ export interface DepositInfo {
927
+ txid: string;
928
+ vout: number;
929
+ amountSats: number;
930
+ isMature: boolean;
931
+ refundTx?: string;
932
+ refundTxId?: string;
933
+ claimError?: DepositClaimError;
970
934
  }
971
935
 
972
- export interface ClaimHtlcPaymentResponse {
973
- payment: Payment;
936
+ export interface SendPaymentRequest {
937
+ prepareResponse: PrepareSendPaymentResponse;
938
+ options?: SendPaymentOptions;
939
+ idempotencyKey?: string;
974
940
  }
975
941
 
976
- export interface Bolt12OfferBlindedPath {
977
- blindedHops: string[];
942
+ export interface Webhook {
943
+ id: string;
944
+ url: string;
945
+ eventTypes: WebhookEventType[];
978
946
  }
979
947
 
980
- export interface GetTokensMetadataResponse {
981
- tokensMetadata: TokenMetadata[];
948
+ export interface ListFiatRatesResponse {
949
+ rates: Rate[];
982
950
  }
983
951
 
984
- export interface GetInfoResponse {
985
- identityPubkey: string;
986
- balanceSats: number;
987
- tokenBalances: Map<string, TokenBalance>;
952
+ export interface TokenMetadata {
953
+ identifier: string;
954
+ issuerPublicKey: string;
955
+ name: string;
956
+ ticker: string;
957
+ decimals: number;
958
+ maxSupply: string;
959
+ isFreezable: boolean;
988
960
  }
989
961
 
990
- 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 };
962
+ export interface PrepareLnurlPayRequest {
963
+ amount: bigint;
964
+ comment?: string;
965
+ payRequest: LnurlPayRequestDetails;
966
+ validateSuccessActionUrl?: boolean;
967
+ tokenIdentifier?: string;
968
+ conversionOptions?: ConversionOptions;
969
+ feePolicy?: FeePolicy;
970
+ }
991
971
 
992
- 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 } | { type: "newDeposits"; newDeposits: DepositInfo[] };
972
+ export interface SyncWalletRequest {}
993
973
 
994
- export interface Record {
995
- id: RecordId;
996
- revision: number;
997
- schemaVersion: string;
998
- data: Map<string, string>;
974
+ export interface ProvisionalPayment {
975
+ paymentId: string;
976
+ amount: bigint;
977
+ details: ProvisionalPaymentDetails;
999
978
  }
1000
979
 
980
+ export interface SyncWalletResponse {}
981
+
1001
982
  export interface RecordChange {
1002
983
  id: RecordId;
1003
984
  schemaVersion: string;
@@ -1005,85 +986,104 @@ export interface RecordChange {
1005
986
  localRevision: number;
1006
987
  }
1007
988
 
1008
- export interface ReceivePaymentRequest {
1009
- paymentMethod: ReceivePaymentMethod;
989
+ export interface RegisterLightningAddressRequest {
990
+ username: string;
991
+ description?: string;
1010
992
  }
1011
993
 
1012
- export type OptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
994
+ export type TokenTransactionType = "transfer" | "mint" | "burn";
1013
995
 
1014
- export interface PrepareSendPaymentResponse {
1015
- paymentMethod: SendPaymentMethod;
1016
- amount: bigint;
1017
- tokenIdentifier?: string;
1018
- conversionEstimate?: ConversionEstimate;
1019
- feePolicy: FeePolicy;
996
+ export interface SparkConfig {
997
+ coordinatorIdentifier: string;
998
+ threshold: number;
999
+ signingOperators: SparkSigningOperator[];
1000
+ sspConfig: SparkSspConfig;
1001
+ expectedWithdrawBondSats: number;
1002
+ expectedWithdrawRelativeBlockLocktime: number;
1020
1003
  }
1021
1004
 
1022
- export interface Bolt12Invoice {
1023
- invoice: string;
1024
- source: PaymentRequestSource;
1005
+ export interface LnurlPayResponse {
1006
+ payment: Payment;
1007
+ successAction?: SuccessActionProcessed;
1025
1008
  }
1026
1009
 
1027
- export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
1028
-
1029
- export interface Credentials {
1030
- username: string;
1031
- password: string;
1010
+ export interface PrepareSendPaymentRequest {
1011
+ paymentRequest: string;
1012
+ amount?: bigint;
1013
+ tokenIdentifier?: string;
1014
+ conversionOptions?: ConversionOptions;
1015
+ feePolicy?: FeePolicy;
1032
1016
  }
1033
1017
 
1034
- export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
1035
-
1036
- export interface Bolt11InvoiceDetails {
1037
- amountMsat?: number;
1038
- description?: string;
1039
- descriptionHash?: string;
1040
- expiry: number;
1041
- invoice: Bolt11Invoice;
1042
- minFinalCltvExpiryDelta: number;
1043
- network: BitcoinNetwork;
1044
- payeePubkey: string;
1018
+ export interface SparkHtlcOptions {
1045
1019
  paymentHash: string;
1046
- paymentSecret: string;
1047
- routingHints: Bolt11RouteHint[];
1048
- timestamp: number;
1020
+ expiryDurationSecs: number;
1049
1021
  }
1050
1022
 
1051
- export interface SilentPaymentAddressDetails {
1052
- address: string;
1023
+ export interface SparkInvoiceDetails {
1024
+ invoice: string;
1025
+ identityPublicKey: string;
1053
1026
  network: BitcoinNetwork;
1054
- source: PaymentRequestSource;
1027
+ amount?: string;
1028
+ tokenIdentifier?: string;
1029
+ expiryTime?: number;
1030
+ description?: string;
1031
+ senderPublicKey?: string;
1055
1032
  }
1056
1033
 
1057
- export interface SyncWalletResponse {}
1034
+ export interface ExternalInputParser {
1035
+ providerId: string;
1036
+ inputRegex: string;
1037
+ parserUrl: string;
1038
+ }
1058
1039
 
1059
- export interface ClaimDepositRequest {
1060
- txid: string;
1061
- vout: number;
1062
- maxFee?: MaxFee;
1040
+ export interface ConversionOptions {
1041
+ conversionType: ConversionType;
1042
+ maxSlippageBps?: number;
1043
+ completionTimeoutSecs?: number;
1063
1044
  }
1064
1045
 
1065
- export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: string; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress"; newAddress?: boolean } | { type: "bolt11Invoice"; description: string; amountSats?: number; expirySecs?: number; paymentHash?: string };
1046
+ export interface LnurlWithdrawRequest {
1047
+ amountSats: number;
1048
+ withdrawRequest: LnurlWithdrawRequestDetails;
1049
+ completionTimeoutSecs?: number;
1050
+ }
1066
1051
 
1067
- export interface OptimizationProgress {
1068
- isRunning: boolean;
1069
- currentRound: number;
1070
- totalRounds: number;
1052
+ export interface Bolt12InvoiceRequestDetails {}
1053
+
1054
+ export type AmountAdjustmentReason = "flooredToMinLimit" | "increasedToAvoidDust";
1055
+
1056
+ export interface ConversionEstimate {
1057
+ options: ConversionOptions;
1058
+ amountIn: bigint;
1059
+ amountOut: bigint;
1060
+ fee: bigint;
1061
+ amountAdjustment?: AmountAdjustmentReason;
1071
1062
  }
1072
1063
 
1073
- 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 };
1064
+ export interface Record {
1065
+ id: RecordId;
1066
+ revision: number;
1067
+ schemaVersion: string;
1068
+ data: Map<string, string>;
1069
+ }
1074
1070
 
1075
- export interface SparkConfig {
1076
- coordinatorIdentifier: string;
1077
- threshold: number;
1078
- signingOperators: SparkSigningOperator[];
1079
- sspConfig: SparkSspConfig;
1080
- expectedWithdrawBondSats: number;
1081
- expectedWithdrawRelativeBlockLocktime: number;
1071
+ export interface GetTokensMetadataRequest {
1072
+ tokenIdentifiers: string[];
1082
1073
  }
1083
1074
 
1084
- export interface SparkHtlcOptions {
1085
- paymentHash: string;
1086
- expiryDurationSecs: number;
1075
+ export interface ListPaymentsResponse {
1076
+ payments: Payment[];
1077
+ }
1078
+
1079
+ export type WebhookEventType = { type: "lightningReceiveFinished" } | { type: "lightningSendFinished" } | { type: "coopExitFinished" } | { type: "staticDepositFinished" } | ({ type: "unknown" } & string);
1080
+
1081
+ export type PaymentStatus = "completed" | "pending" | "failed";
1082
+
1083
+ 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 };
1084
+
1085
+ export interface RegisterWebhookResponse {
1086
+ webhookId: string;
1087
1087
  }
1088
1088
 
1089
1089
  /**
@@ -1138,19 +1138,10 @@ export interface PasskeyPrfProvider {
1138
1138
  isPrfAvailable(): Promise<boolean>;
1139
1139
  }
1140
1140
 
1141
- export interface FreezeIssuerTokenResponse {
1142
- impactedOutputIds: string[];
1143
- impactedTokenAmount: bigint;
1144
- }
1145
-
1146
- export interface BurnIssuerTokenRequest {
1141
+ export interface MintIssuerTokenRequest {
1147
1142
  amount: bigint;
1148
1143
  }
1149
1144
 
1150
- export interface UnfreezeIssuerTokenRequest {
1151
- address: string;
1152
- }
1153
-
1154
1145
  export interface UnfreezeIssuerTokenResponse {
1155
1146
  impactedOutputIds: string[];
1156
1147
  impactedTokenAmount: bigint;
@@ -1168,10 +1159,19 @@ export interface FreezeIssuerTokenRequest {
1168
1159
  address: string;
1169
1160
  }
1170
1161
 
1171
- export interface MintIssuerTokenRequest {
1162
+ export interface FreezeIssuerTokenResponse {
1163
+ impactedOutputIds: string[];
1164
+ impactedTokenAmount: bigint;
1165
+ }
1166
+
1167
+ export interface BurnIssuerTokenRequest {
1172
1168
  amount: bigint;
1173
1169
  }
1174
1170
 
1171
+ export interface UnfreezeIssuerTokenRequest {
1172
+ address: string;
1173
+ }
1174
+
1175
1175
  export interface ExternalSigner {
1176
1176
  identityPublicKey(): PublicKeyBytes;
1177
1177
  derivePublicKey(path: string): Promise<PublicKeyBytes>;
@@ -1195,60 +1195,55 @@ export interface ExternalSigner {
1195
1195
  hmacSha256(message: Uint8Array, path: string): Promise<HashedMessageBytes>;
1196
1196
  }
1197
1197
 
1198
- export interface IdentifierCommitmentPair {
1199
- identifier: ExternalIdentifier;
1200
- commitment: ExternalSigningCommitments;
1198
+ export interface ExternalScalar {
1199
+ bytes: number[];
1201
1200
  }
1202
1201
 
1203
- export interface ExternalSignFrostRequest {
1204
- message: number[];
1205
- publicKey: number[];
1206
- secret: ExternalSecretSource;
1207
- verifyingKey: number[];
1208
- selfNonceCommitment: ExternalFrostCommitments;
1209
- statechainCommitments: IdentifierCommitmentPair[];
1210
- adaptorPublicKey?: number[];
1202
+ export interface RecoverableEcdsaSignatureBytes {
1203
+ bytes: number[];
1211
1204
  }
1212
1205
 
1213
- export interface EcdsaSignatureBytes {
1206
+ export type ExternalSecretToSplit = { type: "secretSource"; source: ExternalSecretSource } | { type: "preimage"; data: number[] };
1207
+
1208
+ export interface PublicKeyBytes {
1214
1209
  bytes: number[];
1215
1210
  }
1216
1211
 
1217
- export interface ExternalEncryptedSecret {
1218
- ciphertext: number[];
1212
+ export interface IdentifierCommitmentPair {
1213
+ identifier: ExternalIdentifier;
1214
+ commitment: ExternalSigningCommitments;
1219
1215
  }
1220
1216
 
1221
- export interface HashedMessageBytes {
1222
- bytes: number[];
1217
+ export interface ExternalSigningCommitments {
1218
+ hiding: number[];
1219
+ binding: number[];
1223
1220
  }
1224
1221
 
1225
- export interface RecoverableEcdsaSignatureBytes {
1226
- bytes: number[];
1222
+ export interface ExternalTreeNodeId {
1223
+ id: string;
1227
1224
  }
1228
1225
 
1229
- export interface MessageBytes {
1230
- bytes: number[];
1226
+ export interface IdentifierSignaturePair {
1227
+ identifier: ExternalIdentifier;
1228
+ signature: ExternalFrostSignatureShare;
1231
1229
  }
1232
1230
 
1233
- export interface ExternalFrostCommitments {
1234
- hidingCommitment: number[];
1235
- bindingCommitment: number[];
1236
- noncesCiphertext: number[];
1231
+ export interface ExternalEncryptedSecret {
1232
+ ciphertext: number[];
1237
1233
  }
1238
1234
 
1239
- export interface SchnorrSignatureBytes {
1235
+ export interface MessageBytes {
1240
1236
  bytes: number[];
1241
1237
  }
1242
1238
 
1239
+ export type ExternalSecretSource = { type: "derived"; nodeId: ExternalTreeNodeId } | { type: "encrypted"; key: ExternalEncryptedSecret };
1240
+
1243
1241
  export interface ExternalFrostSignature {
1244
1242
  bytes: number[];
1245
1243
  }
1246
1244
 
1247
- export type ExternalSecretToSplit = { type: "secretSource"; source: ExternalSecretSource } | { type: "preimage"; data: number[] };
1248
-
1249
- export interface IdentifierSignaturePair {
1250
- identifier: ExternalIdentifier;
1251
- signature: ExternalFrostSignatureShare;
1245
+ export interface EcdsaSignatureBytes {
1246
+ bytes: number[];
1252
1247
  }
1253
1248
 
1254
1249
  export interface ExternalAggregateFrostRequest {
@@ -1263,15 +1258,20 @@ export interface ExternalAggregateFrostRequest {
1263
1258
  adaptorPublicKey?: number[];
1264
1259
  }
1265
1260
 
1266
- export interface SecretBytes {
1267
- bytes: number[];
1261
+ export interface ExternalSignFrostRequest {
1262
+ message: number[];
1263
+ publicKey: number[];
1264
+ secret: ExternalSecretSource;
1265
+ verifyingKey: number[];
1266
+ selfNonceCommitment: ExternalFrostCommitments;
1267
+ statechainCommitments: IdentifierCommitmentPair[];
1268
+ adaptorPublicKey?: number[];
1268
1269
  }
1269
1270
 
1270
- export type ExternalSecretSource = { type: "derived"; nodeId: ExternalTreeNodeId } | { type: "encrypted"; key: ExternalEncryptedSecret };
1271
-
1272
- export interface ExternalSigningCommitments {
1273
- hiding: number[];
1274
- binding: number[];
1271
+ export interface ExternalFrostCommitments {
1272
+ hidingCommitment: number[];
1273
+ bindingCommitment: number[];
1274
+ noncesCiphertext: number[];
1275
1275
  }
1276
1276
 
1277
1277
  export interface ExternalVerifiableSecretShare {
@@ -1279,19 +1279,21 @@ export interface ExternalVerifiableSecretShare {
1279
1279
  proofs: number[][];
1280
1280
  }
1281
1281
 
1282
- export interface ExternalTreeNodeId {
1283
- id: string;
1282
+ export interface ExternalIdentifier {
1283
+ bytes: number[];
1284
1284
  }
1285
1285
 
1286
- export interface ExternalScalar {
1286
+ export interface HashedMessageBytes {
1287
1287
  bytes: number[];
1288
1288
  }
1289
1289
 
1290
- export interface PublicKeyBytes {
1291
- bytes: number[];
1290
+ export interface ExternalSecretShare {
1291
+ threshold: number;
1292
+ index: ExternalScalar;
1293
+ share: ExternalScalar;
1292
1294
  }
1293
1295
 
1294
- export interface ExternalIdentifier {
1296
+ export interface SecretBytes {
1295
1297
  bytes: number[];
1296
1298
  }
1297
1299
 
@@ -1304,10 +1306,8 @@ export interface IdentifierPublicKeyPair {
1304
1306
  publicKey: number[];
1305
1307
  }
1306
1308
 
1307
- export interface ExternalSecretShare {
1308
- threshold: number;
1309
- index: ExternalScalar;
1310
- share: ExternalScalar;
1309
+ export interface SchnorrSignatureBytes {
1310
+ bytes: number[];
1311
1311
  }
1312
1312
 
1313
1313
  /**