@breeztech/breez-sdk-spark 0.12.2 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +68 -69
  2. package/breez-sdk-spark.tgz +0 -0
  3. package/bundler/breez_sdk_spark_wasm.d.ts +734 -602
  4. package/bundler/breez_sdk_spark_wasm_bg.js +175 -78
  5. package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
  6. package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +8 -6
  7. package/bundler/storage/index.js +65 -43
  8. package/deno/breez_sdk_spark_wasm.d.ts +734 -602
  9. package/deno/breez_sdk_spark_wasm.js +165 -78
  10. package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
  11. package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +8 -6
  12. package/nodejs/breez_sdk_spark_wasm.d.ts +734 -602
  13. package/nodejs/breez_sdk_spark_wasm.js +175 -78
  14. package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
  15. package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +8 -6
  16. package/nodejs/index.js +16 -2
  17. package/nodejs/index.mjs +25 -0
  18. package/nodejs/package.json +3 -1
  19. package/nodejs/postgres-storage/index.cjs +42 -31
  20. package/nodejs/postgres-storage/migrations.cjs +24 -0
  21. package/nodejs/postgres-token-store/errors.cjs +13 -0
  22. package/nodejs/postgres-token-store/index.cjs +857 -0
  23. package/nodejs/postgres-token-store/migrations.cjs +163 -0
  24. package/nodejs/postgres-token-store/package.json +9 -0
  25. package/nodejs/postgres-tree-store/index.cjs +12 -2
  26. package/nodejs/storage/index.cjs +19 -28
  27. package/nodejs/storage/migrations.cjs +18 -0
  28. package/package.json +7 -2
  29. package/ssr/index.d.ts +2 -0
  30. package/ssr/index.js +126 -0
  31. package/web/breez_sdk_spark_wasm.d.ts +742 -608
  32. package/web/breez_sdk_spark_wasm.js +165 -78
  33. package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
  34. package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +8 -6
  35. package/web/storage/index.js +65 -43
@@ -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 defaultExternalSigner(mnemonic: string, passphrase: string | null | undefined, network: Network, key_set_config?: KeySetConfig | null): DefaultSigner;
14
+ export function initLogging(logger: Logger, filter?: string | null): Promise<void>;
15
+ export function connectWithSigner(config: Config, signer: ExternalSigner, storage_dir: string): Promise<BreezSdk>;
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 connectWithSigner(config: Config, signer: ExternalSigner, storage_dir: string): Promise<BreezSdk>;
19
22
  export function connect(request: ConnectRequest): Promise<BreezSdk>;
20
- export function defaultConfig(network: Network): Config;
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
  */
@@ -95,6 +95,77 @@ export interface PostgresStorageConfig {
95
95
  recycleTimeoutSecs: number;
96
96
  }
97
97
 
98
+
99
+ interface WasmTokenMetadata {
100
+ identifier: string;
101
+ issuerPublicKey: string;
102
+ name: string;
103
+ ticker: string;
104
+ decimals: number;
105
+ maxSupply: string;
106
+ isFreezable: boolean;
107
+ creationEntityPublicKey: string | null;
108
+ }
109
+
110
+ interface WasmTokenOutput {
111
+ id: string;
112
+ ownerPublicKey: string;
113
+ revocationCommitment: string;
114
+ withdrawBondSats: number;
115
+ withdrawRelativeBlockLocktime: number;
116
+ tokenPublicKey: string | null;
117
+ tokenIdentifier: string;
118
+ tokenAmount: string;
119
+ }
120
+
121
+ interface WasmTokenOutputWithPrevOut {
122
+ output: WasmTokenOutput;
123
+ prevTxHash: string;
124
+ prevTxVout: number;
125
+ }
126
+
127
+ interface WasmTokenOutputs {
128
+ metadata: WasmTokenMetadata;
129
+ outputs: WasmTokenOutputWithPrevOut[];
130
+ }
131
+
132
+ interface WasmTokenOutputsPerStatus {
133
+ metadata: WasmTokenMetadata;
134
+ available: WasmTokenOutputWithPrevOut[];
135
+ reservedForPayment: WasmTokenOutputWithPrevOut[];
136
+ reservedForSwap: WasmTokenOutputWithPrevOut[];
137
+ }
138
+
139
+ interface WasmTokenOutputsReservation {
140
+ id: string;
141
+ tokenOutputs: WasmTokenOutputs;
142
+ }
143
+
144
+ type WasmGetTokenOutputsFilter =
145
+ | { type: 'identifier'; identifier: string }
146
+ | { type: 'issuerPublicKey'; issuerPublicKey: string };
147
+
148
+ type WasmReservationTarget =
149
+ | { type: 'minTotalValue'; value: string }
150
+ | { type: 'maxOutputCount'; value: number };
151
+
152
+ export interface TokenStore {
153
+ setTokensOutputs: (tokenOutputs: WasmTokenOutputs[], refreshStartedAtMs: number) => Promise<void>;
154
+ listTokensOutputs: () => Promise<WasmTokenOutputsPerStatus[]>;
155
+ getTokenOutputs: (filter: WasmGetTokenOutputsFilter) => Promise<WasmTokenOutputsPerStatus>;
156
+ insertTokenOutputs: (tokenOutputs: WasmTokenOutputs) => Promise<void>;
157
+ reserveTokenOutputs: (
158
+ tokenIdentifier: string,
159
+ target: WasmReservationTarget,
160
+ purpose: string,
161
+ preferredOutputs: WasmTokenOutputWithPrevOut[] | null,
162
+ selectionStrategy: string | null
163
+ ) => Promise<WasmTokenOutputsReservation>;
164
+ cancelReservation: (id: string) => Promise<void>;
165
+ finalizeReservation: (id: string) => Promise<void>;
166
+ now: () => Promise<number>;
167
+ }
168
+
98
169
  export interface EventListener {
99
170
  onEvent: (e: SdkEvent) => void;
100
171
  }
@@ -127,13 +198,20 @@ export interface BitcoinChainService {
127
198
  recommendedFees(): Promise<RecommendedFees>;
128
199
  }
129
200
 
201
+ export type ChainApiType = "esplora" | "mempoolSpace";
202
+
130
203
  export interface TxStatus {
131
204
  confirmed: boolean;
132
205
  blockHeight?: number;
133
206
  blockTime?: number;
134
207
  }
135
208
 
136
- export type ChainApiType = "esplora" | "mempoolSpace";
209
+ export interface Utxo {
210
+ txid: string;
211
+ vout: number;
212
+ value: number;
213
+ status: TxStatus;
214
+ }
137
215
 
138
216
  export interface RecommendedFees {
139
217
  fastestFee: number;
@@ -143,28 +221,66 @@ export interface RecommendedFees {
143
221
  minimumFee: number;
144
222
  }
145
223
 
146
- export interface Utxo {
147
- txid: string;
148
- vout: number;
149
- value: number;
150
- status: TxStatus;
151
- }
152
-
153
224
  export interface PaymentObserver {
154
225
  beforeSend: (payments: ProvisionalPayment[]) => Promise<void>;
155
226
  }
156
227
 
157
- export interface BitcoinAddressDetails {
158
- address: string;
159
- network: BitcoinNetwork;
160
- source: PaymentRequestSource;
228
+ export interface Bip21Details {
229
+ amountSat?: number;
230
+ assetId?: string;
231
+ uri: string;
232
+ extras: Bip21Extra[];
233
+ label?: string;
234
+ message?: string;
235
+ paymentMethods: InputType[];
161
236
  }
162
237
 
163
- export interface GetPaymentResponse {
164
- payment: Payment;
238
+ export interface Bolt12InvoiceDetails {
239
+ amountMsat: number;
240
+ invoice: Bolt12Invoice;
165
241
  }
166
242
 
167
- export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
243
+ export interface KeySetConfig {
244
+ keySetType: KeySetType;
245
+ useAddressIndex: boolean;
246
+ accountNumber?: number;
247
+ }
248
+
249
+ export interface SignMessageRequest {
250
+ message: string;
251
+ compact: boolean;
252
+ }
253
+
254
+ 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 };
255
+
256
+ export interface ConversionStep {
257
+ paymentId: string;
258
+ amount: bigint;
259
+ fee: bigint;
260
+ method: PaymentMethod;
261
+ tokenMetadata?: TokenMetadata;
262
+ amountAdjustment?: AmountAdjustmentReason;
263
+ }
264
+
265
+ export interface SyncWalletResponse {}
266
+
267
+ 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 };
268
+
269
+ export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
270
+
271
+ export interface GetPaymentRequest {
272
+ paymentId: string;
273
+ }
274
+
275
+ export interface LnurlWithdrawInfo {
276
+ withdrawUrl: string;
277
+ }
278
+
279
+ export interface ConversionOptions {
280
+ conversionType: ConversionType;
281
+ maxSlippageBps?: number;
282
+ completionTimeoutSecs?: number;
283
+ }
168
284
 
169
285
  export interface ListPaymentsRequest {
170
286
  typeFilter?: PaymentType[];
@@ -178,66 +294,82 @@ export interface ListPaymentsRequest {
178
294
  sortAscending?: boolean;
179
295
  }
180
296
 
181
- export interface ReceivePaymentResponse {
182
- paymentRequest: string;
183
- fee: bigint;
297
+ export interface SignMessageResponse {
298
+ pubkey: string;
299
+ signature: string;
184
300
  }
185
301
 
186
- export type Network = "mainnet" | "regtest";
302
+ export interface ListUnclaimedDepositsRequest {}
187
303
 
188
- export interface PrepareLnurlPayRequest {
189
- amountSats: number;
190
- comment?: string;
191
- payRequest: LnurlPayRequestDetails;
192
- validateSuccessActionUrl?: boolean;
193
- conversionOptions?: ConversionOptions;
194
- feePolicy?: FeePolicy;
304
+ export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
305
+
306
+ export interface LocalizedName {
307
+ locale: string;
308
+ name: string;
195
309
  }
196
310
 
197
- export interface ConversionOptions {
198
- conversionType: ConversionType;
199
- maxSlippageBps?: number;
200
- completionTimeoutSecs?: number;
311
+ export interface LnurlPayRequest {
312
+ prepareResponse: PrepareLnurlPayResponse;
313
+ idempotencyKey?: string;
201
314
  }
202
315
 
203
- export interface UpdateContactRequest {
204
- id: string;
316
+ export interface LnurlReceiveMetadata {
317
+ nostrZapRequest?: string;
318
+ nostrZapReceipt?: string;
319
+ senderComment?: string;
320
+ }
321
+
322
+ export interface TokenMetadata {
323
+ identifier: string;
324
+ issuerPublicKey: string;
205
325
  name: string;
206
- paymentIdentifier: string;
326
+ ticker: string;
327
+ decimals: number;
328
+ maxSupply: string;
329
+ isFreezable: boolean;
207
330
  }
208
331
 
209
- export interface GetInfoRequest {
210
- ensureSynced?: boolean;
332
+ export interface GetTokensMetadataRequest {
333
+ tokenIdentifiers: string[];
211
334
  }
212
335
 
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 };
336
+ export interface LnurlWithdrawRequest {
337
+ amountSats: number;
338
+ withdrawRequest: LnurlWithdrawRequestDetails;
339
+ completionTimeoutSecs?: number;
340
+ }
214
341
 
215
- export interface RecordId {
216
- type: string;
217
- dataId: string;
342
+ export interface Bolt12OfferBlindedPath {
343
+ blindedHops: string[];
218
344
  }
219
345
 
220
- export interface CheckMessageResponse {
221
- isValid: boolean;
346
+ export interface MessageSuccessActionData {
347
+ message: string;
222
348
  }
223
349
 
224
- export type PaymentStatus = "completed" | "pending" | "failed";
350
+ export interface ListUnclaimedDepositsResponse {
351
+ deposits: DepositInfo[];
352
+ }
225
353
 
226
- export interface BuyBitcoinRequest {
227
- lockedAmountSat?: number;
228
- redirectUrl?: string;
354
+ export interface UpdateUserSettingsRequest {
355
+ sparkPrivateModeEnabled?: boolean;
356
+ stableBalanceActiveLabel?: StableBalanceActiveLabel;
229
357
  }
230
358
 
231
- export interface RefundDepositResponse {
232
- txId: string;
233
- txHex: string;
359
+ export interface ExternalInputParser {
360
+ providerId: string;
361
+ inputRegex: string;
362
+ parserUrl: string;
234
363
  }
235
364
 
236
- export type FeePolicy = "feesExcluded" | "feesIncluded";
365
+ export interface SparkInvoicePaymentDetails {
366
+ description?: string;
367
+ invoice: string;
368
+ }
237
369
 
238
- export interface FiatCurrency {
239
- id: string;
240
- info: CurrencyInfo;
370
+ export interface RecordId {
371
+ type: string;
372
+ dataId: string;
241
373
  }
242
374
 
243
375
  export interface PrepareSendPaymentResponse {
@@ -248,67 +380,86 @@ export interface PrepareSendPaymentResponse {
248
380
  feePolicy: FeePolicy;
249
381
  }
250
382
 
251
- export interface StableBalanceConfig {
252
- tokenIdentifier: string;
253
- thresholdSats?: number;
254
- maxSlippageBps?: number;
255
- reservedSats?: number;
383
+ export interface CurrencyInfo {
384
+ name: string;
385
+ fractionSize: number;
386
+ spacing?: number;
387
+ symbol?: Symbol;
388
+ uniqSymbol?: Symbol;
389
+ localizedName: LocalizedName[];
390
+ localeOverrides: LocaleOverrides[];
256
391
  }
257
392
 
258
- export interface Payment {
259
- id: string;
260
- paymentType: PaymentType;
261
- status: PaymentStatus;
262
- amount: bigint;
263
- fees: bigint;
264
- timestamp: number;
265
- method: PaymentMethod;
266
- details?: PaymentDetails;
267
- conversionDetails?: ConversionDetails;
393
+ export interface Rate {
394
+ coin: string;
395
+ value: number;
268
396
  }
269
397
 
270
- export interface ConversionInfo {
271
- poolId: string;
272
- conversionId: string;
273
- status: ConversionStatus;
274
- fee?: string;
275
- purpose?: ConversionPurpose;
398
+ export interface SparkConfig {
399
+ coordinatorIdentifier: string;
400
+ threshold: number;
401
+ signingOperators: SparkSigningOperator[];
402
+ sspConfig: SparkSspConfig;
403
+ expectedWithdrawBondSats: number;
404
+ expectedWithdrawRelativeBlockLocktime: number;
276
405
  }
277
406
 
278
- export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
407
+ export interface Webhook {
408
+ id: string;
409
+ url: string;
410
+ eventTypes: WebhookEventType[];
411
+ }
279
412
 
280
- export interface Bolt12Invoice {
281
- invoice: string;
282
- source: PaymentRequestSource;
413
+ export type AesSuccessActionDataResult = { type: "decrypted"; data: AesSuccessActionDataDecrypted } | { type: "errorStatus"; reason: string };
414
+
415
+ export interface LnurlWithdrawResponse {
416
+ paymentRequest: string;
417
+ payment?: Payment;
283
418
  }
284
419
 
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[];
420
+ export interface LnurlErrorDetails {
421
+ reason: string;
293
422
  }
294
423
 
295
- export type PaymentType = "send" | "receive";
424
+ export interface GetPaymentResponse {
425
+ payment: Payment;
426
+ }
296
427
 
297
- export interface GetTokensMetadataResponse {
298
- tokensMetadata: TokenMetadata[];
428
+ export interface LnurlPayResponse {
429
+ payment: Payment;
430
+ successAction?: SuccessActionProcessed;
299
431
  }
300
432
 
301
- export interface LightningAddressInfo {
302
- description: string;
303
- lightningAddress: string;
304
- lnurl: LnurlInfo;
305
- username: string;
433
+ export interface SparkHtlcDetails {
434
+ paymentHash: string;
435
+ preimage?: string;
436
+ expiryTime: number;
437
+ status: SparkHtlcStatus;
306
438
  }
307
439
 
308
- export interface UrlSuccessActionData {
309
- description: string;
310
- url: string;
311
- matchesCallbackDomain: boolean;
440
+ export interface SendPaymentRequest {
441
+ prepareResponse: PrepareSendPaymentResponse;
442
+ options?: SendPaymentOptions;
443
+ idempotencyKey?: string;
444
+ }
445
+
446
+ export interface ConnectRequest {
447
+ config: Config;
448
+ seed: Seed;
449
+ storageDir: string;
450
+ }
451
+
452
+ export interface ClaimHtlcPaymentRequest {
453
+ preimage: string;
454
+ }
455
+
456
+ export interface SendPaymentResponse {
457
+ payment: Payment;
458
+ }
459
+
460
+ export interface SendOnchainSpeedFeeQuote {
461
+ userFeeSat: number;
462
+ l1BroadcastFeeSat: number;
312
463
  }
313
464
 
314
465
  export interface ProvisionalPayment {
@@ -317,23 +468,23 @@ export interface ProvisionalPayment {
317
468
  details: ProvisionalPaymentDetails;
318
469
  }
319
470
 
320
- export interface Record {
321
- id: RecordId;
322
- revision: number;
323
- schemaVersion: string;
324
- data: Map<string, string>;
471
+ export interface RefundDepositRequest {
472
+ txid: string;
473
+ vout: number;
474
+ destinationAddress: string;
475
+ fee: Fee;
325
476
  }
326
477
 
327
- export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
328
-
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[]);
478
+ export interface UpdateContactRequest {
479
+ id: string;
480
+ name: string;
481
+ paymentIdentifier: string;
482
+ }
332
483
 
333
- export interface GetInfoResponse {
334
- identityPubkey: string;
335
- balanceSats: number;
336
- tokenBalances: Map<string, TokenBalance>;
484
+ export interface ClaimDepositRequest {
485
+ txid: string;
486
+ vout: number;
487
+ maxFee?: MaxFee;
337
488
  }
338
489
 
339
490
  export interface OutgoingChange {
@@ -341,71 +492,51 @@ export interface OutgoingChange {
341
492
  parent?: Record;
342
493
  }
343
494
 
344
- export interface AesSuccessActionDataDecrypted {
345
- description: string;
346
- plaintext: string;
347
- }
348
-
349
- export interface FetchConversionLimitsResponse {
350
- minFromAmount?: bigint;
351
- minToAmount?: bigint;
352
- }
353
-
354
- export interface LnurlInfo {
355
- url: string;
356
- bech32: string;
495
+ export interface FetchConversionLimitsRequest {
496
+ conversionType: ConversionType;
497
+ tokenIdentifier?: string;
357
498
  }
358
499
 
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;
500
+ export interface LightningAddressDetails {
501
+ address: string;
502
+ payRequest: LnurlPayRequestDetails;
368
503
  }
369
504
 
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;
379
- }
505
+ export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
380
506
 
381
- export interface ConnectRequest {
382
- config: Config;
383
- seed: Seed;
384
- storageDir: string;
507
+ export interface Symbol {
508
+ grapheme?: string;
509
+ template?: string;
510
+ rtl?: boolean;
511
+ position?: number;
385
512
  }
386
513
 
387
- export interface LnurlWithdrawResponse {
388
- paymentRequest: string;
389
- payment?: Payment;
514
+ export interface ClaimHtlcPaymentResponse {
515
+ payment: Payment;
390
516
  }
391
517
 
392
- export interface SendPaymentResponse {
393
- payment: Payment;
518
+ export interface UrlSuccessActionData {
519
+ description: string;
520
+ url: string;
521
+ matchesCallbackDomain: boolean;
394
522
  }
395
523
 
396
- export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" | "major";
524
+ 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);
397
525
 
398
- export interface Bolt11RouteHint {
399
- hops: Bolt11RouteHintHop[];
400
- }
526
+ 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[] };
401
527
 
402
- export interface CheckLightningAddressRequest {
403
- username: string;
528
+ export interface RegisterWebhookRequest {
529
+ url: string;
530
+ secret: string;
531
+ eventTypes: WebhookEventType[];
404
532
  }
405
533
 
406
- export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
534
+ export type WebhookEventType = { type: "lightningReceiveFinished" } | { type: "lightningSendFinished" } | { type: "coopExitFinished" } | { type: "staticDepositFinished" } | ({ type: "unknown" } & string);
407
535
 
408
- export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
536
+ export interface PaymentRequestSource {
537
+ bip21Uri?: string;
538
+ bip353Address?: string;
539
+ }
409
540
 
410
541
  export interface SparkInvoiceDetails {
411
542
  invoice: string;
@@ -418,54 +549,113 @@ export interface SparkInvoiceDetails {
418
549
  senderPublicKey?: string;
419
550
  }
420
551
 
421
- export interface KeySetConfig {
422
- keySetType: KeySetType;
423
- useAddressIndex: boolean;
424
- accountNumber?: number;
552
+ export interface ConversionInfo {
553
+ poolId: string;
554
+ conversionId: string;
555
+ status: ConversionStatus;
556
+ fee?: string;
557
+ purpose?: ConversionPurpose;
558
+ amountAdjustment?: AmountAdjustmentReason;
425
559
  }
426
560
 
427
- export interface AesSuccessActionData {
428
- description: string;
429
- ciphertext: string;
430
- iv: string;
561
+ export interface RefundDepositResponse {
562
+ txId: string;
563
+ txHex: string;
431
564
  }
432
565
 
433
- export interface SyncWalletResponse {}
566
+ export interface LnurlInfo {
567
+ url: string;
568
+ bech32: string;
569
+ }
434
570
 
435
- export interface GetPaymentRequest {
436
- paymentId: string;
571
+ export interface PaymentMetadata {
572
+ parentPaymentId?: string;
573
+ lnurlPayInfo?: LnurlPayInfo;
574
+ lnurlWithdrawInfo?: LnurlWithdrawInfo;
575
+ lnurlDescription?: string;
576
+ conversionInfo?: ConversionInfo;
577
+ conversionStatus?: ConversionStatus;
437
578
  }
438
579
 
439
- export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
580
+ export interface ConversionEstimate {
581
+ options: ConversionOptions;
582
+ amountIn: bigint;
583
+ amountOut: bigint;
584
+ fee: bigint;
585
+ amountAdjustment?: AmountAdjustmentReason;
586
+ }
440
587
 
441
- export interface ListFiatRatesResponse {
442
- rates: Rate[];
588
+ export interface OptimizationConfig {
589
+ autoEnabled: boolean;
590
+ multiplicity: number;
443
591
  }
444
592
 
445
- export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
593
+ export interface SyncWalletRequest {}
594
+
595
+ export interface AddContactRequest {
596
+ name: string;
597
+ paymentIdentifier: string;
598
+ }
599
+
600
+ export type OptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
601
+
602
+ export type FeePolicy = "feesExcluded" | "feesIncluded";
603
+
604
+ export interface CheckMessageRequest {
605
+ message: string;
606
+ pubkey: string;
607
+ signature: string;
608
+ }
446
609
 
447
610
  export interface Credentials {
448
611
  username: string;
449
612
  password: string;
450
613
  }
451
614
 
452
- export interface SignMessageRequest {
453
- message: string;
454
- compact: boolean;
615
+ export interface ClaimDepositResponse {
616
+ payment: Payment;
455
617
  }
456
618
 
457
- export interface SparkHtlcDetails {
458
- paymentHash: string;
459
- preimage?: string;
460
- expiryTime: number;
461
- status: SparkHtlcStatus;
619
+ 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 };
620
+
621
+ export interface UserSettings {
622
+ sparkPrivateModeEnabled: boolean;
623
+ stableBalanceActiveLabel?: string;
462
624
  }
463
625
 
464
- export interface LnurlPayRequest {
465
- prepareResponse: PrepareLnurlPayResponse;
466
- idempotencyKey?: string;
626
+ export interface GetInfoRequest {
627
+ ensureSynced?: boolean;
628
+ }
629
+
630
+ export interface LightningAddressInfo {
631
+ description: string;
632
+ lightningAddress: string;
633
+ lnurl: LnurlInfo;
634
+ username: string;
635
+ }
636
+
637
+ export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
638
+
639
+ export interface PrepareLnurlPayResponse {
640
+ amountSats: number;
641
+ comment?: string;
642
+ payRequest: LnurlPayRequestDetails;
643
+ feeSats: number;
644
+ invoiceDetails: Bolt11InvoiceDetails;
645
+ successAction?: SuccessAction;
646
+ conversionEstimate?: ConversionEstimate;
647
+ feePolicy: FeePolicy;
648
+ }
649
+
650
+ export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
651
+
652
+ export interface StableBalanceToken {
653
+ label: string;
654
+ tokenIdentifier: string;
467
655
  }
468
656
 
657
+ export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
658
+
469
659
  export interface Bolt11InvoiceDetails {
470
660
  amountMsat?: number;
471
661
  description?: string;
@@ -481,53 +671,28 @@ export interface Bolt11InvoiceDetails {
481
671
  timestamp: number;
482
672
  }
483
673
 
484
- export interface PaymentRequestSource {
485
- bip21Uri?: string;
486
- bip353Address?: string;
674
+ export interface PrepareLnurlPayRequest {
675
+ amount: bigint;
676
+ comment?: string;
677
+ payRequest: LnurlPayRequestDetails;
678
+ validateSuccessActionUrl?: boolean;
679
+ tokenIdentifier?: string;
680
+ conversionOptions?: ConversionOptions;
681
+ feePolicy?: FeePolicy;
487
682
  }
488
683
 
489
- export interface LocalizedName {
490
- locale: string;
491
- name: string;
492
- }
493
-
494
- export interface Symbol {
495
- grapheme?: string;
496
- template?: string;
497
- rtl?: boolean;
498
- position?: number;
499
- }
500
-
501
- export interface LightningAddressDetails {
502
- address: string;
503
- payRequest: LnurlPayRequestDetails;
504
- }
505
-
506
- export interface RecordChange {
507
- id: RecordId;
508
- schemaVersion: string;
509
- updatedFields: Map<string, string>;
510
- localRevision: number;
511
- }
512
-
513
- export interface Bolt11Invoice {
514
- bolt11: string;
515
- source: PaymentRequestSource;
516
- }
684
+ export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
517
685
 
518
- export interface ClaimHtlcPaymentRequest {
519
- preimage: string;
686
+ export interface RegisterLightningAddressRequest {
687
+ username: string;
688
+ description?: string;
520
689
  }
521
690
 
522
- export interface GetTokensMetadataRequest {
523
- tokenIdentifiers: string[];
691
+ export interface UnregisterWebhookRequest {
692
+ webhookId: string;
524
693
  }
525
694
 
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
-
528
- export interface LnurlErrorDetails {
529
- reason: string;
530
- }
695
+ export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
531
696
 
532
697
  export interface SparkAddressDetails {
533
698
  address: string;
@@ -536,132 +701,125 @@ export interface SparkAddressDetails {
536
701
  source: PaymentRequestSource;
537
702
  }
538
703
 
539
- export interface ReceivePaymentRequest {
540
- paymentMethod: ReceivePaymentMethod;
704
+ export interface CheckMessageResponse {
705
+ isValid: boolean;
541
706
  }
542
707
 
543
- export interface SendOnchainSpeedFeeQuote {
544
- userFeeSat: number;
545
- l1BroadcastFeeSat: number;
708
+ export interface ConversionDetails {
709
+ status: ConversionStatus;
710
+ from?: ConversionStep;
711
+ to?: ConversionStep;
546
712
  }
547
713
 
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;
714
+ export interface Bolt12OfferDetails {
715
+ absoluteExpiry?: number;
716
+ chains: string[];
717
+ description?: string;
718
+ issuer?: string;
719
+ minAmount?: Amount;
720
+ offer: Bolt12Offer;
721
+ paths: Bolt12OfferBlindedPath[];
722
+ signingPubkey?: string;
556
723
  }
557
724
 
558
- export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
725
+ export type StableBalanceActiveLabel = { type: "set"; label: string } | { type: "unset" };
559
726
 
560
- export interface ConversionDetails {
561
- from: ConversionStep;
562
- to: ConversionStep;
563
- }
564
-
565
- export interface ConversionEstimate {
566
- options: ConversionOptions;
727
+ export interface Payment {
728
+ id: string;
729
+ paymentType: PaymentType;
730
+ status: PaymentStatus;
567
731
  amount: bigint;
568
- fee: bigint;
732
+ fees: bigint;
733
+ timestamp: number;
734
+ method: PaymentMethod;
735
+ details?: PaymentDetails;
736
+ conversionDetails?: ConversionDetails;
569
737
  }
570
738
 
571
- export interface PrepareSendPaymentRequest {
572
- paymentRequest: string;
573
- amount?: bigint;
574
- tokenIdentifier?: string;
575
- conversionOptions?: ConversionOptions;
576
- feePolicy?: FeePolicy;
577
- }
739
+ export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
578
740
 
579
- export interface ClaimDepositResponse {
580
- payment: Payment;
741
+ export interface OptimizationProgress {
742
+ isRunning: boolean;
743
+ currentRound: number;
744
+ totalRounds: number;
581
745
  }
582
746
 
583
- export interface RefundDepositRequest {
584
- txid: string;
585
- vout: number;
586
- destinationAddress: string;
587
- fee: Fee;
747
+ export interface FetchConversionLimitsResponse {
748
+ minFromAmount?: bigint;
749
+ minToAmount?: bigint;
588
750
  }
589
751
 
590
- export interface ListFiatCurrenciesResponse {
591
- currencies: FiatCurrency[];
592
- }
752
+ 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 };
593
753
 
594
- export interface OptimizationConfig {
595
- autoEnabled: boolean;
596
- multiplicity: number;
597
- }
754
+ export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
598
755
 
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;
756
+ export interface SparkSspConfig {
757
+ baseUrl: string;
758
+ identityPublicKey: string;
759
+ schemaEndpoint?: string;
609
760
  }
610
761
 
611
- export interface LogEntry {
612
- line: string;
613
- level: string;
762
+ export interface AesSuccessActionData {
763
+ description: string;
764
+ ciphertext: string;
765
+ iv: string;
614
766
  }
615
767
 
616
- export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
768
+ export type BuyBitcoinRequest = { type: "moonpay"; lockedAmountSat?: number; redirectUrl?: string } | { type: "cashApp"; amountSats?: number };
617
769
 
618
- export interface ConversionStep {
619
- paymentId: string;
620
- amount: bigint;
621
- fee: bigint;
622
- method: PaymentMethod;
623
- tokenMetadata?: TokenMetadata;
624
- }
770
+ export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
625
771
 
626
- export interface Bolt12OfferBlindedPath {
627
- blindedHops: string[];
772
+ export interface SparkStatus {
773
+ status: ServiceStatus;
774
+ lastUpdated: number;
628
775
  }
629
776
 
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 };
777
+ export type TokenTransactionType = "transfer" | "mint" | "burn";
631
778
 
632
- export interface LnurlWithdrawRequest {
633
- amountSats: number;
634
- withdrawRequest: LnurlWithdrawRequestDetails;
635
- completionTimeoutSecs?: number;
779
+ export interface LnurlPayRequestDetails {
780
+ callback: string;
781
+ minSendable: number;
782
+ maxSendable: number;
783
+ metadataStr: string;
784
+ commentAllowed: number;
785
+ domain: string;
786
+ url: string;
787
+ address?: string;
788
+ allowsNostr?: boolean;
789
+ nostrPubkey?: string;
636
790
  }
637
791
 
638
- export interface ClaimDepositRequest {
639
- txid: string;
640
- vout: number;
641
- maxFee?: MaxFee;
792
+ export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
793
+
794
+ export interface TokenBalance {
795
+ balance: bigint;
796
+ tokenMetadata: TokenMetadata;
642
797
  }
643
798
 
644
- export interface Rate {
645
- coin: string;
646
- value: number;
799
+ export interface ReceivePaymentRequest {
800
+ paymentMethod: ReceivePaymentMethod;
647
801
  }
648
802
 
649
- export interface Bolt12InvoiceDetails {
650
- amountMsat: number;
651
- invoice: Bolt12Invoice;
803
+ export type StoragePaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
804
+
805
+ export interface Bolt11Invoice {
806
+ bolt11: string;
807
+ source: PaymentRequestSource;
652
808
  }
653
809
 
654
- export interface ListPaymentsResponse {
655
- payments: Payment[];
810
+ export interface LnurlWithdrawRequestDetails {
811
+ callback: string;
812
+ k1: string;
813
+ defaultDescription: string;
814
+ minWithdrawable: number;
815
+ maxWithdrawable: number;
656
816
  }
657
817
 
658
- export interface LnurlPayInfo {
659
- lnAddress?: string;
660
- comment?: string;
661
- domain?: string;
662
- metadata?: string;
663
- processedSuccessAction?: SuccessActionProcessed;
664
- rawSuccessAction?: SuccessAction;
818
+ export interface SparkSigningOperator {
819
+ id: number;
820
+ identifier: string;
821
+ address: string;
822
+ identityPublicKey: string;
665
823
  }
666
824
 
667
825
  export interface IncomingChange {
@@ -669,292 +827,264 @@ export interface IncomingChange {
669
827
  oldState?: Record;
670
828
  }
671
829
 
672
- export interface UserSettings {
673
- sparkPrivateModeEnabled: boolean;
674
- }
675
-
676
- export interface DepositInfo {
677
- txid: string;
678
- vout: number;
679
- amountSats: number;
680
- refundTx?: string;
681
- refundTxId?: string;
682
- claimError?: DepositClaimError;
683
- }
830
+ export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
684
831
 
685
- export interface UpdateUserSettingsRequest {
686
- sparkPrivateModeEnabled?: boolean;
832
+ export interface ReceivePaymentResponse {
833
+ paymentRequest: string;
834
+ fee: bigint;
687
835
  }
688
836
 
689
- export interface Config {
690
- apiKey?: string;
691
- network: Network;
692
- syncIntervalSecs: number;
693
- maxDepositClaimFee?: MaxFee;
694
- lnurlDomain?: string;
695
- preferSparkOverLightning: boolean;
696
- externalInputParsers?: ExternalInputParser[];
697
- useDefaultExternalInputParsers: boolean;
698
- realTimeSyncServerUrl?: string;
699
- privateEnabledDefault: boolean;
700
- optimizationConfig: OptimizationConfig;
701
- stableBalanceConfig?: StableBalanceConfig;
702
- /**
703
- * Maximum number of concurrent transfer claims.
704
- *
705
- * Controls how many pending Spark transfers can be claimed in parallel.
706
- * Default is 4. Increase for server environments with high incoming
707
- * payment volume to improve throughput.
708
- */
709
- maxConcurrentClaims: number;
710
- supportLnurlVerify: boolean;
837
+ export interface BitcoinAddressDetails {
838
+ address: string;
839
+ network: BitcoinNetwork;
840
+ source: PaymentRequestSource;
711
841
  }
712
842
 
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;
843
+ export interface ListFiatCurrenciesResponse {
844
+ currencies: FiatCurrency[];
721
845
  }
722
846
 
723
- export interface CheckMessageRequest {
724
- message: string;
725
- pubkey: string;
726
- signature: string;
847
+ export interface RecordChange {
848
+ id: RecordId;
849
+ schemaVersion: string;
850
+ updatedFields: Map<string, string>;
851
+ localRevision: number;
727
852
  }
728
853
 
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 };
730
-
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;
854
+ export interface Bolt12Offer {
855
+ offer: string;
856
+ source: PaymentRequestSource;
742
857
  }
743
858
 
744
- export interface OptimizationProgress {
745
- isRunning: boolean;
746
- currentRound: number;
747
- totalRounds: number;
859
+ export interface UnversionedRecordChange {
860
+ id: RecordId;
861
+ schemaVersion: string;
862
+ updatedFields: Map<string, string>;
748
863
  }
749
864
 
750
- export interface LnurlAuthRequestDetails {
751
- k1: string;
752
- action?: string;
753
- domain: string;
754
- url: string;
755
- }
865
+ export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
756
866
 
757
- export interface PaymentMetadata {
758
- parentPaymentId?: string;
759
- lnurlPayInfo?: LnurlPayInfo;
760
- lnurlWithdrawInfo?: LnurlWithdrawInfo;
761
- lnurlDescription?: string;
762
- conversionInfo?: ConversionInfo;
763
- }
867
+ export type AmountAdjustmentReason = "flooredToMinLimit" | "increasedToAvoidDust";
764
868
 
765
- export interface LnurlWithdrawRequestDetails {
766
- callback: string;
767
- k1: string;
768
- defaultDescription: string;
769
- minWithdrawable: number;
770
- maxWithdrawable: number;
869
+ export interface LnurlPayInfo {
870
+ lnAddress?: string;
871
+ comment?: string;
872
+ domain?: string;
873
+ metadata?: string;
874
+ processedSuccessAction?: SuccessActionProcessed;
875
+ rawSuccessAction?: SuccessAction;
771
876
  }
772
877
 
773
- export type OptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
774
-
775
- export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
878
+ export type Network = "mainnet" | "regtest";
776
879
 
777
- export interface Contact {
880
+ export interface SendOnchainFeeQuote {
778
881
  id: string;
779
- name: string;
780
- paymentIdentifier: string;
781
- createdAt: number;
782
- updatedAt: number;
783
- }
784
-
785
- export interface ListContactsRequest {
786
- offset?: number;
787
- limit?: number;
882
+ expiresAt: number;
883
+ speedFast: SendOnchainSpeedFeeQuote;
884
+ speedMedium: SendOnchainSpeedFeeQuote;
885
+ speedSlow: SendOnchainSpeedFeeQuote;
788
886
  }
789
887
 
790
- export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
888
+ export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
791
889
 
792
- export interface BuyBitcoinResponse {
793
- url: string;
890
+ export interface FiatCurrency {
891
+ id: string;
892
+ info: CurrencyInfo;
794
893
  }
795
894
 
796
- export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
797
-
798
895
  export interface Bip21Extra {
799
896
  key: string;
800
897
  value: string;
801
898
  }
802
899
 
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);
804
-
805
- export interface Bolt12Offer {
806
- offer: string;
900
+ export interface SilentPaymentAddressDetails {
901
+ address: string;
902
+ network: BitcoinNetwork;
807
903
  source: PaymentRequestSource;
808
904
  }
809
905
 
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 };
906
+ export type ConversionStatus = "pending" | "completed" | "failed" | "refundNeeded" | "refunded";
811
907
 
812
- export interface SendPaymentRequest {
813
- prepareResponse: PrepareSendPaymentResponse;
814
- options?: SendPaymentOptions;
815
- idempotencyKey?: string;
908
+ export interface BuyBitcoinResponse {
909
+ url: string;
816
910
  }
817
911
 
818
- export interface UnversionedRecordChange {
819
- id: RecordId;
820
- schemaVersion: string;
821
- updatedFields: Map<string, string>;
912
+ export interface AesSuccessActionDataDecrypted {
913
+ description: string;
914
+ plaintext: string;
822
915
  }
823
916
 
824
- export interface MessageSuccessActionData {
825
- message: string;
917
+ export interface CheckLightningAddressRequest {
918
+ username: string;
826
919
  }
827
920
 
828
- export interface Bolt12InvoiceRequestDetails {}
921
+ export interface GetTokensMetadataResponse {
922
+ tokensMetadata: TokenMetadata[];
923
+ }
829
924
 
830
- export interface TokenBalance {
831
- balance: bigint;
832
- tokenMetadata: TokenMetadata;
925
+ export interface ListContactsRequest {
926
+ offset?: number;
927
+ limit?: number;
833
928
  }
834
929
 
835
- export interface FetchConversionLimitsRequest {
836
- conversionType: ConversionType;
837
- tokenIdentifier?: string;
930
+ export interface Bolt11RouteHintHop {
931
+ srcNodeId: string;
932
+ shortChannelId: string;
933
+ feesBaseMsat: number;
934
+ feesProportionalMillionths: number;
935
+ cltvExpiryDelta: number;
936
+ htlcMinimumMsat?: number;
937
+ htlcMaximumMsat?: number;
838
938
  }
839
939
 
840
- export interface SyncWalletRequest {}
940
+ export interface Bolt12InvoiceRequestDetails {}
841
941
 
842
- export interface ExternalInputParser {
843
- providerId: string;
844
- inputRegex: string;
845
- parserUrl: string;
942
+ export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
943
+
944
+ export interface PrepareSendPaymentRequest {
945
+ paymentRequest: string;
946
+ amount?: bigint;
947
+ tokenIdentifier?: string;
948
+ conversionOptions?: ConversionOptions;
949
+ feePolicy?: FeePolicy;
846
950
  }
847
951
 
848
- export interface CurrencyInfo {
849
- name: string;
850
- fractionSize: number;
952
+ export type PaymentStatus = "completed" | "pending" | "failed";
953
+
954
+ export interface LocaleOverrides {
955
+ locale: string;
851
956
  spacing?: number;
852
- symbol?: Symbol;
853
- uniqSymbol?: Symbol;
854
- localizedName: LocalizedName[];
855
- localeOverrides: LocaleOverrides[];
957
+ symbol: Symbol;
856
958
  }
857
959
 
858
- export interface LnurlPayResponse {
859
- payment: Payment;
860
- successAction?: SuccessActionProcessed;
960
+ export interface RegisterWebhookResponse {
961
+ webhookId: string;
861
962
  }
862
963
 
863
- export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
964
+ export interface LnurlAuthRequestDetails {
965
+ k1: string;
966
+ action?: string;
967
+ domain: string;
968
+ url: string;
969
+ }
864
970
 
865
- export interface AddContactRequest {
866
- name: string;
867
- paymentIdentifier: string;
971
+ export interface GetInfoResponse {
972
+ identityPubkey: string;
973
+ balanceSats: number;
974
+ tokenBalances: Map<string, TokenBalance>;
868
975
  }
869
976
 
870
- export interface SetLnurlMetadataItem {
871
- paymentHash: string;
872
- senderComment?: string;
873
- nostrZapRequest?: string;
874
- nostrZapReceipt?: string;
875
- preimage?: string;
977
+ export interface StableBalanceConfig {
978
+ tokens: StableBalanceToken[];
979
+ defaultActiveLabel?: string;
980
+ thresholdSats?: number;
981
+ maxSlippageBps?: number;
876
982
  }
877
983
 
878
- export interface SparkInvoicePaymentDetails {
879
- description?: string;
880
- invoice: string;
984
+ export interface Config {
985
+ apiKey?: string;
986
+ network: Network;
987
+ syncIntervalSecs: number;
988
+ maxDepositClaimFee?: MaxFee;
989
+ lnurlDomain?: string;
990
+ preferSparkOverLightning: boolean;
991
+ externalInputParsers?: ExternalInputParser[];
992
+ useDefaultExternalInputParsers: boolean;
993
+ realTimeSyncServerUrl?: string;
994
+ privateEnabledDefault: boolean;
995
+ optimizationConfig: OptimizationConfig;
996
+ stableBalanceConfig?: StableBalanceConfig;
997
+ /**
998
+ * Maximum number of concurrent transfer claims.
999
+ *
1000
+ * Controls how many pending Spark transfers can be claimed in parallel.
1001
+ * Default is 4. Increase for server environments with high incoming
1002
+ * payment volume to improve throughput.
1003
+ */
1004
+ maxConcurrentClaims: number;
1005
+ sparkConfig?: SparkConfig;
881
1006
  }
882
1007
 
883
- export interface LocaleOverrides {
884
- locale: string;
885
- spacing?: number;
886
- symbol: Symbol;
1008
+ export interface Record {
1009
+ id: RecordId;
1010
+ revision: number;
1011
+ schemaVersion: string;
1012
+ data: Map<string, string>;
887
1013
  }
888
1014
 
889
- export type ConversionStatus = "completed" | "refundNeeded" | "refunded";
1015
+ export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
890
1016
 
891
- export interface LnurlReceiveMetadata {
892
- nostrZapRequest?: string;
893
- nostrZapReceipt?: string;
894
- senderComment?: string;
1017
+ export interface Bolt11RouteHint {
1018
+ hops: Bolt11RouteHintHop[];
895
1019
  }
896
1020
 
897
- export interface SilentPaymentAddressDetails {
898
- address: string;
899
- network: BitcoinNetwork;
900
- source: PaymentRequestSource;
1021
+ export interface DepositInfo {
1022
+ txid: string;
1023
+ vout: number;
1024
+ amountSats: number;
1025
+ isMature: boolean;
1026
+ refundTx?: string;
1027
+ refundTxId?: string;
1028
+ claimError?: DepositClaimError;
901
1029
  }
902
1030
 
903
- export type TokenTransactionType = "transfer" | "mint" | "burn";
904
-
905
- export interface ListUnclaimedDepositsResponse {
906
- deposits: DepositInfo[];
1031
+ export interface Contact {
1032
+ id: string;
1033
+ name: string;
1034
+ paymentIdentifier: string;
1035
+ createdAt: number;
1036
+ updatedAt: number;
907
1037
  }
908
1038
 
909
- export interface RegisterLightningAddressRequest {
910
- username: string;
911
- description?: string;
1039
+ export interface SparkHtlcOptions {
1040
+ paymentHash: string;
1041
+ expiryDurationSecs: number;
912
1042
  }
913
1043
 
914
- export interface ListUnclaimedDepositsRequest {}
1044
+ export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
915
1045
 
916
- export interface LnurlWithdrawInfo {
917
- withdrawUrl: string;
1046
+ export interface LogEntry {
1047
+ line: string;
1048
+ level: string;
918
1049
  }
919
1050
 
920
- export interface SendOnchainFeeQuote {
921
- id: string;
922
- expiresAt: number;
923
- speedFast: SendOnchainSpeedFeeQuote;
924
- speedMedium: SendOnchainSpeedFeeQuote;
925
- speedSlow: SendOnchainSpeedFeeQuote;
1051
+ export interface StorageListPaymentsRequest {
1052
+ typeFilter?: PaymentType[];
1053
+ statusFilter?: PaymentStatus[];
1054
+ assetFilter?: AssetFilter;
1055
+ paymentDetailsFilter?: StoragePaymentDetailsFilter[];
1056
+ fromTimestamp?: number;
1057
+ toTimestamp?: number;
1058
+ offset?: number;
1059
+ limit?: number;
1060
+ sortAscending?: boolean;
926
1061
  }
927
1062
 
928
- export interface SparkStatus {
929
- status: ServiceStatus;
930
- lastUpdated: number;
1063
+ export interface SetLnurlMetadataItem {
1064
+ paymentHash: string;
1065
+ senderComment?: string;
1066
+ nostrZapRequest?: string;
1067
+ nostrZapReceipt?: string;
931
1068
  }
932
1069
 
933
- export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
1070
+ export interface ListFiatRatesResponse {
1071
+ rates: Rate[];
1072
+ }
934
1073
 
935
- export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" } | { type: "autoConversion" };
1074
+ export type PaymentType = "send" | "receive";
936
1075
 
937
- export interface ClaimHtlcPaymentResponse {
938
- payment: Payment;
1076
+ export interface Bolt12Invoice {
1077
+ invoice: string;
1078
+ source: PaymentRequestSource;
939
1079
  }
940
1080
 
941
- export interface SignMessageResponse {
942
- pubkey: string;
943
- signature: string;
1081
+ export interface ListPaymentsResponse {
1082
+ payments: Payment[];
944
1083
  }
945
1084
 
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;
955
- }
1085
+ export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" | "major";
956
1086
 
957
- export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
1087
+ export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" } | { type: "autoConversion" };
958
1088
 
959
1089
  /**
960
1090
  * Interface for passkey PRF (Pseudo-Random Function) operations.
@@ -1008,11 +1138,19 @@ export interface PasskeyPrfProvider {
1008
1138
  isPrfAvailable(): Promise<boolean>;
1009
1139
  }
1010
1140
 
1011
- export interface UnfreezeIssuerTokenResponse {
1141
+ export interface UnfreezeIssuerTokenRequest {
1142
+ address: string;
1143
+ }
1144
+
1145
+ export interface FreezeIssuerTokenResponse {
1012
1146
  impactedOutputIds: string[];
1013
1147
  impactedTokenAmount: bigint;
1014
1148
  }
1015
1149
 
1150
+ export interface FreezeIssuerTokenRequest {
1151
+ address: string;
1152
+ }
1153
+
1016
1154
  export interface CreateIssuerTokenRequest {
1017
1155
  name: string;
1018
1156
  ticker: string;
@@ -1025,23 +1163,15 @@ export interface MintIssuerTokenRequest {
1025
1163
  amount: bigint;
1026
1164
  }
1027
1165
 
1028
- export interface BurnIssuerTokenRequest {
1029
- amount: bigint;
1030
- }
1031
-
1032
- export interface UnfreezeIssuerTokenRequest {
1033
- address: string;
1034
- }
1035
-
1036
- export interface FreezeIssuerTokenRequest {
1037
- address: string;
1038
- }
1039
-
1040
- export interface FreezeIssuerTokenResponse {
1166
+ export interface UnfreezeIssuerTokenResponse {
1041
1167
  impactedOutputIds: string[];
1042
1168
  impactedTokenAmount: bigint;
1043
1169
  }
1044
1170
 
1171
+ export interface BurnIssuerTokenRequest {
1172
+ amount: bigint;
1173
+ }
1174
+
1045
1175
  export interface ExternalSigner {
1046
1176
  identityPublicKey(): PublicKeyBytes;
1047
1177
  derivePublicKey(path: string): Promise<PublicKeyBytes>;
@@ -1065,78 +1195,65 @@ export interface ExternalSigner {
1065
1195
  hmacSha256(message: Uint8Array, path: string): Promise<HashedMessageBytes>;
1066
1196
  }
1067
1197
 
1068
- export interface ExternalTreeNodeId {
1069
- id: string;
1070
- }
1071
-
1072
1198
  export interface ExternalSecretShare {
1073
1199
  threshold: number;
1074
1200
  index: ExternalScalar;
1075
1201
  share: ExternalScalar;
1076
1202
  }
1077
1203
 
1078
- export interface EcdsaSignatureBytes {
1079
- bytes: number[];
1204
+ export interface ExternalVerifiableSecretShare {
1205
+ secretShare: ExternalSecretShare;
1206
+ proofs: number[][];
1080
1207
  }
1081
1208
 
1082
- export interface ExternalSigningCommitments {
1083
- hiding: number[];
1084
- binding: number[];
1209
+ export interface ExternalEncryptedSecret {
1210
+ ciphertext: number[];
1085
1211
  }
1086
1212
 
1087
- export interface IdentifierCommitmentPair {
1213
+ export interface IdentifierSignaturePair {
1088
1214
  identifier: ExternalIdentifier;
1089
- commitment: ExternalSigningCommitments;
1215
+ signature: ExternalFrostSignatureShare;
1090
1216
  }
1091
1217
 
1092
- export interface ExternalIdentifier {
1093
- bytes: number[];
1218
+ export interface ExternalSigningCommitments {
1219
+ hiding: number[];
1220
+ binding: number[];
1094
1221
  }
1095
1222
 
1096
- export interface ExternalVerifiableSecretShare {
1097
- secretShare: ExternalSecretShare;
1098
- proofs: number[][];
1223
+ export interface HashedMessageBytes {
1224
+ bytes: number[];
1099
1225
  }
1100
1226
 
1101
- export interface IdentifierPublicKeyPair {
1102
- identifier: ExternalIdentifier;
1227
+ export interface ExternalSignFrostRequest {
1228
+ message: number[];
1103
1229
  publicKey: number[];
1230
+ secret: ExternalSecretSource;
1231
+ verifyingKey: number[];
1232
+ selfNonceCommitment: ExternalFrostCommitments;
1233
+ statechainCommitments: IdentifierCommitmentPair[];
1234
+ adaptorPublicKey?: number[];
1104
1235
  }
1105
1236
 
1106
- export interface ExternalEncryptedSecret {
1107
- ciphertext: number[];
1108
- }
1109
-
1110
- export interface ExternalScalar {
1237
+ export interface ExternalIdentifier {
1111
1238
  bytes: number[];
1112
1239
  }
1113
1240
 
1114
- export interface RecoverableEcdsaSignatureBytes {
1241
+ export interface ExternalFrostSignatureShare {
1115
1242
  bytes: number[];
1116
1243
  }
1117
1244
 
1118
1245
  export type ExternalSecretToSplit = { type: "secretSource"; source: ExternalSecretSource } | { type: "preimage"; data: number[] };
1119
1246
 
1120
- export interface MessageBytes {
1121
- bytes: number[];
1122
- }
1123
-
1124
- export interface SecretBytes {
1247
+ export interface RecoverableEcdsaSignatureBytes {
1125
1248
  bytes: number[];
1126
1249
  }
1127
1250
 
1128
- export interface PublicKeyBytes {
1251
+ export interface EcdsaSignatureBytes {
1129
1252
  bytes: number[];
1130
1253
  }
1131
1254
 
1132
- export interface ExternalFrostCommitments {
1133
- hidingCommitment: number[];
1134
- bindingCommitment: number[];
1135
- noncesCiphertext: number[];
1136
- }
1137
-
1138
- export interface ExternalFrostSignatureShare {
1139
- bytes: number[];
1255
+ export interface ExternalTreeNodeId {
1256
+ id: string;
1140
1257
  }
1141
1258
 
1142
1259
  export interface ExternalAggregateFrostRequest {
@@ -1155,43 +1272,42 @@ export interface SchnorrSignatureBytes {
1155
1272
  bytes: number[];
1156
1273
  }
1157
1274
 
1158
- export type ExternalSecretSource = { type: "derived"; nodeId: ExternalTreeNodeId } | { type: "encrypted"; key: ExternalEncryptedSecret };
1275
+ export interface ExternalFrostCommitments {
1276
+ hidingCommitment: number[];
1277
+ bindingCommitment: number[];
1278
+ noncesCiphertext: number[];
1279
+ }
1159
1280
 
1160
- export interface HashedMessageBytes {
1281
+ export interface SecretBytes {
1161
1282
  bytes: number[];
1162
1283
  }
1163
1284
 
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[];
1285
+ export interface IdentifierCommitmentPair {
1286
+ identifier: ExternalIdentifier;
1287
+ commitment: ExternalSigningCommitments;
1288
+ }
1289
+
1290
+ export interface PublicKeyBytes {
1291
+ bytes: number[];
1172
1292
  }
1173
1293
 
1174
1294
  export interface ExternalFrostSignature {
1175
1295
  bytes: number[];
1176
1296
  }
1177
1297
 
1178
- export interface IdentifierSignaturePair {
1298
+ export interface IdentifierPublicKeyPair {
1179
1299
  identifier: ExternalIdentifier;
1180
- signature: ExternalFrostSignatureShare;
1300
+ publicKey: number[];
1181
1301
  }
1182
1302
 
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;
1303
+ export type ExternalSecretSource = { type: "derived"; nodeId: ExternalTreeNodeId } | { type: "encrypted"; key: ExternalEncryptedSecret };
1304
+
1305
+ export interface MessageBytes {
1306
+ bytes: number[];
1307
+ }
1308
+
1309
+ export interface ExternalScalar {
1310
+ bytes: number[];
1195
1311
  }
1196
1312
 
1197
1313
  /**
@@ -1211,6 +1327,20 @@ export interface NostrRelayConfig {
1211
1327
  timeoutSecs?: number;
1212
1328
  }
1213
1329
 
1330
+ /**
1331
+ * A wallet derived from a passkey.
1332
+ */
1333
+ export interface Wallet {
1334
+ /**
1335
+ * The derived seed.
1336
+ */
1337
+ seed: Seed;
1338
+ /**
1339
+ * The label used for derivation.
1340
+ */
1341
+ label: string;
1342
+ }
1343
+
1214
1344
  export interface Storage {
1215
1345
  getCachedItem: (key: string) => Promise<string | null>;
1216
1346
  setCachedItem: (key: string, value: string) => Promise<void>;
@@ -1220,7 +1350,7 @@ export interface Storage {
1220
1350
  insertPaymentMetadata: (paymentId: string, metadata: PaymentMetadata) => Promise<void>;
1221
1351
  getPaymentById: (id: string) => Promise<Payment>;
1222
1352
  getPaymentByInvoice: (invoice: string) => Promise<Payment>;
1223
- addDeposit: (txid: string, vout: number, amount_sats: number) => Promise<void>;
1353
+ addDeposit: (txid: string, vout: number, amount_sats: number, isMature: boolean) => Promise<void>;
1224
1354
  deleteDeposit: (txid: string, vout: number) => Promise<void>;
1225
1355
  listDeposits: () => Promise<DepositInfo[]>;
1226
1356
  updateDeposit: (txid: string, vout: number, payload: UpdateDepositPayload) => Promise<void>;
@@ -1256,6 +1386,7 @@ export class BreezSdk {
1256
1386
  claimDeposit(request: ClaimDepositRequest): Promise<ClaimDepositResponse>;
1257
1387
  listContacts(request: ListContactsRequest): Promise<Contact[]>;
1258
1388
  listPayments(request: ListPaymentsRequest): Promise<ListPaymentsResponse>;
1389
+ listWebhooks(): Promise<Webhook[]>;
1259
1390
  deleteContact(id: string): Promise<void>;
1260
1391
  lnurlWithdraw(request: LnurlWithdrawRequest): Promise<LnurlWithdrawResponse>;
1261
1392
  refundDeposit(request: RefundDepositRequest): Promise<RefundDepositResponse>;
@@ -1264,10 +1395,12 @@ export class BreezSdk {
1264
1395
  receivePayment(request: ReceivePaymentRequest): Promise<ReceivePaymentResponse>;
1265
1396
  getTokenIssuer(): TokenIssuer;
1266
1397
  recommendedFees(): Promise<RecommendedFees>;
1398
+ registerWebhook(request: RegisterWebhookRequest): Promise<RegisterWebhookResponse>;
1267
1399
  getUserSettings(): Promise<UserSettings>;
1268
1400
  prepareLnurlPay(request: PrepareLnurlPayRequest): Promise<PrepareLnurlPayResponse>;
1269
1401
  addEventListener(listener: EventListener): Promise<string>;
1270
1402
  claimHtlcPayment(request: ClaimHtlcPaymentRequest): Promise<ClaimHtlcPaymentResponse>;
1403
+ unregisterWebhook(request: UnregisterWebhookRequest): Promise<void>;
1271
1404
  getTokensMetadata(request: GetTokensMetadataRequest): Promise<GetTokensMetadataResponse>;
1272
1405
  listFiatCurrencies(): Promise<ListFiatCurrenciesResponse>;
1273
1406
  prepareSendPayment(request: PrepareSendPaymentRequest): Promise<PrepareSendPaymentResponse>;
@@ -1276,7 +1409,7 @@ export class BreezSdk {
1276
1409
  removeEventListener(id: string): Promise<boolean>;
1277
1410
  fetchConversionLimits(request: FetchConversionLimitsRequest): Promise<FetchConversionLimitsResponse>;
1278
1411
  listUnclaimedDeposits(request: ListUnclaimedDepositsRequest): Promise<ListUnclaimedDepositsResponse>;
1279
- startLeafOptimization(): void;
1412
+ startLeafOptimization(): Promise<void>;
1280
1413
  cancelLeafOptimization(): Promise<void>;
1281
1414
  deleteLightningAddress(): Promise<void>;
1282
1415
  registerLightningAddress(request: RegisterLightningAddressRequest): Promise<LightningAddressInfo>;
@@ -1388,9 +1521,8 @@ export class SdkBuilder {
1388
1521
  withChainService(chain_service: BitcoinChainService): SdkBuilder;
1389
1522
  withDefaultStorage(storage_dir: string): Promise<SdkBuilder>;
1390
1523
  withPaymentObserver(payment_observer: PaymentObserver): SdkBuilder;
1391
- withPostgresStorage(config: PostgresStorageConfig): SdkBuilder;
1524
+ withPostgresBackend(config: PostgresStorageConfig): SdkBuilder;
1392
1525
  withRestChainService(url: string, api_type: ChainApiType, credentials?: Credentials | null): SdkBuilder;
1393
- withPostgresTreeStore(config: PostgresStorageConfig): SdkBuilder;
1394
1526
  static new(config: Config, seed: Seed): SdkBuilder;
1395
1527
  build(): Promise<BreezSdk>;
1396
1528
  }
@@ -1439,6 +1571,7 @@ export interface InitOutput {
1439
1571
  readonly breezsdk_listFiatRates: (a: number) => any;
1440
1572
  readonly breezsdk_listPayments: (a: number, b: any) => any;
1441
1573
  readonly breezsdk_listUnclaimedDeposits: (a: number, b: any) => any;
1574
+ readonly breezsdk_listWebhooks: (a: number) => any;
1442
1575
  readonly breezsdk_lnurlAuth: (a: number, b: any) => any;
1443
1576
  readonly breezsdk_lnurlPay: (a: number, b: any) => any;
1444
1577
  readonly breezsdk_lnurlWithdraw: (a: number, b: any) => any;
@@ -1449,11 +1582,13 @@ export interface InitOutput {
1449
1582
  readonly breezsdk_recommendedFees: (a: number) => any;
1450
1583
  readonly breezsdk_refundDeposit: (a: number, b: any) => any;
1451
1584
  readonly breezsdk_registerLightningAddress: (a: number, b: any) => any;
1585
+ readonly breezsdk_registerWebhook: (a: number, b: any) => any;
1452
1586
  readonly breezsdk_removeEventListener: (a: number, b: number, c: number) => any;
1453
1587
  readonly breezsdk_sendPayment: (a: number, b: any) => any;
1454
1588
  readonly breezsdk_signMessage: (a: number, b: any) => any;
1455
- readonly breezsdk_startLeafOptimization: (a: number) => void;
1589
+ readonly breezsdk_startLeafOptimization: (a: number) => any;
1456
1590
  readonly breezsdk_syncWallet: (a: number, b: any) => any;
1591
+ readonly breezsdk_unregisterWebhook: (a: number, b: any) => any;
1457
1592
  readonly breezsdk_updateContact: (a: number, b: any) => any;
1458
1593
  readonly breezsdk_updateUserSettings: (a: number, b: any) => any;
1459
1594
  readonly connect: (a: any) => any;
@@ -1497,8 +1632,7 @@ export interface InitOutput {
1497
1632
  readonly sdkbuilder_withKeySet: (a: number, b: any) => number;
1498
1633
  readonly sdkbuilder_withLnurlClient: (a: number, b: any) => number;
1499
1634
  readonly sdkbuilder_withPaymentObserver: (a: number, b: any) => number;
1500
- readonly sdkbuilder_withPostgresStorage: (a: number, b: any) => number;
1501
- readonly sdkbuilder_withPostgresTreeStore: (a: number, b: any) => number;
1635
+ readonly sdkbuilder_withPostgresBackend: (a: number, b: any) => number;
1502
1636
  readonly sdkbuilder_withRestChainService: (a: number, b: number, c: number, d: any, e: number) => number;
1503
1637
  readonly sdkbuilder_withStorage: (a: number, b: any) => number;
1504
1638
  readonly tokenissuer_burnIssuerToken: (a: number, b: any) => any;
@@ -1535,9 +1669,9 @@ export interface InitOutput {
1535
1669
  readonly __externref_drop_slice: (a: number, b: number) => void;
1536
1670
  readonly __wbindgen_export_7: WebAssembly.Table;
1537
1671
  readonly __externref_table_dealloc: (a: number) => void;
1538
- readonly closure444_externref_shim: (a: number, b: number, c: any) => void;
1539
- readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1bbbe552b190da27: (a: number, b: number) => void;
1540
- readonly closure711_externref_shim: (a: number, b: number, c: any, d: any) => void;
1672
+ readonly closure383_externref_shim: (a: number, b: number, c: any) => void;
1673
+ readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h140914a8cfe47e73: (a: number, b: number) => void;
1674
+ readonly closure661_externref_shim: (a: number, b: number, c: any, d: any) => void;
1541
1675
  readonly __wbindgen_start: () => void;
1542
1676
  }
1543
1677