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

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