@breeztech/breez-sdk-spark 0.12.2-dev2 → 0.12.2-dev4

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