@breeztech/breez-sdk-spark 0.7.2 → 0.7.4
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 +387 -360
- package/bundler/breez_sdk_spark_wasm_bg.js +72 -44
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
- package/bundler/storage/index.js +8 -9
- package/deno/breez_sdk_spark_wasm.d.ts +387 -360
- package/deno/breez_sdk_spark_wasm.js +71 -44
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
- package/nodejs/breez_sdk_spark_wasm.d.ts +387 -360
- package/nodejs/breez_sdk_spark_wasm.js +72 -44
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
- package/nodejs/storage/index.cjs +15 -16
- package/nodejs/storage/migrations.cjs +6 -0
- package/package.json +1 -1
- package/web/breez_sdk_spark_wasm.d.ts +394 -365
- package/web/breez_sdk_spark_wasm.js +71 -44
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
- package/web/storage/index.js +8 -9
|
@@ -79,92 +79,84 @@ export interface PaymentObserver {
|
|
|
79
79
|
beforeSend: (payments: ProvisionalPayment[]) => Promise<void>;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
export interface
|
|
83
|
-
|
|
82
|
+
export interface LocalizedName {
|
|
83
|
+
locale: string;
|
|
84
|
+
name: string;
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
export interface ListUnclaimedDepositsResponse {
|
|
87
88
|
deposits: DepositInfo[];
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
export
|
|
91
|
+
export interface SyncWalletRequest {}
|
|
91
92
|
|
|
92
|
-
export
|
|
93
|
-
paymentHash: string;
|
|
94
|
-
preimage?: string;
|
|
95
|
-
expiryTime: number;
|
|
96
|
-
status: SparkHtlcStatus;
|
|
97
|
-
}
|
|
93
|
+
export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails; conversionInfo?: ConversionInfo } | { type: "token"; metadata: TokenMetadata; txHash: string; invoiceDetails?: SparkInvoicePaymentDetails; conversionInfo?: ConversionInfo } | { type: "lightning"; description?: string; preimage?: string; invoice: string; paymentHash: string; destinationPubkey: string; lnurlPayInfo?: LnurlPayInfo; lnurlWithdrawInfo?: LnurlWithdrawInfo; lnurlReceiveMetadata?: LnurlReceiveMetadata } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string };
|
|
98
94
|
|
|
99
|
-
export type
|
|
95
|
+
export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string };
|
|
100
96
|
|
|
101
97
|
export type InputType = ({ type: "bitcoinAddress" } & BitcoinAddressDetails) | ({ type: "bolt11Invoice" } & Bolt11InvoiceDetails) | ({ type: "bolt12Invoice" } & Bolt12InvoiceDetails) | ({ type: "bolt12Offer" } & Bolt12OfferDetails) | ({ type: "lightningAddress" } & LightningAddressDetails) | ({ type: "lnurlPay" } & LnurlPayRequestDetails) | ({ type: "silentPaymentAddress" } & SilentPaymentAddressDetails) | ({ type: "lnurlAuth" } & LnurlAuthRequestDetails) | ({ type: "url" } & string) | ({ type: "bip21" } & Bip21Details) | ({ type: "bolt12InvoiceRequest" } & Bolt12InvoiceRequestDetails) | ({ type: "lnurlWithdraw" } & LnurlWithdrawRequestDetails) | ({ type: "sparkAddress" } & SparkAddressDetails) | ({ type: "sparkInvoice" } & SparkInvoiceDetails);
|
|
102
98
|
|
|
103
|
-
export interface
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
symbol: Symbol;
|
|
99
|
+
export interface FiatCurrency {
|
|
100
|
+
id: string;
|
|
101
|
+
info: CurrencyInfo;
|
|
107
102
|
}
|
|
108
103
|
|
|
109
|
-
export interface
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
payRequest: LnurlPayRequestDetails;
|
|
113
|
-
feeSats: number;
|
|
114
|
-
invoiceDetails: Bolt11InvoiceDetails;
|
|
115
|
-
successAction?: SuccessAction;
|
|
104
|
+
export interface ReceivePaymentResponse {
|
|
105
|
+
paymentRequest: string;
|
|
106
|
+
fee: bigint;
|
|
116
107
|
}
|
|
117
108
|
|
|
118
|
-
export interface
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
tokenConversionOptions?: TokenConversionOptions;
|
|
109
|
+
export interface LnurlWithdrawRequest {
|
|
110
|
+
amountSats: number;
|
|
111
|
+
withdrawRequest: LnurlWithdrawRequestDetails;
|
|
112
|
+
completionTimeoutSecs?: number;
|
|
123
113
|
}
|
|
124
114
|
|
|
125
|
-
export interface
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
spacing?: number;
|
|
129
|
-
symbol?: Symbol;
|
|
130
|
-
uniqSymbol?: Symbol;
|
|
131
|
-
localizedName: LocalizedName[];
|
|
132
|
-
localeOverrides: LocaleOverrides[];
|
|
115
|
+
export interface Rate {
|
|
116
|
+
coin: string;
|
|
117
|
+
value: number;
|
|
133
118
|
}
|
|
134
119
|
|
|
135
|
-
export
|
|
120
|
+
export interface SendOnchainFeeQuote {
|
|
121
|
+
id: string;
|
|
122
|
+
expiresAt: number;
|
|
123
|
+
speedFast: SendOnchainSpeedFeeQuote;
|
|
124
|
+
speedMedium: SendOnchainSpeedFeeQuote;
|
|
125
|
+
speedSlow: SendOnchainSpeedFeeQuote;
|
|
126
|
+
}
|
|
136
127
|
|
|
137
|
-
export interface
|
|
138
|
-
|
|
128
|
+
export interface SetLnurlMetadataItem {
|
|
129
|
+
paymentHash: string;
|
|
130
|
+
senderComment?: string;
|
|
131
|
+
nostrZapRequest?: string;
|
|
132
|
+
nostrZapReceipt?: string;
|
|
139
133
|
}
|
|
140
134
|
|
|
141
|
-
export interface
|
|
142
|
-
|
|
143
|
-
schemaVersion: string;
|
|
144
|
-
updatedFields: Map<string, string>;
|
|
135
|
+
export interface CheckMessageResponse {
|
|
136
|
+
isValid: boolean;
|
|
145
137
|
}
|
|
146
138
|
|
|
147
|
-
export
|
|
139
|
+
export interface PrepareSendPaymentResponse {
|
|
140
|
+
paymentMethod: SendPaymentMethod;
|
|
141
|
+
amount: bigint;
|
|
142
|
+
tokenIdentifier?: string;
|
|
143
|
+
conversionEstimate?: ConversionEstimate;
|
|
144
|
+
}
|
|
148
145
|
|
|
149
146
|
export interface Bolt12Offer {
|
|
150
147
|
offer: string;
|
|
151
148
|
source: PaymentRequestSource;
|
|
152
149
|
}
|
|
153
150
|
|
|
154
|
-
export interface
|
|
151
|
+
export interface UrlSuccessActionData {
|
|
155
152
|
description: string;
|
|
156
|
-
|
|
157
|
-
|
|
153
|
+
url: string;
|
|
154
|
+
matchesCallbackDomain: boolean;
|
|
158
155
|
}
|
|
159
156
|
|
|
160
|
-
export interface
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
name: string;
|
|
164
|
-
ticker: string;
|
|
165
|
-
decimals: number;
|
|
166
|
-
maxSupply: string;
|
|
167
|
-
isFreezable: boolean;
|
|
157
|
+
export interface GetInfoResponse {
|
|
158
|
+
balanceSats: number;
|
|
159
|
+
tokenBalances: Map<string, TokenBalance>;
|
|
168
160
|
}
|
|
169
161
|
|
|
170
162
|
export interface BitcoinAddressDetails {
|
|
@@ -173,20 +165,21 @@ export interface BitcoinAddressDetails {
|
|
|
173
165
|
source: PaymentRequestSource;
|
|
174
166
|
}
|
|
175
167
|
|
|
176
|
-
export interface SetLnurlMetadataItem {
|
|
177
|
-
paymentHash: string;
|
|
178
|
-
senderComment?: string;
|
|
179
|
-
nostrZapRequest?: string;
|
|
180
|
-
nostrZapReceipt?: string;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string };
|
|
184
|
-
|
|
185
168
|
export interface LogEntry {
|
|
186
169
|
line: string;
|
|
187
170
|
level: string;
|
|
188
171
|
}
|
|
189
172
|
|
|
173
|
+
export interface SendPaymentRequest {
|
|
174
|
+
prepareResponse: PrepareSendPaymentResponse;
|
|
175
|
+
options?: SendPaymentOptions;
|
|
176
|
+
idempotencyKey?: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface GetPaymentRequest {
|
|
180
|
+
paymentId: string;
|
|
181
|
+
}
|
|
182
|
+
|
|
190
183
|
export interface Bip21Details {
|
|
191
184
|
amountSat?: number;
|
|
192
185
|
assetId?: string;
|
|
@@ -197,7 +190,7 @@ export interface Bip21Details {
|
|
|
197
190
|
paymentMethods: InputType[];
|
|
198
191
|
}
|
|
199
192
|
|
|
200
|
-
export type
|
|
193
|
+
export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
|
|
201
194
|
|
|
202
195
|
export type DepositClaimError = { type: "maxDepositClaimFeeExceeded"; tx: string; vout: number; maxFee?: Fee; requiredFeeSats: number; requiredFeeRateSatPerVbyte: number } | { type: "missingUtxo"; tx: string; vout: number } | { type: "generic"; message: string };
|
|
203
196
|
|
|
@@ -208,41 +201,28 @@ export interface RefundDepositRequest {
|
|
|
208
201
|
fee: Fee;
|
|
209
202
|
}
|
|
210
203
|
|
|
211
|
-
export interface
|
|
212
|
-
id: string;
|
|
213
|
-
expiresAt: number;
|
|
214
|
-
speedFast: SendOnchainSpeedFeeQuote;
|
|
215
|
-
speedMedium: SendOnchainSpeedFeeQuote;
|
|
216
|
-
speedSlow: SendOnchainSpeedFeeQuote;
|
|
217
|
-
}
|
|
204
|
+
export interface SyncWalletResponse {}
|
|
218
205
|
|
|
219
|
-
export interface
|
|
220
|
-
|
|
221
|
-
statusFilter?: PaymentStatus[];
|
|
222
|
-
assetFilter?: AssetFilter;
|
|
223
|
-
paymentDetailsFilter?: PaymentDetailsFilter[];
|
|
224
|
-
fromTimestamp?: number;
|
|
225
|
-
toTimestamp?: number;
|
|
226
|
-
offset?: number;
|
|
227
|
-
limit?: number;
|
|
228
|
-
sortAscending?: boolean;
|
|
206
|
+
export interface SendPaymentResponse {
|
|
207
|
+
payment: Payment;
|
|
229
208
|
}
|
|
230
209
|
|
|
231
|
-
export interface
|
|
232
|
-
|
|
233
|
-
|
|
210
|
+
export interface ProvisionalPayment {
|
|
211
|
+
paymentId: string;
|
|
212
|
+
amount: bigint;
|
|
213
|
+
details: ProvisionalPaymentDetails;
|
|
234
214
|
}
|
|
235
215
|
|
|
236
|
-
export interface
|
|
237
|
-
|
|
238
|
-
|
|
216
|
+
export interface PrepareLnurlPayRequest {
|
|
217
|
+
amountSats: number;
|
|
218
|
+
comment?: string;
|
|
219
|
+
payRequest: LnurlPayRequestDetails;
|
|
220
|
+
validateSuccessActionUrl?: boolean;
|
|
239
221
|
}
|
|
240
222
|
|
|
241
|
-
export
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
parserUrl: string;
|
|
245
|
-
}
|
|
223
|
+
export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
|
|
224
|
+
|
|
225
|
+
export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
|
|
246
226
|
|
|
247
227
|
export interface SilentPaymentAddressDetails {
|
|
248
228
|
address: string;
|
|
@@ -250,31 +230,24 @@ export interface SilentPaymentAddressDetails {
|
|
|
250
230
|
source: PaymentRequestSource;
|
|
251
231
|
}
|
|
252
232
|
|
|
253
|
-
export
|
|
254
|
-
withdrawUrl: string;
|
|
255
|
-
}
|
|
233
|
+
export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
|
|
256
234
|
|
|
257
|
-
export interface
|
|
258
|
-
|
|
235
|
+
export interface ExternalInputParser {
|
|
236
|
+
providerId: string;
|
|
237
|
+
inputRegex: string;
|
|
238
|
+
parserUrl: string;
|
|
259
239
|
}
|
|
260
240
|
|
|
241
|
+
export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
|
|
242
|
+
|
|
261
243
|
export interface SignMessageResponse {
|
|
262
244
|
pubkey: string;
|
|
263
245
|
signature: string;
|
|
264
246
|
}
|
|
265
247
|
|
|
266
|
-
export
|
|
267
|
-
isValid: boolean;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
export interface GetPaymentRequest {
|
|
271
|
-
paymentId: string;
|
|
272
|
-
}
|
|
248
|
+
export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
|
|
273
249
|
|
|
274
|
-
export
|
|
275
|
-
description: string;
|
|
276
|
-
plaintext: string;
|
|
277
|
-
}
|
|
250
|
+
export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
|
|
278
251
|
|
|
279
252
|
export interface Bolt11Invoice {
|
|
280
253
|
bolt11: string;
|
|
@@ -311,24 +284,32 @@ export interface PaymentRequestSource {
|
|
|
311
284
|
bip353Address?: string;
|
|
312
285
|
}
|
|
313
286
|
|
|
314
|
-
export
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
287
|
+
export type PaymentType = "send" | "receive";
|
|
288
|
+
|
|
289
|
+
export interface Config {
|
|
290
|
+
apiKey?: string;
|
|
291
|
+
network: Network;
|
|
292
|
+
syncIntervalSecs: number;
|
|
293
|
+
maxDepositClaimFee?: MaxFee;
|
|
294
|
+
lnurlDomain?: string;
|
|
295
|
+
preferSparkOverLightning: boolean;
|
|
296
|
+
externalInputParsers?: ExternalInputParser[];
|
|
297
|
+
useDefaultExternalInputParsers: boolean;
|
|
298
|
+
realTimeSyncServerUrl?: string;
|
|
299
|
+
privateEnabledDefault: boolean;
|
|
300
|
+
optimizationConfig: OptimizationConfig;
|
|
323
301
|
}
|
|
324
302
|
|
|
325
|
-
export
|
|
303
|
+
export interface GetTokensMetadataResponse {
|
|
304
|
+
tokensMetadata: TokenMetadata[];
|
|
305
|
+
}
|
|
326
306
|
|
|
327
|
-
export type
|
|
307
|
+
export type Network = "mainnet" | "regtest";
|
|
328
308
|
|
|
329
|
-
export interface
|
|
330
|
-
|
|
331
|
-
|
|
309
|
+
export interface ConversionOptions {
|
|
310
|
+
conversionType: ConversionType;
|
|
311
|
+
maxSlippageBps?: number;
|
|
312
|
+
completionTimeoutSecs?: number;
|
|
332
313
|
}
|
|
333
314
|
|
|
334
315
|
export interface Bolt11InvoiceDetails {
|
|
@@ -346,33 +327,32 @@ export interface Bolt11InvoiceDetails {
|
|
|
346
327
|
timestamp: number;
|
|
347
328
|
}
|
|
348
329
|
|
|
349
|
-
export
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
message: string;
|
|
330
|
+
export interface OptimizationConfig {
|
|
331
|
+
autoEnabled: boolean;
|
|
332
|
+
multiplicity: number;
|
|
353
333
|
}
|
|
354
334
|
|
|
355
|
-
export
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
335
|
+
export type AesSuccessActionDataResult = { type: "decrypted"; data: AesSuccessActionDataDecrypted } | { type: "errorStatus"; reason: string };
|
|
336
|
+
|
|
337
|
+
export interface OptimizationProgress {
|
|
338
|
+
isRunning: boolean;
|
|
339
|
+
currentRound: number;
|
|
340
|
+
totalRounds: number;
|
|
359
341
|
}
|
|
360
342
|
|
|
361
|
-
export
|
|
343
|
+
export interface LnurlErrorDetails {
|
|
344
|
+
reason: string;
|
|
345
|
+
}
|
|
362
346
|
|
|
363
|
-
export interface
|
|
347
|
+
export interface UnversionedRecordChange {
|
|
364
348
|
id: RecordId;
|
|
365
|
-
revision: number;
|
|
366
349
|
schemaVersion: string;
|
|
367
|
-
|
|
350
|
+
updatedFields: Map<string, string>;
|
|
368
351
|
}
|
|
369
352
|
|
|
370
353
|
export type SdkEvent = { type: "synced" } | { type: "unclaimedDeposits"; unclaimedDeposits: DepositInfo[] } | { type: "claimedDeposits"; claimedDeposits: DepositInfo[] } | { type: "paymentSucceeded"; payment: Payment } | { type: "paymentPending"; payment: Payment } | { type: "paymentFailed"; payment: Payment } | { type: "optimization"; optimizationEvent: OptimizationEvent };
|
|
371
354
|
|
|
372
|
-
export interface
|
|
373
|
-
description: string;
|
|
374
|
-
lightningAddress: string;
|
|
375
|
-
lnurl: string;
|
|
355
|
+
export interface CheckLightningAddressRequest {
|
|
376
356
|
username: string;
|
|
377
357
|
}
|
|
378
358
|
|
|
@@ -381,22 +361,20 @@ export interface LightningAddressDetails {
|
|
|
381
361
|
payRequest: LnurlPayRequestDetails;
|
|
382
362
|
}
|
|
383
363
|
|
|
384
|
-
export interface
|
|
385
|
-
|
|
364
|
+
export interface OutgoingChange {
|
|
365
|
+
change: RecordChange;
|
|
366
|
+
parent?: Record;
|
|
386
367
|
}
|
|
387
368
|
|
|
388
|
-
export interface
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
updatedFields: Map<string, string>;
|
|
392
|
-
revision: number;
|
|
369
|
+
export interface RecordId {
|
|
370
|
+
type: string;
|
|
371
|
+
dataId: string;
|
|
393
372
|
}
|
|
394
373
|
|
|
395
|
-
export interface
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
refundIdentifier?: string;
|
|
374
|
+
export interface LnurlReceiveMetadata {
|
|
375
|
+
nostrZapRequest?: string;
|
|
376
|
+
nostrZapReceipt?: string;
|
|
377
|
+
senderComment?: string;
|
|
400
378
|
}
|
|
401
379
|
|
|
402
380
|
export interface LnurlWithdrawRequestDetails {
|
|
@@ -413,76 +391,72 @@ export interface KeySetConfig {
|
|
|
413
391
|
accountNumber?: number;
|
|
414
392
|
}
|
|
415
393
|
|
|
416
|
-
export interface
|
|
417
|
-
|
|
418
|
-
network: Network;
|
|
419
|
-
syncIntervalSecs: number;
|
|
420
|
-
maxDepositClaimFee?: MaxFee;
|
|
421
|
-
lnurlDomain?: string;
|
|
422
|
-
preferSparkOverLightning: boolean;
|
|
423
|
-
externalInputParsers?: ExternalInputParser[];
|
|
424
|
-
useDefaultExternalInputParsers: boolean;
|
|
425
|
-
realTimeSyncServerUrl?: string;
|
|
426
|
-
privateEnabledDefault: boolean;
|
|
427
|
-
optimizationConfig: OptimizationConfig;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
export interface LnurlReceiveMetadata {
|
|
431
|
-
nostrZapRequest?: string;
|
|
432
|
-
nostrZapReceipt?: string;
|
|
433
|
-
senderComment?: string;
|
|
394
|
+
export interface LnurlWithdrawInfo {
|
|
395
|
+
withdrawUrl: string;
|
|
434
396
|
}
|
|
435
397
|
|
|
436
|
-
export interface
|
|
437
|
-
|
|
438
|
-
template?: string;
|
|
439
|
-
rtl?: boolean;
|
|
440
|
-
position?: number;
|
|
398
|
+
export interface ClaimHtlcPaymentRequest {
|
|
399
|
+
preimage: string;
|
|
441
400
|
}
|
|
442
401
|
|
|
443
|
-
export interface
|
|
444
|
-
|
|
402
|
+
export interface LocaleOverrides {
|
|
403
|
+
locale: string;
|
|
404
|
+
spacing?: number;
|
|
405
|
+
symbol: Symbol;
|
|
445
406
|
}
|
|
446
407
|
|
|
447
|
-
export interface
|
|
408
|
+
export interface RegisterLightningAddressRequest {
|
|
409
|
+
username: string;
|
|
448
410
|
description?: string;
|
|
449
|
-
invoice: string;
|
|
450
411
|
}
|
|
451
412
|
|
|
452
|
-
export interface
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
413
|
+
export interface Payment {
|
|
414
|
+
id: string;
|
|
415
|
+
paymentType: PaymentType;
|
|
416
|
+
status: PaymentStatus;
|
|
417
|
+
amount: bigint;
|
|
418
|
+
fees: bigint;
|
|
419
|
+
timestamp: number;
|
|
420
|
+
method: PaymentMethod;
|
|
421
|
+
details?: PaymentDetails;
|
|
456
422
|
}
|
|
457
423
|
|
|
458
|
-
export
|
|
459
|
-
payments: Payment[];
|
|
460
|
-
}
|
|
424
|
+
export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
|
|
461
425
|
|
|
462
|
-
export interface
|
|
463
|
-
|
|
464
|
-
|
|
426
|
+
export interface ListPaymentsRequest {
|
|
427
|
+
typeFilter?: PaymentType[];
|
|
428
|
+
statusFilter?: PaymentStatus[];
|
|
429
|
+
assetFilter?: AssetFilter;
|
|
430
|
+
paymentDetailsFilter?: PaymentDetailsFilter[];
|
|
431
|
+
fromTimestamp?: number;
|
|
432
|
+
toTimestamp?: number;
|
|
433
|
+
offset?: number;
|
|
434
|
+
limit?: number;
|
|
435
|
+
sortAscending?: boolean;
|
|
465
436
|
}
|
|
466
437
|
|
|
467
|
-
export
|
|
438
|
+
export type ConversionStatus = "completed" | "refundNeeded" | "refunded";
|
|
468
439
|
|
|
469
|
-
export interface
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
440
|
+
export interface TokenMetadata {
|
|
441
|
+
identifier: string;
|
|
442
|
+
issuerPublicKey: string;
|
|
443
|
+
name: string;
|
|
444
|
+
ticker: string;
|
|
445
|
+
decimals: number;
|
|
446
|
+
maxSupply: string;
|
|
447
|
+
isFreezable: boolean;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export interface LnurlPayRequest {
|
|
451
|
+
prepareResponse: PrepareLnurlPayResponse;
|
|
452
|
+
idempotencyKey?: string;
|
|
473
453
|
}
|
|
474
454
|
|
|
475
455
|
export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
|
|
476
456
|
|
|
477
|
-
export
|
|
478
|
-
conversionType: TokenConversionType;
|
|
479
|
-
tokenIdentifier?: string;
|
|
480
|
-
}
|
|
457
|
+
export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" };
|
|
481
458
|
|
|
482
|
-
export
|
|
483
|
-
userFeeSat: number;
|
|
484
|
-
l1BroadcastFeeSat: number;
|
|
485
|
-
}
|
|
459
|
+
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 };
|
|
486
460
|
|
|
487
461
|
export interface DepositInfo {
|
|
488
462
|
txid: string;
|
|
@@ -493,64 +467,62 @@ export interface DepositInfo {
|
|
|
493
467
|
claimError?: DepositClaimError;
|
|
494
468
|
}
|
|
495
469
|
|
|
496
|
-
export interface
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
470
|
+
export interface GetTokensMetadataRequest {
|
|
471
|
+
tokenIdentifiers: string[];
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
export interface FetchConversionLimitsResponse {
|
|
475
|
+
minFromAmount?: bigint;
|
|
476
|
+
minToAmount?: bigint;
|
|
500
477
|
}
|
|
501
478
|
|
|
502
479
|
export interface Bolt12OfferBlindedPath {
|
|
503
480
|
blindedHops: string[];
|
|
504
481
|
}
|
|
505
482
|
|
|
506
|
-
export interface
|
|
507
|
-
|
|
508
|
-
comment?: string;
|
|
509
|
-
payRequest: LnurlPayRequestDetails;
|
|
510
|
-
validateSuccessActionUrl?: boolean;
|
|
483
|
+
export interface ReceivePaymentRequest {
|
|
484
|
+
paymentMethod: ReceivePaymentMethod;
|
|
511
485
|
}
|
|
512
486
|
|
|
513
|
-
export interface
|
|
514
|
-
|
|
515
|
-
|
|
487
|
+
export interface Credentials {
|
|
488
|
+
username: string;
|
|
489
|
+
password: string;
|
|
516
490
|
}
|
|
517
491
|
|
|
518
492
|
export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
|
|
519
493
|
|
|
520
|
-
export interface
|
|
521
|
-
|
|
522
|
-
|
|
494
|
+
export interface PrepareLnurlPayResponse {
|
|
495
|
+
amountSats: number;
|
|
496
|
+
comment?: string;
|
|
497
|
+
payRequest: LnurlPayRequestDetails;
|
|
498
|
+
feeSats: number;
|
|
499
|
+
invoiceDetails: Bolt11InvoiceDetails;
|
|
500
|
+
successAction?: SuccessAction;
|
|
523
501
|
}
|
|
524
502
|
|
|
525
|
-
export interface
|
|
526
|
-
|
|
503
|
+
export interface SparkHtlcOptions {
|
|
504
|
+
paymentHash: string;
|
|
505
|
+
expiryDurationSecs: number;
|
|
527
506
|
}
|
|
528
507
|
|
|
529
|
-
export
|
|
530
|
-
username: string;
|
|
531
|
-
description?: string;
|
|
532
|
-
}
|
|
508
|
+
export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
|
|
533
509
|
|
|
534
|
-
export
|
|
535
|
-
lnAddress?: string;
|
|
536
|
-
comment?: string;
|
|
537
|
-
domain?: string;
|
|
538
|
-
metadata?: string;
|
|
539
|
-
processedSuccessAction?: SuccessActionProcessed;
|
|
540
|
-
rawSuccessAction?: SuccessAction;
|
|
541
|
-
}
|
|
510
|
+
export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
|
|
542
511
|
|
|
543
|
-
export
|
|
512
|
+
export interface SparkHtlcDetails {
|
|
513
|
+
paymentHash: string;
|
|
514
|
+
preimage?: string;
|
|
515
|
+
expiryTime: number;
|
|
516
|
+
status: SparkHtlcStatus;
|
|
517
|
+
}
|
|
544
518
|
|
|
545
|
-
export interface
|
|
546
|
-
|
|
547
|
-
tokenMetadata: TokenMetadata;
|
|
519
|
+
export interface GetInfoRequest {
|
|
520
|
+
ensureSynced?: boolean;
|
|
548
521
|
}
|
|
549
522
|
|
|
550
|
-
export interface
|
|
523
|
+
export interface SignMessageRequest {
|
|
551
524
|
message: string;
|
|
552
|
-
|
|
553
|
-
signature: string;
|
|
525
|
+
compact: boolean;
|
|
554
526
|
}
|
|
555
527
|
|
|
556
528
|
export interface Bolt12OfferDetails {
|
|
@@ -564,36 +536,50 @@ export interface Bolt12OfferDetails {
|
|
|
564
536
|
signingPubkey?: string;
|
|
565
537
|
}
|
|
566
538
|
|
|
567
|
-
export
|
|
539
|
+
export interface AesSuccessActionData {
|
|
540
|
+
description: string;
|
|
541
|
+
ciphertext: string;
|
|
542
|
+
iv: string;
|
|
543
|
+
}
|
|
568
544
|
|
|
569
545
|
export interface RefundDepositResponse {
|
|
570
546
|
txId: string;
|
|
571
547
|
txHex: string;
|
|
572
548
|
}
|
|
573
549
|
|
|
574
|
-
export type
|
|
550
|
+
export type PaymentStatus = "completed" | "pending" | "failed";
|
|
575
551
|
|
|
576
|
-
export interface
|
|
577
|
-
|
|
578
|
-
|
|
552
|
+
export interface CheckMessageRequest {
|
|
553
|
+
message: string;
|
|
554
|
+
pubkey: string;
|
|
555
|
+
signature: string;
|
|
579
556
|
}
|
|
580
557
|
|
|
581
|
-
export interface
|
|
582
|
-
|
|
583
|
-
info: CurrencyInfo;
|
|
558
|
+
export interface ListFiatRatesResponse {
|
|
559
|
+
rates: Rate[];
|
|
584
560
|
}
|
|
585
561
|
|
|
586
|
-
export
|
|
562
|
+
export interface MessageSuccessActionData {
|
|
563
|
+
message: string;
|
|
564
|
+
}
|
|
587
565
|
|
|
588
|
-
export interface
|
|
589
|
-
locale: string;
|
|
566
|
+
export interface CurrencyInfo {
|
|
590
567
|
name: string;
|
|
568
|
+
fractionSize: number;
|
|
569
|
+
spacing?: number;
|
|
570
|
+
symbol?: Symbol;
|
|
571
|
+
uniqSymbol?: Symbol;
|
|
572
|
+
localizedName: LocalizedName[];
|
|
573
|
+
localeOverrides: LocaleOverrides[];
|
|
591
574
|
}
|
|
592
575
|
|
|
593
|
-
export interface
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
576
|
+
export interface FetchConversionLimitsRequest {
|
|
577
|
+
conversionType: ConversionType;
|
|
578
|
+
tokenIdentifier?: string;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
export interface ClaimHtlcPaymentResponse {
|
|
582
|
+
payment: Payment;
|
|
597
583
|
}
|
|
598
584
|
|
|
599
585
|
export interface LnurlAuthRequestDetails {
|
|
@@ -603,12 +589,16 @@ export interface LnurlAuthRequestDetails {
|
|
|
603
589
|
url: string;
|
|
604
590
|
}
|
|
605
591
|
|
|
606
|
-
export interface
|
|
592
|
+
export interface TokenBalance {
|
|
593
|
+
balance: bigint;
|
|
594
|
+
tokenMetadata: TokenMetadata;
|
|
595
|
+
}
|
|
607
596
|
|
|
608
597
|
export interface ListUnclaimedDepositsRequest {}
|
|
609
598
|
|
|
610
|
-
export interface
|
|
611
|
-
|
|
599
|
+
export interface IncomingChange {
|
|
600
|
+
newState: Record;
|
|
601
|
+
oldState?: Record;
|
|
612
602
|
}
|
|
613
603
|
|
|
614
604
|
export interface Bolt11RouteHintHop {
|
|
@@ -626,38 +616,33 @@ export interface Bip21Extra {
|
|
|
626
616
|
value: string;
|
|
627
617
|
}
|
|
628
618
|
|
|
629
|
-
export interface
|
|
630
|
-
|
|
619
|
+
export interface LightningAddressInfo {
|
|
620
|
+
description: string;
|
|
621
|
+
lightningAddress: string;
|
|
622
|
+
lnurl: string;
|
|
623
|
+
username: string;
|
|
631
624
|
}
|
|
632
625
|
|
|
633
|
-
export interface
|
|
634
|
-
|
|
626
|
+
export interface UpdateUserSettingsRequest {
|
|
627
|
+
sparkPrivateModeEnabled?: boolean;
|
|
635
628
|
}
|
|
636
629
|
|
|
637
|
-
export
|
|
638
|
-
paymentHash: string;
|
|
639
|
-
expiryDurationSecs: number;
|
|
640
|
-
}
|
|
630
|
+
export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
|
|
641
631
|
|
|
642
|
-
export interface
|
|
643
|
-
|
|
644
|
-
lnurlPayInfo?: LnurlPayInfo;
|
|
645
|
-
lnurlWithdrawInfo?: LnurlWithdrawInfo;
|
|
646
|
-
lnurlDescription?: string;
|
|
647
|
-
tokenConversionInfo?: TokenConversionInfo;
|
|
632
|
+
export interface GetPaymentResponse {
|
|
633
|
+
payment: Payment;
|
|
648
634
|
}
|
|
649
635
|
|
|
650
636
|
export interface ClaimDepositResponse {
|
|
651
637
|
payment: Payment;
|
|
652
638
|
}
|
|
653
639
|
|
|
654
|
-
export interface
|
|
655
|
-
|
|
656
|
-
value: number;
|
|
640
|
+
export interface ListFiatCurrenciesResponse {
|
|
641
|
+
currencies: FiatCurrency[];
|
|
657
642
|
}
|
|
658
643
|
|
|
659
|
-
export interface
|
|
660
|
-
|
|
644
|
+
export interface UserSettings {
|
|
645
|
+
sparkPrivateModeEnabled: boolean;
|
|
661
646
|
}
|
|
662
647
|
|
|
663
648
|
export interface ConnectRequest {
|
|
@@ -668,19 +653,28 @@ export interface ConnectRequest {
|
|
|
668
653
|
|
|
669
654
|
export interface Bolt12InvoiceRequestDetails {}
|
|
670
655
|
|
|
671
|
-
export
|
|
656
|
+
export interface SparkInvoicePaymentDetails {
|
|
657
|
+
description?: string;
|
|
658
|
+
invoice: string;
|
|
659
|
+
}
|
|
672
660
|
|
|
673
661
|
export interface Bolt12Invoice {
|
|
674
662
|
invoice: string;
|
|
675
663
|
source: PaymentRequestSource;
|
|
676
664
|
}
|
|
677
665
|
|
|
678
|
-
export interface
|
|
679
|
-
|
|
680
|
-
|
|
666
|
+
export interface LnurlPayResponse {
|
|
667
|
+
payment: Payment;
|
|
668
|
+
successAction?: SuccessActionProcessed;
|
|
681
669
|
}
|
|
682
670
|
|
|
683
|
-
export
|
|
671
|
+
export interface PaymentMetadata {
|
|
672
|
+
parentPaymentId?: string;
|
|
673
|
+
lnurlPayInfo?: LnurlPayInfo;
|
|
674
|
+
lnurlWithdrawInfo?: LnurlWithdrawInfo;
|
|
675
|
+
lnurlDescription?: string;
|
|
676
|
+
conversionInfo?: ConversionInfo;
|
|
677
|
+
}
|
|
684
678
|
|
|
685
679
|
export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
|
|
686
680
|
|
|
@@ -690,25 +684,39 @@ export interface Bolt11RouteHint {
|
|
|
690
684
|
hops: Bolt11RouteHintHop[];
|
|
691
685
|
}
|
|
692
686
|
|
|
693
|
-
export
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
687
|
+
export interface PrepareSendPaymentRequest {
|
|
688
|
+
paymentRequest: string;
|
|
689
|
+
amount?: bigint;
|
|
690
|
+
tokenIdentifier?: string;
|
|
691
|
+
conversionOptions?: ConversionOptions;
|
|
697
692
|
}
|
|
698
693
|
|
|
699
|
-
export
|
|
694
|
+
export interface SendOnchainSpeedFeeQuote {
|
|
695
|
+
userFeeSat: number;
|
|
696
|
+
l1BroadcastFeeSat: number;
|
|
697
|
+
}
|
|
700
698
|
|
|
701
|
-
export type
|
|
699
|
+
export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
|
|
702
700
|
|
|
703
|
-
export interface
|
|
704
|
-
|
|
705
|
-
|
|
701
|
+
export interface LnurlPayInfo {
|
|
702
|
+
lnAddress?: string;
|
|
703
|
+
comment?: string;
|
|
704
|
+
domain?: string;
|
|
705
|
+
metadata?: string;
|
|
706
|
+
processedSuccessAction?: SuccessActionProcessed;
|
|
707
|
+
rawSuccessAction?: SuccessAction;
|
|
706
708
|
}
|
|
707
709
|
|
|
708
|
-
export type
|
|
710
|
+
export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
|
|
709
711
|
|
|
710
|
-
export interface
|
|
711
|
-
|
|
712
|
+
export interface ConversionEstimate {
|
|
713
|
+
options: ConversionOptions;
|
|
714
|
+
amount: bigint;
|
|
715
|
+
fee: bigint;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
export interface ListPaymentsResponse {
|
|
719
|
+
payments: Payment[];
|
|
712
720
|
}
|
|
713
721
|
|
|
714
722
|
export interface SparkInvoiceDetails {
|
|
@@ -722,8 +730,19 @@ export interface SparkInvoiceDetails {
|
|
|
722
730
|
senderPublicKey?: string;
|
|
723
731
|
}
|
|
724
732
|
|
|
725
|
-
export interface
|
|
726
|
-
|
|
733
|
+
export interface ConversionInfo {
|
|
734
|
+
poolId: string;
|
|
735
|
+
conversionId: string;
|
|
736
|
+
status: ConversionStatus;
|
|
737
|
+
fee?: string;
|
|
738
|
+
purpose?: ConversionPurpose;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
export interface Symbol {
|
|
742
|
+
grapheme?: string;
|
|
743
|
+
template?: string;
|
|
744
|
+
rtl?: boolean;
|
|
745
|
+
position?: number;
|
|
727
746
|
}
|
|
728
747
|
|
|
729
748
|
export interface ClaimDepositRequest {
|
|
@@ -734,33 +753,30 @@ export interface ClaimDepositRequest {
|
|
|
734
753
|
|
|
735
754
|
export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
|
|
736
755
|
|
|
737
|
-
export interface
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
tokenIdentifier?: string;
|
|
741
|
-
tokenConversionOptions?: TokenConversionOptions;
|
|
742
|
-
tokenConversionFee?: bigint;
|
|
756
|
+
export interface LnurlWithdrawResponse {
|
|
757
|
+
paymentRequest: string;
|
|
758
|
+
payment?: Payment;
|
|
743
759
|
}
|
|
744
760
|
|
|
745
|
-
export interface
|
|
746
|
-
|
|
747
|
-
|
|
761
|
+
export interface Record {
|
|
762
|
+
id: RecordId;
|
|
763
|
+
revision: number;
|
|
764
|
+
schemaVersion: string;
|
|
765
|
+
data: Map<string, string>;
|
|
748
766
|
}
|
|
749
767
|
|
|
750
|
-
export interface
|
|
768
|
+
export interface AesSuccessActionDataDecrypted {
|
|
751
769
|
description: string;
|
|
752
|
-
|
|
753
|
-
matchesCallbackDomain: boolean;
|
|
770
|
+
plaintext: string;
|
|
754
771
|
}
|
|
755
772
|
|
|
756
|
-
export
|
|
757
|
-
paymentRequest: string;
|
|
758
|
-
fee: bigint;
|
|
759
|
-
}
|
|
773
|
+
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 };
|
|
760
774
|
|
|
761
|
-
export interface
|
|
762
|
-
|
|
763
|
-
|
|
775
|
+
export interface RecordChange {
|
|
776
|
+
id: RecordId;
|
|
777
|
+
schemaVersion: string;
|
|
778
|
+
updatedFields: Map<string, string>;
|
|
779
|
+
revision: number;
|
|
764
780
|
}
|
|
765
781
|
|
|
766
782
|
export interface MintIssuerTokenRequest {
|
|
@@ -800,8 +816,8 @@ export interface UnfreezeIssuerTokenRequest {
|
|
|
800
816
|
export interface ExternalSigner {
|
|
801
817
|
identityPublicKey(): PublicKeyBytes;
|
|
802
818
|
derivePublicKey(path: string): Promise<PublicKeyBytes>;
|
|
803
|
-
signEcdsa(message:
|
|
804
|
-
signEcdsaRecoverable(message:
|
|
819
|
+
signEcdsa(message: MessageBytes, path: string): Promise<EcdsaSignatureBytes>;
|
|
820
|
+
signEcdsaRecoverable(message: MessageBytes, path: string): Promise<RecoverableEcdsaSignatureBytes>;
|
|
805
821
|
eciesEncrypt(message: Uint8Array, path: string): Promise<Uint8Array>;
|
|
806
822
|
eciesDecrypt(message: Uint8Array, path: string): Promise<Uint8Array>;
|
|
807
823
|
signHashSchnorr(hash: Uint8Array, path: string): Promise<SchnorrSignatureBytes>;
|
|
@@ -817,24 +833,28 @@ export interface ExternalSigner {
|
|
|
817
833
|
getPublicKeyFromPrivateKeySource(privateKey: ExternalPrivateKeySource): Promise<PublicKeyBytes>;
|
|
818
834
|
signFrost(request: ExternalSignFrostRequest): Promise<ExternalFrostSignatureShare>;
|
|
819
835
|
aggregateFrost(request: ExternalAggregateFrostRequest): Promise<ExternalFrostSignature>;
|
|
836
|
+
hmacSha256(message: Uint8Array, path: string): Promise<HashedMessageBytes>;
|
|
820
837
|
}
|
|
821
838
|
|
|
822
|
-
export interface
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
privateKey: ExternalPrivateKeySource;
|
|
826
|
-
verifyingKey: number[];
|
|
827
|
-
selfNonceCommitment: ExternalFrostCommitments;
|
|
828
|
-
statechainCommitments: IdentifierCommitmentPair[];
|
|
829
|
-
adaptorPublicKey?: number[];
|
|
839
|
+
export interface IdentifierSignaturePair {
|
|
840
|
+
identifier: ExternalIdentifier;
|
|
841
|
+
signature: ExternalFrostSignatureShare;
|
|
830
842
|
}
|
|
831
843
|
|
|
832
844
|
export interface PrivateKeyBytes {
|
|
833
845
|
bytes: number[];
|
|
834
846
|
}
|
|
835
847
|
|
|
836
|
-
export interface
|
|
837
|
-
|
|
848
|
+
export interface ExternalAggregateFrostRequest {
|
|
849
|
+
message: number[];
|
|
850
|
+
statechainSignatures: IdentifierSignaturePair[];
|
|
851
|
+
statechainPublicKeys: IdentifierPublicKeyPair[];
|
|
852
|
+
verifyingKey: number[];
|
|
853
|
+
statechainCommitments: IdentifierCommitmentPair[];
|
|
854
|
+
selfCommitment: ExternalSigningCommitments;
|
|
855
|
+
publicKey: number[];
|
|
856
|
+
selfSignature: ExternalFrostSignatureShare;
|
|
857
|
+
adaptorPublicKey?: number[];
|
|
838
858
|
}
|
|
839
859
|
|
|
840
860
|
export interface RecoverableEcdsaSignatureBytes {
|
|
@@ -849,15 +869,14 @@ export interface EcdsaSignatureBytes {
|
|
|
849
869
|
bytes: number[];
|
|
850
870
|
}
|
|
851
871
|
|
|
852
|
-
export interface
|
|
853
|
-
|
|
854
|
-
bindingCommitment: number[];
|
|
855
|
-
noncesCiphertext: number[];
|
|
872
|
+
export interface ExternalFrostSignatureShare {
|
|
873
|
+
bytes: number[];
|
|
856
874
|
}
|
|
857
875
|
|
|
858
|
-
export interface
|
|
859
|
-
|
|
860
|
-
|
|
876
|
+
export interface ExternalSecretShare {
|
|
877
|
+
threshold: number;
|
|
878
|
+
index: ExternalScalar;
|
|
879
|
+
share: ExternalScalar;
|
|
861
880
|
}
|
|
862
881
|
|
|
863
882
|
export interface ExternalSigningCommitments {
|
|
@@ -865,32 +884,33 @@ export interface ExternalSigningCommitments {
|
|
|
865
884
|
binding: number[];
|
|
866
885
|
}
|
|
867
886
|
|
|
868
|
-
export interface
|
|
869
|
-
|
|
887
|
+
export interface ExternalFrostCommitments {
|
|
888
|
+
hidingCommitment: number[];
|
|
889
|
+
bindingCommitment: number[];
|
|
890
|
+
noncesCiphertext: number[];
|
|
870
891
|
}
|
|
871
892
|
|
|
872
|
-
export
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
bytes: number[];
|
|
893
|
+
export interface ExternalVerifiableSecretShare {
|
|
894
|
+
secretShare: ExternalSecretShare;
|
|
895
|
+
proofs: number[][];
|
|
876
896
|
}
|
|
877
897
|
|
|
878
|
-
export
|
|
898
|
+
export interface ExternalEncryptedPrivateKey {
|
|
899
|
+
ciphertext: number[];
|
|
900
|
+
}
|
|
879
901
|
|
|
880
|
-
export interface
|
|
902
|
+
export interface ExternalSignFrostRequest {
|
|
881
903
|
message: number[];
|
|
882
|
-
|
|
883
|
-
|
|
904
|
+
publicKey: number[];
|
|
905
|
+
privateKey: ExternalPrivateKeySource;
|
|
884
906
|
verifyingKey: number[];
|
|
907
|
+
selfNonceCommitment: ExternalFrostCommitments;
|
|
885
908
|
statechainCommitments: IdentifierCommitmentPair[];
|
|
886
|
-
selfCommitment: ExternalSigningCommitments;
|
|
887
|
-
publicKey: number[];
|
|
888
|
-
selfSignature: ExternalFrostSignatureShare;
|
|
889
909
|
adaptorPublicKey?: number[];
|
|
890
910
|
}
|
|
891
911
|
|
|
892
|
-
export interface
|
|
893
|
-
|
|
912
|
+
export interface ExternalTreeNodeId {
|
|
913
|
+
id: string;
|
|
894
914
|
}
|
|
895
915
|
|
|
896
916
|
export interface IdentifierPublicKeyPair {
|
|
@@ -898,32 +918,37 @@ export interface IdentifierPublicKeyPair {
|
|
|
898
918
|
publicKey: number[];
|
|
899
919
|
}
|
|
900
920
|
|
|
901
|
-
export interface
|
|
921
|
+
export interface MessageBytes {
|
|
902
922
|
bytes: number[];
|
|
903
923
|
}
|
|
904
924
|
|
|
905
|
-
export interface
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
925
|
+
export interface IdentifierCommitmentPair {
|
|
926
|
+
identifier: ExternalIdentifier;
|
|
927
|
+
commitment: ExternalSigningCommitments;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
export type ExternalPrivateKeySource = { type: "derived"; nodeId: ExternalTreeNodeId } | { type: "encrypted"; key: ExternalEncryptedPrivateKey };
|
|
931
|
+
|
|
932
|
+
export type ExternalSecretToSplit = { type: "privateKey"; source: ExternalPrivateKeySource } | { type: "preimage"; data: number[] };
|
|
933
|
+
|
|
934
|
+
export interface ExternalFrostSignature {
|
|
935
|
+
bytes: number[];
|
|
909
936
|
}
|
|
910
937
|
|
|
911
938
|
export interface PublicKeyBytes {
|
|
912
939
|
bytes: number[];
|
|
913
940
|
}
|
|
914
941
|
|
|
915
|
-
export interface
|
|
916
|
-
|
|
917
|
-
commitment: ExternalSigningCommitments;
|
|
942
|
+
export interface ExternalIdentifier {
|
|
943
|
+
bytes: number[];
|
|
918
944
|
}
|
|
919
945
|
|
|
920
|
-
export interface
|
|
921
|
-
|
|
922
|
-
proofs: number[][];
|
|
946
|
+
export interface ExternalScalar {
|
|
947
|
+
bytes: number[];
|
|
923
948
|
}
|
|
924
949
|
|
|
925
|
-
export interface
|
|
926
|
-
|
|
950
|
+
export interface HashedMessageBytes {
|
|
951
|
+
bytes: number[];
|
|
927
952
|
}
|
|
928
953
|
|
|
929
954
|
export interface Storage {
|
|
@@ -956,6 +981,7 @@ export class BreezSdk {
|
|
|
956
981
|
private constructor();
|
|
957
982
|
free(): void;
|
|
958
983
|
disconnect(): Promise<void>;
|
|
984
|
+
lnurlAuth(request_data: LnurlAuthRequestDetails): Promise<LnurlCallbackStatus>;
|
|
959
985
|
getPayment(request: GetPaymentRequest): Promise<GetPaymentResponse>;
|
|
960
986
|
syncWallet(request: SyncWalletRequest): Promise<SyncWalletResponse>;
|
|
961
987
|
sendPayment(request: SendPaymentRequest): Promise<SendPaymentResponse>;
|
|
@@ -979,12 +1005,12 @@ export class BreezSdk {
|
|
|
979
1005
|
updateUserSettings(request: UpdateUserSettingsRequest): Promise<void>;
|
|
980
1006
|
getLightningAddress(): Promise<LightningAddressInfo | undefined>;
|
|
981
1007
|
removeEventListener(id: string): Promise<boolean>;
|
|
1008
|
+
fetchConversionLimits(request: FetchConversionLimitsRequest): Promise<FetchConversionLimitsResponse>;
|
|
982
1009
|
listUnclaimedDeposits(request: ListUnclaimedDepositsRequest): Promise<ListUnclaimedDepositsResponse>;
|
|
983
1010
|
startLeafOptimization(): void;
|
|
984
1011
|
cancelLeafOptimization(): Promise<void>;
|
|
985
1012
|
deleteLightningAddress(): Promise<void>;
|
|
986
1013
|
registerLightningAddress(request: RegisterLightningAddressRequest): Promise<LightningAddressInfo>;
|
|
987
|
-
fetchTokenConversionLimits(request: FetchTokenConversionLimitsRequest): Promise<FetchTokenConversionLimitsResponse>;
|
|
988
1014
|
getLeafOptimizationProgress(): OptimizationProgress;
|
|
989
1015
|
checkLightningAddressAvailable(request: CheckLightningAddressRequest): Promise<boolean>;
|
|
990
1016
|
parse(input: string): Promise<InputType>;
|
|
@@ -998,8 +1024,9 @@ export class BreezSdk {
|
|
|
998
1024
|
export class DefaultSigner {
|
|
999
1025
|
private constructor();
|
|
1000
1026
|
free(): void;
|
|
1001
|
-
signEcdsa(message:
|
|
1027
|
+
signEcdsa(message: MessageBytes, path: string): Promise<EcdsaSignatureBytes>;
|
|
1002
1028
|
signFrost(request: ExternalSignFrostRequest): Promise<ExternalFrostSignatureShare>;
|
|
1029
|
+
hmacSha256(message: Uint8Array, path: string): Promise<HashedMessageBytes>;
|
|
1003
1030
|
eciesDecrypt(message: Uint8Array, path: string): Promise<Uint8Array>;
|
|
1004
1031
|
eciesEncrypt(message: Uint8Array, path: string): Promise<Uint8Array>;
|
|
1005
1032
|
aggregateFrost(request: ExternalAggregateFrostRequest): Promise<ExternalFrostSignature>;
|
|
@@ -1008,7 +1035,7 @@ export class DefaultSigner {
|
|
|
1008
1035
|
generateRandomKey(): Promise<ExternalPrivateKeySource>;
|
|
1009
1036
|
identityPublicKey(): PublicKeyBytes;
|
|
1010
1037
|
subtractPrivateKeys(signing_key: ExternalPrivateKeySource, new_signing_key: ExternalPrivateKeySource): Promise<ExternalPrivateKeySource>;
|
|
1011
|
-
signEcdsaRecoverable(message:
|
|
1038
|
+
signEcdsaRecoverable(message: MessageBytes, path: string): Promise<RecoverableEcdsaSignatureBytes>;
|
|
1012
1039
|
getPublicKeyForNode(id: ExternalTreeNodeId): Promise<PublicKeyBytes>;
|
|
1013
1040
|
splitSecretWithProofs(secret: ExternalSecretToSplit, threshold: number, num_shares: number): Promise<ExternalVerifiableSecretShare[]>;
|
|
1014
1041
|
getStaticDepositPublicKey(index: number): Promise<PublicKeyBytes>;
|