@breeztech/breez-sdk-spark 0.8.3-dev1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export function defaultExternalSigner(mnemonic: string, passphrase: string | null | undefined, network: Network, key_set_config?: KeySetConfig | null): DefaultSigner;
4
- export function connect(request: ConnectRequest): Promise<BreezSdk>;
5
4
  export function initLogging(logger: Logger, filter?: string | null): Promise<void>;
6
- export function connectWithSigner(config: Config, signer: ExternalSigner, storage_dir: string): Promise<BreezSdk>;
7
5
  export function defaultConfig(network: Network): Config;
8
6
  /**
9
7
  * Creates a default external signer from a mnemonic phrase.
@@ -11,6 +9,8 @@ export function defaultConfig(network: Network): Config;
11
9
  * This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
12
10
  */
13
11
  export function getSparkStatus(): Promise<SparkStatus>;
12
+ export function connectWithSigner(config: Config, signer: ExternalSigner, storage_dir: string): Promise<BreezSdk>;
13
+ export function connect(request: ConnectRequest): Promise<BreezSdk>;
14
14
  /**
15
15
  * Entry point invoked by JavaScript in a worker.
16
16
  */
@@ -53,22 +53,12 @@ export interface BitcoinChainService {
53
53
  recommendedFees(): Promise<RecommendedFees>;
54
54
  }
55
55
 
56
- export interface RecommendedFees {
57
- fastestFee: number;
58
- halfHourFee: number;
59
- hourFee: number;
60
- economyFee: number;
61
- minimumFee: number;
62
- }
63
-
64
56
  export interface TxStatus {
65
57
  confirmed: boolean;
66
58
  blockHeight?: number;
67
59
  blockTime?: number;
68
60
  }
69
61
 
70
- export type ChainApiType = "esplora" | "mempoolSpace";
71
-
72
62
  export interface Utxo {
73
63
  txid: string;
74
64
  vout: number;
@@ -76,376 +66,424 @@ export interface Utxo {
76
66
  status: TxStatus;
77
67
  }
78
68
 
69
+ export type ChainApiType = "esplora" | "mempoolSpace";
70
+
71
+ export interface RecommendedFees {
72
+ fastestFee: number;
73
+ halfHourFee: number;
74
+ hourFee: number;
75
+ economyFee: number;
76
+ minimumFee: number;
77
+ }
78
+
79
79
  export interface PaymentObserver {
80
80
  beforeSend: (payments: ProvisionalPayment[]) => Promise<void>;
81
81
  }
82
82
 
83
- export interface Bolt11InvoiceDetails {
84
- amountMsat?: number;
85
- description?: string;
86
- descriptionHash?: string;
87
- expiry: number;
88
- invoice: Bolt11Invoice;
89
- minFinalCltvExpiryDelta: number;
90
- network: BitcoinNetwork;
91
- payeePubkey: string;
92
- paymentHash: string;
93
- paymentSecret: string;
94
- routingHints: Bolt11RouteHint[];
95
- timestamp: number;
83
+ export interface ConversionDetails {
84
+ from: ConversionStep;
85
+ to: ConversionStep;
96
86
  }
97
87
 
98
- export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
99
-
100
- export interface CheckMessageRequest {
101
- message: string;
102
- pubkey: string;
103
- signature: string;
88
+ export interface Bolt12InvoiceDetails {
89
+ amountMsat: number;
90
+ invoice: Bolt12Invoice;
104
91
  }
105
92
 
106
- export interface FiatCurrency {
107
- id: string;
108
- info: CurrencyInfo;
93
+ export type AesSuccessActionDataResult = { type: "decrypted"; data: AesSuccessActionDataDecrypted } | { type: "errorStatus"; reason: string };
94
+
95
+ export interface LnurlPayResponse {
96
+ payment: Payment;
97
+ successAction?: SuccessActionProcessed;
109
98
  }
110
99
 
111
- export interface KeySetConfig {
112
- keySetType: KeySetType;
113
- useAddressIndex: boolean;
114
- accountNumber?: number;
100
+ export type OptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
101
+
102
+ export interface ReceivePaymentResponse {
103
+ paymentRequest: string;
104
+ fee: bigint;
115
105
  }
116
106
 
117
- export interface SendOnchainSpeedFeeQuote {
118
- userFeeSat: number;
119
- l1BroadcastFeeSat: number;
107
+ export interface SignMessageRequest {
108
+ message: string;
109
+ compact: boolean;
120
110
  }
121
111
 
122
- export interface Bolt12InvoiceRequestDetails {}
112
+ 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 };
123
113
 
124
- export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
114
+ export interface Config {
115
+ apiKey?: string;
116
+ network: Network;
117
+ syncIntervalSecs: number;
118
+ maxDepositClaimFee?: MaxFee;
119
+ lnurlDomain?: string;
120
+ preferSparkOverLightning: boolean;
121
+ externalInputParsers?: ExternalInputParser[];
122
+ useDefaultExternalInputParsers: boolean;
123
+ realTimeSyncServerUrl?: string;
124
+ privateEnabledDefault: boolean;
125
+ optimizationConfig: OptimizationConfig;
126
+ stableBalanceConfig?: StableBalanceConfig;
127
+ }
125
128
 
126
- export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
129
+ export interface SparkInvoicePaymentDetails {
130
+ description?: string;
131
+ invoice: string;
132
+ }
127
133
 
128
- export interface SendPaymentRequest {
129
- prepareResponse: PrepareSendPaymentResponse;
130
- options?: SendPaymentOptions;
131
- idempotencyKey?: string;
134
+ export interface SparkInvoiceDetails {
135
+ invoice: string;
136
+ identityPublicKey: string;
137
+ network: BitcoinNetwork;
138
+ amount?: string;
139
+ tokenIdentifier?: string;
140
+ expiryTime?: number;
141
+ description?: string;
142
+ senderPublicKey?: string;
132
143
  }
133
144
 
134
- export interface SendPaymentResponse {
135
- payment: Payment;
145
+ export interface LnurlErrorDetails {
146
+ reason: string;
136
147
  }
137
148
 
138
- export interface IncomingChange {
139
- newState: Record;
140
- oldState?: Record;
149
+ export interface RefundDepositResponse {
150
+ txId: string;
151
+ txHex: string;
141
152
  }
142
153
 
143
- export interface ConversionStep {
144
- paymentId: string;
154
+ export interface BuyBitcoinResponse {
155
+ url: string;
156
+ }
157
+
158
+ export interface Payment {
159
+ id: string;
160
+ paymentType: PaymentType;
161
+ status: PaymentStatus;
145
162
  amount: bigint;
146
- fee: bigint;
163
+ fees: bigint;
164
+ timestamp: number;
147
165
  method: PaymentMethod;
148
- tokenMetadata?: TokenMetadata;
166
+ details?: PaymentDetails;
167
+ conversionDetails?: ConversionDetails;
149
168
  }
150
169
 
151
- export interface ConversionInfo {
152
- poolId: string;
153
- conversionId: string;
154
- status: ConversionStatus;
155
- fee?: string;
156
- purpose?: ConversionPurpose;
170
+ export interface FetchConversionLimitsResponse {
171
+ minFromAmount?: bigint;
172
+ minToAmount?: bigint;
157
173
  }
158
174
 
159
- export interface CurrencyInfo {
160
- name: string;
161
- fractionSize: number;
162
- spacing?: number;
163
- symbol?: Symbol;
164
- uniqSymbol?: Symbol;
165
- localizedName: LocalizedName[];
166
- localeOverrides: LocaleOverrides[];
175
+ export interface LightningAddressDetails {
176
+ address: string;
177
+ payRequest: LnurlPayRequestDetails;
167
178
  }
168
179
 
169
- export type OptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
180
+ export type PaymentType = "send" | "receive";
170
181
 
171
- export interface TokenMetadata {
172
- identifier: string;
173
- issuerPublicKey: string;
174
- name: string;
175
- ticker: string;
176
- decimals: number;
177
- maxSupply: string;
178
- isFreezable: boolean;
182
+ export interface LnurlPayRequestDetails {
183
+ callback: string;
184
+ minSendable: number;
185
+ maxSendable: number;
186
+ metadataStr: string;
187
+ commentAllowed: number;
188
+ domain: string;
189
+ url: string;
190
+ address?: string;
191
+ allowsNostr?: boolean;
192
+ nostrPubkey?: string;
179
193
  }
180
194
 
181
- 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 };
195
+ export interface GetTokensMetadataResponse {
196
+ tokensMetadata: TokenMetadata[];
197
+ }
182
198
 
183
- export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
199
+ 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 };
184
200
 
185
- export interface Bolt12OfferBlindedPath {
186
- blindedHops: string[];
187
- }
201
+ export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
188
202
 
189
- export interface CheckMessageResponse {
190
- isValid: boolean;
203
+ export interface ListFiatCurrenciesResponse {
204
+ currencies: FiatCurrency[];
191
205
  }
192
206
 
193
- export interface Bip21Details {
194
- amountSat?: number;
195
- assetId?: string;
196
- uri: string;
197
- extras: Bip21Extra[];
198
- label?: string;
199
- message?: string;
200
- paymentMethods: InputType[];
207
+ export interface UpdateUserSettingsRequest {
208
+ sparkPrivateModeEnabled?: boolean;
201
209
  }
202
210
 
203
- export interface SparkStatus {
204
- status: ServiceStatus;
205
- lastUpdated: number;
206
- }
211
+ export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
207
212
 
208
- export interface LnurlWithdrawRequest {
209
- amountSats: number;
210
- withdrawRequest: LnurlWithdrawRequestDetails;
211
- completionTimeoutSecs?: number;
213
+ export interface OptimizationConfig {
214
+ autoEnabled: boolean;
215
+ multiplicity: number;
212
216
  }
213
217
 
214
- export interface RecordId {
215
- type: string;
216
- dataId: string;
218
+ export interface Record {
219
+ id: RecordId;
220
+ revision: number;
221
+ schemaVersion: string;
222
+ data: Map<string, string>;
217
223
  }
218
224
 
219
- export interface SparkAddressDetails {
220
- address: string;
221
- identityPublicKey: string;
222
- network: BitcoinNetwork;
225
+ export interface Bolt11Invoice {
226
+ bolt11: string;
223
227
  source: PaymentRequestSource;
224
228
  }
225
229
 
226
- export interface PrepareSendPaymentRequest {
227
- paymentRequest: string;
228
- amount?: bigint;
229
- tokenIdentifier?: string;
230
- conversionOptions?: ConversionOptions;
231
- feePolicy?: FeePolicy;
230
+ export interface ListPaymentsResponse {
231
+ payments: Payment[];
232
232
  }
233
233
 
234
- export interface LocaleOverrides {
235
- locale: string;
236
- spacing?: number;
237
- symbol: Symbol;
234
+ export interface LnurlWithdrawRequestDetails {
235
+ callback: string;
236
+ k1: string;
237
+ defaultDescription: string;
238
+ minWithdrawable: number;
239
+ maxWithdrawable: number;
238
240
  }
239
241
 
240
- export interface Bolt12Invoice {
241
- invoice: string;
242
- source: PaymentRequestSource;
242
+ export interface DepositInfo {
243
+ txid: string;
244
+ vout: number;
245
+ amountSats: number;
246
+ refundTx?: string;
247
+ refundTxId?: string;
248
+ claimError?: DepositClaimError;
243
249
  }
244
250
 
245
- export interface Symbol {
246
- grapheme?: string;
247
- template?: string;
248
- rtl?: boolean;
249
- position?: number;
251
+ export interface ConnectRequest {
252
+ config: Config;
253
+ seed: Seed;
254
+ storageDir: string;
250
255
  }
251
256
 
252
- export interface PrepareLnurlPayRequest {
253
- amountSats: number;
254
- comment?: string;
255
- payRequest: LnurlPayRequestDetails;
256
- validateSuccessActionUrl?: boolean;
257
- conversionOptions?: ConversionOptions;
258
- feePolicy?: FeePolicy;
257
+ export interface ClaimDepositResponse {
258
+ payment: Payment;
259
259
  }
260
260
 
261
- export interface UserSettings {
262
- sparkPrivateModeEnabled: boolean;
261
+ export interface LnurlWithdrawInfo {
262
+ withdrawUrl: string;
263
263
  }
264
264
 
265
- export interface ClaimDepositResponse {
266
- payment: Payment;
265
+ export interface LnurlWithdrawRequest {
266
+ amountSats: number;
267
+ withdrawRequest: LnurlWithdrawRequestDetails;
268
+ completionTimeoutSecs?: number;
267
269
  }
268
270
 
269
- export interface OptimizationConfig {
270
- autoEnabled: boolean;
271
- multiplicity: number;
271
+ export interface LogEntry {
272
+ line: string;
273
+ level: string;
272
274
  }
273
275
 
274
- export interface LocalizedName {
275
- locale: string;
276
- name: string;
276
+ export interface Bolt11RouteHint {
277
+ hops: Bolt11RouteHintHop[];
277
278
  }
278
279
 
279
- export interface SyncWalletRequest {}
280
-
281
- export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" | "major";
280
+ export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
282
281
 
283
- export interface LnurlWithdrawRequestDetails {
284
- callback: string;
285
- k1: string;
286
- defaultDescription: string;
287
- minWithdrawable: number;
288
- maxWithdrawable: number;
282
+ export interface BuyBitcoinRequest {
283
+ lockedAmountSat?: number;
284
+ redirectUrl?: string;
289
285
  }
290
286
 
291
- export interface Payment {
292
- id: string;
293
- paymentType: PaymentType;
294
- status: PaymentStatus;
295
- amount: bigint;
296
- fees: bigint;
297
- timestamp: number;
298
- method: PaymentMethod;
299
- details?: PaymentDetails;
300
- conversionDetails?: ConversionDetails;
287
+ export interface ExternalInputParser {
288
+ providerId: string;
289
+ inputRegex: string;
290
+ parserUrl: string;
301
291
  }
302
292
 
303
- export interface GetTokensMetadataRequest {
304
- tokenIdentifiers: string[];
293
+ export interface CheckLightningAddressRequest {
294
+ username: string;
305
295
  }
306
296
 
307
- export interface UnversionedRecordChange {
308
- id: RecordId;
309
- schemaVersion: string;
310
- updatedFields: Map<string, string>;
297
+ export interface LnurlAuthRequestDetails {
298
+ k1: string;
299
+ action?: string;
300
+ domain: string;
301
+ url: string;
311
302
  }
312
303
 
313
- export interface ClaimHtlcPaymentResponse {
314
- payment: Payment;
304
+ export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
305
+
306
+ export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
307
+
308
+ export interface LnurlPayInfo {
309
+ lnAddress?: string;
310
+ comment?: string;
311
+ domain?: string;
312
+ metadata?: string;
313
+ processedSuccessAction?: SuccessActionProcessed;
314
+ rawSuccessAction?: SuccessAction;
315
315
  }
316
316
 
317
- export interface LnurlPayRequest {
318
- prepareResponse: PrepareLnurlPayResponse;
319
- idempotencyKey?: string;
317
+ export interface LocalizedName {
318
+ locale: string;
319
+ name: string;
320
320
  }
321
321
 
322
- 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 };
322
+ export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
323
323
 
324
- export interface FetchConversionLimitsRequest {
325
- conversionType: ConversionType;
326
- tokenIdentifier?: string;
324
+ export interface Credentials {
325
+ username: string;
326
+ password: string;
327
327
  }
328
328
 
329
- export interface Rate {
330
- coin: string;
331
- value: number;
329
+ export interface LnurlWithdrawResponse {
330
+ paymentRequest: string;
331
+ payment?: Payment;
332
332
  }
333
333
 
334
- export type TokenTransactionType = "transfer" | "mint" | "burn";
334
+ export interface SendOnchainFeeQuote {
335
+ id: string;
336
+ expiresAt: number;
337
+ speedFast: SendOnchainSpeedFeeQuote;
338
+ speedMedium: SendOnchainSpeedFeeQuote;
339
+ speedSlow: SendOnchainSpeedFeeQuote;
340
+ }
335
341
 
336
- export interface SilentPaymentAddressDetails {
342
+ export interface SparkAddressDetails {
337
343
  address: string;
344
+ identityPublicKey: string;
338
345
  network: BitcoinNetwork;
339
346
  source: PaymentRequestSource;
340
347
  }
341
348
 
342
- export type Network = "mainnet" | "regtest";
343
-
344
- export interface ConversionEstimate {
345
- options: ConversionOptions;
346
- amount: bigint;
347
- fee: bigint;
349
+ export interface SilentPaymentAddressDetails {
350
+ address: string;
351
+ network: BitcoinNetwork;
352
+ source: PaymentRequestSource;
348
353
  }
349
354
 
350
- export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
355
+ export interface OutgoingChange {
356
+ change: RecordChange;
357
+ parent?: Record;
358
+ }
351
359
 
352
- export interface PaymentMetadata {
353
- parentPaymentId?: string;
354
- lnurlPayInfo?: LnurlPayInfo;
355
- lnurlWithdrawInfo?: LnurlWithdrawInfo;
356
- lnurlDescription?: string;
357
- conversionInfo?: ConversionInfo;
360
+ export interface TokenBalance {
361
+ balance: bigint;
362
+ tokenMetadata: TokenMetadata;
358
363
  }
359
364
 
360
- export interface ClaimHtlcPaymentRequest {
361
- preimage: string;
365
+ export interface LnurlPayRequest {
366
+ prepareResponse: PrepareLnurlPayResponse;
367
+ idempotencyKey?: string;
362
368
  }
363
369
 
364
- export interface LightningAddressInfo {
365
- description: string;
366
- lightningAddress: string;
367
- lnurl: LnurlInfo;
368
- username: string;
370
+ export interface SetLnurlMetadataItem {
371
+ paymentHash: string;
372
+ senderComment?: string;
373
+ nostrZapRequest?: string;
374
+ nostrZapReceipt?: string;
369
375
  }
370
376
 
371
- export interface Record {
372
- id: RecordId;
373
- revision: number;
374
- schemaVersion: string;
375
- data: Map<string, string>;
377
+ export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
378
+
379
+ export interface KeySetConfig {
380
+ keySetType: KeySetType;
381
+ useAddressIndex: boolean;
382
+ accountNumber?: number;
376
383
  }
377
384
 
378
- export interface Bolt11Invoice {
379
- bolt11: string;
380
- source: PaymentRequestSource;
385
+ export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
386
+
387
+ export interface GetPaymentResponse {
388
+ payment: Payment;
381
389
  }
382
390
 
383
- export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
391
+ export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
384
392
 
385
- export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
393
+ export interface SendPaymentRequest {
394
+ prepareResponse: PrepareSendPaymentResponse;
395
+ options?: SendPaymentOptions;
396
+ idempotencyKey?: string;
397
+ }
386
398
 
387
- export interface Credentials {
388
- username: string;
389
- password: string;
399
+ export interface PrepareLnurlPayResponse {
400
+ amountSats: number;
401
+ comment?: string;
402
+ payRequest: LnurlPayRequestDetails;
403
+ feeSats: number;
404
+ invoiceDetails: Bolt11InvoiceDetails;
405
+ successAction?: SuccessAction;
406
+ conversionEstimate?: ConversionEstimate;
407
+ feePolicy: FeePolicy;
390
408
  }
391
409
 
392
- export interface BuyBitcoinRequest {
393
- lockedAmountSat?: number;
394
- redirectUrl?: string;
410
+ export interface Bolt12OfferBlindedPath {
411
+ blindedHops: string[];
395
412
  }
396
413
 
397
- export interface GetInfoResponse {
398
- identityPubkey: string;
399
- balanceSats: number;
400
- tokenBalances: Map<string, TokenBalance>;
414
+ export interface FetchConversionLimitsRequest {
415
+ conversionType: ConversionType;
416
+ tokenIdentifier?: string;
401
417
  }
402
418
 
403
- export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
419
+ export interface SendOnchainSpeedFeeQuote {
420
+ userFeeSat: number;
421
+ l1BroadcastFeeSat: number;
422
+ }
404
423
 
405
424
  export interface Bip21Extra {
406
425
  key: string;
407
426
  value: string;
408
427
  }
409
428
 
410
- export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
429
+ 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 };
411
430
 
412
- export interface LnurlAuthRequestDetails {
413
- k1: string;
414
- action?: string;
415
- domain: string;
416
- url: string;
431
+ export interface SparkHtlcDetails {
432
+ paymentHash: string;
433
+ preimage?: string;
434
+ expiryTime: number;
435
+ status: SparkHtlcStatus;
417
436
  }
418
437
 
419
- 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);
438
+ export interface Bip21Details {
439
+ amountSat?: number;
440
+ assetId?: string;
441
+ uri: string;
442
+ extras: Bip21Extra[];
443
+ label?: string;
444
+ message?: string;
445
+ paymentMethods: InputType[];
446
+ }
420
447
 
421
- export type ConversionStatus = "completed" | "refundNeeded" | "refunded";
448
+ export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
422
449
 
423
- export interface LogEntry {
424
- line: string;
425
- level: string;
450
+ export interface LnurlInfo {
451
+ url: string;
452
+ bech32: string;
426
453
  }
427
454
 
428
- export interface ListUnclaimedDepositsResponse {
429
- deposits: DepositInfo[];
455
+ export interface LocaleOverrides {
456
+ locale: string;
457
+ spacing?: number;
458
+ symbol: Symbol;
430
459
  }
431
460
 
432
- export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
461
+ export interface AesSuccessActionDataDecrypted {
462
+ description: string;
463
+ plaintext: string;
464
+ }
433
465
 
434
- export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
466
+ export interface SendPaymentResponse {
467
+ payment: Payment;
468
+ }
435
469
 
436
- export interface Bolt12InvoiceDetails {
437
- amountMsat: number;
438
- invoice: Bolt12Invoice;
470
+ export interface Rate {
471
+ coin: string;
472
+ value: number;
439
473
  }
440
474
 
441
- export interface ReceivePaymentResponse {
442
- paymentRequest: string;
443
- fee: bigint;
475
+ export interface ClaimHtlcPaymentRequest {
476
+ preimage: string;
444
477
  }
445
478
 
446
- export interface LnurlWithdrawResponse {
447
- paymentRequest: string;
448
- payment?: Payment;
479
+ export interface ListFiatRatesResponse {
480
+ rates: Rate[];
481
+ }
482
+
483
+ export interface ProvisionalPayment {
484
+ paymentId: string;
485
+ amount: bigint;
486
+ details: ProvisionalPaymentDetails;
449
487
  }
450
488
 
451
489
  export interface PaymentRequestSource {
@@ -453,87 +491,99 @@ export interface PaymentRequestSource {
453
491
  bip353Address?: string;
454
492
  }
455
493
 
456
- export interface PrepareLnurlPayResponse {
457
- amountSats: number;
458
- comment?: string;
459
- payRequest: LnurlPayRequestDetails;
460
- feeSats: number;
461
- invoiceDetails: Bolt11InvoiceDetails;
462
- successAction?: SuccessAction;
463
- conversionEstimate?: ConversionEstimate;
464
- feePolicy: FeePolicy;
494
+ export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
495
+
496
+ export interface SparkHtlcOptions {
497
+ paymentHash: string;
498
+ expiryDurationSecs: number;
465
499
  }
466
500
 
467
- export interface AesSuccessActionData {
468
- description: string;
469
- ciphertext: string;
470
- iv: string;
501
+ export interface ReceivePaymentRequest {
502
+ paymentMethod: ReceivePaymentMethod;
471
503
  }
472
504
 
473
- export interface Config {
474
- apiKey?: string;
475
- network: Network;
476
- syncIntervalSecs: number;
477
- maxDepositClaimFee?: MaxFee;
478
- lnurlDomain?: string;
479
- preferSparkOverLightning: boolean;
480
- externalInputParsers?: ExternalInputParser[];
481
- useDefaultExternalInputParsers: boolean;
482
- realTimeSyncServerUrl?: string;
483
- privateEnabledDefault: boolean;
484
- optimizationConfig: OptimizationConfig;
485
- stableBalanceConfig?: StableBalanceConfig;
505
+ export interface ConversionOptions {
506
+ conversionType: ConversionType;
507
+ maxSlippageBps?: number;
508
+ completionTimeoutSecs?: number;
486
509
  }
487
510
 
488
- export interface ClaimDepositRequest {
511
+ export interface OptimizationProgress {
512
+ isRunning: boolean;
513
+ currentRound: number;
514
+ totalRounds: number;
515
+ }
516
+
517
+ export interface SignMessageResponse {
518
+ pubkey: string;
519
+ signature: string;
520
+ }
521
+
522
+ export interface Symbol {
523
+ grapheme?: string;
524
+ template?: string;
525
+ rtl?: boolean;
526
+ position?: number;
527
+ }
528
+
529
+ export interface RefundDepositRequest {
489
530
  txid: string;
490
531
  vout: number;
491
- maxFee?: MaxFee;
532
+ destinationAddress: string;
533
+ fee: Fee;
492
534
  }
493
535
 
494
- export interface ListFiatCurrenciesResponse {
495
- currencies: FiatCurrency[];
536
+ export interface ListUnclaimedDepositsResponse {
537
+ deposits: DepositInfo[];
496
538
  }
497
539
 
498
- export interface Bolt11RouteHintHop {
499
- srcNodeId: string;
500
- shortChannelId: string;
501
- feesBaseMsat: number;
502
- feesProportionalMillionths: number;
503
- cltvExpiryDelta: number;
504
- htlcMinimumMsat?: number;
505
- htlcMaximumMsat?: number;
506
- }
540
+ export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
541
+
542
+ export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" } | { type: "autoConversion" };
543
+
544
+ export type Network = "mainnet" | "regtest";
545
+
546
+ export type PaymentStatus = "completed" | "pending" | "failed";
507
547
 
508
- export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
548
+ export interface PrepareLnurlPayRequest {
549
+ amountSats: number;
550
+ comment?: string;
551
+ payRequest: LnurlPayRequestDetails;
552
+ validateSuccessActionUrl?: boolean;
553
+ conversionOptions?: ConversionOptions;
554
+ feePolicy?: FeePolicy;
555
+ }
509
556
 
510
- 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 };
557
+ 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);
511
558
 
512
- export interface OptimizationProgress {
513
- isRunning: boolean;
514
- currentRound: number;
515
- totalRounds: number;
559
+ export interface RecordChange {
560
+ id: RecordId;
561
+ schemaVersion: string;
562
+ updatedFields: Map<string, string>;
563
+ localRevision: number;
516
564
  }
517
565
 
518
- export interface PrepareSendPaymentResponse {
519
- paymentMethod: SendPaymentMethod;
520
- amount: bigint;
521
- tokenIdentifier?: string;
522
- conversionEstimate?: ConversionEstimate;
523
- feePolicy: FeePolicy;
566
+ export interface UnversionedRecordChange {
567
+ id: RecordId;
568
+ schemaVersion: string;
569
+ updatedFields: Map<string, string>;
524
570
  }
525
571
 
526
- export interface SignMessageRequest {
527
- message: string;
528
- compact: boolean;
572
+ 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 };
573
+
574
+ export interface FiatCurrency {
575
+ id: string;
576
+ info: CurrencyInfo;
529
577
  }
530
578
 
531
- export interface UrlSuccessActionData {
532
- description: string;
533
- url: string;
534
- matchesCallbackDomain: boolean;
579
+ export interface LnurlReceiveMetadata {
580
+ nostrZapRequest?: string;
581
+ nostrZapReceipt?: string;
582
+ senderComment?: string;
535
583
  }
536
584
 
585
+ export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
586
+
537
587
  export interface StableBalanceConfig {
538
588
  tokenIdentifier: string;
539
589
  thresholdSats?: number;
@@ -541,72 +591,53 @@ export interface StableBalanceConfig {
541
591
  reservedSats?: number;
542
592
  }
543
593
 
544
- export interface GetInfoRequest {
545
- ensureSynced?: boolean;
546
- }
547
-
548
- export interface LnurlPayRequestDetails {
549
- callback: string;
550
- minSendable: number;
551
- maxSendable: number;
552
- metadataStr: string;
553
- commentAllowed: number;
554
- domain: string;
555
- url: string;
556
- address?: string;
557
- allowsNostr?: boolean;
558
- nostrPubkey?: string;
594
+ export interface GetInfoResponse {
595
+ identityPubkey: string;
596
+ balanceSats: number;
597
+ tokenBalances: Map<string, TokenBalance>;
559
598
  }
560
599
 
561
- export interface GetTokensMetadataResponse {
562
- tokensMetadata: TokenMetadata[];
600
+ export interface ConversionInfo {
601
+ poolId: string;
602
+ conversionId: string;
603
+ status: ConversionStatus;
604
+ fee?: string;
605
+ purpose?: ConversionPurpose;
563
606
  }
564
607
 
565
- export interface SparkInvoiceDetails {
566
- invoice: string;
567
- identityPublicKey: string;
568
- network: BitcoinNetwork;
569
- amount?: string;
570
- tokenIdentifier?: string;
571
- expiryTime?: number;
572
- description?: string;
573
- senderPublicKey?: string;
608
+ export interface IncomingChange {
609
+ newState: Record;
610
+ oldState?: Record;
574
611
  }
575
612
 
576
- export interface OutgoingChange {
577
- change: RecordChange;
578
- parent?: Record;
613
+ export interface TokenMetadata {
614
+ identifier: string;
615
+ issuerPublicKey: string;
616
+ name: string;
617
+ ticker: string;
618
+ decimals: number;
619
+ maxSupply: string;
620
+ isFreezable: boolean;
579
621
  }
580
622
 
581
- export interface LnurlPayInfo {
582
- lnAddress?: string;
583
- comment?: string;
584
- domain?: string;
585
- metadata?: string;
586
- processedSuccessAction?: SuccessActionProcessed;
587
- rawSuccessAction?: SuccessAction;
623
+ export interface UserSettings {
624
+ sparkPrivateModeEnabled: boolean;
588
625
  }
589
626
 
590
- export interface RefundDepositRequest {
591
- txid: string;
592
- vout: number;
593
- destinationAddress: string;
594
- fee: Fee;
595
- }
627
+ 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 };
596
628
 
597
- export interface Bolt12Offer {
598
- offer: string;
629
+ export interface Bolt12Invoice {
630
+ invoice: string;
599
631
  source: PaymentRequestSource;
600
632
  }
601
633
 
602
- export interface ListUnclaimedDepositsRequest {}
603
-
604
- export interface BitcoinAddressDetails {
605
- address: string;
606
- network: BitcoinNetwork;
607
- source: PaymentRequestSource;
634
+ export interface RegisterLightningAddressRequest {
635
+ username: string;
636
+ description?: string;
608
637
  }
609
638
 
639
+ export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
640
+
610
641
  export interface ListPaymentsRequest {
611
642
  typeFilter?: PaymentType[];
612
643
  statusFilter?: PaymentStatus[];
@@ -619,155 +650,159 @@ export interface ListPaymentsRequest {
619
650
  sortAscending?: boolean;
620
651
  }
621
652
 
622
- export interface CheckLightningAddressRequest {
623
- username: string;
624
- }
625
-
626
- export interface RefundDepositResponse {
627
- txId: string;
628
- txHex: string;
653
+ export interface GetTokensMetadataRequest {
654
+ tokenIdentifiers: string[];
629
655
  }
630
656
 
631
- export interface SyncWalletResponse {}
632
-
633
- export interface UpdateUserSettingsRequest {
634
- sparkPrivateModeEnabled?: boolean;
657
+ export interface GetInfoRequest {
658
+ ensureSynced?: boolean;
635
659
  }
636
660
 
637
- export interface LnurlReceiveMetadata {
638
- nostrZapRequest?: string;
639
- nostrZapReceipt?: string;
640
- senderComment?: string;
661
+ export interface MessageSuccessActionData {
662
+ message: string;
641
663
  }
642
664
 
643
- export type PaymentStatus = "completed" | "pending" | "failed";
665
+ export interface SyncWalletRequest {}
644
666
 
645
- export interface FetchConversionLimitsResponse {
646
- minFromAmount?: bigint;
647
- minToAmount?: bigint;
667
+ export interface ConversionStep {
668
+ paymentId: string;
669
+ amount: bigint;
670
+ fee: bigint;
671
+ method: PaymentMethod;
672
+ tokenMetadata?: TokenMetadata;
648
673
  }
649
674
 
650
- export interface GetPaymentResponse {
651
- payment: Payment;
652
- }
675
+ export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
653
676
 
654
- export interface ListPaymentsResponse {
655
- payments: Payment[];
677
+ export interface PrepareSendPaymentResponse {
678
+ paymentMethod: SendPaymentMethod;
679
+ amount: bigint;
680
+ tokenIdentifier?: string;
681
+ conversionEstimate?: ConversionEstimate;
682
+ feePolicy: FeePolicy;
656
683
  }
657
684
 
658
- 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 };
659
-
660
- export interface ReceivePaymentRequest {
661
- paymentMethod: ReceivePaymentMethod;
685
+ export interface Bolt11RouteHintHop {
686
+ srcNodeId: string;
687
+ shortChannelId: string;
688
+ feesBaseMsat: number;
689
+ feesProportionalMillionths: number;
690
+ cltvExpiryDelta: number;
691
+ htlcMinimumMsat?: number;
692
+ htlcMaximumMsat?: number;
662
693
  }
663
694
 
664
- export interface SparkHtlcDetails {
665
- paymentHash: string;
666
- preimage?: string;
667
- expiryTime: number;
668
- status: SparkHtlcStatus;
695
+ export interface Bolt12Offer {
696
+ offer: string;
697
+ source: PaymentRequestSource;
669
698
  }
670
699
 
671
- export interface ExternalInputParser {
672
- providerId: string;
673
- inputRegex: string;
674
- parserUrl: string;
700
+ export interface PrepareSendPaymentRequest {
701
+ paymentRequest: string;
702
+ amount?: bigint;
703
+ tokenIdentifier?: string;
704
+ conversionOptions?: ConversionOptions;
705
+ feePolicy?: FeePolicy;
675
706
  }
676
707
 
677
- export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
678
-
679
- export interface SparkHtlcOptions {
680
- paymentHash: string;
681
- expiryDurationSecs: number;
682
- }
708
+ export interface SyncWalletResponse {}
683
709
 
684
- export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
710
+ export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
685
711
 
686
- export interface DepositInfo {
687
- txid: string;
688
- vout: number;
689
- amountSats: number;
690
- refundTx?: string;
691
- refundTxId?: string;
692
- claimError?: DepositClaimError;
693
- }
712
+ export type TokenTransactionType = "transfer" | "mint" | "burn";
694
713
 
695
- export interface LnurlErrorDetails {
696
- reason: string;
697
- }
714
+ export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
698
715
 
699
- export interface TokenBalance {
700
- balance: bigint;
701
- tokenMetadata: TokenMetadata;
716
+ export interface ConversionEstimate {
717
+ options: ConversionOptions;
718
+ amount: bigint;
719
+ fee: bigint;
702
720
  }
703
721
 
704
722
  export interface GetPaymentRequest {
705
723
  paymentId: string;
706
724
  }
707
725
 
708
- export interface SignMessageResponse {
709
- pubkey: string;
710
- signature: string;
711
- }
712
-
713
- export interface BuyBitcoinResponse {
714
- url: string;
726
+ export interface ClaimDepositRequest {
727
+ txid: string;
728
+ vout: number;
729
+ maxFee?: MaxFee;
715
730
  }
716
731
 
717
- export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
732
+ export interface ListUnclaimedDepositsRequest {}
718
733
 
719
- export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
734
+ export interface SparkStatus {
735
+ status: ServiceStatus;
736
+ lastUpdated: number;
737
+ }
720
738
 
721
- export interface Bolt11RouteHint {
722
- hops: Bolt11RouteHintHop[];
739
+ export interface RecordId {
740
+ type: string;
741
+ dataId: string;
742
+ }
743
+
744
+ export interface AesSuccessActionData {
745
+ description: string;
746
+ ciphertext: string;
747
+ iv: string;
723
748
  }
724
749
 
725
- export interface ProvisionalPayment {
726
- paymentId: string;
727
- amount: bigint;
728
- details: ProvisionalPaymentDetails;
750
+ export interface BitcoinAddressDetails {
751
+ address: string;
752
+ network: BitcoinNetwork;
753
+ source: PaymentRequestSource;
729
754
  }
730
755
 
731
- export interface LnurlPayResponse {
732
- payment: Payment;
733
- successAction?: SuccessActionProcessed;
756
+ export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
757
+
758
+ export interface UrlSuccessActionData {
759
+ description: string;
760
+ url: string;
761
+ matchesCallbackDomain: boolean;
734
762
  }
735
763
 
736
- export interface LnurlWithdrawInfo {
737
- withdrawUrl: string;
764
+ export interface LightningAddressInfo {
765
+ description: string;
766
+ lightningAddress: string;
767
+ lnurl: LnurlInfo;
768
+ username: string;
738
769
  }
739
770
 
740
- export interface ConversionDetails {
741
- from: ConversionStep;
742
- to: ConversionStep;
771
+ export interface PaymentMetadata {
772
+ parentPaymentId?: string;
773
+ lnurlPayInfo?: LnurlPayInfo;
774
+ lnurlWithdrawInfo?: LnurlWithdrawInfo;
775
+ lnurlDescription?: string;
776
+ conversionInfo?: ConversionInfo;
743
777
  }
744
778
 
745
- export interface ConnectRequest {
746
- config: Config;
747
- seed: Seed;
748
- storageDir: string;
779
+ export interface Bolt12InvoiceRequestDetails {}
780
+
781
+ export interface CheckMessageResponse {
782
+ isValid: boolean;
749
783
  }
750
784
 
751
- export interface SetLnurlMetadataItem {
785
+ export interface Bolt11InvoiceDetails {
786
+ amountMsat?: number;
787
+ description?: string;
788
+ descriptionHash?: string;
789
+ expiry: number;
790
+ invoice: Bolt11Invoice;
791
+ minFinalCltvExpiryDelta: number;
792
+ network: BitcoinNetwork;
793
+ payeePubkey: string;
752
794
  paymentHash: string;
753
- senderComment?: string;
754
- nostrZapRequest?: string;
755
- nostrZapReceipt?: string;
795
+ paymentSecret: string;
796
+ routingHints: Bolt11RouteHint[];
797
+ timestamp: number;
756
798
  }
757
799
 
758
- export interface SendOnchainFeeQuote {
759
- id: string;
760
- expiresAt: number;
761
- speedFast: SendOnchainSpeedFeeQuote;
762
- speedMedium: SendOnchainSpeedFeeQuote;
763
- speedSlow: SendOnchainSpeedFeeQuote;
764
- }
800
+ export type ConversionStatus = "completed" | "refundNeeded" | "refunded";
765
801
 
766
- export interface RecordChange {
767
- id: RecordId;
768
- schemaVersion: string;
769
- updatedFields: Map<string, string>;
770
- localRevision: number;
802
+ export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" | "major";
803
+
804
+ export interface ClaimHtlcPaymentResponse {
805
+ payment: Payment;
771
806
  }
772
807
 
773
808
  export interface Bolt12OfferDetails {
@@ -781,61 +816,43 @@ export interface Bolt12OfferDetails {
781
816
  signingPubkey?: string;
782
817
  }
783
818
 
784
- export interface LightningAddressDetails {
785
- address: string;
786
- payRequest: LnurlPayRequestDetails;
819
+ export interface CheckMessageRequest {
820
+ message: string;
821
+ pubkey: string;
822
+ signature: string;
787
823
  }
788
824
 
789
- export type AesSuccessActionDataResult = { type: "decrypted"; data: AesSuccessActionDataDecrypted } | { type: "errorStatus"; reason: string };
790
-
791
- export interface AesSuccessActionDataDecrypted {
792
- description: string;
793
- plaintext: string;
825
+ export interface CurrencyInfo {
826
+ name: string;
827
+ fractionSize: number;
828
+ spacing?: number;
829
+ symbol?: Symbol;
830
+ uniqSymbol?: Symbol;
831
+ localizedName: LocalizedName[];
832
+ localeOverrides: LocaleOverrides[];
794
833
  }
795
834
 
796
835
  export type FeePolicy = "feesExcluded" | "feesIncluded";
797
836
 
798
- export interface LnurlInfo {
799
- url: string;
800
- bech32: string;
801
- }
802
-
803
- export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
804
-
805
- export interface ConversionOptions {
806
- conversionType: ConversionType;
807
- maxSlippageBps?: number;
808
- completionTimeoutSecs?: number;
809
- }
810
-
811
- export interface SparkInvoicePaymentDetails {
812
- description?: string;
813
- invoice: string;
837
+ export interface MintIssuerTokenRequest {
838
+ amount: bigint;
814
839
  }
815
840
 
816
- export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
817
-
818
- export interface RegisterLightningAddressRequest {
819
- username: string;
820
- description?: string;
841
+ export interface UnfreezeIssuerTokenRequest {
842
+ address: string;
821
843
  }
822
844
 
823
- 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 };
824
-
825
- export interface ListFiatRatesResponse {
826
- rates: Rate[];
845
+ export interface FreezeIssuerTokenRequest {
846
+ address: string;
827
847
  }
828
848
 
829
- export type PaymentType = "send" | "receive";
830
-
831
- export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" } | { type: "autoConversion" };
832
-
833
- export interface MessageSuccessActionData {
834
- message: string;
849
+ export interface BurnIssuerTokenRequest {
850
+ amount: bigint;
835
851
  }
836
852
 
837
- export interface UnfreezeIssuerTokenRequest {
838
- address: string;
853
+ export interface FreezeIssuerTokenResponse {
854
+ impactedOutputIds: string[];
855
+ impactedTokenAmount: bigint;
839
856
  }
840
857
 
841
858
  export interface CreateIssuerTokenRequest {
@@ -851,23 +868,6 @@ export interface UnfreezeIssuerTokenResponse {
851
868
  impactedTokenAmount: bigint;
852
869
  }
853
870
 
854
- export interface FreezeIssuerTokenResponse {
855
- impactedOutputIds: string[];
856
- impactedTokenAmount: bigint;
857
- }
858
-
859
- export interface BurnIssuerTokenRequest {
860
- amount: bigint;
861
- }
862
-
863
- export interface FreezeIssuerTokenRequest {
864
- address: string;
865
- }
866
-
867
- export interface MintIssuerTokenRequest {
868
- amount: bigint;
869
- }
870
-
871
871
  export interface ExternalSigner {
872
872
  identityPublicKey(): PublicKeyBytes;
873
873
  derivePublicKey(path: string): Promise<PublicKeyBytes>;
@@ -891,61 +891,61 @@ export interface ExternalSigner {
891
891
  hmacSha256(message: Uint8Array, path: string): Promise<HashedMessageBytes>;
892
892
  }
893
893
 
894
- export interface ExternalScalar {
894
+ export interface PublicKeyBytes {
895
895
  bytes: number[];
896
896
  }
897
897
 
898
- export interface ExternalVerifiableSecretShare {
899
- secretShare: ExternalSecretShare;
900
- proofs: number[][];
898
+ export interface ExternalFrostCommitments {
899
+ hidingCommitment: number[];
900
+ bindingCommitment: number[];
901
+ noncesCiphertext: number[];
901
902
  }
902
903
 
903
- export interface ExternalEncryptedSecret {
904
- ciphertext: number[];
904
+ export interface ExternalTreeNodeId {
905
+ id: string;
905
906
  }
906
907
 
907
- export interface SchnorrSignatureBytes {
908
+ export interface SecretBytes {
908
909
  bytes: number[];
909
910
  }
910
911
 
911
- export type ExternalSecretToSplit = { type: "secretSource"; source: ExternalSecretSource } | { type: "preimage"; data: number[] };
912
+ export interface IdentifierCommitmentPair {
913
+ identifier: ExternalIdentifier;
914
+ commitment: ExternalSigningCommitments;
915
+ }
912
916
 
913
- export interface ExternalIdentifier {
917
+ export interface ExternalFrostSignatureShare {
914
918
  bytes: number[];
915
919
  }
916
920
 
917
- export interface ExternalSignFrostRequest {
918
- message: number[];
919
- publicKey: number[];
920
- secret: ExternalSecretSource;
921
- verifyingKey: number[];
922
- selfNonceCommitment: ExternalFrostCommitments;
923
- statechainCommitments: IdentifierCommitmentPair[];
924
- adaptorPublicKey?: number[];
921
+ export interface SchnorrSignatureBytes {
922
+ bytes: number[];
925
923
  }
926
924
 
927
- export interface SecretBytes {
925
+ export type ExternalSecretToSplit = { type: "secretSource"; source: ExternalSecretSource } | { type: "preimage"; data: number[] };
926
+
927
+ export interface ExternalFrostSignature {
928
928
  bytes: number[];
929
929
  }
930
930
 
931
- export interface IdentifierCommitmentPair {
932
- identifier: ExternalIdentifier;
933
- commitment: ExternalSigningCommitments;
931
+ export interface ExternalScalar {
932
+ bytes: number[];
934
933
  }
935
934
 
936
- export interface IdentifierSignaturePair {
937
- identifier: ExternalIdentifier;
938
- signature: ExternalFrostSignatureShare;
935
+ export interface MessageBytes {
936
+ bytes: number[];
939
937
  }
940
938
 
941
- export interface HashedMessageBytes {
939
+ export interface ExternalIdentifier {
942
940
  bytes: number[];
943
941
  }
944
942
 
945
- export interface ExternalFrostSignatureShare {
943
+ export interface HashedMessageBytes {
946
944
  bytes: number[];
947
945
  }
948
946
 
947
+ export type ExternalSecretSource = { type: "derived"; nodeId: ExternalTreeNodeId } | { type: "encrypted"; key: ExternalEncryptedSecret };
948
+
949
949
  export interface ExternalAggregateFrostRequest {
950
950
  message: number[];
951
951
  statechainSignatures: IdentifierSignaturePair[];
@@ -958,20 +958,18 @@ export interface ExternalAggregateFrostRequest {
958
958
  adaptorPublicKey?: number[];
959
959
  }
960
960
 
961
- export type ExternalSecretSource = { type: "derived"; nodeId: ExternalTreeNodeId } | { type: "encrypted"; key: ExternalEncryptedSecret };
962
-
963
- export interface PublicKeyBytes {
964
- bytes: number[];
961
+ export interface ExternalVerifiableSecretShare {
962
+ secretShare: ExternalSecretShare;
963
+ proofs: number[][];
965
964
  }
966
965
 
967
- export interface ExternalFrostCommitments {
968
- hidingCommitment: number[];
969
- bindingCommitment: number[];
970
- noncesCiphertext: number[];
966
+ export interface ExternalEncryptedSecret {
967
+ ciphertext: number[];
971
968
  }
972
969
 
973
- export interface RecoverableEcdsaSignatureBytes {
974
- bytes: number[];
970
+ export interface IdentifierSignaturePair {
971
+ identifier: ExternalIdentifier;
972
+ signature: ExternalFrostSignatureShare;
975
973
  }
976
974
 
977
975
  export interface IdentifierPublicKeyPair {
@@ -979,22 +977,24 @@ export interface IdentifierPublicKeyPair {
979
977
  publicKey: number[];
980
978
  }
981
979
 
982
- export interface ExternalSecretShare {
983
- threshold: number;
984
- index: ExternalScalar;
985
- share: ExternalScalar;
986
- }
987
-
988
980
  export interface EcdsaSignatureBytes {
989
981
  bytes: number[];
990
982
  }
991
983
 
992
- export interface MessageBytes {
993
- bytes: number[];
984
+ export interface ExternalSignFrostRequest {
985
+ message: number[];
986
+ publicKey: number[];
987
+ secret: ExternalSecretSource;
988
+ verifyingKey: number[];
989
+ selfNonceCommitment: ExternalFrostCommitments;
990
+ statechainCommitments: IdentifierCommitmentPair[];
991
+ adaptorPublicKey?: number[];
994
992
  }
995
993
 
996
- export interface ExternalFrostSignature {
997
- bytes: number[];
994
+ export interface ExternalSecretShare {
995
+ threshold: number;
996
+ index: ExternalScalar;
997
+ share: ExternalScalar;
998
998
  }
999
999
 
1000
1000
  export interface ExternalSigningCommitments {
@@ -1002,8 +1002,8 @@ export interface ExternalSigningCommitments {
1002
1002
  binding: number[];
1003
1003
  }
1004
1004
 
1005
- export interface ExternalTreeNodeId {
1006
- id: string;
1005
+ export interface RecoverableEcdsaSignatureBytes {
1006
+ bytes: number[];
1007
1007
  }
1008
1008
 
1009
1009
  export interface Storage {