@breeztech/breez-sdk-spark 0.6.6 → 0.7.0-dev1

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.
@@ -1,8 +1,15 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function defaultConfig(network: Network): Config;
4
- export function initLogging(logger: Logger, filter?: string | null): Promise<void>;
5
3
  export function connect(request: ConnectRequest): Promise<BreezSdk>;
4
+ export function initLogging(logger: Logger, filter?: string | null): Promise<void>;
5
+ export function connectWithSigner(config: Config, signer: ExternalSigner, storage_dir: string): Promise<BreezSdk>;
6
+ export function defaultConfig(network: Network): Config;
7
+ /**
8
+ * Creates a default external signer from a mnemonic phrase.
9
+ *
10
+ * This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
11
+ */
12
+ export function defaultExternalSigner(mnemonic: string, passphrase: string | null | undefined, network: Network, key_set_config?: KeySetConfig | null): DefaultSigner;
6
13
  /**
7
14
  * Entry point invoked by JavaScript in a worker.
8
15
  */
@@ -45,12 +52,11 @@ export interface BitcoinChainService {
45
52
  recommendedFees(): Promise<RecommendedFees>;
46
53
  }
47
54
 
48
- export interface RecommendedFees {
49
- fastestFee: number;
50
- halfHourFee: number;
51
- hourFee: number;
52
- economyFee: number;
53
- minimumFee: number;
55
+ export interface Utxo {
56
+ txid: string;
57
+ vout: number;
58
+ value: number;
59
+ status: TxStatus;
54
60
  }
55
61
 
56
62
  export type ChainApiType = "esplora" | "mempoolSpace";
@@ -61,22 +67,59 @@ export interface TxStatus {
61
67
  blockTime?: number;
62
68
  }
63
69
 
64
- export interface Utxo {
65
- txid: string;
66
- vout: number;
67
- value: number;
68
- status: TxStatus;
70
+ export interface RecommendedFees {
71
+ fastestFee: number;
72
+ halfHourFee: number;
73
+ hourFee: number;
74
+ economyFee: number;
75
+ minimumFee: number;
69
76
  }
70
77
 
71
78
  export interface PaymentObserver {
72
79
  beforeSend: (payments: ProvisionalPayment[]) => Promise<void>;
73
80
  }
74
81
 
75
- export interface RecordChange {
76
- id: RecordId;
77
- schemaVersion: string;
78
- updatedFields: Map<string, string>;
79
- revision: number;
82
+ export interface GetTokensMetadataRequest {
83
+ tokenIdentifiers: string[];
84
+ }
85
+
86
+ export interface ListUnclaimedDepositsResponse {
87
+ deposits: DepositInfo[];
88
+ }
89
+
90
+ export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: bigint; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress" } | { type: "bolt11Invoice"; description: string; amountSats?: number; expirySecs?: number };
91
+
92
+ export interface SparkHtlcDetails {
93
+ paymentHash: string;
94
+ preimage?: string;
95
+ expiryTime: number;
96
+ status: SparkHtlcStatus;
97
+ }
98
+
99
+ export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
100
+
101
+ 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);
102
+
103
+ export interface LocaleOverrides {
104
+ locale: string;
105
+ spacing?: number;
106
+ symbol: Symbol;
107
+ }
108
+
109
+ export interface PrepareLnurlPayResponse {
110
+ amountSats: number;
111
+ comment?: string;
112
+ payRequest: LnurlPayRequestDetails;
113
+ feeSats: number;
114
+ invoiceDetails: Bolt11InvoiceDetails;
115
+ successAction?: SuccessAction;
116
+ }
117
+
118
+ export interface PrepareSendPaymentRequest {
119
+ paymentRequest: string;
120
+ amount?: bigint;
121
+ tokenIdentifier?: string;
122
+ tokenConversionOptions?: TokenConversionOptions;
80
123
  }
81
124
 
82
125
  export interface CurrencyInfo {
@@ -89,81 +132,116 @@ export interface CurrencyInfo {
89
132
  localeOverrides: LocaleOverrides[];
90
133
  }
91
134
 
92
- export interface LnurlWithdrawRequestDetails {
93
- callback: string;
94
- k1: string;
95
- defaultDescription: string;
96
- minWithdrawable: number;
97
- maxWithdrawable: number;
135
+ export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: bigint; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: bigint; tokenIdentifier?: string };
136
+
137
+ export interface CheckLightningAddressRequest {
138
+ username: string;
98
139
  }
99
140
 
100
- export interface UserSettings {
101
- sparkPrivateModeEnabled: boolean;
141
+ export interface UnversionedRecordChange {
142
+ id: RecordId;
143
+ schemaVersion: string;
144
+ updatedFields: Map<string, string>;
102
145
  }
103
146
 
104
- export interface ListFiatCurrenciesResponse {
105
- currencies: FiatCurrency[];
147
+ export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
148
+
149
+ export interface Bolt12Offer {
150
+ offer: string;
151
+ source: PaymentRequestSource;
106
152
  }
107
153
 
108
- export interface Bolt12OfferDetails {
109
- absoluteExpiry?: number;
110
- chains: string[];
111
- description?: string;
112
- issuer?: string;
113
- minAmount?: Amount;
114
- offer: Bolt12Offer;
115
- paths: Bolt12OfferBlindedPath[];
116
- signingPubkey?: string;
154
+ export interface AesSuccessActionData {
155
+ description: string;
156
+ ciphertext: string;
157
+ iv: string;
117
158
  }
118
159
 
119
- export interface PrepareLnurlPayRequest {
120
- amountSats: number;
121
- comment?: string;
122
- payRequest: LnurlPayRequestDetails;
123
- validateSuccessActionUrl?: boolean;
160
+ export interface TokenMetadata {
161
+ identifier: string;
162
+ issuerPublicKey: string;
163
+ name: string;
164
+ ticker: string;
165
+ decimals: number;
166
+ maxSupply: bigint;
167
+ isFreezable: boolean;
124
168
  }
125
169
 
126
- export interface GetTokensMetadataResponse {
127
- tokensMetadata: TokenMetadata[];
170
+ export interface BitcoinAddressDetails {
171
+ address: string;
172
+ network: BitcoinNetwork;
173
+ source: PaymentRequestSource;
128
174
  }
129
175
 
130
- export interface Bolt11RouteHint {
131
- hops: Bolt11RouteHintHop[];
176
+ export interface SetLnurlMetadataItem {
177
+ paymentHash: string;
178
+ senderComment?: string;
179
+ nostrZapRequest?: string;
180
+ nostrZapReceipt?: string;
132
181
  }
133
182
 
134
- export interface LnurlPayInfo {
135
- lnAddress?: string;
136
- comment?: string;
137
- domain?: string;
138
- metadata?: string;
139
- processedSuccessAction?: SuccessActionProcessed;
140
- rawSuccessAction?: SuccessAction;
183
+ export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string };
184
+
185
+ export interface LogEntry {
186
+ line: string;
187
+ level: string;
141
188
  }
142
189
 
143
- export interface TokenBalance {
144
- balance: bigint;
145
- tokenMetadata: TokenMetadata;
190
+ export interface Bip21Details {
191
+ amountSat?: number;
192
+ assetId?: string;
193
+ uri: string;
194
+ extras: Bip21Extra[];
195
+ label?: string;
196
+ message?: string;
197
+ paymentMethods: InputType[];
146
198
  }
147
199
 
148
- 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);
200
+ export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
149
201
 
150
- export interface PaymentMetadata {
151
- lnurlPayInfo?: LnurlPayInfo;
152
- lnurlWithdrawInfo?: LnurlWithdrawInfo;
153
- lnurlDescription?: string;
202
+ 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 };
203
+
204
+ export interface RefundDepositRequest {
205
+ txid: string;
206
+ vout: number;
207
+ destinationAddress: string;
208
+ fee: Fee;
154
209
  }
155
210
 
156
- export interface ConnectRequest {
157
- config: Config;
158
- seed: Seed;
159
- storageDir: string;
211
+ export interface SendOnchainFeeQuote {
212
+ id: string;
213
+ expiresAt: number;
214
+ speedFast: SendOnchainSpeedFeeQuote;
215
+ speedMedium: SendOnchainSpeedFeeQuote;
216
+ speedSlow: SendOnchainSpeedFeeQuote;
160
217
  }
161
218
 
162
- export interface Bolt12InvoiceRequestDetails {}
219
+ export interface ListPaymentsRequest {
220
+ typeFilter?: PaymentType[];
221
+ statusFilter?: PaymentStatus[];
222
+ assetFilter?: AssetFilter;
223
+ paymentDetailsFilter?: PaymentDetailsFilter[];
224
+ fromTimestamp?: number;
225
+ toTimestamp?: number;
226
+ offset?: number;
227
+ limit?: number;
228
+ sortAscending?: boolean;
229
+ }
163
230
 
164
- export interface Bolt12Invoice {
165
- invoice: string;
166
- source: PaymentRequestSource;
231
+ export interface SignMessageRequest {
232
+ message: string;
233
+ compact: boolean;
234
+ }
235
+
236
+ export interface LnurlPayRequest {
237
+ prepareResponse: PrepareLnurlPayResponse;
238
+ idempotencyKey?: string;
239
+ }
240
+
241
+ export interface ExternalInputParser {
242
+ providerId: string;
243
+ inputRegex: string;
244
+ parserUrl: string;
167
245
  }
168
246
 
169
247
  export interface SilentPaymentAddressDetails {
@@ -172,18 +250,34 @@ export interface SilentPaymentAddressDetails {
172
250
  source: PaymentRequestSource;
173
251
  }
174
252
 
175
- export interface LnurlWithdrawRequest {
176
- amountSats: number;
177
- withdrawRequest: LnurlWithdrawRequestDetails;
178
- completionTimeoutSecs?: number;
253
+ export interface LnurlWithdrawInfo {
254
+ withdrawUrl: string;
179
255
  }
180
256
 
181
- export interface ListUnclaimedDepositsResponse {
182
- deposits: DepositInfo[];
257
+ export interface GetInfoRequest {
258
+ ensureSynced?: boolean;
183
259
  }
184
260
 
185
- export interface Bolt12Offer {
186
- offer: string;
261
+ export interface SignMessageResponse {
262
+ pubkey: string;
263
+ signature: string;
264
+ }
265
+
266
+ export interface CheckMessageResponse {
267
+ isValid: boolean;
268
+ }
269
+
270
+ export interface GetPaymentRequest {
271
+ paymentId: string;
272
+ }
273
+
274
+ export interface AesSuccessActionDataDecrypted {
275
+ description: string;
276
+ plaintext: string;
277
+ }
278
+
279
+ export interface Bolt11Invoice {
280
+ bolt11: string;
187
281
  source: PaymentRequestSource;
188
282
  }
189
283
 
@@ -194,17 +288,6 @@ export interface SparkAddressDetails {
194
288
  source: PaymentRequestSource;
195
289
  }
196
290
 
197
- export interface LnurlPayResponse {
198
- payment: Payment;
199
- successAction?: SuccessActionProcessed;
200
- }
201
-
202
- 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 };
203
-
204
- export interface UpdateUserSettingsRequest {
205
- sparkPrivateModeEnabled?: boolean;
206
- }
207
-
208
291
  export interface LnurlPayRequestDetails {
209
292
  callback: string;
210
293
  minSendable: number;
@@ -218,94 +301,130 @@ export interface LnurlPayRequestDetails {
218
301
  nostrPubkey?: string;
219
302
  }
220
303
 
221
- export interface UnversionedRecordChange {
222
- id: RecordId;
223
- schemaVersion: string;
224
- updatedFields: Map<string, string>;
304
+ export interface Bolt12InvoiceDetails {
305
+ amountMsat: number;
306
+ invoice: Bolt12Invoice;
225
307
  }
226
308
 
227
- export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
228
-
229
- export interface SignMessageResponse {
230
- pubkey: string;
231
- signature: string;
309
+ export interface PaymentRequestSource {
310
+ bip21Uri?: string;
311
+ bip353Address?: string;
232
312
  }
233
313
 
234
- export interface CheckLightningAddressRequest {
235
- username: string;
314
+ export interface Payment {
315
+ id: string;
316
+ paymentType: PaymentType;
317
+ status: PaymentStatus;
318
+ amount: bigint;
319
+ fees: bigint;
320
+ timestamp: number;
321
+ method: PaymentMethod;
322
+ details?: PaymentDetails;
236
323
  }
237
324
 
238
- export interface RecordId {
239
- type: string;
240
- dataId: string;
325
+ export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
326
+
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 interface OptimizationConfig {
330
+ autoEnabled: boolean;
331
+ multiplicity: number;
241
332
  }
242
333
 
243
- export interface Bolt12OfferBlindedPath {
244
- blindedHops: string[];
334
+ export interface Bolt11InvoiceDetails {
335
+ amountMsat?: number;
336
+ description?: string;
337
+ descriptionHash?: string;
338
+ expiry: number;
339
+ invoice: Bolt11Invoice;
340
+ minFinalCltvExpiryDelta: number;
341
+ network: BitcoinNetwork;
342
+ payeePubkey: string;
343
+ paymentHash: string;
344
+ paymentSecret: string;
345
+ routingHints: Bolt11RouteHint[];
346
+ timestamp: number;
245
347
  }
246
348
 
247
- export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
349
+ export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
248
350
 
249
- export interface SendPaymentRequest {
250
- prepareResponse: PrepareSendPaymentResponse;
251
- options?: SendPaymentOptions;
252
- idempotencyKey?: string;
351
+ export interface MessageSuccessActionData {
352
+ message: string;
253
353
  }
254
354
 
255
- export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails } | { type: "token"; metadata: TokenMetadata; txHash: string; invoiceDetails?: SparkInvoicePaymentDetails } | { type: "lightning"; description?: string; preimage?: string; invoice: string; paymentHash: string; destinationPubkey: string; lnurlPayInfo?: LnurlPayInfo; lnurlWithdrawInfo?: LnurlWithdrawInfo; lnurlReceiveMetadata?: LnurlReceiveMetadata } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string };
355
+ export interface TokenConversionOptions {
356
+ conversionType: TokenConversionType;
357
+ maxSlippageBps?: number;
358
+ completionTimeoutSecs?: number;
359
+ }
256
360
 
257
- export type Network = "mainnet" | "regtest";
361
+ export type PaymentType = "send" | "receive";
258
362
 
259
- export interface LocaleOverrides {
260
- locale: string;
261
- spacing?: number;
262
- symbol: Symbol;
363
+ export interface Record {
364
+ id: RecordId;
365
+ revision: number;
366
+ schemaVersion: string;
367
+ data: Map<string, string>;
263
368
  }
264
369
 
265
- export interface ClaimDepositResponse {
266
- payment: Payment;
370
+ 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 };
371
+
372
+ export interface LightningAddressInfo {
373
+ description: string;
374
+ lightningAddress: string;
375
+ lnurl: string;
376
+ username: string;
267
377
  }
268
378
 
269
- export interface SparkHtlcOptions {
270
- paymentHash: string;
271
- expiryDurationSecs: number;
379
+ export interface LightningAddressDetails {
380
+ address: string;
381
+ payRequest: LnurlPayRequestDetails;
272
382
  }
273
383
 
274
- export interface ListPaymentsResponse {
275
- payments: Payment[];
384
+ export interface UpdateUserSettingsRequest {
385
+ sparkPrivateModeEnabled?: boolean;
276
386
  }
277
387
 
278
- export interface RefundDepositRequest {
279
- txid: string;
280
- vout: number;
281
- destinationAddress: string;
282
- fee: Fee;
388
+ export interface RecordChange {
389
+ id: RecordId;
390
+ schemaVersion: string;
391
+ updatedFields: Map<string, string>;
392
+ revision: number;
283
393
  }
284
394
 
285
- export interface PaymentRequestSource {
286
- bip21Uri?: string;
287
- bip353Address?: string;
395
+ export interface TokenConversionInfo {
396
+ poolId: string;
397
+ paymentId?: string;
398
+ fee?: bigint;
399
+ refundIdentifier?: string;
288
400
  }
289
401
 
290
- export interface Payment {
291
- id: string;
292
- paymentType: PaymentType;
293
- status: PaymentStatus;
294
- amount: bigint;
295
- fees: bigint;
296
- timestamp: number;
297
- method: PaymentMethod;
298
- details?: PaymentDetails;
402
+ export interface LnurlWithdrawRequestDetails {
403
+ callback: string;
404
+ k1: string;
405
+ defaultDescription: string;
406
+ minWithdrawable: number;
407
+ maxWithdrawable: number;
299
408
  }
300
409
 
301
- export interface GetTokensMetadataRequest {
302
- tokenIdentifiers: string[];
410
+ export interface KeySetConfig {
411
+ keySetType: KeySetType;
412
+ useAddressIndex: boolean;
413
+ accountNumber?: number;
303
414
  }
304
415
 
305
- export interface ClaimDepositRequest {
306
- txid: string;
307
- vout: number;
308
- maxFee?: MaxFee;
416
+ export interface Config {
417
+ apiKey?: string;
418
+ network: Network;
419
+ syncIntervalSecs: number;
420
+ maxDepositClaimFee?: MaxFee;
421
+ lnurlDomain?: string;
422
+ preferSparkOverLightning: boolean;
423
+ externalInputParsers?: ExternalInputParser[];
424
+ useDefaultExternalInputParsers: boolean;
425
+ realTimeSyncServerUrl?: string;
426
+ privateEnabledDefault: boolean;
427
+ optimizationConfig: OptimizationConfig;
309
428
  }
310
429
 
311
430
  export interface LnurlReceiveMetadata {
@@ -314,88 +433,97 @@ export interface LnurlReceiveMetadata {
314
433
  senderComment?: string;
315
434
  }
316
435
 
317
- export interface OptimizationProgress {
318
- isRunning: boolean;
319
- currentRound: number;
320
- totalRounds: number;
436
+ export interface Symbol {
437
+ grapheme?: string;
438
+ template?: string;
439
+ rtl?: boolean;
440
+ position?: number;
321
441
  }
322
442
 
323
- export interface LnurlWithdrawInfo {
324
- withdrawUrl: string;
443
+ export interface ListFiatCurrenciesResponse {
444
+ currencies: FiatCurrency[];
325
445
  }
326
446
 
327
- export type OptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
447
+ export interface SparkInvoicePaymentDetails {
448
+ description?: string;
449
+ invoice: string;
450
+ }
328
451
 
329
- export interface ListPaymentsRequest {
330
- typeFilter?: PaymentType[];
331
- statusFilter?: PaymentStatus[];
332
- assetFilter?: AssetFilter;
333
- sparkHtlcStatusFilter?: SparkHtlcStatus[];
334
- fromTimestamp?: number;
335
- toTimestamp?: number;
336
- offset?: number;
337
- limit?: number;
338
- sortAscending?: boolean;
452
+ export interface SendPaymentRequest {
453
+ prepareResponse: PrepareSendPaymentResponse;
454
+ options?: SendPaymentOptions;
455
+ idempotencyKey?: string;
339
456
  }
340
457
 
341
- export type SendPaymentMethod = { type: "bitcoinAddress"; address: BitcoinAddressDetails; feeQuote: SendOnchainFeeQuote } | { type: "bolt11Invoice"; invoiceDetails: Bolt11InvoiceDetails; sparkTransferFeeSats?: number; lightningFeeSats: number } | { type: "sparkAddress"; address: string; fee: bigint; tokenIdentifier?: string } | { type: "sparkInvoice"; sparkInvoiceDetails: SparkInvoiceDetails; fee: bigint; tokenIdentifier?: string };
458
+ export interface ListPaymentsResponse {
459
+ payments: Payment[];
460
+ }
342
461
 
343
- export interface GetInfoRequest {
344
- ensureSynced?: boolean;
462
+ export interface FetchTokenConversionLimitsResponse {
463
+ minFromAmount?: bigint;
464
+ minToAmount?: bigint;
345
465
  }
346
466
 
347
- export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
467
+ export interface SyncWalletResponse {}
348
468
 
349
- export interface PrepareSendPaymentRequest {
350
- paymentRequest: string;
351
- amount?: bigint;
469
+ export interface LnurlWithdrawRequest {
470
+ amountSats: number;
471
+ withdrawRequest: LnurlWithdrawRequestDetails;
472
+ completionTimeoutSecs?: number;
473
+ }
474
+
475
+ export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
476
+
477
+ export interface FetchTokenConversionLimitsRequest {
478
+ conversionType: TokenConversionType;
352
479
  tokenIdentifier?: string;
353
480
  }
354
481
 
355
- export interface Record {
356
- id: RecordId;
357
- revision: number;
358
- schemaVersion: string;
359
- data: Map<string, string>;
482
+ export interface SendOnchainSpeedFeeQuote {
483
+ userFeeSat: number;
484
+ l1BroadcastFeeSat: number;
360
485
  }
361
486
 
362
- export interface PrepareLnurlPayResponse {
487
+ export interface DepositInfo {
488
+ txid: string;
489
+ vout: number;
490
+ amountSats: number;
491
+ refundTx?: string;
492
+ refundTxId?: string;
493
+ claimError?: DepositClaimError;
494
+ }
495
+
496
+ export interface ProvisionalPayment {
497
+ paymentId: string;
498
+ amount: bigint;
499
+ details: ProvisionalPaymentDetails;
500
+ }
501
+
502
+ export interface Bolt12OfferBlindedPath {
503
+ blindedHops: string[];
504
+ }
505
+
506
+ export interface PrepareLnurlPayRequest {
363
507
  amountSats: number;
364
508
  comment?: string;
365
509
  payRequest: LnurlPayRequestDetails;
366
- feeSats: number;
367
- invoiceDetails: Bolt11InvoiceDetails;
368
- successAction?: SuccessAction;
510
+ validateSuccessActionUrl?: boolean;
369
511
  }
370
512
 
371
- export interface BitcoinAddressDetails {
372
- address: string;
373
- network: BitcoinNetwork;
374
- source: PaymentRequestSource;
513
+ export interface GetInfoResponse {
514
+ balanceSats: number;
515
+ tokenBalances: Map<string, TokenBalance>;
375
516
  }
376
517
 
377
518
  export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
378
519
 
379
- export interface Symbol {
380
- grapheme?: string;
381
- template?: string;
382
- rtl?: boolean;
383
- position?: number;
384
- }
385
-
386
- export interface LogEntry {
387
- line: string;
388
- level: string;
520
+ export interface LnurlPayResponse {
521
+ payment: Payment;
522
+ successAction?: SuccessActionProcessed;
389
523
  }
390
524
 
391
- export interface Bip21Details {
392
- amountSat?: number;
393
- assetId?: string;
394
- uri: string;
395
- extras: Bip21Extra[];
396
- label?: string;
397
- message?: string;
398
- paymentMethods: InputType[];
525
+ export interface SendPaymentResponse {
526
+ payment: Payment;
399
527
  }
400
528
 
401
529
  export interface RegisterLightningAddressRequest {
@@ -403,21 +531,20 @@ export interface RegisterLightningAddressRequest {
403
531
  description?: string;
404
532
  }
405
533
 
406
- export interface PrepareSendPaymentResponse {
407
- paymentMethod: SendPaymentMethod;
408
- amount: bigint;
409
- tokenIdentifier?: string;
534
+ export interface LnurlPayInfo {
535
+ lnAddress?: string;
536
+ comment?: string;
537
+ domain?: string;
538
+ metadata?: string;
539
+ processedSuccessAction?: SuccessActionProcessed;
540
+ rawSuccessAction?: SuccessAction;
410
541
  }
411
542
 
412
- export interface ProvisionalPayment {
413
- paymentId: string;
414
- amount: bigint;
415
- details: ProvisionalPaymentDetails;
416
- }
543
+ export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
417
544
 
418
- export interface IncomingChange {
419
- newState: Record;
420
- oldState?: Record;
545
+ export interface TokenBalance {
546
+ balance: bigint;
547
+ tokenMetadata: TokenMetadata;
421
548
  }
422
549
 
423
550
  export interface CheckMessageRequest {
@@ -426,8 +553,47 @@ export interface CheckMessageRequest {
426
553
  signature: string;
427
554
  }
428
555
 
429
- export interface ListFiatRatesResponse {
430
- rates: Rate[];
556
+ export interface Bolt12OfferDetails {
557
+ absoluteExpiry?: number;
558
+ chains: string[];
559
+ description?: string;
560
+ issuer?: string;
561
+ minAmount?: Amount;
562
+ offer: Bolt12Offer;
563
+ paths: Bolt12OfferBlindedPath[];
564
+ signingPubkey?: string;
565
+ }
566
+
567
+ export type Network = "mainnet" | "regtest";
568
+
569
+ export interface RefundDepositResponse {
570
+ txId: string;
571
+ txHex: string;
572
+ }
573
+
574
+ export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails; tokenConversionInfo?: TokenConversionInfo } | { type: "token"; metadata: TokenMetadata; txHash: string; invoiceDetails?: SparkInvoicePaymentDetails; tokenConversionInfo?: TokenConversionInfo } | { type: "lightning"; description?: string; preimage?: string; invoice: string; paymentHash: string; destinationPubkey: string; lnurlPayInfo?: LnurlPayInfo; lnurlWithdrawInfo?: LnurlWithdrawInfo; lnurlReceiveMetadata?: LnurlReceiveMetadata } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string };
575
+
576
+ export interface RecordId {
577
+ type: string;
578
+ dataId: string;
579
+ }
580
+
581
+ export interface FiatCurrency {
582
+ id: string;
583
+ info: CurrencyInfo;
584
+ }
585
+
586
+ export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
587
+
588
+ export interface LocalizedName {
589
+ locale: string;
590
+ name: string;
591
+ }
592
+
593
+ export interface OptimizationProgress {
594
+ isRunning: boolean;
595
+ currentRound: number;
596
+ totalRounds: number;
431
597
  }
432
598
 
433
599
  export interface LnurlAuthRequestDetails {
@@ -437,6 +603,14 @@ export interface LnurlAuthRequestDetails {
437
603
  url: string;
438
604
  }
439
605
 
606
+ export interface SyncWalletRequest {}
607
+
608
+ export interface ListUnclaimedDepositsRequest {}
609
+
610
+ export interface UserSettings {
611
+ sparkPrivateModeEnabled: boolean;
612
+ }
613
+
440
614
  export interface Bolt11RouteHintHop {
441
615
  srcNodeId: string;
442
616
  shortChannelId: string;
@@ -447,120 +621,125 @@ export interface Bolt11RouteHintHop {
447
621
  htlcMaximumMsat?: number;
448
622
  }
449
623
 
450
- export interface SyncWalletResponse {}
451
-
452
- export interface SparkInvoiceDetails {
453
- invoice: string;
454
- identityPublicKey: string;
455
- network: BitcoinNetwork;
456
- amount?: bigint;
457
- tokenIdentifier?: string;
458
- expiryTime?: number;
459
- description?: string;
460
- senderPublicKey?: string;
624
+ export interface Bip21Extra {
625
+ key: string;
626
+ value: string;
461
627
  }
462
628
 
463
- export interface TokenMetadata {
464
- identifier: string;
465
- issuerPublicKey: string;
466
- name: string;
467
- ticker: string;
468
- decimals: number;
469
- maxSupply: bigint;
470
- isFreezable: boolean;
629
+ export interface ListFiatRatesResponse {
630
+ rates: Rate[];
471
631
  }
472
632
 
473
- export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
633
+ export interface ClaimHtlcPaymentResponse {
634
+ payment: Payment;
635
+ }
474
636
 
475
- export interface LightningAddressDetails {
476
- address: string;
477
- payRequest: LnurlPayRequestDetails;
637
+ export interface SparkHtlcOptions {
638
+ paymentHash: string;
639
+ expiryDurationSecs: number;
478
640
  }
479
641
 
480
- export interface GetInfoResponse {
481
- balanceSats: number;
482
- tokenBalances: Map<string, TokenBalance>;
642
+ export interface PaymentMetadata {
643
+ parentPaymentId?: string;
644
+ lnurlPayInfo?: LnurlPayInfo;
645
+ lnurlWithdrawInfo?: LnurlWithdrawInfo;
646
+ lnurlDescription?: string;
647
+ tokenConversionInfo?: TokenConversionInfo;
483
648
  }
484
649
 
485
- export interface SparkInvoicePaymentDetails {
486
- description?: string;
487
- invoice: string;
650
+ export interface ClaimDepositResponse {
651
+ payment: Payment;
488
652
  }
489
653
 
490
- export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
654
+ export interface Rate {
655
+ coin: string;
656
+ value: number;
657
+ }
491
658
 
492
- export interface ClaimHtlcPaymentResponse {
493
- payment: Payment;
659
+ export interface ClaimHtlcPaymentRequest {
660
+ preimage: string;
494
661
  }
495
662
 
496
- export interface Config {
497
- apiKey?: string;
498
- network: Network;
499
- syncIntervalSecs: number;
500
- maxDepositClaimFee?: MaxFee;
501
- lnurlDomain?: string;
502
- preferSparkOverLightning: boolean;
503
- externalInputParsers?: ExternalInputParser[];
504
- useDefaultExternalInputParsers: boolean;
505
- realTimeSyncServerUrl?: string;
506
- privateEnabledDefault: boolean;
507
- optimizationConfig: OptimizationConfig;
663
+ export interface ConnectRequest {
664
+ config: Config;
665
+ seed: Seed;
666
+ storageDir: string;
508
667
  }
509
668
 
510
- export interface LightningAddressInfo {
511
- description: string;
512
- lightningAddress: string;
513
- lnurl: string;
514
- username: string;
669
+ export interface Bolt12InvoiceRequestDetails {}
670
+
671
+ export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
672
+
673
+ export interface Bolt12Invoice {
674
+ invoice: string;
675
+ source: PaymentRequestSource;
515
676
  }
516
677
 
517
- export interface AesSuccessActionData {
518
- description: string;
519
- ciphertext: string;
520
- iv: string;
678
+ export interface LnurlWithdrawResponse {
679
+ paymentRequest: string;
680
+ payment?: Payment;
521
681
  }
522
682
 
523
- export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
683
+ export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
524
684
 
525
685
  export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
526
686
 
527
- export interface Bolt11Invoice {
528
- bolt11: string;
529
- source: PaymentRequestSource;
687
+ export type OptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
688
+
689
+ export interface Bolt11RouteHint {
690
+ hops: Bolt11RouteHintHop[];
530
691
  }
531
692
 
532
- export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
693
+ export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
533
694
 
534
- export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
695
+ export interface ReceivePaymentRequest {
696
+ paymentMethod: ReceivePaymentMethod;
697
+ }
535
698
 
536
- export interface SendOnchainSpeedFeeQuote {
537
- userFeeSat: number;
538
- l1BroadcastFeeSat: number;
699
+ export type PaymentStatus = "completed" | "pending" | "failed";
700
+
701
+ export type AesSuccessActionDataResult = { type: "decrypted"; data: AesSuccessActionDataDecrypted } | { type: "errorStatus"; reason: string };
702
+
703
+ export interface Credentials {
704
+ username: string;
705
+ password: string;
539
706
  }
540
707
 
541
- export interface SendPaymentResponse {
708
+ export type TokenConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
709
+
710
+ export interface GetPaymentResponse {
542
711
  payment: Payment;
543
712
  }
544
713
 
545
- export interface UrlSuccessActionData {
546
- description: string;
547
- url: string;
548
- matchesCallbackDomain: boolean;
714
+ export interface SparkInvoiceDetails {
715
+ invoice: string;
716
+ identityPublicKey: string;
717
+ network: BitcoinNetwork;
718
+ amount?: bigint;
719
+ tokenIdentifier?: string;
720
+ expiryTime?: number;
721
+ description?: string;
722
+ senderPublicKey?: string;
549
723
  }
550
724
 
551
- export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
552
-
553
- export interface ReceivePaymentRequest {
554
- paymentMethod: ReceivePaymentMethod;
725
+ export interface GetTokensMetadataResponse {
726
+ tokensMetadata: TokenMetadata[];
555
727
  }
556
728
 
557
- export interface DepositInfo {
729
+ export interface ClaimDepositRequest {
558
730
  txid: string;
559
731
  vout: number;
560
- amountSats: number;
561
- refundTx?: string;
562
- refundTxId?: string;
563
- claimError?: DepositClaimError;
732
+ maxFee?: MaxFee;
733
+ }
734
+
735
+ export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
736
+
737
+ export interface PrepareSendPaymentResponse {
738
+ paymentMethod: SendPaymentMethod;
739
+ amount: bigint;
740
+ tokenIdentifier?: string;
741
+ tokenConversionOptions?: TokenConversionOptions;
742
+ tokenConversionFee?: bigint;
564
743
  }
565
744
 
566
745
  export interface OutgoingChange {
@@ -568,188 +747,183 @@ export interface OutgoingChange {
568
747
  parent?: Record;
569
748
  }
570
749
 
571
- export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
572
-
573
- export interface Bip21Extra {
574
- key: string;
575
- value: string;
576
- }
577
-
578
- export type AesSuccessActionDataResult = { type: "decrypted"; data: AesSuccessActionDataDecrypted } | { type: "errorStatus"; reason: string };
579
-
580
- export interface LocalizedName {
581
- locale: string;
582
- name: string;
750
+ export interface UrlSuccessActionData {
751
+ description: string;
752
+ url: string;
753
+ matchesCallbackDomain: boolean;
583
754
  }
584
755
 
585
- 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 };
586
-
587
756
  export interface ReceivePaymentResponse {
588
757
  paymentRequest: string;
589
758
  fee: bigint;
590
759
  }
591
760
 
592
- export interface AesSuccessActionDataDecrypted {
593
- description: string;
594
- plaintext: string;
761
+ export interface IncomingChange {
762
+ newState: Record;
763
+ oldState?: Record;
595
764
  }
596
765
 
597
- export interface ClaimHtlcPaymentRequest {
598
- preimage: string;
766
+ export interface MintIssuerTokenRequest {
767
+ amount: bigint;
599
768
  }
600
769
 
601
- export interface ExternalInputParser {
602
- providerId: string;
603
- inputRegex: string;
604
- parserUrl: string;
770
+ export interface UnfreezeIssuerTokenResponse {
771
+ impactedOutputIds: string[];
772
+ impactedTokenAmount: bigint;
605
773
  }
606
774
 
607
- export interface LnurlPayRequest {
608
- prepareResponse: PrepareLnurlPayResponse;
609
- idempotencyKey?: string;
775
+ export interface FreezeIssuerTokenRequest {
776
+ address: string;
610
777
  }
611
778
 
612
- export interface Credentials {
613
- username: string;
614
- password: string;
779
+ export interface CreateIssuerTokenRequest {
780
+ name: string;
781
+ ticker: string;
782
+ decimals: number;
783
+ isFreezable: boolean;
784
+ maxSupply: bigint;
615
785
  }
616
786
 
617
- export interface Bolt11InvoiceDetails {
618
- amountMsat?: number;
619
- description?: string;
620
- descriptionHash?: string;
621
- expiry: number;
622
- invoice: Bolt11Invoice;
623
- minFinalCltvExpiryDelta: number;
624
- network: BitcoinNetwork;
625
- payeePubkey: string;
626
- paymentHash: string;
627
- paymentSecret: string;
628
- routingHints: Bolt11RouteHint[];
629
- timestamp: number;
787
+ export interface BurnIssuerTokenRequest {
788
+ amount: bigint;
630
789
  }
631
790
 
632
- export interface MessageSuccessActionData {
633
- message: string;
791
+ export interface FreezeIssuerTokenResponse {
792
+ impactedOutputIds: string[];
793
+ impactedTokenAmount: bigint;
634
794
  }
635
795
 
636
- export interface SparkHtlcDetails {
637
- paymentHash: string;
638
- preimage?: string;
639
- expiryTime: number;
640
- status: SparkHtlcStatus;
796
+ export interface UnfreezeIssuerTokenRequest {
797
+ address: string;
641
798
  }
642
799
 
643
- export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
644
-
645
- export type PaymentStatus = "completed" | "pending" | "failed";
646
-
647
- export interface RefundDepositResponse {
648
- txId: string;
649
- txHex: string;
800
+ export interface ExternalSigner {
801
+ identityPublicKey(): PublicKeyBytes;
802
+ derivePublicKey(path: string): Promise<PublicKeyBytes>;
803
+ signEcdsa(message: Uint8Array, path: string): Promise<EcdsaSignatureBytes>;
804
+ signEcdsaRecoverable(message: Uint8Array, path: string): Promise<RecoverableEcdsaSignatureBytes>;
805
+ eciesEncrypt(message: Uint8Array, path: string): Promise<Uint8Array>;
806
+ eciesDecrypt(message: Uint8Array, path: string): Promise<Uint8Array>;
807
+ signHashSchnorr(hash: Uint8Array, path: string): Promise<SchnorrSignatureBytes>;
808
+ generateFrostSigningCommitments(): Promise<ExternalFrostCommitments>;
809
+ getPublicKeyForNode(id: ExternalTreeNodeId): Promise<PublicKeyBytes>;
810
+ generateRandomKey(): Promise<ExternalPrivateKeySource>;
811
+ getStaticDepositPrivateKeySource(index: number): Promise<ExternalPrivateKeySource>;
812
+ getStaticDepositPrivateKey(index: number): Promise<PrivateKeyBytes>;
813
+ getStaticDepositPublicKey(index: number): Promise<PublicKeyBytes>;
814
+ subtractPrivateKeys(signingKey: ExternalPrivateKeySource, newSigningKey: ExternalPrivateKeySource): Promise<ExternalPrivateKeySource>;
815
+ splitSecretWithProofs(secret: ExternalSecretToSplit, threshold: number, numShares: number): Promise<ExternalVerifiableSecretShare[]>;
816
+ encryptPrivateKeyForReceiver(privateKey: ExternalEncryptedPrivateKey, receiverPublicKey: PublicKeyBytes): Promise<Uint8Array>;
817
+ getPublicKeyFromPrivateKeySource(privateKey: ExternalPrivateKeySource): Promise<PublicKeyBytes>;
818
+ signFrost(request: ExternalSignFrostRequest): Promise<ExternalFrostSignatureShare>;
819
+ aggregateFrost(request: ExternalAggregateFrostRequest): Promise<ExternalFrostSignature>;
650
820
  }
651
821
 
652
- export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: bigint; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress" } | { type: "bolt11Invoice"; description: string; amountSats?: number; expirySecs?: number };
653
-
654
- export interface LnurlWithdrawResponse {
655
- paymentRequest: string;
656
- payment?: Payment;
822
+ export interface ExternalSignFrostRequest {
823
+ message: number[];
824
+ publicKey: number[];
825
+ privateKey: ExternalPrivateKeySource;
826
+ verifyingKey: number[];
827
+ selfNonceCommitment: ExternalFrostCommitments;
828
+ statechainCommitments: IdentifierCommitmentPair[];
829
+ adaptorPublicKey?: number[];
657
830
  }
658
831
 
659
- export interface GetPaymentRequest {
660
- paymentId: string;
832
+ export interface PrivateKeyBytes {
833
+ bytes: number[];
661
834
  }
662
835
 
663
- export interface Rate {
664
- coin: string;
665
- value: number;
836
+ export interface ExternalFrostSignature {
837
+ bytes: number[];
666
838
  }
667
839
 
668
- export interface ListUnclaimedDepositsRequest {}
669
-
670
- export interface SyncWalletRequest {}
671
-
672
- export interface SetLnurlMetadataItem {
673
- paymentHash: string;
674
- senderComment?: string;
675
- nostrZapRequest?: string;
676
- nostrZapReceipt?: string;
840
+ export interface RecoverableEcdsaSignatureBytes {
841
+ bytes: number[];
677
842
  }
678
843
 
679
- export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
680
-
681
- export type PaymentType = "send" | "receive";
844
+ export interface SchnorrSignatureBytes {
845
+ bytes: number[];
846
+ }
682
847
 
683
- export interface SignMessageRequest {
684
- message: string;
685
- compact: boolean;
848
+ export interface EcdsaSignatureBytes {
849
+ bytes: number[];
686
850
  }
687
851
 
688
- export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
852
+ export interface ExternalFrostCommitments {
853
+ hidingCommitment: number[];
854
+ bindingCommitment: number[];
855
+ noncesCiphertext: number[];
856
+ }
689
857
 
690
- export interface SendOnchainFeeQuote {
691
- id: string;
692
- expiresAt: number;
693
- speedFast: SendOnchainSpeedFeeQuote;
694
- speedMedium: SendOnchainSpeedFeeQuote;
695
- speedSlow: SendOnchainSpeedFeeQuote;
858
+ export interface IdentifierSignaturePair {
859
+ identifier: ExternalIdentifier;
860
+ signature: ExternalFrostSignatureShare;
696
861
  }
697
862
 
698
- export interface OptimizationConfig {
699
- autoEnabled: boolean;
700
- multiplicity: number;
863
+ export interface ExternalSigningCommitments {
864
+ hiding: number[];
865
+ binding: number[];
701
866
  }
702
867
 
703
- export interface CheckMessageResponse {
704
- isValid: boolean;
868
+ export interface ExternalIdentifier {
869
+ bytes: number[];
705
870
  }
706
871
 
707
- export interface GetPaymentResponse {
708
- payment: Payment;
872
+ export type ExternalSecretToSplit = { type: "privateKey"; source: ExternalPrivateKeySource } | { type: "preimage"; data: number[] };
873
+
874
+ export interface ExternalFrostSignatureShare {
875
+ bytes: number[];
709
876
  }
710
877
 
711
- export interface Bolt12InvoiceDetails {
712
- amountMsat: number;
713
- invoice: Bolt12Invoice;
878
+ export type ExternalPrivateKeySource = { type: "derived"; nodeId: ExternalTreeNodeId } | { type: "encrypted"; key: ExternalEncryptedPrivateKey };
879
+
880
+ export interface ExternalAggregateFrostRequest {
881
+ message: number[];
882
+ statechainSignatures: IdentifierSignaturePair[];
883
+ statechainPublicKeys: IdentifierPublicKeyPair[];
884
+ verifyingKey: number[];
885
+ statechainCommitments: IdentifierCommitmentPair[];
886
+ selfCommitment: ExternalSigningCommitments;
887
+ publicKey: number[];
888
+ selfSignature: ExternalFrostSignatureShare;
889
+ adaptorPublicKey?: number[];
714
890
  }
715
891
 
716
- export interface FiatCurrency {
717
- id: string;
718
- info: CurrencyInfo;
892
+ export interface ExternalEncryptedPrivateKey {
893
+ ciphertext: number[];
719
894
  }
720
895
 
721
- export interface UnfreezeIssuerTokenResponse {
722
- impactedOutputIds: string[];
723
- impactedTokenAmount: bigint;
896
+ export interface IdentifierPublicKeyPair {
897
+ identifier: ExternalIdentifier;
898
+ publicKey: number[];
724
899
  }
725
900
 
726
- export interface MintIssuerTokenRequest {
727
- amount: bigint;
901
+ export interface ExternalScalar {
902
+ bytes: number[];
728
903
  }
729
904
 
730
- export interface BurnIssuerTokenRequest {
731
- amount: bigint;
905
+ export interface ExternalSecretShare {
906
+ threshold: number;
907
+ index: ExternalScalar;
908
+ share: ExternalScalar;
732
909
  }
733
910
 
734
- export interface UnfreezeIssuerTokenRequest {
735
- address: string;
911
+ export interface PublicKeyBytes {
912
+ bytes: number[];
736
913
  }
737
914
 
738
- export interface FreezeIssuerTokenRequest {
739
- address: string;
915
+ export interface IdentifierCommitmentPair {
916
+ identifier: ExternalIdentifier;
917
+ commitment: ExternalSigningCommitments;
740
918
  }
741
919
 
742
- export interface FreezeIssuerTokenResponse {
743
- impactedOutputIds: string[];
744
- impactedTokenAmount: bigint;
920
+ export interface ExternalVerifiableSecretShare {
921
+ secretShare: ExternalSecretShare;
922
+ proofs: number[][];
745
923
  }
746
924
 
747
- export interface CreateIssuerTokenRequest {
748
- name: string;
749
- ticker: string;
750
- decimals: number;
751
- isFreezable: boolean;
752
- maxSupply: bigint;
925
+ export interface ExternalTreeNodeId {
926
+ id: string;
753
927
  }
754
928
 
755
929
  export interface Storage {
@@ -810,12 +984,40 @@ export class BreezSdk {
810
984
  cancelLeafOptimization(): Promise<void>;
811
985
  deleteLightningAddress(): Promise<void>;
812
986
  registerLightningAddress(request: RegisterLightningAddressRequest): Promise<LightningAddressInfo>;
987
+ fetchTokenConversionLimits(request: FetchTokenConversionLimitsRequest): Promise<FetchTokenConversionLimitsResponse>;
813
988
  getLeafOptimizationProgress(): OptimizationProgress;
814
989
  checkLightningAddressAvailable(request: CheckLightningAddressRequest): Promise<boolean>;
815
990
  parse(input: string): Promise<InputType>;
816
991
  getInfo(request: GetInfoRequest): Promise<GetInfoResponse>;
817
992
  lnurlPay(request: LnurlPayRequest): Promise<LnurlPayResponse>;
818
993
  }
994
+ /**
995
+ * A default signer implementation that wraps the core SDK's ExternalSigner.
996
+ * This is returned by `defaultExternalSigner` and can be passed to `connectWithSigner`.
997
+ */
998
+ export class DefaultSigner {
999
+ private constructor();
1000
+ free(): void;
1001
+ signEcdsa(message: Uint8Array, path: string): Promise<EcdsaSignatureBytes>;
1002
+ signFrost(request: ExternalSignFrostRequest): Promise<ExternalFrostSignatureShare>;
1003
+ eciesDecrypt(message: Uint8Array, path: string): Promise<Uint8Array>;
1004
+ eciesEncrypt(message: Uint8Array, path: string): Promise<Uint8Array>;
1005
+ aggregateFrost(request: ExternalAggregateFrostRequest): Promise<ExternalFrostSignature>;
1006
+ derivePublicKey(path: string): Promise<PublicKeyBytes>;
1007
+ signHashSchnorr(hash: Uint8Array, path: string): Promise<SchnorrSignatureBytes>;
1008
+ generateRandomKey(): Promise<ExternalPrivateKeySource>;
1009
+ identityPublicKey(): PublicKeyBytes;
1010
+ subtractPrivateKeys(signing_key: ExternalPrivateKeySource, new_signing_key: ExternalPrivateKeySource): Promise<ExternalPrivateKeySource>;
1011
+ signEcdsaRecoverable(message: Uint8Array, path: string): Promise<RecoverableEcdsaSignatureBytes>;
1012
+ getPublicKeyForNode(id: ExternalTreeNodeId): Promise<PublicKeyBytes>;
1013
+ splitSecretWithProofs(secret: ExternalSecretToSplit, threshold: number, num_shares: number): Promise<ExternalVerifiableSecretShare[]>;
1014
+ getStaticDepositPublicKey(index: number): Promise<PublicKeyBytes>;
1015
+ getStaticDepositPrivateKey(index: number): Promise<PrivateKeyBytes>;
1016
+ encryptPrivateKeyForReceiver(private_key: ExternalEncryptedPrivateKey, receiver_public_key: PublicKeyBytes): Promise<Uint8Array>;
1017
+ generateFrostSigningCommitments(): Promise<ExternalFrostCommitments>;
1018
+ getStaticDepositPrivateKeySource(index: number): Promise<ExternalPrivateKeySource>;
1019
+ getPublicKeyFromPrivateKeySource(private_key: ExternalPrivateKeySource): Promise<PublicKeyBytes>;
1020
+ }
819
1021
  export class IntoUnderlyingByteSource {
820
1022
  private constructor();
821
1023
  free(): void;
@@ -841,8 +1043,9 @@ export class IntoUnderlyingSource {
841
1043
  export class SdkBuilder {
842
1044
  private constructor();
843
1045
  free(): void;
844
- withKeySet(key_set_type: KeySetType, use_address_index: boolean, account_number?: number | null): SdkBuilder;
1046
+ withKeySet(config: KeySetConfig): SdkBuilder;
845
1047
  withStorage(storage: Storage): SdkBuilder;
1048
+ static newWithSigner(config: Config, signer: ExternalSigner): SdkBuilder;
846
1049
  withFiatService(fiat_service: FiatService): SdkBuilder;
847
1050
  withLnurlClient(lnurl_client: RestClient): SdkBuilder;
848
1051
  withChainService(chain_service: BitcoinChainService): SdkBuilder;
@@ -869,6 +1072,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
869
1072
  export interface InitOutput {
870
1073
  readonly memory: WebAssembly.Memory;
871
1074
  readonly __wbg_breezsdk_free: (a: number, b: number) => void;
1075
+ readonly __wbg_defaultsigner_free: (a: number, b: number) => void;
872
1076
  readonly __wbg_sdkbuilder_free: (a: number, b: number) => void;
873
1077
  readonly __wbg_tokenissuer_free: (a: number, b: number) => void;
874
1078
  readonly breezsdk_addEventListener: (a: number, b: any) => any;
@@ -879,6 +1083,7 @@ export interface InitOutput {
879
1083
  readonly breezsdk_claimHtlcPayment: (a: number, b: any) => any;
880
1084
  readonly breezsdk_deleteLightningAddress: (a: number) => any;
881
1085
  readonly breezsdk_disconnect: (a: number) => any;
1086
+ readonly breezsdk_fetchTokenConversionLimits: (a: number, b: any) => any;
882
1087
  readonly breezsdk_getInfo: (a: number, b: any) => any;
883
1088
  readonly breezsdk_getLeafOptimizationProgress: (a: number) => any;
884
1089
  readonly breezsdk_getLightningAddress: (a: number) => any;
@@ -906,14 +1111,36 @@ export interface InitOutput {
906
1111
  readonly breezsdk_syncWallet: (a: number, b: any) => any;
907
1112
  readonly breezsdk_updateUserSettings: (a: number, b: any) => any;
908
1113
  readonly connect: (a: any) => any;
1114
+ readonly connectWithSigner: (a: any, b: any, c: number, d: number) => any;
909
1115
  readonly defaultConfig: (a: any) => any;
1116
+ readonly defaultExternalSigner: (a: number, b: number, c: number, d: number, e: any, f: number) => [number, number, number];
1117
+ readonly defaultsigner_aggregateFrost: (a: number, b: any) => any;
1118
+ readonly defaultsigner_derivePublicKey: (a: number, b: number, c: number) => any;
1119
+ readonly defaultsigner_eciesDecrypt: (a: number, b: number, c: number, d: number, e: number) => any;
1120
+ readonly defaultsigner_eciesEncrypt: (a: number, b: number, c: number, d: number, e: number) => any;
1121
+ readonly defaultsigner_encryptPrivateKeyForReceiver: (a: number, b: any, c: any) => any;
1122
+ readonly defaultsigner_generateFrostSigningCommitments: (a: number) => any;
1123
+ readonly defaultsigner_generateRandomKey: (a: number) => any;
1124
+ readonly defaultsigner_getPublicKeyForNode: (a: number, b: any) => any;
1125
+ readonly defaultsigner_getPublicKeyFromPrivateKeySource: (a: number, b: any) => any;
1126
+ readonly defaultsigner_getStaticDepositPrivateKey: (a: number, b: number) => any;
1127
+ readonly defaultsigner_getStaticDepositPrivateKeySource: (a: number, b: number) => any;
1128
+ readonly defaultsigner_getStaticDepositPublicKey: (a: number, b: number) => any;
1129
+ readonly defaultsigner_identityPublicKey: (a: number) => [number, number, number];
1130
+ readonly defaultsigner_signEcdsa: (a: number, b: number, c: number, d: number, e: number) => any;
1131
+ readonly defaultsigner_signEcdsaRecoverable: (a: number, b: number, c: number, d: number, e: number) => any;
1132
+ readonly defaultsigner_signFrost: (a: number, b: any) => any;
1133
+ readonly defaultsigner_signHashSchnorr: (a: number, b: number, c: number, d: number, e: number) => any;
1134
+ readonly defaultsigner_splitSecretWithProofs: (a: number, b: any, c: number, d: number) => any;
1135
+ readonly defaultsigner_subtractPrivateKeys: (a: number, b: any, c: any) => any;
910
1136
  readonly initLogging: (a: any, b: number, c: number) => any;
911
1137
  readonly sdkbuilder_build: (a: number) => any;
912
1138
  readonly sdkbuilder_new: (a: any, b: any) => number;
1139
+ readonly sdkbuilder_newWithSigner: (a: any, b: any) => number;
913
1140
  readonly sdkbuilder_withChainService: (a: number, b: any) => number;
914
1141
  readonly sdkbuilder_withDefaultStorage: (a: number, b: number, c: number) => any;
915
1142
  readonly sdkbuilder_withFiatService: (a: number, b: any) => number;
916
- readonly sdkbuilder_withKeySet: (a: number, b: any, c: number, d: number) => number;
1143
+ readonly sdkbuilder_withKeySet: (a: number, b: any) => number;
917
1144
  readonly sdkbuilder_withLnurlClient: (a: number, b: any) => number;
918
1145
  readonly sdkbuilder_withPaymentObserver: (a: number, b: any) => number;
919
1146
  readonly sdkbuilder_withRestChainService: (a: number, b: number, c: number, d: any, e: number) => number;
@@ -953,8 +1180,8 @@ export interface InitOutput {
953
1180
  readonly __wbindgen_export_7: WebAssembly.Table;
954
1181
  readonly __externref_table_dealloc: (a: number) => void;
955
1182
  readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hdf0ebd5238280272: (a: number, b: number) => void;
956
- readonly closure997_externref_shim: (a: number, b: number, c: any) => void;
957
- readonly closure571_externref_shim: (a: number, b: number, c: any, d: any) => void;
1183
+ readonly closure1047_externref_shim: (a: number, b: number, c: any) => void;
1184
+ readonly closure632_externref_shim: (a: number, b: number, c: any, d: any) => void;
958
1185
  readonly __wbindgen_start: () => void;
959
1186
  }
960
1187