@breeztech/breez-sdk-spark 0.11.0-dev3 → 0.11.0-dev5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,10 +9,6 @@
9
9
  * - `recycleTimeoutSecs`: 10 (10 seconds idle before disconnect)
10
10
  */
11
11
  export function defaultPostgresStorageConfig(connection_string: string): PostgresStorageConfig;
12
- export function defaultExternalSigner(mnemonic: string, passphrase: string | null | undefined, network: Network, key_set_config?: KeySetConfig | null): DefaultSigner;
13
- export function defaultConfig(network: Network): Config;
14
- export function initLogging(logger: Logger, filter?: string | null): Promise<void>;
15
- export function connect(request: ConnectRequest): Promise<BreezSdk>;
16
12
  /**
17
13
  * Creates a default external signer from a mnemonic phrase.
18
14
  *
@@ -20,6 +16,10 @@ export function connect(request: ConnectRequest): Promise<BreezSdk>;
20
16
  */
21
17
  export function getSparkStatus(): Promise<SparkStatus>;
22
18
  export function connectWithSigner(config: Config, signer: ExternalSigner, storage_dir: string): Promise<BreezSdk>;
19
+ export function defaultConfig(network: Network): Config;
20
+ export function defaultExternalSigner(mnemonic: string, passphrase: string | null | undefined, network: Network, key_set_config?: KeySetConfig | null): DefaultSigner;
21
+ export function connect(request: ConnectRequest): Promise<BreezSdk>;
22
+ export function initLogging(logger: Logger, filter?: string | null): Promise<void>;
23
23
  /**
24
24
  * Entry point invoked by JavaScript in a worker.
25
25
  */
@@ -135,12 +135,6 @@ export interface RecommendedFees {
135
135
  minimumFee: number;
136
136
  }
137
137
 
138
- export interface TxStatus {
139
- confirmed: boolean;
140
- blockHeight?: number;
141
- blockTime?: number;
142
- }
143
-
144
138
  export type ChainApiType = "esplora" | "mempoolSpace";
145
139
 
146
140
  export interface Utxo {
@@ -150,655 +144,631 @@ export interface Utxo {
150
144
  status: TxStatus;
151
145
  }
152
146
 
147
+ export interface TxStatus {
148
+ confirmed: boolean;
149
+ blockHeight?: number;
150
+ blockTime?: number;
151
+ }
152
+
153
153
  export interface PaymentObserver {
154
154
  beforeSend: (payments: ProvisionalPayment[]) => Promise<void>;
155
155
  }
156
156
 
157
- export type AesSuccessActionDataResult = { type: "decrypted"; data: AesSuccessActionDataDecrypted } | { type: "errorStatus"; reason: string };
158
-
159
- export interface Bolt12InvoiceDetails {
160
- amountMsat: number;
161
- invoice: Bolt12Invoice;
157
+ export interface FiatCurrency {
158
+ id: string;
159
+ info: CurrencyInfo;
162
160
  }
163
161
 
164
- export interface ConnectRequest {
165
- config: Config;
166
- seed: Seed;
167
- storageDir: string;
162
+ export interface SilentPaymentAddressDetails {
163
+ address: string;
164
+ network: BitcoinNetwork;
165
+ source: PaymentRequestSource;
168
166
  }
169
167
 
170
- export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
168
+ export interface SparkAddressDetails {
169
+ address: string;
170
+ identityPublicKey: string;
171
+ network: BitcoinNetwork;
172
+ source: PaymentRequestSource;
173
+ }
171
174
 
172
- export interface Bolt11RouteHintHop {
173
- srcNodeId: string;
174
- shortChannelId: string;
175
- feesBaseMsat: number;
176
- feesProportionalMillionths: number;
177
- cltvExpiryDelta: number;
178
- htlcMinimumMsat?: number;
179
- htlcMaximumMsat?: number;
175
+ export interface LnurlPayInfo {
176
+ lnAddress?: string;
177
+ comment?: string;
178
+ domain?: string;
179
+ metadata?: string;
180
+ processedSuccessAction?: SuccessActionProcessed;
181
+ rawSuccessAction?: SuccessAction;
180
182
  }
181
183
 
182
- export interface LightningAddressDetails {
183
- address: string;
184
- payRequest: LnurlPayRequestDetails;
184
+ export interface ConversionOptions {
185
+ conversionType: ConversionType;
186
+ maxSlippageBps?: number;
187
+ completionTimeoutSecs?: number;
185
188
  }
186
189
 
187
- export interface LnurlAuthRequestDetails {
188
- k1: string;
189
- action?: string;
190
- domain: string;
191
- url: string;
190
+ export interface Bolt12OfferBlindedPath {
191
+ blindedHops: string[];
192
192
  }
193
193
 
194
- export interface LnurlInfo {
195
- url: string;
196
- bech32: string;
194
+ export interface GetPaymentRequest {
195
+ paymentId: string;
197
196
  }
198
197
 
199
- export interface ConversionDetails {
200
- from: ConversionStep;
201
- to: ConversionStep;
198
+ 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 };
199
+
200
+ export interface FetchConversionLimitsRequest {
201
+ conversionType: ConversionType;
202
+ tokenIdentifier?: string;
202
203
  }
203
204
 
205
+ export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
206
+
204
207
  export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" | "major";
205
208
 
206
- export interface TokenMetadata {
207
- identifier: string;
208
- issuerPublicKey: string;
209
- name: string;
210
- ticker: string;
211
- decimals: number;
212
- maxSupply: string;
213
- isFreezable: boolean;
214
- }
209
+ export type Network = "mainnet" | "regtest";
215
210
 
216
- export interface OutgoingChange {
217
- change: RecordChange;
218
- parent?: Record;
211
+ export type FeePolicy = "feesExcluded" | "feesIncluded";
212
+
213
+ export interface LnurlInfo {
214
+ url: string;
215
+ bech32: string;
219
216
  }
220
217
 
221
- export interface GetInfoRequest {
222
- ensureSynced?: boolean;
218
+ export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
219
+
220
+ export interface FetchConversionLimitsResponse {
221
+ minFromAmount?: bigint;
222
+ minToAmount?: bigint;
223
223
  }
224
224
 
225
- export interface Bip21Details {
226
- amountSat?: number;
227
- assetId?: string;
228
- uri: string;
229
- extras: Bip21Extra[];
230
- label?: string;
231
- message?: string;
232
- paymentMethods: InputType[];
225
+ export interface ConnectRequest {
226
+ config: Config;
227
+ seed: Seed;
228
+ storageDir: string;
233
229
  }
234
230
 
235
- export interface ListPaymentsResponse {
236
- payments: Payment[];
231
+ export interface LnurlPayRequest {
232
+ prepareResponse: PrepareLnurlPayResponse;
233
+ idempotencyKey?: string;
237
234
  }
238
235
 
239
- export interface SendOnchainSpeedFeeQuote {
240
- userFeeSat: number;
241
- l1BroadcastFeeSat: number;
236
+ export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
237
+
238
+ export interface Bolt11InvoiceDetails {
239
+ amountMsat?: number;
240
+ description?: string;
241
+ descriptionHash?: string;
242
+ expiry: number;
243
+ invoice: Bolt11Invoice;
244
+ minFinalCltvExpiryDelta: number;
245
+ network: BitcoinNetwork;
246
+ payeePubkey: string;
247
+ paymentHash: string;
248
+ paymentSecret: string;
249
+ routingHints: Bolt11RouteHint[];
250
+ timestamp: number;
242
251
  }
243
252
 
244
- export interface SignMessageRequest {
245
- message: string;
246
- compact: boolean;
253
+ export interface KeySetConfig {
254
+ keySetType: KeySetType;
255
+ useAddressIndex: boolean;
256
+ accountNumber?: number;
247
257
  }
248
258
 
249
- export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
259
+ export interface Bolt11RouteHint {
260
+ hops: Bolt11RouteHintHop[];
261
+ }
250
262
 
251
- export interface CheckMessageRequest {
252
- message: string;
253
- pubkey: string;
254
- signature: string;
263
+ export interface ProvisionalPayment {
264
+ paymentId: string;
265
+ amount: bigint;
266
+ details: ProvisionalPaymentDetails;
255
267
  }
256
268
 
257
- 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 };
269
+ export interface UpdateContactRequest {
270
+ id: string;
271
+ name: string;
272
+ paymentIdentifier: string;
273
+ }
258
274
 
259
- export interface SendPaymentResponse {
260
- payment: Payment;
275
+ export interface ConversionStep {
276
+ paymentId: string;
277
+ amount: bigint;
278
+ fee: bigint;
279
+ method: PaymentMethod;
280
+ tokenMetadata?: TokenMetadata;
261
281
  }
262
282
 
263
- export interface Bolt11Invoice {
264
- bolt11: string;
283
+ export type AesSuccessActionDataResult = { type: "decrypted"; data: AesSuccessActionDataDecrypted } | { type: "errorStatus"; reason: string };
284
+
285
+ export interface Bolt12Offer {
286
+ offer: string;
265
287
  source: PaymentRequestSource;
266
288
  }
267
289
 
268
- export interface LnurlWithdrawRequestDetails {
269
- callback: string;
270
- k1: string;
271
- defaultDescription: string;
272
- minWithdrawable: number;
273
- maxWithdrawable: number;
290
+ export interface ConversionInfo {
291
+ poolId: string;
292
+ conversionId: string;
293
+ status: ConversionStatus;
294
+ fee?: string;
295
+ purpose?: ConversionPurpose;
274
296
  }
275
297
 
276
- export interface ListContactsRequest {
277
- offset?: number;
278
- limit?: number;
298
+ export interface DepositInfo {
299
+ txid: string;
300
+ vout: number;
301
+ amountSats: number;
302
+ refundTx?: string;
303
+ refundTxId?: string;
304
+ claimError?: DepositClaimError;
279
305
  }
280
306
 
281
- export interface Record {
282
- id: RecordId;
283
- revision: number;
284
- schemaVersion: string;
285
- data: Map<string, string>;
307
+ export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
308
+
309
+ export interface IncomingChange {
310
+ newState: Record;
311
+ oldState?: Record;
286
312
  }
287
313
 
288
- export interface Payment {
289
- id: string;
290
- paymentType: PaymentType;
291
- status: PaymentStatus;
314
+ export interface ConversionEstimate {
315
+ options: ConversionOptions;
292
316
  amount: bigint;
293
- fees: bigint;
294
- timestamp: number;
295
- method: PaymentMethod;
296
- details?: PaymentDetails;
297
- conversionDetails?: ConversionDetails;
317
+ fee: bigint;
298
318
  }
299
319
 
300
- export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
301
-
302
- export type PaymentStatus = "completed" | "pending" | "failed";
303
-
304
320
  export interface ListUnclaimedDepositsRequest {}
305
321
 
306
- export interface Bip21Extra {
307
- key: string;
308
- value: string;
309
- }
322
+ export type OptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
310
323
 
311
- export interface ListFiatCurrenciesResponse {
312
- currencies: FiatCurrency[];
324
+ 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 };
325
+
326
+ export interface RecordId {
327
+ type: string;
328
+ dataId: string;
313
329
  }
314
330
 
315
- export interface SendOnchainFeeQuote {
331
+ export interface Contact {
316
332
  id: string;
317
- expiresAt: number;
318
- speedFast: SendOnchainSpeedFeeQuote;
319
- speedMedium: SendOnchainSpeedFeeQuote;
320
- speedSlow: SendOnchainSpeedFeeQuote;
333
+ name: string;
334
+ paymentIdentifier: string;
335
+ createdAt: number;
336
+ updatedAt: number;
321
337
  }
322
338
 
323
- export interface PaymentRequestSource {
324
- bip21Uri?: string;
325
- bip353Address?: string;
339
+ export interface BuyBitcoinRequest {
340
+ lockedAmountSat?: number;
341
+ redirectUrl?: string;
326
342
  }
327
343
 
328
- export type PaymentType = "send" | "receive";
329
-
330
- export type ConversionStatus = "completed" | "refundNeeded" | "refunded";
344
+ export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
331
345
 
332
- export interface TokenBalance {
333
- balance: bigint;
334
- tokenMetadata: TokenMetadata;
346
+ export interface SparkInvoiceDetails {
347
+ invoice: string;
348
+ identityPublicKey: string;
349
+ network: BitcoinNetwork;
350
+ amount?: string;
351
+ tokenIdentifier?: string;
352
+ expiryTime?: number;
353
+ description?: string;
354
+ senderPublicKey?: string;
335
355
  }
336
356
 
337
- export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
338
-
339
- export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
357
+ export interface SparkInvoicePaymentDetails {
358
+ description?: string;
359
+ invoice: string;
360
+ }
340
361
 
341
362
  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);
342
363
 
343
- export interface BuyBitcoinResponse {
344
- url: string;
345
- }
346
-
347
- export interface ConversionStep {
348
- paymentId: string;
349
- amount: bigint;
350
- fee: bigint;
351
- method: PaymentMethod;
352
- tokenMetadata?: TokenMetadata;
364
+ export interface UserSettings {
365
+ sparkPrivateModeEnabled: boolean;
353
366
  }
354
367
 
355
- export interface RecordChange {
356
- id: RecordId;
357
- schemaVersion: string;
358
- updatedFields: Map<string, string>;
359
- localRevision: number;
368
+ export interface Symbol {
369
+ grapheme?: string;
370
+ template?: string;
371
+ rtl?: boolean;
372
+ position?: number;
360
373
  }
361
374
 
362
- export interface LocalizedName {
363
- locale: string;
364
- name: string;
375
+ export interface SendOnchainFeeQuote {
376
+ id: string;
377
+ expiresAt: number;
378
+ speedFast: SendOnchainSpeedFeeQuote;
379
+ speedMedium: SendOnchainSpeedFeeQuote;
380
+ speedSlow: SendOnchainSpeedFeeQuote;
365
381
  }
366
382
 
367
- export interface PrepareSendPaymentResponse {
368
- paymentMethod: SendPaymentMethod;
369
- amount: bigint;
370
- tokenIdentifier?: string;
371
- conversionEstimate?: ConversionEstimate;
372
- feePolicy: FeePolicy;
383
+ export interface ListFiatCurrenciesResponse {
384
+ currencies: FiatCurrency[];
373
385
  }
374
386
 
375
- export interface ClaimDepositRequest {
376
- txid: string;
377
- vout: number;
378
- maxFee?: MaxFee;
387
+ export interface GetPaymentResponse {
388
+ payment: Payment;
379
389
  }
380
390
 
381
- export interface ReceivePaymentResponse {
382
- paymentRequest: string;
383
- fee: bigint;
391
+ export interface LnurlPayRequestDetails {
392
+ callback: string;
393
+ minSendable: number;
394
+ maxSendable: number;
395
+ metadataStr: string;
396
+ commentAllowed: number;
397
+ domain: string;
398
+ url: string;
399
+ address?: string;
400
+ allowsNostr?: boolean;
401
+ nostrPubkey?: string;
384
402
  }
385
403
 
386
- export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
387
-
388
- export interface UpdateContactRequest {
389
- id: string;
390
- name: string;
391
- paymentIdentifier: string;
404
+ export interface SendOnchainSpeedFeeQuote {
405
+ userFeeSat: number;
406
+ l1BroadcastFeeSat: number;
392
407
  }
393
408
 
394
- export interface SilentPaymentAddressDetails {
395
- address: string;
396
- network: BitcoinNetwork;
397
- source: PaymentRequestSource;
409
+ export interface LightningAddressInfo {
410
+ description: string;
411
+ lightningAddress: string;
412
+ lnurl: LnurlInfo;
413
+ username: string;
398
414
  }
399
415
 
400
- export interface FiatCurrency {
401
- id: string;
402
- info: CurrencyInfo;
416
+ export interface Credentials {
417
+ username: string;
418
+ password: string;
403
419
  }
404
420
 
405
- export interface GetPaymentResponse {
406
- payment: Payment;
421
+ export interface CurrencyInfo {
422
+ name: string;
423
+ fractionSize: number;
424
+ spacing?: number;
425
+ symbol?: Symbol;
426
+ uniqSymbol?: Symbol;
427
+ localizedName: LocalizedName[];
428
+ localeOverrides: LocaleOverrides[];
407
429
  }
408
430
 
409
- export interface Config {
410
- apiKey?: string;
411
- network: Network;
412
- syncIntervalSecs: number;
413
- maxDepositClaimFee?: MaxFee;
414
- lnurlDomain?: string;
415
- preferSparkOverLightning: boolean;
416
- externalInputParsers?: ExternalInputParser[];
417
- useDefaultExternalInputParsers: boolean;
418
- realTimeSyncServerUrl?: string;
419
- privateEnabledDefault: boolean;
420
- optimizationConfig: OptimizationConfig;
421
- stableBalanceConfig?: StableBalanceConfig;
422
- /**
423
- * Maximum number of concurrent transfer claims.
424
- *
425
- * Controls how many pending Spark transfers can be claimed in parallel.
426
- * Default is 4. Increase for server environments with high incoming
427
- * payment volume to improve throughput.
428
- */
429
- maxConcurrentClaims: number;
430
- supportLnurlVerify: boolean;
431
+ export interface PrepareLnurlPayResponse {
432
+ amountSats: number;
433
+ comment?: string;
434
+ payRequest: LnurlPayRequestDetails;
435
+ feeSats: number;
436
+ invoiceDetails: Bolt11InvoiceDetails;
437
+ successAction?: SuccessAction;
438
+ conversionEstimate?: ConversionEstimate;
439
+ feePolicy: FeePolicy;
431
440
  }
432
441
 
433
- export interface ClaimDepositResponse {
434
- payment: Payment;
435
- }
442
+ export interface SyncWalletResponse {}
436
443
 
437
- export interface IncomingChange {
438
- newState: Record;
439
- oldState?: Record;
444
+ export interface SetLnurlMetadataItem {
445
+ paymentHash: string;
446
+ senderComment?: string;
447
+ nostrZapRequest?: string;
448
+ nostrZapReceipt?: string;
449
+ preimage?: string;
440
450
  }
441
451
 
442
- export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
443
-
444
- export interface OptimizationConfig {
445
- autoEnabled: boolean;
446
- multiplicity: number;
452
+ export interface Bolt11Invoice {
453
+ bolt11: string;
454
+ source: PaymentRequestSource;
447
455
  }
448
456
 
449
- export interface PrepareSendPaymentRequest {
450
- paymentRequest: string;
451
- amount?: bigint;
452
- tokenIdentifier?: string;
457
+ export interface PrepareLnurlPayRequest {
458
+ amountSats: number;
459
+ comment?: string;
460
+ payRequest: LnurlPayRequestDetails;
461
+ validateSuccessActionUrl?: boolean;
453
462
  conversionOptions?: ConversionOptions;
454
463
  feePolicy?: FeePolicy;
455
464
  }
456
465
 
457
- export interface MessageSuccessActionData {
458
- message: string;
466
+ export interface ListPaymentsResponse {
467
+ payments: Payment[];
459
468
  }
460
469
 
461
- 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 };
462
-
463
- export interface SignMessageResponse {
464
- pubkey: string;
465
- signature: string;
470
+ export interface RefundDepositResponse {
471
+ txId: string;
472
+ txHex: string;
466
473
  }
467
474
 
468
- export interface KeySetConfig {
469
- keySetType: KeySetType;
470
- useAddressIndex: boolean;
471
- accountNumber?: number;
475
+ export interface GetInfoRequest {
476
+ ensureSynced?: boolean;
472
477
  }
473
478
 
474
- 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 };
479
+ export interface CheckMessageResponse {
480
+ isValid: boolean;
481
+ }
475
482
 
476
- export interface UnversionedRecordChange {
477
- id: RecordId;
478
- schemaVersion: string;
479
- updatedFields: Map<string, string>;
483
+ export interface ReceivePaymentResponse {
484
+ paymentRequest: string;
485
+ fee: bigint;
480
486
  }
481
487
 
482
- export interface AddContactRequest {
483
- name: string;
484
- paymentIdentifier: string;
488
+ export interface PaymentRequestSource {
489
+ bip21Uri?: string;
490
+ bip353Address?: string;
485
491
  }
486
492
 
487
- export interface DepositInfo {
488
- txid: string;
489
- vout: number;
490
- amountSats: number;
491
- refundTx?: string;
492
- refundTxId?: string;
493
- claimError?: DepositClaimError;
493
+ 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 };
494
+
495
+ export interface LnurlPayResponse {
496
+ payment: Payment;
497
+ successAction?: SuccessActionProcessed;
494
498
  }
495
499
 
496
- export interface SetLnurlMetadataItem {
497
- paymentHash: string;
498
- senderComment?: string;
500
+ export interface LnurlReceiveMetadata {
499
501
  nostrZapRequest?: string;
500
502
  nostrZapReceipt?: string;
501
- preimage?: string;
503
+ senderComment?: string;
502
504
  }
503
505
 
504
- export interface AesSuccessActionDataDecrypted {
506
+ export interface AesSuccessActionData {
505
507
  description: string;
506
- plaintext: string;
508
+ ciphertext: string;
509
+ iv: string;
507
510
  }
508
511
 
509
- export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
512
+ export type StoragePaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[]; hasLnurlPreimage?: boolean };
510
513
 
511
- export interface UserSettings {
512
- sparkPrivateModeEnabled: boolean;
514
+ export interface LnurlWithdrawRequest {
515
+ amountSats: number;
516
+ withdrawRequest: LnurlWithdrawRequestDetails;
517
+ completionTimeoutSecs?: number;
513
518
  }
514
519
 
515
- export interface GetTokensMetadataRequest {
516
- tokenIdentifiers: string[];
520
+ export interface LnurlErrorDetails {
521
+ reason: string;
517
522
  }
518
523
 
519
- export type FeePolicy = "feesExcluded" | "feesIncluded";
524
+ export interface Bolt12Invoice {
525
+ invoice: string;
526
+ source: PaymentRequestSource;
527
+ }
520
528
 
521
- export type OptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
529
+ export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
522
530
 
523
- export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
531
+ export type TokenTransactionType = "transfer" | "mint" | "burn";
524
532
 
525
- export interface Credentials {
526
- username: string;
527
- password: string;
533
+ export interface LnurlWithdrawRequestDetails {
534
+ callback: string;
535
+ k1: string;
536
+ defaultDescription: string;
537
+ minWithdrawable: number;
538
+ maxWithdrawable: number;
528
539
  }
529
540
 
530
- export interface CheckMessageResponse {
531
- isValid: boolean;
541
+ export interface PaymentMetadata {
542
+ parentPaymentId?: string;
543
+ lnurlPayInfo?: LnurlPayInfo;
544
+ lnurlWithdrawInfo?: LnurlWithdrawInfo;
545
+ lnurlDescription?: string;
546
+ conversionInfo?: ConversionInfo;
532
547
  }
533
548
 
534
- 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 };
535
-
536
- export interface AesSuccessActionData {
537
- description: string;
538
- ciphertext: string;
539
- iv: string;
549
+ export interface ClaimHtlcPaymentRequest {
550
+ preimage: string;
540
551
  }
541
552
 
542
- export interface SparkHtlcDetails {
543
- paymentHash: string;
544
- preimage?: string;
545
- expiryTime: number;
546
- status: SparkHtlcStatus;
553
+ export interface UrlSuccessActionData {
554
+ description: string;
555
+ url: string;
556
+ matchesCallbackDomain: boolean;
547
557
  }
548
558
 
549
- export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
550
-
551
- export interface Symbol {
552
- grapheme?: string;
553
- template?: string;
554
- rtl?: boolean;
555
- position?: number;
556
- }
559
+ export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
557
560
 
558
- export interface LnurlPayResponse {
561
+ export interface SendPaymentResponse {
559
562
  payment: Payment;
560
- successAction?: SuccessActionProcessed;
561
563
  }
562
564
 
563
- export type Network = "mainnet" | "regtest";
565
+ export interface ListFiatRatesResponse {
566
+ rates: Rate[];
567
+ }
564
568
 
565
569
  export interface SyncWalletRequest {}
566
570
 
567
- export interface LnurlPayInfo {
568
- lnAddress?: string;
569
- comment?: string;
570
- domain?: string;
571
- metadata?: string;
572
- processedSuccessAction?: SuccessActionProcessed;
573
- rawSuccessAction?: SuccessAction;
571
+ export interface ConversionDetails {
572
+ from: ConversionStep;
573
+ to: ConversionStep;
574
574
  }
575
575
 
576
- export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
577
-
578
- export interface ProvisionalPayment {
579
- paymentId: string;
580
- amount: bigint;
581
- details: ProvisionalPaymentDetails;
576
+ export interface MessageSuccessActionData {
577
+ message: string;
582
578
  }
583
579
 
584
- export interface FetchConversionLimitsResponse {
585
- minFromAmount?: bigint;
586
- minToAmount?: bigint;
580
+ export interface OptimizationProgress {
581
+ isRunning: boolean;
582
+ currentRound: number;
583
+ totalRounds: number;
587
584
  }
588
585
 
589
- export interface GetTokensMetadataResponse {
590
- tokensMetadata: TokenMetadata[];
586
+ export interface RecordChange {
587
+ id: RecordId;
588
+ schemaVersion: string;
589
+ updatedFields: Map<string, string>;
590
+ localRevision: number;
591
591
  }
592
592
 
593
- export interface Bolt12OfferDetails {
594
- absoluteExpiry?: number;
595
- chains: string[];
596
- description?: string;
597
- issuer?: string;
598
- minAmount?: Amount;
599
- offer: Bolt12Offer;
600
- paths: Bolt12OfferBlindedPath[];
601
- signingPubkey?: string;
593
+ export interface Bolt11RouteHintHop {
594
+ srcNodeId: string;
595
+ shortChannelId: string;
596
+ feesBaseMsat: number;
597
+ feesProportionalMillionths: number;
598
+ cltvExpiryDelta: number;
599
+ htlcMinimumMsat?: number;
600
+ htlcMaximumMsat?: number;
602
601
  }
603
602
 
604
- export type StoragePaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[]; hasLnurlPreimage?: boolean };
605
-
606
- export interface ClaimHtlcPaymentResponse {
607
- payment: Payment;
603
+ export interface LocalizedName {
604
+ locale: string;
605
+ name: string;
608
606
  }
609
607
 
610
- export interface LnurlPayRequest {
611
- prepareResponse: PrepareLnurlPayResponse;
612
- idempotencyKey?: string;
608
+ export interface Bip21Details {
609
+ amountSat?: number;
610
+ assetId?: string;
611
+ uri: string;
612
+ extras: Bip21Extra[];
613
+ label?: string;
614
+ message?: string;
615
+ paymentMethods: InputType[];
613
616
  }
614
617
 
615
- export interface SparkAddressDetails {
616
- address: string;
617
- identityPublicKey: string;
618
- network: BitcoinNetwork;
619
- source: PaymentRequestSource;
618
+ export interface Record {
619
+ id: RecordId;
620
+ revision: number;
621
+ schemaVersion: string;
622
+ data: Map<string, string>;
620
623
  }
621
624
 
622
- export interface ConversionEstimate {
623
- options: ConversionOptions;
624
- amount: bigint;
625
- fee: bigint;
625
+ export interface ListUnclaimedDepositsResponse {
626
+ deposits: DepositInfo[];
626
627
  }
627
628
 
628
- export interface ExternalInputParser {
629
- providerId: string;
630
- inputRegex: string;
631
- parserUrl: string;
629
+ export interface ClaimDepositResponse {
630
+ payment: Payment;
632
631
  }
633
632
 
634
- export interface ListPaymentsRequest {
635
- typeFilter?: PaymentType[];
636
- statusFilter?: PaymentStatus[];
637
- assetFilter?: AssetFilter;
638
- paymentDetailsFilter?: PaymentDetailsFilter[];
639
- fromTimestamp?: number;
640
- toTimestamp?: number;
641
- offset?: number;
642
- limit?: number;
643
- sortAscending?: boolean;
644
- }
633
+ export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
645
634
 
646
- export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
635
+ export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
647
636
 
648
- export interface LnurlPayRequestDetails {
649
- callback: string;
650
- minSendable: number;
651
- maxSendable: number;
652
- metadataStr: string;
653
- commentAllowed: number;
654
- domain: string;
655
- url: string;
656
- address?: string;
657
- allowsNostr?: boolean;
658
- nostrPubkey?: string;
637
+ export interface Rate {
638
+ coin: string;
639
+ value: number;
659
640
  }
660
641
 
661
- export interface PrepareLnurlPayResponse {
662
- amountSats: number;
663
- comment?: string;
664
- payRequest: LnurlPayRequestDetails;
665
- feeSats: number;
666
- invoiceDetails: Bolt11InvoiceDetails;
667
- successAction?: SuccessAction;
668
- conversionEstimate?: ConversionEstimate;
669
- feePolicy: FeePolicy;
642
+ export interface PrepareSendPaymentRequest {
643
+ paymentRequest: string;
644
+ amount?: bigint;
645
+ tokenIdentifier?: string;
646
+ conversionOptions?: ConversionOptions;
647
+ feePolicy?: FeePolicy;
670
648
  }
671
649
 
672
- export interface SendPaymentRequest {
673
- prepareResponse: PrepareSendPaymentResponse;
674
- options?: SendPaymentOptions;
675
- idempotencyKey?: string;
650
+ export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" } | { type: "autoConversion" };
651
+
652
+ export interface Config {
653
+ apiKey?: string;
654
+ network: Network;
655
+ syncIntervalSecs: number;
656
+ maxDepositClaimFee?: MaxFee;
657
+ lnurlDomain?: string;
658
+ preferSparkOverLightning: boolean;
659
+ externalInputParsers?: ExternalInputParser[];
660
+ useDefaultExternalInputParsers: boolean;
661
+ realTimeSyncServerUrl?: string;
662
+ privateEnabledDefault: boolean;
663
+ optimizationConfig: OptimizationConfig;
664
+ stableBalanceConfig?: StableBalanceConfig;
665
+ /**
666
+ * Maximum number of concurrent transfer claims.
667
+ *
668
+ * Controls how many pending Spark transfers can be claimed in parallel.
669
+ * Default is 4. Increase for server environments with high incoming
670
+ * payment volume to improve throughput.
671
+ */
672
+ maxConcurrentClaims: number;
673
+ supportLnurlVerify: boolean;
676
674
  }
677
675
 
678
- 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 };
676
+ export interface SparkStatus {
677
+ status: ServiceStatus;
678
+ lastUpdated: number;
679
+ }
679
680
 
680
- export interface Bolt12Invoice {
681
- invoice: string;
682
- source: PaymentRequestSource;
681
+ export interface Bip21Extra {
682
+ key: string;
683
+ value: string;
683
684
  }
684
685
 
685
- export interface LightningAddressInfo {
686
- description: string;
687
- lightningAddress: string;
688
- lnurl: LnurlInfo;
689
- username: string;
686
+ export interface SendPaymentRequest {
687
+ prepareResponse: PrepareSendPaymentResponse;
688
+ options?: SendPaymentOptions;
689
+ idempotencyKey?: string;
690
690
  }
691
691
 
692
- export interface ReceivePaymentRequest {
693
- paymentMethod: ReceivePaymentMethod;
692
+ export interface Bolt12InvoiceDetails {
693
+ amountMsat: number;
694
+ invoice: Bolt12Invoice;
694
695
  }
695
696
 
696
- export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
697
-
698
- export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
699
-
700
- export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
701
-
702
- export interface Bolt12InvoiceRequestDetails {}
703
-
704
- export interface BitcoinAddressDetails {
705
- address: string;
706
- network: BitcoinNetwork;
707
- source: PaymentRequestSource;
697
+ export interface UnversionedRecordChange {
698
+ id: RecordId;
699
+ schemaVersion: string;
700
+ updatedFields: Map<string, string>;
708
701
  }
709
702
 
710
- export interface ConversionInfo {
711
- poolId: string;
712
- conversionId: string;
713
- status: ConversionStatus;
714
- fee?: string;
715
- purpose?: ConversionPurpose;
703
+ export interface GetInfoResponse {
704
+ identityPubkey: string;
705
+ balanceSats: number;
706
+ tokenBalances: Map<string, TokenBalance>;
716
707
  }
717
708
 
718
- export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
709
+ export interface Bolt12InvoiceRequestDetails {}
719
710
 
720
- export interface LnurlReceiveMetadata {
721
- nostrZapRequest?: string;
722
- nostrZapReceipt?: string;
723
- senderComment?: string;
711
+ export interface PrepareSendPaymentResponse {
712
+ paymentMethod: SendPaymentMethod;
713
+ amount: bigint;
714
+ tokenIdentifier?: string;
715
+ conversionEstimate?: ConversionEstimate;
716
+ feePolicy: FeePolicy;
724
717
  }
725
718
 
726
- export interface Rate {
727
- coin: string;
728
- value: number;
719
+ export interface BuyBitcoinResponse {
720
+ url: string;
729
721
  }
730
722
 
731
- export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
723
+ export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
732
724
 
733
- export interface UpdateUserSettingsRequest {
734
- sparkPrivateModeEnabled?: boolean;
735
- }
725
+ export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
736
726
 
737
- export interface SparkHtlcOptions {
738
- paymentHash: string;
739
- expiryDurationSecs: number;
727
+ export interface CheckLightningAddressRequest {
728
+ username: string;
740
729
  }
741
730
 
742
- export interface PrepareLnurlPayRequest {
743
- amountSats: number;
744
- comment?: string;
745
- payRequest: LnurlPayRequestDetails;
746
- validateSuccessActionUrl?: boolean;
747
- conversionOptions?: ConversionOptions;
748
- feePolicy?: FeePolicy;
749
- }
731
+ 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 };
750
732
 
751
- export interface RefundDepositResponse {
752
- txId: string;
753
- txHex: string;
733
+ export interface ListContactsRequest {
734
+ offset?: number;
735
+ limit?: number;
754
736
  }
755
737
 
756
- export interface CurrencyInfo {
757
- name: string;
758
- fractionSize: number;
759
- spacing?: number;
760
- symbol?: Symbol;
761
- uniqSymbol?: Symbol;
762
- localizedName: LocalizedName[];
763
- localeOverrides: LocaleOverrides[];
738
+ export interface SignMessageResponse {
739
+ pubkey: string;
740
+ signature: string;
764
741
  }
765
742
 
766
- export interface SparkStatus {
767
- status: ServiceStatus;
768
- lastUpdated: number;
743
+ export interface StorageListPaymentsRequest {
744
+ typeFilter?: PaymentType[];
745
+ statusFilter?: PaymentStatus[];
746
+ assetFilter?: AssetFilter;
747
+ paymentDetailsFilter?: StoragePaymentDetailsFilter[];
748
+ fromTimestamp?: number;
749
+ toTimestamp?: number;
750
+ offset?: number;
751
+ limit?: number;
752
+ sortAscending?: boolean;
769
753
  }
770
754
 
771
- export interface Contact {
772
- id: string;
773
- name: string;
774
- paymentIdentifier: string;
775
- createdAt: number;
776
- updatedAt: number;
777
- }
755
+ 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 };
778
756
 
779
- export interface UrlSuccessActionData {
780
- description: string;
781
- url: string;
782
- matchesCallbackDomain: boolean;
757
+ export interface LightningAddressDetails {
758
+ address: string;
759
+ payRequest: LnurlPayRequestDetails;
783
760
  }
784
761
 
785
- export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
762
+ export type PaymentStatus = "completed" | "pending" | "failed";
786
763
 
787
- export interface Bolt11InvoiceDetails {
788
- amountMsat?: number;
789
- description?: string;
790
- descriptionHash?: string;
791
- expiry: number;
792
- invoice: Bolt11Invoice;
793
- minFinalCltvExpiryDelta: number;
794
- network: BitcoinNetwork;
795
- payeePubkey: string;
796
- paymentHash: string;
797
- paymentSecret: string;
798
- routingHints: Bolt11RouteHint[];
799
- timestamp: number;
764
+ export interface CheckMessageRequest {
765
+ message: string;
766
+ pubkey: string;
767
+ signature: string;
800
768
  }
801
769
 
770
+ export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
771
+
802
772
  export interface RefundDepositRequest {
803
773
  txid: string;
804
774
  vout: number;
@@ -806,11 +776,10 @@ export interface RefundDepositRequest {
806
776
  fee: Fee;
807
777
  }
808
778
 
809
- export type TokenTransactionType = "transfer" | "mint" | "burn";
810
-
811
- export interface BuyBitcoinRequest {
812
- lockedAmountSat?: number;
813
- redirectUrl?: string;
779
+ export interface ExternalInputParser {
780
+ providerId: string;
781
+ inputRegex: string;
782
+ parserUrl: string;
814
783
  }
815
784
 
816
785
  export interface RegisterLightningAddressRequest {
@@ -818,68 +787,56 @@ export interface RegisterLightningAddressRequest {
818
787
  description?: string;
819
788
  }
820
789
 
821
- export interface GetInfoResponse {
822
- identityPubkey: string;
823
- balanceSats: number;
824
- tokenBalances: Map<string, TokenBalance>;
790
+ export interface Payment {
791
+ id: string;
792
+ paymentType: PaymentType;
793
+ status: PaymentStatus;
794
+ amount: bigint;
795
+ fees: bigint;
796
+ timestamp: number;
797
+ method: PaymentMethod;
798
+ details?: PaymentDetails;
799
+ conversionDetails?: ConversionDetails;
825
800
  }
826
801
 
827
- export interface Bolt12Offer {
828
- offer: string;
829
- source: PaymentRequestSource;
802
+ export interface SparkHtlcOptions {
803
+ paymentHash: string;
804
+ expiryDurationSecs: number;
830
805
  }
831
806
 
832
- export interface PaymentMetadata {
833
- parentPaymentId?: string;
834
- lnurlPayInfo?: LnurlPayInfo;
835
- lnurlWithdrawInfo?: LnurlWithdrawInfo;
836
- lnurlDescription?: string;
837
- conversionInfo?: ConversionInfo;
807
+ export interface GetTokensMetadataResponse {
808
+ tokensMetadata: TokenMetadata[];
838
809
  }
839
810
 
811
+ export type ConversionStatus = "completed" | "refundNeeded" | "refunded";
812
+
840
813
  export interface LocaleOverrides {
841
814
  locale: string;
842
815
  spacing?: number;
843
816
  symbol: Symbol;
844
817
  }
845
818
 
846
- export interface LnurlWithdrawRequest {
847
- amountSats: number;
848
- withdrawRequest: LnurlWithdrawRequestDetails;
849
- completionTimeoutSecs?: number;
850
- }
851
-
852
- export interface ConversionOptions {
853
- conversionType: ConversionType;
854
- maxSlippageBps?: number;
855
- completionTimeoutSecs?: number;
856
- }
857
-
858
- export interface CheckLightningAddressRequest {
859
- username: string;
860
- }
861
-
862
- export interface SparkInvoicePaymentDetails {
819
+ export interface Bolt12OfferDetails {
820
+ absoluteExpiry?: number;
821
+ chains: string[];
863
822
  description?: string;
864
- invoice: string;
823
+ issuer?: string;
824
+ minAmount?: Amount;
825
+ offer: Bolt12Offer;
826
+ paths: Bolt12OfferBlindedPath[];
827
+ signingPubkey?: string;
865
828
  }
866
829
 
867
- export interface SparkInvoiceDetails {
868
- invoice: string;
869
- identityPublicKey: string;
870
- network: BitcoinNetwork;
871
- amount?: string;
872
- tokenIdentifier?: string;
873
- expiryTime?: number;
874
- description?: string;
875
- senderPublicKey?: string;
830
+ export interface LnurlWithdrawResponse {
831
+ paymentRequest: string;
832
+ payment?: Payment;
876
833
  }
877
834
 
878
- export interface StorageListPaymentsRequest {
835
+ export interface ListPaymentsRequest {
879
836
  typeFilter?: PaymentType[];
880
837
  statusFilter?: PaymentStatus[];
881
838
  assetFilter?: AssetFilter;
882
- paymentDetailsFilter?: StoragePaymentDetailsFilter[];
839
+ paymentDetailsFilter?: PaymentDetailsFilter[];
883
840
  fromTimestamp?: number;
884
841
  toTimestamp?: number;
885
842
  offset?: number;
@@ -887,73 +844,116 @@ export interface StorageListPaymentsRequest {
887
844
  sortAscending?: boolean;
888
845
  }
889
846
 
890
- export interface ListFiatRatesResponse {
891
- rates: Rate[];
847
+ export interface GetTokensMetadataRequest {
848
+ tokenIdentifiers: string[];
849
+ }
850
+
851
+ export type PaymentType = "send" | "receive";
852
+
853
+ export interface ClaimDepositRequest {
854
+ txid: string;
855
+ vout: number;
856
+ maxFee?: MaxFee;
857
+ }
858
+
859
+ export interface SparkHtlcDetails {
860
+ paymentHash: string;
861
+ preimage?: string;
862
+ expiryTime: number;
863
+ status: SparkHtlcStatus;
864
+ }
865
+
866
+ export interface TokenBalance {
867
+ balance: bigint;
868
+ tokenMetadata: TokenMetadata;
892
869
  }
893
870
 
871
+ export interface LnurlAuthRequestDetails {
872
+ k1: string;
873
+ action?: string;
874
+ domain: string;
875
+ url: string;
876
+ }
877
+
878
+ export interface AddContactRequest {
879
+ name: string;
880
+ paymentIdentifier: string;
881
+ }
882
+
883
+ export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
884
+
885
+ export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
886
+
887
+ export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
888
+
894
889
  export interface LnurlWithdrawInfo {
895
890
  withdrawUrl: string;
896
891
  }
897
892
 
898
- export interface StableBalanceConfig {
899
- tokenIdentifier: string;
900
- thresholdSats?: number;
901
- maxSlippageBps?: number;
902
- reservedSats?: number;
893
+ export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
894
+
895
+ export interface BitcoinAddressDetails {
896
+ address: string;
897
+ network: BitcoinNetwork;
898
+ source: PaymentRequestSource;
903
899
  }
904
900
 
905
- export interface LnurlErrorDetails {
906
- reason: string;
901
+ export interface ClaimHtlcPaymentResponse {
902
+ payment: Payment;
907
903
  }
908
904
 
909
- export interface FetchConversionLimitsRequest {
910
- conversionType: ConversionType;
911
- tokenIdentifier?: string;
905
+ export interface SignMessageRequest {
906
+ message: string;
907
+ compact: boolean;
912
908
  }
913
909
 
914
- export interface GetPaymentRequest {
915
- paymentId: string;
910
+ export interface ReceivePaymentRequest {
911
+ paymentMethod: ReceivePaymentMethod;
916
912
  }
917
913
 
918
- export interface ListUnclaimedDepositsResponse {
919
- deposits: DepositInfo[];
914
+ export interface OutgoingChange {
915
+ change: RecordChange;
916
+ parent?: Record;
920
917
  }
921
918
 
922
- export interface ClaimHtlcPaymentRequest {
923
- preimage: string;
919
+ export interface StableBalanceConfig {
920
+ tokenIdentifier: string;
921
+ thresholdSats?: number;
922
+ maxSlippageBps?: number;
923
+ reservedSats?: number;
924
924
  }
925
925
 
926
- export interface Bolt11RouteHint {
927
- hops: Bolt11RouteHintHop[];
926
+ export interface OptimizationConfig {
927
+ autoEnabled: boolean;
928
+ multiplicity: number;
928
929
  }
929
930
 
930
- export interface OptimizationProgress {
931
- isRunning: boolean;
932
- currentRound: number;
933
- totalRounds: number;
931
+ export interface UpdateUserSettingsRequest {
932
+ sparkPrivateModeEnabled?: boolean;
934
933
  }
935
934
 
935
+ export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
936
+
936
937
  export interface LogEntry {
937
938
  line: string;
938
939
  level: string;
939
940
  }
940
941
 
941
- export interface RecordId {
942
- type: string;
943
- dataId: string;
944
- }
945
-
946
- export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" } | { type: "autoConversion" };
947
-
948
- export interface LnurlWithdrawResponse {
949
- paymentRequest: string;
950
- payment?: Payment;
942
+ export interface TokenMetadata {
943
+ identifier: string;
944
+ issuerPublicKey: string;
945
+ name: string;
946
+ ticker: string;
947
+ decimals: number;
948
+ maxSupply: string;
949
+ isFreezable: boolean;
951
950
  }
952
951
 
953
- export interface SyncWalletResponse {}
952
+ export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
954
953
 
955
- export interface Bolt12OfferBlindedPath {
956
- blindedHops: string[];
954
+ export interface AesSuccessActionDataDecrypted {
955
+ description: string;
956
+ plaintext: string;
957
957
  }
958
958
 
959
959
  /**
@@ -1008,40 +1008,40 @@ export interface PasskeyPrfProvider {
1008
1008
  isPrfAvailable(): Promise<boolean>;
1009
1009
  }
1010
1010
 
1011
- export interface FreezeIssuerTokenRequest {
1012
- address: string;
1013
- }
1014
-
1015
- export interface FreezeIssuerTokenResponse {
1016
- impactedOutputIds: string[];
1017
- impactedTokenAmount: bigint;
1011
+ export interface CreateIssuerTokenRequest {
1012
+ name: string;
1013
+ ticker: string;
1014
+ decimals: number;
1015
+ isFreezable: boolean;
1016
+ maxSupply: bigint;
1018
1017
  }
1019
1018
 
1020
1019
  export interface MintIssuerTokenRequest {
1021
1020
  amount: bigint;
1022
1021
  }
1023
1022
 
1024
- export interface UnfreezeIssuerTokenRequest {
1025
- address: string;
1026
- }
1027
-
1028
1023
  export interface UnfreezeIssuerTokenResponse {
1029
1024
  impactedOutputIds: string[];
1030
1025
  impactedTokenAmount: bigint;
1031
1026
  }
1032
1027
 
1033
- export interface CreateIssuerTokenRequest {
1034
- name: string;
1035
- ticker: string;
1036
- decimals: number;
1037
- isFreezable: boolean;
1038
- maxSupply: bigint;
1028
+ export interface FreezeIssuerTokenRequest {
1029
+ address: string;
1039
1030
  }
1040
1031
 
1041
1032
  export interface BurnIssuerTokenRequest {
1042
1033
  amount: bigint;
1043
1034
  }
1044
1035
 
1036
+ export interface FreezeIssuerTokenResponse {
1037
+ impactedOutputIds: string[];
1038
+ impactedTokenAmount: bigint;
1039
+ }
1040
+
1041
+ export interface UnfreezeIssuerTokenRequest {
1042
+ address: string;
1043
+ }
1044
+
1045
1045
  export interface ExternalSigner {
1046
1046
  identityPublicKey(): PublicKeyBytes;
1047
1047
  derivePublicKey(path: string): Promise<PublicKeyBytes>;
@@ -1065,139 +1065,125 @@ export interface ExternalSigner {
1065
1065
  hmacSha256(message: Uint8Array, path: string): Promise<HashedMessageBytes>;
1066
1066
  }
1067
1067
 
1068
- export interface ExternalFrostCommitments {
1069
- hidingCommitment: number[];
1070
- bindingCommitment: number[];
1071
- noncesCiphertext: number[];
1068
+ export interface MessageBytes {
1069
+ bytes: number[];
1072
1070
  }
1073
1071
 
1074
- export interface ExternalAggregateFrostRequest {
1072
+ export interface ExternalEncryptedSecret {
1073
+ ciphertext: number[];
1074
+ }
1075
+
1076
+ export interface ExternalSignFrostRequest {
1075
1077
  message: number[];
1076
- statechainSignatures: IdentifierSignaturePair[];
1077
- statechainPublicKeys: IdentifierPublicKeyPair[];
1078
+ publicKey: number[];
1079
+ secret: ExternalSecretSource;
1078
1080
  verifyingKey: number[];
1081
+ selfNonceCommitment: ExternalFrostCommitments;
1079
1082
  statechainCommitments: IdentifierCommitmentPair[];
1080
- selfCommitment: ExternalSigningCommitments;
1081
- publicKey: number[];
1082
- selfSignature: ExternalFrostSignatureShare;
1083
1083
  adaptorPublicKey?: number[];
1084
1084
  }
1085
1085
 
1086
- export interface HashedMessageBytes {
1087
- bytes: number[];
1088
- }
1089
-
1090
- export interface ExternalEncryptedSecret {
1091
- ciphertext: number[];
1092
- }
1086
+ export type ExternalSecretToSplit = { type: "secretSource"; source: ExternalSecretSource } | { type: "preimage"; data: number[] };
1093
1087
 
1094
- export interface PublicKeyBytes {
1088
+ export interface SecretBytes {
1095
1089
  bytes: number[];
1096
1090
  }
1097
1091
 
1098
- export interface ExternalIdentifier {
1099
- bytes: number[];
1092
+ export interface IdentifierCommitmentPair {
1093
+ identifier: ExternalIdentifier;
1094
+ commitment: ExternalSigningCommitments;
1100
1095
  }
1101
1096
 
1102
- export interface ExternalTreeNodeId {
1103
- id: string;
1097
+ export interface ExternalSecretShare {
1098
+ threshold: number;
1099
+ index: ExternalScalar;
1100
+ share: ExternalScalar;
1104
1101
  }
1105
1102
 
1106
- export interface SecretBytes {
1107
- bytes: number[];
1103
+ export interface ExternalVerifiableSecretShare {
1104
+ secretShare: ExternalSecretShare;
1105
+ proofs: number[][];
1108
1106
  }
1109
1107
 
1110
- export interface ExternalSigningCommitments {
1111
- hiding: number[];
1112
- binding: number[];
1108
+ export interface ExternalIdentifier {
1109
+ bytes: number[];
1113
1110
  }
1114
1111
 
1115
- export interface ExternalFrostSignatureShare {
1116
- bytes: number[];
1112
+ export interface IdentifierPublicKeyPair {
1113
+ identifier: ExternalIdentifier;
1114
+ publicKey: number[];
1117
1115
  }
1118
1116
 
1119
- export interface ExternalSignFrostRequest {
1117
+ export interface ExternalAggregateFrostRequest {
1120
1118
  message: number[];
1121
- publicKey: number[];
1122
- secret: ExternalSecretSource;
1119
+ statechainSignatures: IdentifierSignaturePair[];
1120
+ statechainPublicKeys: IdentifierPublicKeyPair[];
1123
1121
  verifyingKey: number[];
1124
- selfNonceCommitment: ExternalFrostCommitments;
1125
1122
  statechainCommitments: IdentifierCommitmentPair[];
1123
+ selfCommitment: ExternalSigningCommitments;
1124
+ publicKey: number[];
1125
+ selfSignature: ExternalFrostSignatureShare;
1126
1126
  adaptorPublicKey?: number[];
1127
1127
  }
1128
1128
 
1129
- export type ExternalSecretToSplit = { type: "secretSource"; source: ExternalSecretSource } | { type: "preimage"; data: number[] };
1130
-
1131
- export interface ExternalFrostSignature {
1132
- bytes: number[];
1129
+ export interface ExternalSigningCommitments {
1130
+ hiding: number[];
1131
+ binding: number[];
1133
1132
  }
1134
1133
 
1135
- export interface IdentifierPublicKeyPair {
1134
+ export interface IdentifierSignaturePair {
1136
1135
  identifier: ExternalIdentifier;
1137
- publicKey: number[];
1136
+ signature: ExternalFrostSignatureShare;
1138
1137
  }
1139
1138
 
1140
- export interface ExternalScalar {
1139
+ export interface RecoverableEcdsaSignatureBytes {
1141
1140
  bytes: number[];
1142
1141
  }
1143
1142
 
1144
1143
  export type ExternalSecretSource = { type: "derived"; nodeId: ExternalTreeNodeId } | { type: "encrypted"; key: ExternalEncryptedSecret };
1145
1144
 
1146
- export interface EcdsaSignatureBytes {
1145
+ export interface ExternalFrostSignature {
1147
1146
  bytes: number[];
1148
1147
  }
1149
1148
 
1150
- export interface SchnorrSignatureBytes {
1149
+ export interface ExternalFrostSignatureShare {
1151
1150
  bytes: number[];
1152
1151
  }
1153
1152
 
1154
- export interface RecoverableEcdsaSignatureBytes {
1155
- bytes: number[];
1153
+ export interface ExternalFrostCommitments {
1154
+ hidingCommitment: number[];
1155
+ bindingCommitment: number[];
1156
+ noncesCiphertext: number[];
1156
1157
  }
1157
1158
 
1158
- export interface ExternalSecretShare {
1159
- threshold: number;
1160
- index: ExternalScalar;
1161
- share: ExternalScalar;
1159
+ export interface EcdsaSignatureBytes {
1160
+ bytes: number[];
1162
1161
  }
1163
1162
 
1164
- export interface IdentifierSignaturePair {
1165
- identifier: ExternalIdentifier;
1166
- signature: ExternalFrostSignatureShare;
1163
+ export interface ExternalTreeNodeId {
1164
+ id: string;
1167
1165
  }
1168
1166
 
1169
- export interface ExternalVerifiableSecretShare {
1170
- secretShare: ExternalSecretShare;
1171
- proofs: number[][];
1167
+ export interface SchnorrSignatureBytes {
1168
+ bytes: number[];
1172
1169
  }
1173
1170
 
1174
- export interface MessageBytes {
1171
+ export interface HashedMessageBytes {
1175
1172
  bytes: number[];
1176
1173
  }
1177
1174
 
1178
- export interface IdentifierCommitmentPair {
1179
- identifier: ExternalIdentifier;
1180
- commitment: ExternalSigningCommitments;
1175
+ export interface ExternalScalar {
1176
+ bytes: number[];
1181
1177
  }
1182
1178
 
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 wallet name used for derivation.
1193
- */
1194
- name: string;
1179
+ export interface PublicKeyBytes {
1180
+ bytes: number[];
1195
1181
  }
1196
1182
 
1197
1183
  /**
1198
- * Nostr relay configuration for passkey wallet name operations.
1184
+ * Nostr relay configuration for passkey label operations.
1199
1185
  *
1200
- * Used by `Passkey.listWalletNames` and `Passkey.storeWalletName`.
1186
+ * Used by `Passkey.listLabels` and `Passkey.storeLabel`.
1201
1187
  */
1202
1188
  export interface NostrRelayConfig {
1203
1189
  /**
@@ -1211,6 +1197,20 @@ export interface NostrRelayConfig {
1211
1197
  timeoutSecs?: number;
1212
1198
  }
1213
1199
 
1200
+ /**
1201
+ * A wallet derived from a passkey.
1202
+ */
1203
+ export interface Wallet {
1204
+ /**
1205
+ * The derived seed.
1206
+ */
1207
+ seed: Seed;
1208
+ /**
1209
+ * The label used for derivation.
1210
+ */
1211
+ label: string;
1212
+ }
1213
+
1214
1214
  export interface Storage {
1215
1215
  getCachedItem: (key: string) => Promise<string | null>;
1216
1216
  setCachedItem: (key: string, value: string) => Promise<void>;
@@ -1340,35 +1340,35 @@ export class IntoUnderlyingSource {
1340
1340
  * Passkey-based wallet operations using WebAuthn PRF extension.
1341
1341
  *
1342
1342
  * Wraps a `PasskeyPrfProvider` and optional relay configuration to provide
1343
- * wallet derivation and name management via Nostr relays.
1343
+ * wallet derivation and label management via Nostr relays.
1344
1344
  */
1345
1345
  export class Passkey {
1346
1346
  free(): void;
1347
1347
  /**
1348
- * Derive a wallet for a given wallet name.
1348
+ * Derive a wallet for a given label.
1349
1349
  *
1350
- * Uses the passkey PRF to derive a `Wallet` containing the seed and resolved name.
1350
+ * Uses the passkey PRF to derive a `Wallet` containing the seed and resolved label.
1351
1351
  *
1352
- * @param walletName - Optional wallet name string (defaults to "Default")
1352
+ * @param label - Optional label string (defaults to "Default")
1353
1353
  */
1354
- getWallet(wallet_name?: string | null): Promise<Wallet>;
1354
+ getWallet(label?: string | null): Promise<Wallet>;
1355
1355
  /**
1356
- * Check if passkey PRF is available on this device.
1357
- */
1358
- isAvailable(): Promise<boolean>;
1359
- /**
1360
- * List all wallet names published to Nostr for this passkey's identity.
1356
+ * List all labels published to Nostr for this passkey's identity.
1361
1357
  *
1362
1358
  * Requires 1 PRF call (for Nostr identity derivation).
1363
1359
  */
1364
- listWalletNames(): Promise<string[]>;
1360
+ listLabels(): Promise<string[]>;
1365
1361
  /**
1366
- * Publish a wallet name to Nostr relays for this passkey's identity.
1362
+ * Publish a label to Nostr relays for this passkey's identity.
1367
1363
  *
1368
- * Idempotent: if the wallet name already exists, it is not published again.
1364
+ * Idempotent: if the label already exists, it is not published again.
1369
1365
  * Requires 1 PRF call.
1370
1366
  */
1371
- storeWalletName(wallet_name: string): Promise<void>;
1367
+ storeLabel(label: string): Promise<void>;
1368
+ /**
1369
+ * Check if passkey PRF is available on this device.
1370
+ */
1371
+ isAvailable(): Promise<boolean>;
1372
1372
  /**
1373
1373
  * Create a new `Passkey` instance.
1374
1374
  *