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