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