@breeztech/breez-sdk-spark 0.12.2-dev1 → 0.12.2-dev2
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/README.md +4 -4
- package/breez-sdk-spark.tgz +0 -0
- package/bundler/breez_sdk_spark_wasm.d.ts +731 -601
- package/bundler/breez_sdk_spark_wasm_bg.js +151 -54
- 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 +65 -43
- package/deno/breez_sdk_spark_wasm.d.ts +731 -601
- package/deno/breez_sdk_spark_wasm.js +141 -54
- 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 +731 -601
- package/nodejs/breez_sdk_spark_wasm.js +151 -54
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +7 -5
- package/nodejs/index.js +16 -2
- package/nodejs/package.json +1 -0
- package/nodejs/postgres-storage/index.cjs +42 -31
- package/nodejs/postgres-storage/migrations.cjs +24 -0
- package/nodejs/postgres-token-store/errors.cjs +13 -0
- package/nodejs/postgres-token-store/index.cjs +857 -0
- package/nodejs/postgres-token-store/migrations.cjs +163 -0
- package/nodejs/postgres-token-store/package.json +9 -0
- package/nodejs/postgres-tree-store/index.cjs +12 -2
- package/nodejs/storage/index.cjs +19 -28
- package/nodejs/storage/migrations.cjs +18 -0
- package/package.json +1 -1
- package/web/breez_sdk_spark_wasm.d.ts +738 -606
- package/web/breez_sdk_spark_wasm.js +141 -54
- 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 +65 -43
|
@@ -15,11 +15,11 @@ export function defaultPostgresStorageConfig(connection_string: string): Postgre
|
|
|
15
15
|
* This creates a signer that can be used with `connectWithSigner` or `SdkBuilder.newWithSigner`.
|
|
16
16
|
*/
|
|
17
17
|
export function getSparkStatus(): Promise<SparkStatus>;
|
|
18
|
-
export function connectWithSigner(config: Config, signer: ExternalSigner, storage_dir: string): Promise<BreezSdk>;
|
|
19
18
|
export function connect(request: ConnectRequest): Promise<BreezSdk>;
|
|
20
|
-
export function defaultConfig(network: Network): Config;
|
|
21
19
|
export function initLogging(logger: Logger, filter?: string | null): Promise<void>;
|
|
20
|
+
export function defaultConfig(network: Network): Config;
|
|
22
21
|
export function defaultExternalSigner(mnemonic: string, passphrase: string | null | undefined, network: Network, key_set_config?: KeySetConfig | null): DefaultSigner;
|
|
22
|
+
export function connectWithSigner(config: Config, signer: ExternalSigner, storage_dir: string): Promise<BreezSdk>;
|
|
23
23
|
/**
|
|
24
24
|
* Entry point invoked by JavaScript in a worker.
|
|
25
25
|
*/
|
|
@@ -95,6 +95,77 @@ export interface PostgresStorageConfig {
|
|
|
95
95
|
recycleTimeoutSecs: number;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
|
|
99
|
+
interface WasmTokenMetadata {
|
|
100
|
+
identifier: string;
|
|
101
|
+
issuerPublicKey: string;
|
|
102
|
+
name: string;
|
|
103
|
+
ticker: string;
|
|
104
|
+
decimals: number;
|
|
105
|
+
maxSupply: string;
|
|
106
|
+
isFreezable: boolean;
|
|
107
|
+
creationEntityPublicKey: string | null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface WasmTokenOutput {
|
|
111
|
+
id: string;
|
|
112
|
+
ownerPublicKey: string;
|
|
113
|
+
revocationCommitment: string;
|
|
114
|
+
withdrawBondSats: number;
|
|
115
|
+
withdrawRelativeBlockLocktime: number;
|
|
116
|
+
tokenPublicKey: string | null;
|
|
117
|
+
tokenIdentifier: string;
|
|
118
|
+
tokenAmount: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
interface WasmTokenOutputWithPrevOut {
|
|
122
|
+
output: WasmTokenOutput;
|
|
123
|
+
prevTxHash: string;
|
|
124
|
+
prevTxVout: number;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface WasmTokenOutputs {
|
|
128
|
+
metadata: WasmTokenMetadata;
|
|
129
|
+
outputs: WasmTokenOutputWithPrevOut[];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
interface WasmTokenOutputsPerStatus {
|
|
133
|
+
metadata: WasmTokenMetadata;
|
|
134
|
+
available: WasmTokenOutputWithPrevOut[];
|
|
135
|
+
reservedForPayment: WasmTokenOutputWithPrevOut[];
|
|
136
|
+
reservedForSwap: WasmTokenOutputWithPrevOut[];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface WasmTokenOutputsReservation {
|
|
140
|
+
id: string;
|
|
141
|
+
tokenOutputs: WasmTokenOutputs;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
type WasmGetTokenOutputsFilter =
|
|
145
|
+
| { type: 'identifier'; identifier: string }
|
|
146
|
+
| { type: 'issuerPublicKey'; issuerPublicKey: string };
|
|
147
|
+
|
|
148
|
+
type WasmReservationTarget =
|
|
149
|
+
| { type: 'minTotalValue'; value: string }
|
|
150
|
+
| { type: 'maxOutputCount'; value: number };
|
|
151
|
+
|
|
152
|
+
export interface TokenStore {
|
|
153
|
+
setTokensOutputs: (tokenOutputs: WasmTokenOutputs[], refreshStartedAtMs: number) => Promise<void>;
|
|
154
|
+
listTokensOutputs: () => Promise<WasmTokenOutputsPerStatus[]>;
|
|
155
|
+
getTokenOutputs: (filter: WasmGetTokenOutputsFilter) => Promise<WasmTokenOutputsPerStatus>;
|
|
156
|
+
insertTokenOutputs: (tokenOutputs: WasmTokenOutputs) => Promise<void>;
|
|
157
|
+
reserveTokenOutputs: (
|
|
158
|
+
tokenIdentifier: string,
|
|
159
|
+
target: WasmReservationTarget,
|
|
160
|
+
purpose: string,
|
|
161
|
+
preferredOutputs: WasmTokenOutputWithPrevOut[] | null,
|
|
162
|
+
selectionStrategy: string | null
|
|
163
|
+
) => Promise<WasmTokenOutputsReservation>;
|
|
164
|
+
cancelReservation: (id: string) => Promise<void>;
|
|
165
|
+
finalizeReservation: (id: string) => Promise<void>;
|
|
166
|
+
now: () => Promise<number>;
|
|
167
|
+
}
|
|
168
|
+
|
|
98
169
|
export interface EventListener {
|
|
99
170
|
onEvent: (e: SdkEvent) => void;
|
|
100
171
|
}
|
|
@@ -127,10 +198,11 @@ export interface BitcoinChainService {
|
|
|
127
198
|
recommendedFees(): Promise<RecommendedFees>;
|
|
128
199
|
}
|
|
129
200
|
|
|
130
|
-
export interface
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
201
|
+
export interface Utxo {
|
|
202
|
+
txid: string;
|
|
203
|
+
vout: number;
|
|
204
|
+
value: number;
|
|
205
|
+
status: TxStatus;
|
|
134
206
|
}
|
|
135
207
|
|
|
136
208
|
export type ChainApiType = "esplora" | "mempoolSpace";
|
|
@@ -143,28 +215,86 @@ export interface RecommendedFees {
|
|
|
143
215
|
minimumFee: number;
|
|
144
216
|
}
|
|
145
217
|
|
|
146
|
-
export interface
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
status: TxStatus;
|
|
218
|
+
export interface TxStatus {
|
|
219
|
+
confirmed: boolean;
|
|
220
|
+
blockHeight?: number;
|
|
221
|
+
blockTime?: number;
|
|
151
222
|
}
|
|
152
223
|
|
|
153
224
|
export interface PaymentObserver {
|
|
154
225
|
beforeSend: (payments: ProvisionalPayment[]) => Promise<void>;
|
|
155
226
|
}
|
|
156
227
|
|
|
157
|
-
export
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
228
|
+
export type ServiceStatus = "operational" | "degraded" | "partial" | "unknown" | "major";
|
|
229
|
+
|
|
230
|
+
export interface PrepareSendPaymentResponse {
|
|
231
|
+
paymentMethod: SendPaymentMethod;
|
|
232
|
+
amount: bigint;
|
|
233
|
+
tokenIdentifier?: string;
|
|
234
|
+
conversionEstimate?: ConversionEstimate;
|
|
235
|
+
feePolicy: FeePolicy;
|
|
161
236
|
}
|
|
162
237
|
|
|
163
|
-
export interface
|
|
164
|
-
|
|
238
|
+
export interface TokenBalance {
|
|
239
|
+
balance: bigint;
|
|
240
|
+
tokenMetadata: TokenMetadata;
|
|
165
241
|
}
|
|
166
242
|
|
|
167
|
-
export type
|
|
243
|
+
export type ProvisionalPaymentDetails = { type: "bitcoin"; withdrawalAddress: string } | { type: "lightning"; invoice: string } | { type: "spark"; payRequest: string } | { type: "token"; tokenId: string; payRequest: string };
|
|
244
|
+
|
|
245
|
+
export interface Payment {
|
|
246
|
+
id: string;
|
|
247
|
+
paymentType: PaymentType;
|
|
248
|
+
status: PaymentStatus;
|
|
249
|
+
amount: bigint;
|
|
250
|
+
fees: bigint;
|
|
251
|
+
timestamp: number;
|
|
252
|
+
method: PaymentMethod;
|
|
253
|
+
details?: PaymentDetails;
|
|
254
|
+
conversionDetails?: ConversionDetails;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export interface CheckMessageRequest {
|
|
258
|
+
message: string;
|
|
259
|
+
pubkey: string;
|
|
260
|
+
signature: string;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export type ReceivePaymentMethod = { type: "sparkAddress" } | { type: "sparkInvoice"; amount?: string; tokenIdentifier?: string; expiryTime?: number; description?: string; senderPublicKey?: string } | { type: "bitcoinAddress"; newAddress?: boolean } | { type: "bolt11Invoice"; description: string; amountSats?: number; expirySecs?: number; paymentHash?: string };
|
|
264
|
+
|
|
265
|
+
export interface ProvisionalPayment {
|
|
266
|
+
paymentId: string;
|
|
267
|
+
amount: bigint;
|
|
268
|
+
details: ProvisionalPaymentDetails;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export interface ListContactsRequest {
|
|
272
|
+
offset?: number;
|
|
273
|
+
limit?: number;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export type BitcoinNetwork = "bitcoin" | "testnet3" | "testnet4" | "signet" | "regtest";
|
|
277
|
+
|
|
278
|
+
export type UpdateDepositPayload = { type: "claimError"; error: DepositClaimError } | { type: "refund"; refundTxid: string; refundTx: string };
|
|
279
|
+
|
|
280
|
+
export interface TokenMetadata {
|
|
281
|
+
identifier: string;
|
|
282
|
+
issuerPublicKey: string;
|
|
283
|
+
name: string;
|
|
284
|
+
ticker: string;
|
|
285
|
+
decimals: number;
|
|
286
|
+
maxSupply: string;
|
|
287
|
+
isFreezable: boolean;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface ReceivePaymentResponse {
|
|
291
|
+
paymentRequest: string;
|
|
292
|
+
fee: bigint;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export type Amount = { type: "bitcoin"; amountMsat: number } | { type: "currency"; iso4217Code: string; fractionalAmount: number };
|
|
296
|
+
|
|
297
|
+
export type PaymentType = "send" | "receive";
|
|
168
298
|
|
|
169
299
|
export interface ListPaymentsRequest {
|
|
170
300
|
typeFilter?: PaymentType[];
|
|
@@ -178,20 +308,26 @@ export interface ListPaymentsRequest {
|
|
|
178
308
|
sortAscending?: boolean;
|
|
179
309
|
}
|
|
180
310
|
|
|
181
|
-
export interface
|
|
182
|
-
|
|
183
|
-
fee: bigint;
|
|
311
|
+
export interface SendPaymentResponse {
|
|
312
|
+
payment: Payment;
|
|
184
313
|
}
|
|
185
314
|
|
|
186
|
-
export
|
|
315
|
+
export interface StorageListPaymentsRequest {
|
|
316
|
+
typeFilter?: PaymentType[];
|
|
317
|
+
statusFilter?: PaymentStatus[];
|
|
318
|
+
assetFilter?: AssetFilter;
|
|
319
|
+
paymentDetailsFilter?: StoragePaymentDetailsFilter[];
|
|
320
|
+
fromTimestamp?: number;
|
|
321
|
+
toTimestamp?: number;
|
|
322
|
+
offset?: number;
|
|
323
|
+
limit?: number;
|
|
324
|
+
sortAscending?: boolean;
|
|
325
|
+
}
|
|
187
326
|
|
|
188
|
-
export interface
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
validateSuccessActionUrl?: boolean;
|
|
193
|
-
conversionOptions?: ConversionOptions;
|
|
194
|
-
feePolicy?: FeePolicy;
|
|
327
|
+
export interface LocaleOverrides {
|
|
328
|
+
locale: string;
|
|
329
|
+
spacing?: number;
|
|
330
|
+
symbol: Symbol;
|
|
195
331
|
}
|
|
196
332
|
|
|
197
333
|
export interface ConversionOptions {
|
|
@@ -200,213 +336,250 @@ export interface ConversionOptions {
|
|
|
200
336
|
completionTimeoutSecs?: number;
|
|
201
337
|
}
|
|
202
338
|
|
|
203
|
-
export interface
|
|
204
|
-
id: string;
|
|
339
|
+
export interface CurrencyInfo {
|
|
205
340
|
name: string;
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
341
|
+
fractionSize: number;
|
|
342
|
+
spacing?: number;
|
|
343
|
+
symbol?: Symbol;
|
|
344
|
+
uniqSymbol?: Symbol;
|
|
345
|
+
localizedName: LocalizedName[];
|
|
346
|
+
localeOverrides: LocaleOverrides[];
|
|
211
347
|
}
|
|
212
348
|
|
|
213
|
-
export
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
dataId: string;
|
|
349
|
+
export interface LnurlWithdrawRequest {
|
|
350
|
+
amountSats: number;
|
|
351
|
+
withdrawRequest: LnurlWithdrawRequestDetails;
|
|
352
|
+
completionTimeoutSecs?: number;
|
|
218
353
|
}
|
|
219
354
|
|
|
220
|
-
export interface
|
|
221
|
-
|
|
355
|
+
export interface OutgoingChange {
|
|
356
|
+
change: RecordChange;
|
|
357
|
+
parent?: Record;
|
|
222
358
|
}
|
|
223
359
|
|
|
224
|
-
export type
|
|
225
|
-
|
|
226
|
-
export interface BuyBitcoinRequest {
|
|
227
|
-
lockedAmountSat?: number;
|
|
228
|
-
redirectUrl?: string;
|
|
229
|
-
}
|
|
360
|
+
export type ConversionStatus = "pending" | "completed" | "failed" | "refundNeeded" | "refunded";
|
|
230
361
|
|
|
231
|
-
export interface
|
|
232
|
-
|
|
233
|
-
txHex: string;
|
|
362
|
+
export interface Bolt12OfferBlindedPath {
|
|
363
|
+
blindedHops: string[];
|
|
234
364
|
}
|
|
235
365
|
|
|
236
|
-
export type
|
|
366
|
+
export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" } | { type: "autoConversion" };
|
|
237
367
|
|
|
238
|
-
export interface
|
|
239
|
-
|
|
240
|
-
|
|
368
|
+
export interface LnurlWithdrawResponse {
|
|
369
|
+
paymentRequest: string;
|
|
370
|
+
payment?: Payment;
|
|
241
371
|
}
|
|
242
372
|
|
|
243
|
-
export interface
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
tokenIdentifier?: string;
|
|
247
|
-
conversionEstimate?: ConversionEstimate;
|
|
248
|
-
feePolicy: FeePolicy;
|
|
373
|
+
export interface Bolt12Invoice {
|
|
374
|
+
invoice: string;
|
|
375
|
+
source: PaymentRequestSource;
|
|
249
376
|
}
|
|
250
377
|
|
|
251
|
-
export
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
378
|
+
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);
|
|
379
|
+
|
|
380
|
+
export interface PrepareLnurlPayRequest {
|
|
381
|
+
amountSats: number;
|
|
382
|
+
comment?: string;
|
|
383
|
+
payRequest: LnurlPayRequestDetails;
|
|
384
|
+
validateSuccessActionUrl?: boolean;
|
|
385
|
+
conversionOptions?: ConversionOptions;
|
|
386
|
+
feePolicy?: FeePolicy;
|
|
256
387
|
}
|
|
257
388
|
|
|
258
|
-
export interface
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
389
|
+
export interface Bolt11InvoiceDetails {
|
|
390
|
+
amountMsat?: number;
|
|
391
|
+
description?: string;
|
|
392
|
+
descriptionHash?: string;
|
|
393
|
+
expiry: number;
|
|
394
|
+
invoice: Bolt11Invoice;
|
|
395
|
+
minFinalCltvExpiryDelta: number;
|
|
396
|
+
network: BitcoinNetwork;
|
|
397
|
+
payeePubkey: string;
|
|
398
|
+
paymentHash: string;
|
|
399
|
+
paymentSecret: string;
|
|
400
|
+
routingHints: Bolt11RouteHint[];
|
|
264
401
|
timestamp: number;
|
|
265
|
-
method: PaymentMethod;
|
|
266
|
-
details?: PaymentDetails;
|
|
267
|
-
conversionDetails?: ConversionDetails;
|
|
268
402
|
}
|
|
269
403
|
|
|
270
|
-
export interface
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
404
|
+
export interface SendOnchainFeeQuote {
|
|
405
|
+
id: string;
|
|
406
|
+
expiresAt: number;
|
|
407
|
+
speedFast: SendOnchainSpeedFeeQuote;
|
|
408
|
+
speedMedium: SendOnchainSpeedFeeQuote;
|
|
409
|
+
speedSlow: SendOnchainSpeedFeeQuote;
|
|
276
410
|
}
|
|
277
411
|
|
|
278
|
-
export
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
source: PaymentRequestSource;
|
|
412
|
+
export interface SendPaymentRequest {
|
|
413
|
+
prepareResponse: PrepareSendPaymentResponse;
|
|
414
|
+
options?: SendPaymentOptions;
|
|
415
|
+
idempotencyKey?: string;
|
|
283
416
|
}
|
|
284
417
|
|
|
285
|
-
export interface
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
418
|
+
export interface Bolt12OfferDetails {
|
|
419
|
+
absoluteExpiry?: number;
|
|
420
|
+
chains: string[];
|
|
421
|
+
description?: string;
|
|
422
|
+
issuer?: string;
|
|
423
|
+
minAmount?: Amount;
|
|
424
|
+
offer: Bolt12Offer;
|
|
425
|
+
paths: Bolt12OfferBlindedPath[];
|
|
426
|
+
signingPubkey?: string;
|
|
293
427
|
}
|
|
294
428
|
|
|
295
|
-
export
|
|
429
|
+
export interface RegisterLightningAddressRequest {
|
|
430
|
+
username: string;
|
|
431
|
+
description?: string;
|
|
432
|
+
}
|
|
296
433
|
|
|
297
|
-
export interface
|
|
298
|
-
|
|
434
|
+
export interface UnregisterWebhookRequest {
|
|
435
|
+
webhookId: string;
|
|
299
436
|
}
|
|
300
437
|
|
|
301
|
-
export interface
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
438
|
+
export interface Contact {
|
|
439
|
+
id: string;
|
|
440
|
+
name: string;
|
|
441
|
+
paymentIdentifier: string;
|
|
442
|
+
createdAt: number;
|
|
443
|
+
updatedAt: number;
|
|
306
444
|
}
|
|
307
445
|
|
|
308
|
-
export interface
|
|
309
|
-
description: string;
|
|
446
|
+
export interface LnurlInfo {
|
|
310
447
|
url: string;
|
|
311
|
-
|
|
448
|
+
bech32: string;
|
|
312
449
|
}
|
|
313
450
|
|
|
314
|
-
export
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
451
|
+
export type StableBalanceActiveLabel = { type: "set"; label: string } | { type: "unset" };
|
|
452
|
+
|
|
453
|
+
export interface LnurlPayRequestDetails {
|
|
454
|
+
callback: string;
|
|
455
|
+
minSendable: number;
|
|
456
|
+
maxSendable: number;
|
|
457
|
+
metadataStr: string;
|
|
458
|
+
commentAllowed: number;
|
|
459
|
+
domain: string;
|
|
460
|
+
url: string;
|
|
461
|
+
address?: string;
|
|
462
|
+
allowsNostr?: boolean;
|
|
463
|
+
nostrPubkey?: string;
|
|
318
464
|
}
|
|
319
465
|
|
|
320
|
-
export interface
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
schemaVersion: string;
|
|
324
|
-
data: Map<string, string>;
|
|
466
|
+
export interface SparkInvoicePaymentDetails {
|
|
467
|
+
description?: string;
|
|
468
|
+
invoice: string;
|
|
325
469
|
}
|
|
326
470
|
|
|
327
|
-
export
|
|
471
|
+
export interface StableBalanceConfig {
|
|
472
|
+
tokens: StableBalanceToken[];
|
|
473
|
+
defaultActiveLabel?: string;
|
|
474
|
+
thresholdSats?: number;
|
|
475
|
+
maxSlippageBps?: number;
|
|
476
|
+
}
|
|
328
477
|
|
|
329
|
-
export type
|
|
478
|
+
export type SdkEvent = { type: "synced" } | { type: "unclaimedDeposits"; unclaimedDeposits: DepositInfo[] } | { type: "claimedDeposits"; claimedDeposits: DepositInfo[] } | { type: "paymentSucceeded"; payment: Payment } | { type: "paymentPending"; payment: Payment } | { type: "paymentFailed"; payment: Payment } | { type: "optimization"; optimizationEvent: OptimizationEvent } | { type: "lightningAddressChanged"; lightningAddress?: LightningAddressInfo } | { type: "newDeposits"; newDeposits: DepositInfo[] };
|
|
330
479
|
|
|
331
|
-
export
|
|
480
|
+
export interface StableBalanceToken {
|
|
481
|
+
label: string;
|
|
482
|
+
tokenIdentifier: string;
|
|
483
|
+
}
|
|
332
484
|
|
|
333
|
-
export interface
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
485
|
+
export interface ExternalInputParser {
|
|
486
|
+
providerId: string;
|
|
487
|
+
inputRegex: string;
|
|
488
|
+
parserUrl: string;
|
|
337
489
|
}
|
|
338
490
|
|
|
339
|
-
export interface
|
|
340
|
-
|
|
341
|
-
|
|
491
|
+
export interface LnurlWithdrawRequestDetails {
|
|
492
|
+
callback: string;
|
|
493
|
+
k1: string;
|
|
494
|
+
defaultDescription: string;
|
|
495
|
+
minWithdrawable: number;
|
|
496
|
+
maxWithdrawable: number;
|
|
342
497
|
}
|
|
343
498
|
|
|
344
|
-
export interface
|
|
345
|
-
|
|
346
|
-
plaintext: string;
|
|
499
|
+
export interface GetTokensMetadataRequest {
|
|
500
|
+
tokenIdentifiers: string[];
|
|
347
501
|
}
|
|
348
502
|
|
|
349
|
-
export interface
|
|
350
|
-
|
|
351
|
-
|
|
503
|
+
export interface RecordId {
|
|
504
|
+
type: string;
|
|
505
|
+
dataId: string;
|
|
352
506
|
}
|
|
353
507
|
|
|
354
|
-
export interface
|
|
355
|
-
|
|
356
|
-
|
|
508
|
+
export interface BitcoinAddressDetails {
|
|
509
|
+
address: string;
|
|
510
|
+
network: BitcoinNetwork;
|
|
511
|
+
source: PaymentRequestSource;
|
|
357
512
|
}
|
|
358
513
|
|
|
359
|
-
export interface
|
|
360
|
-
|
|
361
|
-
chains: string[];
|
|
362
|
-
description?: string;
|
|
363
|
-
issuer?: string;
|
|
364
|
-
minAmount?: Amount;
|
|
365
|
-
offer: Bolt12Offer;
|
|
366
|
-
paths: Bolt12OfferBlindedPath[];
|
|
367
|
-
signingPubkey?: string;
|
|
514
|
+
export interface LnurlErrorDetails {
|
|
515
|
+
reason: string;
|
|
368
516
|
}
|
|
369
517
|
|
|
370
|
-
export type
|
|
518
|
+
export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
|
|
371
519
|
|
|
372
|
-
export
|
|
520
|
+
export interface Bip21Details {
|
|
521
|
+
amountSat?: number;
|
|
522
|
+
assetId?: string;
|
|
523
|
+
uri: string;
|
|
524
|
+
extras: Bip21Extra[];
|
|
525
|
+
label?: string;
|
|
526
|
+
message?: string;
|
|
527
|
+
paymentMethods: InputType[];
|
|
528
|
+
}
|
|
373
529
|
|
|
374
|
-
export type
|
|
530
|
+
export type SuccessAction = { type: "aes"; data: AesSuccessActionData } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
|
|
375
531
|
|
|
376
|
-
export interface
|
|
377
|
-
|
|
378
|
-
|
|
532
|
+
export interface KeySetConfig {
|
|
533
|
+
keySetType: KeySetType;
|
|
534
|
+
useAddressIndex: boolean;
|
|
535
|
+
accountNumber?: number;
|
|
379
536
|
}
|
|
380
537
|
|
|
381
|
-
export
|
|
382
|
-
config: Config;
|
|
383
|
-
seed: Seed;
|
|
384
|
-
storageDir: string;
|
|
385
|
-
}
|
|
538
|
+
export type OptimizationEvent = { type: "started"; totalRounds: number } | { type: "roundCompleted"; currentRound: number; totalRounds: number } | { type: "completed" } | { type: "cancelled" } | { type: "failed"; error: string } | { type: "skipped" };
|
|
386
539
|
|
|
387
|
-
export
|
|
388
|
-
|
|
389
|
-
|
|
540
|
+
export type TokenTransactionType = "transfer" | "mint" | "burn";
|
|
541
|
+
|
|
542
|
+
export interface UpdateContactRequest {
|
|
543
|
+
id: string;
|
|
544
|
+
name: string;
|
|
545
|
+
paymentIdentifier: string;
|
|
390
546
|
}
|
|
391
547
|
|
|
392
|
-
export interface
|
|
393
|
-
|
|
548
|
+
export interface AesSuccessActionDataDecrypted {
|
|
549
|
+
description: string;
|
|
550
|
+
plaintext: string;
|
|
394
551
|
}
|
|
395
552
|
|
|
396
|
-
export
|
|
553
|
+
export interface SyncWalletRequest {}
|
|
397
554
|
|
|
398
|
-
export interface
|
|
399
|
-
|
|
555
|
+
export interface Config {
|
|
556
|
+
apiKey?: string;
|
|
557
|
+
network: Network;
|
|
558
|
+
syncIntervalSecs: number;
|
|
559
|
+
maxDepositClaimFee?: MaxFee;
|
|
560
|
+
lnurlDomain?: string;
|
|
561
|
+
preferSparkOverLightning: boolean;
|
|
562
|
+
externalInputParsers?: ExternalInputParser[];
|
|
563
|
+
useDefaultExternalInputParsers: boolean;
|
|
564
|
+
realTimeSyncServerUrl?: string;
|
|
565
|
+
privateEnabledDefault: boolean;
|
|
566
|
+
optimizationConfig: OptimizationConfig;
|
|
567
|
+
stableBalanceConfig?: StableBalanceConfig;
|
|
568
|
+
/**
|
|
569
|
+
* Maximum number of concurrent transfer claims.
|
|
570
|
+
*
|
|
571
|
+
* Controls how many pending Spark transfers can be claimed in parallel.
|
|
572
|
+
* Default is 4. Increase for server environments with high incoming
|
|
573
|
+
* payment volume to improve throughput.
|
|
574
|
+
*/
|
|
575
|
+
maxConcurrentClaims: number;
|
|
576
|
+
sparkConfig?: SparkConfig;
|
|
400
577
|
}
|
|
401
578
|
|
|
402
|
-
export interface
|
|
403
|
-
|
|
579
|
+
export interface RegisterWebhookResponse {
|
|
580
|
+
webhookId: string;
|
|
404
581
|
}
|
|
405
582
|
|
|
406
|
-
export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
|
|
407
|
-
|
|
408
|
-
export type ConversionType = { type: "fromBitcoin" } | { type: "toBitcoin"; fromTokenIdentifier: string };
|
|
409
|
-
|
|
410
583
|
export interface SparkInvoiceDetails {
|
|
411
584
|
invoice: string;
|
|
412
585
|
identityPublicKey: string;
|
|
@@ -418,10 +591,21 @@ export interface SparkInvoiceDetails {
|
|
|
418
591
|
senderPublicKey?: string;
|
|
419
592
|
}
|
|
420
593
|
|
|
421
|
-
export
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
594
|
+
export type SendPaymentOptions = { type: "bitcoinAddress"; confirmationSpeed: OnchainConfirmationSpeed } | { type: "bolt11Invoice"; preferSpark: boolean; completionTimeoutSecs?: number } | { type: "sparkAddress"; htlcOptions?: SparkHtlcOptions };
|
|
595
|
+
|
|
596
|
+
export interface SignMessageResponse {
|
|
597
|
+
pubkey: string;
|
|
598
|
+
signature: string;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
export interface Bolt12InvoiceDetails {
|
|
602
|
+
amountMsat: number;
|
|
603
|
+
invoice: Bolt12Invoice;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
export interface LogEntry {
|
|
607
|
+
line: string;
|
|
608
|
+
level: string;
|
|
425
609
|
}
|
|
426
610
|
|
|
427
611
|
export interface AesSuccessActionData {
|
|
@@ -430,65 +614,91 @@ export interface AesSuccessActionData {
|
|
|
430
614
|
iv: string;
|
|
431
615
|
}
|
|
432
616
|
|
|
433
|
-
export interface
|
|
617
|
+
export interface LnurlPayInfo {
|
|
618
|
+
lnAddress?: string;
|
|
619
|
+
comment?: string;
|
|
620
|
+
domain?: string;
|
|
621
|
+
metadata?: string;
|
|
622
|
+
processedSuccessAction?: SuccessActionProcessed;
|
|
623
|
+
rawSuccessAction?: SuccessAction;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
export interface LightningAddressDetails {
|
|
627
|
+
address: string;
|
|
628
|
+
payRequest: LnurlPayRequestDetails;
|
|
629
|
+
}
|
|
434
630
|
|
|
435
631
|
export interface GetPaymentRequest {
|
|
436
632
|
paymentId: string;
|
|
437
633
|
}
|
|
438
634
|
|
|
439
|
-
export
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
rates: Rate[];
|
|
635
|
+
export interface Bip21Extra {
|
|
636
|
+
key: string;
|
|
637
|
+
value: string;
|
|
443
638
|
}
|
|
444
639
|
|
|
445
|
-
export
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
640
|
+
export interface ConversionStep {
|
|
641
|
+
paymentId: string;
|
|
642
|
+
amount: bigint;
|
|
643
|
+
fee: bigint;
|
|
644
|
+
method: PaymentMethod;
|
|
645
|
+
tokenMetadata?: TokenMetadata;
|
|
646
|
+
amountAdjustment?: AmountAdjustmentReason;
|
|
450
647
|
}
|
|
451
648
|
|
|
452
|
-
export interface
|
|
453
|
-
|
|
454
|
-
|
|
649
|
+
export interface LnurlAuthRequestDetails {
|
|
650
|
+
k1: string;
|
|
651
|
+
action?: string;
|
|
652
|
+
domain: string;
|
|
653
|
+
url: string;
|
|
455
654
|
}
|
|
456
655
|
|
|
457
|
-
export interface
|
|
656
|
+
export interface SetLnurlMetadataItem {
|
|
458
657
|
paymentHash: string;
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
export interface LnurlPayRequest {
|
|
465
|
-
prepareResponse: PrepareLnurlPayResponse;
|
|
466
|
-
idempotencyKey?: string;
|
|
658
|
+
senderComment?: string;
|
|
659
|
+
nostrZapRequest?: string;
|
|
660
|
+
nostrZapReceipt?: string;
|
|
467
661
|
}
|
|
468
662
|
|
|
469
|
-
export interface
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
expiry: number;
|
|
474
|
-
invoice: Bolt11Invoice;
|
|
475
|
-
minFinalCltvExpiryDelta: number;
|
|
476
|
-
network: BitcoinNetwork;
|
|
477
|
-
payeePubkey: string;
|
|
478
|
-
paymentHash: string;
|
|
479
|
-
paymentSecret: string;
|
|
480
|
-
routingHints: Bolt11RouteHint[];
|
|
481
|
-
timestamp: number;
|
|
663
|
+
export interface OptimizationProgress {
|
|
664
|
+
isRunning: boolean;
|
|
665
|
+
currentRound: number;
|
|
666
|
+
totalRounds: number;
|
|
482
667
|
}
|
|
483
668
|
|
|
484
|
-
export interface
|
|
485
|
-
|
|
486
|
-
|
|
669
|
+
export interface Record {
|
|
670
|
+
id: RecordId;
|
|
671
|
+
revision: number;
|
|
672
|
+
schemaVersion: string;
|
|
673
|
+
data: Map<string, string>;
|
|
487
674
|
}
|
|
488
675
|
|
|
489
|
-
export interface
|
|
490
|
-
|
|
491
|
-
|
|
676
|
+
export interface ConversionDetails {
|
|
677
|
+
status: ConversionStatus;
|
|
678
|
+
from?: ConversionStep;
|
|
679
|
+
to?: ConversionStep;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
export interface GetInfoResponse {
|
|
683
|
+
identityPubkey: string;
|
|
684
|
+
balanceSats: number;
|
|
685
|
+
tokenBalances: Map<string, TokenBalance>;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
export type StoragePaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
|
|
689
|
+
|
|
690
|
+
export interface RefundDepositResponse {
|
|
691
|
+
txId: string;
|
|
692
|
+
txHex: string;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
export interface SparkStatus {
|
|
696
|
+
status: ServiceStatus;
|
|
697
|
+
lastUpdated: number;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
export interface BuyBitcoinResponse {
|
|
701
|
+
url: string;
|
|
492
702
|
}
|
|
493
703
|
|
|
494
704
|
export interface Symbol {
|
|
@@ -498,51 +708,39 @@ export interface Symbol {
|
|
|
498
708
|
position?: number;
|
|
499
709
|
}
|
|
500
710
|
|
|
501
|
-
export interface
|
|
502
|
-
|
|
503
|
-
payRequest: LnurlPayRequestDetails;
|
|
711
|
+
export interface ClaimHtlcPaymentResponse {
|
|
712
|
+
payment: Payment;
|
|
504
713
|
}
|
|
505
714
|
|
|
506
|
-
export
|
|
507
|
-
id: RecordId;
|
|
508
|
-
schemaVersion: string;
|
|
509
|
-
updatedFields: Map<string, string>;
|
|
510
|
-
localRevision: number;
|
|
511
|
-
}
|
|
715
|
+
export type WebhookEventType = { type: "lightningReceiveFinished" } | { type: "lightningSendFinished" } | { type: "coopExitFinished" } | { type: "staticDepositFinished" } | ({ type: "unknown" } & string);
|
|
512
716
|
|
|
513
|
-
export
|
|
514
|
-
bolt11: string;
|
|
515
|
-
source: PaymentRequestSource;
|
|
516
|
-
}
|
|
717
|
+
export type PaymentMethod = "lightning" | "spark" | "token" | "deposit" | "withdraw" | "unknown";
|
|
517
718
|
|
|
518
|
-
export interface
|
|
519
|
-
|
|
719
|
+
export interface PaymentRequestSource {
|
|
720
|
+
bip21Uri?: string;
|
|
721
|
+
bip353Address?: string;
|
|
520
722
|
}
|
|
521
723
|
|
|
522
|
-
export
|
|
523
|
-
tokenIdentifiers: string[];
|
|
524
|
-
}
|
|
724
|
+
export type FeePolicy = "feesExcluded" | "feesIncluded";
|
|
525
725
|
|
|
526
|
-
export type
|
|
726
|
+
export type AesSuccessActionDataResult = { type: "decrypted"; data: AesSuccessActionDataDecrypted } | { type: "errorStatus"; reason: string };
|
|
527
727
|
|
|
528
|
-
export interface
|
|
529
|
-
|
|
728
|
+
export interface ListUnclaimedDepositsResponse {
|
|
729
|
+
deposits: DepositInfo[];
|
|
530
730
|
}
|
|
531
731
|
|
|
532
|
-
export interface
|
|
533
|
-
|
|
534
|
-
identityPublicKey: string;
|
|
535
|
-
network: BitcoinNetwork;
|
|
536
|
-
source: PaymentRequestSource;
|
|
732
|
+
export interface GetInfoRequest {
|
|
733
|
+
ensureSynced?: boolean;
|
|
537
734
|
}
|
|
538
735
|
|
|
539
|
-
export interface
|
|
540
|
-
|
|
736
|
+
export interface UserSettings {
|
|
737
|
+
sparkPrivateModeEnabled: boolean;
|
|
738
|
+
stableBalanceActiveLabel?: string;
|
|
541
739
|
}
|
|
542
740
|
|
|
543
|
-
export interface
|
|
544
|
-
|
|
545
|
-
|
|
741
|
+
export interface Credentials {
|
|
742
|
+
username: string;
|
|
743
|
+
password: string;
|
|
546
744
|
}
|
|
547
745
|
|
|
548
746
|
export interface Bolt11RouteHintHop {
|
|
@@ -555,29 +753,42 @@ export interface Bolt11RouteHintHop {
|
|
|
555
753
|
htlcMaximumMsat?: number;
|
|
556
754
|
}
|
|
557
755
|
|
|
558
|
-
export
|
|
756
|
+
export interface LnurlReceiveMetadata {
|
|
757
|
+
nostrZapRequest?: string;
|
|
758
|
+
nostrZapReceipt?: string;
|
|
759
|
+
senderComment?: string;
|
|
760
|
+
}
|
|
559
761
|
|
|
560
|
-
export interface
|
|
561
|
-
|
|
562
|
-
|
|
762
|
+
export interface SendOnchainSpeedFeeQuote {
|
|
763
|
+
userFeeSat: number;
|
|
764
|
+
l1BroadcastFeeSat: number;
|
|
563
765
|
}
|
|
564
766
|
|
|
565
|
-
export interface
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
767
|
+
export interface ListUnclaimedDepositsRequest {}
|
|
768
|
+
|
|
769
|
+
export interface Bolt12Offer {
|
|
770
|
+
offer: string;
|
|
771
|
+
source: PaymentRequestSource;
|
|
569
772
|
}
|
|
570
773
|
|
|
571
|
-
export
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
feePolicy?: FeePolicy;
|
|
774
|
+
export type Fee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number };
|
|
775
|
+
|
|
776
|
+
export interface UpdateUserSettingsRequest {
|
|
777
|
+
sparkPrivateModeEnabled?: boolean;
|
|
778
|
+
stableBalanceActiveLabel?: StableBalanceActiveLabel;
|
|
577
779
|
}
|
|
578
780
|
|
|
579
|
-
export interface
|
|
580
|
-
|
|
781
|
+
export interface SilentPaymentAddressDetails {
|
|
782
|
+
address: string;
|
|
783
|
+
network: BitcoinNetwork;
|
|
784
|
+
source: PaymentRequestSource;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
export interface SparkSigningOperator {
|
|
788
|
+
id: number;
|
|
789
|
+
identifier: string;
|
|
790
|
+
address: string;
|
|
791
|
+
identityPublicKey: string;
|
|
581
792
|
}
|
|
582
793
|
|
|
583
794
|
export interface RefundDepositRequest {
|
|
@@ -587,81 +798,56 @@ export interface RefundDepositRequest {
|
|
|
587
798
|
fee: Fee;
|
|
588
799
|
}
|
|
589
800
|
|
|
590
|
-
export interface
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
export interface OptimizationConfig {
|
|
595
|
-
autoEnabled: boolean;
|
|
596
|
-
multiplicity: number;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
export interface StorageListPaymentsRequest {
|
|
600
|
-
typeFilter?: PaymentType[];
|
|
601
|
-
statusFilter?: PaymentStatus[];
|
|
602
|
-
assetFilter?: AssetFilter;
|
|
603
|
-
paymentDetailsFilter?: StoragePaymentDetailsFilter[];
|
|
604
|
-
fromTimestamp?: number;
|
|
605
|
-
toTimestamp?: number;
|
|
606
|
-
offset?: number;
|
|
607
|
-
limit?: number;
|
|
608
|
-
sortAscending?: boolean;
|
|
801
|
+
export interface AddContactRequest {
|
|
802
|
+
name: string;
|
|
803
|
+
paymentIdentifier: string;
|
|
609
804
|
}
|
|
610
805
|
|
|
611
|
-
export interface
|
|
612
|
-
|
|
613
|
-
|
|
806
|
+
export interface Webhook {
|
|
807
|
+
id: string;
|
|
808
|
+
url: string;
|
|
809
|
+
eventTypes: WebhookEventType[];
|
|
614
810
|
}
|
|
615
811
|
|
|
616
|
-
export type
|
|
812
|
+
export type Network = "mainnet" | "regtest";
|
|
617
813
|
|
|
618
|
-
export interface
|
|
619
|
-
|
|
620
|
-
amount: bigint;
|
|
621
|
-
fee: bigint;
|
|
622
|
-
method: PaymentMethod;
|
|
623
|
-
tokenMetadata?: TokenMetadata;
|
|
814
|
+
export interface ClaimHtlcPaymentRequest {
|
|
815
|
+
preimage: string;
|
|
624
816
|
}
|
|
625
817
|
|
|
626
|
-
export interface
|
|
627
|
-
|
|
818
|
+
export interface RegisterWebhookRequest {
|
|
819
|
+
url: string;
|
|
820
|
+
secret: string;
|
|
821
|
+
eventTypes: WebhookEventType[];
|
|
628
822
|
}
|
|
629
823
|
|
|
630
|
-
export
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
amountSats: number;
|
|
634
|
-
withdrawRequest: LnurlWithdrawRequestDetails;
|
|
635
|
-
completionTimeoutSecs?: number;
|
|
824
|
+
export interface SparkHtlcOptions {
|
|
825
|
+
paymentHash: string;
|
|
826
|
+
expiryDurationSecs: number;
|
|
636
827
|
}
|
|
637
828
|
|
|
638
|
-
export interface
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
maxFee?: MaxFee;
|
|
829
|
+
export interface FiatCurrency {
|
|
830
|
+
id: string;
|
|
831
|
+
info: CurrencyInfo;
|
|
642
832
|
}
|
|
643
833
|
|
|
644
|
-
export
|
|
645
|
-
coin: string;
|
|
646
|
-
value: number;
|
|
647
|
-
}
|
|
834
|
+
export type BuyBitcoinRequest = { type: "moonpay"; lockedAmountSat?: number; redirectUrl?: string } | { type: "cashApp"; amountSats?: number };
|
|
648
835
|
|
|
649
|
-
export interface
|
|
650
|
-
|
|
651
|
-
invoice: Bolt12Invoice;
|
|
836
|
+
export interface ClaimDepositResponse {
|
|
837
|
+
payment: Payment;
|
|
652
838
|
}
|
|
653
839
|
|
|
654
|
-
export interface
|
|
655
|
-
|
|
840
|
+
export interface PrepareSendPaymentRequest {
|
|
841
|
+
paymentRequest: string;
|
|
842
|
+
amount?: bigint;
|
|
843
|
+
tokenIdentifier?: string;
|
|
844
|
+
conversionOptions?: ConversionOptions;
|
|
845
|
+
feePolicy?: FeePolicy;
|
|
656
846
|
}
|
|
657
847
|
|
|
658
|
-
export interface
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
domain?: string;
|
|
662
|
-
metadata?: string;
|
|
663
|
-
processedSuccessAction?: SuccessActionProcessed;
|
|
664
|
-
rawSuccessAction?: SuccessAction;
|
|
848
|
+
export interface SignMessageRequest {
|
|
849
|
+
message: string;
|
|
850
|
+
compact: boolean;
|
|
665
851
|
}
|
|
666
852
|
|
|
667
853
|
export interface IncomingChange {
|
|
@@ -669,292 +855,234 @@ export interface IncomingChange {
|
|
|
669
855
|
oldState?: Record;
|
|
670
856
|
}
|
|
671
857
|
|
|
672
|
-
export interface
|
|
673
|
-
|
|
858
|
+
export interface GetTokensMetadataResponse {
|
|
859
|
+
tokensMetadata: TokenMetadata[];
|
|
674
860
|
}
|
|
675
861
|
|
|
676
|
-
export interface
|
|
677
|
-
|
|
678
|
-
vout: number;
|
|
679
|
-
amountSats: number;
|
|
680
|
-
refundTx?: string;
|
|
681
|
-
refundTxId?: string;
|
|
682
|
-
claimError?: DepositClaimError;
|
|
862
|
+
export interface Bolt11RouteHint {
|
|
863
|
+
hops: Bolt11RouteHintHop[];
|
|
683
864
|
}
|
|
684
865
|
|
|
685
|
-
export interface
|
|
686
|
-
|
|
866
|
+
export interface OptimizationConfig {
|
|
867
|
+
autoEnabled: boolean;
|
|
868
|
+
multiplicity: number;
|
|
687
869
|
}
|
|
688
870
|
|
|
689
|
-
export interface
|
|
690
|
-
apiKey?: string;
|
|
691
|
-
network: Network;
|
|
692
|
-
syncIntervalSecs: number;
|
|
693
|
-
maxDepositClaimFee?: MaxFee;
|
|
694
|
-
lnurlDomain?: string;
|
|
695
|
-
preferSparkOverLightning: boolean;
|
|
696
|
-
externalInputParsers?: ExternalInputParser[];
|
|
697
|
-
useDefaultExternalInputParsers: boolean;
|
|
698
|
-
realTimeSyncServerUrl?: string;
|
|
699
|
-
privateEnabledDefault: boolean;
|
|
700
|
-
optimizationConfig: OptimizationConfig;
|
|
701
|
-
stableBalanceConfig?: StableBalanceConfig;
|
|
702
|
-
/**
|
|
703
|
-
* Maximum number of concurrent transfer claims.
|
|
704
|
-
*
|
|
705
|
-
* Controls how many pending Spark transfers can be claimed in parallel.
|
|
706
|
-
* Default is 4. Increase for server environments with high incoming
|
|
707
|
-
* payment volume to improve throughput.
|
|
708
|
-
*/
|
|
709
|
-
maxConcurrentClaims: number;
|
|
710
|
-
supportLnurlVerify: boolean;
|
|
711
|
-
}
|
|
871
|
+
export interface Bolt12InvoiceRequestDetails {}
|
|
712
872
|
|
|
713
|
-
export
|
|
714
|
-
identifier: string;
|
|
715
|
-
issuerPublicKey: string;
|
|
716
|
-
name: string;
|
|
717
|
-
ticker: string;
|
|
718
|
-
decimals: number;
|
|
719
|
-
maxSupply: string;
|
|
720
|
-
isFreezable: boolean;
|
|
721
|
-
}
|
|
873
|
+
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 };
|
|
722
874
|
|
|
723
|
-
export interface
|
|
875
|
+
export interface MessageSuccessActionData {
|
|
724
876
|
message: string;
|
|
725
|
-
pubkey: string;
|
|
726
|
-
signature: string;
|
|
727
877
|
}
|
|
728
878
|
|
|
729
|
-
export
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
callback: string;
|
|
733
|
-
minSendable: number;
|
|
734
|
-
maxSendable: number;
|
|
735
|
-
metadataStr: string;
|
|
736
|
-
commentAllowed: number;
|
|
737
|
-
domain: string;
|
|
738
|
-
url: string;
|
|
739
|
-
address?: string;
|
|
740
|
-
allowsNostr?: boolean;
|
|
741
|
-
nostrPubkey?: string;
|
|
879
|
+
export interface LnurlPayRequest {
|
|
880
|
+
prepareResponse: PrepareLnurlPayResponse;
|
|
881
|
+
idempotencyKey?: string;
|
|
742
882
|
}
|
|
743
883
|
|
|
744
|
-
export interface
|
|
745
|
-
|
|
746
|
-
currentRound: number;
|
|
747
|
-
totalRounds: number;
|
|
884
|
+
export interface ListFiatCurrenciesResponse {
|
|
885
|
+
currencies: FiatCurrency[];
|
|
748
886
|
}
|
|
749
887
|
|
|
750
|
-
export
|
|
751
|
-
k1: string;
|
|
752
|
-
action?: string;
|
|
753
|
-
domain: string;
|
|
754
|
-
url: string;
|
|
755
|
-
}
|
|
888
|
+
export type KeySetType = "default" | "taproot" | "nativeSegwit" | "wrappedSegwit" | "legacy";
|
|
756
889
|
|
|
757
|
-
export interface
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
lnurlWithdrawInfo?: LnurlWithdrawInfo;
|
|
761
|
-
lnurlDescription?: string;
|
|
762
|
-
conversionInfo?: ConversionInfo;
|
|
890
|
+
export interface Bolt11Invoice {
|
|
891
|
+
bolt11: string;
|
|
892
|
+
source: PaymentRequestSource;
|
|
763
893
|
}
|
|
764
894
|
|
|
765
|
-
export interface
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
maxWithdrawable: number;
|
|
895
|
+
export interface SparkAddressDetails {
|
|
896
|
+
address: string;
|
|
897
|
+
identityPublicKey: string;
|
|
898
|
+
network: BitcoinNetwork;
|
|
899
|
+
source: PaymentRequestSource;
|
|
771
900
|
}
|
|
772
901
|
|
|
773
|
-
export
|
|
902
|
+
export interface LightningAddressInfo {
|
|
903
|
+
description: string;
|
|
904
|
+
lightningAddress: string;
|
|
905
|
+
lnurl: LnurlInfo;
|
|
906
|
+
username: string;
|
|
907
|
+
}
|
|
774
908
|
|
|
775
|
-
export
|
|
909
|
+
export interface RecordChange {
|
|
910
|
+
id: RecordId;
|
|
911
|
+
schemaVersion: string;
|
|
912
|
+
updatedFields: Map<string, string>;
|
|
913
|
+
localRevision: number;
|
|
914
|
+
}
|
|
776
915
|
|
|
777
|
-
export interface
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
updatedAt: number;
|
|
916
|
+
export interface SparkHtlcDetails {
|
|
917
|
+
paymentHash: string;
|
|
918
|
+
preimage?: string;
|
|
919
|
+
expiryTime: number;
|
|
920
|
+
status: SparkHtlcStatus;
|
|
783
921
|
}
|
|
784
922
|
|
|
785
|
-
export interface
|
|
786
|
-
|
|
787
|
-
|
|
923
|
+
export interface UnversionedRecordChange {
|
|
924
|
+
id: RecordId;
|
|
925
|
+
schemaVersion: string;
|
|
926
|
+
updatedFields: Map<string, string>;
|
|
788
927
|
}
|
|
789
928
|
|
|
790
|
-
export type
|
|
929
|
+
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 };
|
|
791
930
|
|
|
792
|
-
export interface
|
|
793
|
-
|
|
931
|
+
export interface Rate {
|
|
932
|
+
coin: string;
|
|
933
|
+
value: number;
|
|
794
934
|
}
|
|
795
935
|
|
|
796
|
-
export type
|
|
936
|
+
export type Seed = { type: "mnemonic"; mnemonic: string; passphrase?: string } | ({ type: "entropy" } & number[]);
|
|
797
937
|
|
|
798
|
-
export interface
|
|
799
|
-
|
|
800
|
-
|
|
938
|
+
export interface ConnectRequest {
|
|
939
|
+
config: Config;
|
|
940
|
+
seed: Seed;
|
|
941
|
+
storageDir: string;
|
|
801
942
|
}
|
|
802
943
|
|
|
803
|
-
export
|
|
944
|
+
export interface DepositInfo {
|
|
945
|
+
txid: string;
|
|
946
|
+
vout: number;
|
|
947
|
+
amountSats: number;
|
|
948
|
+
isMature: boolean;
|
|
949
|
+
refundTx?: string;
|
|
950
|
+
refundTxId?: string;
|
|
951
|
+
claimError?: DepositClaimError;
|
|
952
|
+
}
|
|
804
953
|
|
|
805
|
-
export interface
|
|
806
|
-
|
|
807
|
-
|
|
954
|
+
export interface SyncWalletResponse {}
|
|
955
|
+
|
|
956
|
+
export type OnchainConfirmationSpeed = "fast" | "medium" | "slow";
|
|
957
|
+
|
|
958
|
+
export interface ReceivePaymentRequest {
|
|
959
|
+
paymentMethod: ReceivePaymentMethod;
|
|
808
960
|
}
|
|
809
961
|
|
|
810
962
|
export type PaymentDetails = { type: "spark"; invoiceDetails?: SparkInvoicePaymentDetails; htlcDetails?: SparkHtlcDetails; conversionInfo?: ConversionInfo } | { type: "token"; metadata: TokenMetadata; txHash: string; txType: TokenTransactionType; invoiceDetails?: SparkInvoicePaymentDetails; conversionInfo?: ConversionInfo } | { type: "lightning"; description?: string; invoice: string; destinationPubkey: string; htlcDetails: SparkHtlcDetails; lnurlPayInfo?: LnurlPayInfo; lnurlWithdrawInfo?: LnurlWithdrawInfo; lnurlReceiveMetadata?: LnurlReceiveMetadata } | { type: "withdraw"; txId: string } | { type: "deposit"; txId: string };
|
|
811
963
|
|
|
812
|
-
export
|
|
813
|
-
prepareResponse: PrepareSendPaymentResponse;
|
|
814
|
-
options?: SendPaymentOptions;
|
|
815
|
-
idempotencyKey?: string;
|
|
816
|
-
}
|
|
964
|
+
export type PaymentStatus = "completed" | "pending" | "failed";
|
|
817
965
|
|
|
818
|
-
export interface
|
|
819
|
-
|
|
820
|
-
schemaVersion: string;
|
|
821
|
-
updatedFields: Map<string, string>;
|
|
966
|
+
export interface ListFiatRatesResponse {
|
|
967
|
+
rates: Rate[];
|
|
822
968
|
}
|
|
823
969
|
|
|
824
|
-
export
|
|
825
|
-
message: string;
|
|
826
|
-
}
|
|
970
|
+
export type PaymentDetailsFilter = { type: "spark"; htlcStatus?: SparkHtlcStatus[]; conversionRefundNeeded?: boolean } | { type: "token"; conversionRefundNeeded?: boolean; txHash?: string; txType?: TokenTransactionType } | { type: "lightning"; htlcStatus?: SparkHtlcStatus[] };
|
|
827
971
|
|
|
828
|
-
export interface
|
|
972
|
+
export interface FetchConversionLimitsResponse {
|
|
973
|
+
minFromAmount?: bigint;
|
|
974
|
+
minToAmount?: bigint;
|
|
975
|
+
}
|
|
829
976
|
|
|
830
|
-
export interface
|
|
831
|
-
|
|
832
|
-
|
|
977
|
+
export interface SparkSspConfig {
|
|
978
|
+
baseUrl: string;
|
|
979
|
+
identityPublicKey: string;
|
|
980
|
+
schemaEndpoint?: string;
|
|
833
981
|
}
|
|
834
982
|
|
|
983
|
+
export type MaxFee = { type: "fixed"; amount: number } | { type: "rate"; satPerVbyte: number } | { type: "networkRecommended"; leewaySatPerVbyte: number };
|
|
984
|
+
|
|
835
985
|
export interface FetchConversionLimitsRequest {
|
|
836
986
|
conversionType: ConversionType;
|
|
837
987
|
tokenIdentifier?: string;
|
|
838
988
|
}
|
|
839
989
|
|
|
840
|
-
export interface SyncWalletRequest {}
|
|
841
|
-
|
|
842
|
-
export interface ExternalInputParser {
|
|
843
|
-
providerId: string;
|
|
844
|
-
inputRegex: string;
|
|
845
|
-
parserUrl: string;
|
|
846
|
-
}
|
|
847
|
-
|
|
848
|
-
export interface CurrencyInfo {
|
|
849
|
-
name: string;
|
|
850
|
-
fractionSize: number;
|
|
851
|
-
spacing?: number;
|
|
852
|
-
symbol?: Symbol;
|
|
853
|
-
uniqSymbol?: Symbol;
|
|
854
|
-
localizedName: LocalizedName[];
|
|
855
|
-
localeOverrides: LocaleOverrides[];
|
|
856
|
-
}
|
|
857
|
-
|
|
858
990
|
export interface LnurlPayResponse {
|
|
859
991
|
payment: Payment;
|
|
860
992
|
successAction?: SuccessActionProcessed;
|
|
861
993
|
}
|
|
862
994
|
|
|
863
|
-
export type
|
|
995
|
+
export type SparkHtlcStatus = "waitingForPreimage" | "preimageShared" | "returned";
|
|
864
996
|
|
|
865
|
-
export interface
|
|
866
|
-
|
|
867
|
-
paymentIdentifier: string;
|
|
997
|
+
export interface GetPaymentResponse {
|
|
998
|
+
payment: Payment;
|
|
868
999
|
}
|
|
869
1000
|
|
|
870
|
-
export interface
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
1001
|
+
export interface PrepareLnurlPayResponse {
|
|
1002
|
+
amountSats: number;
|
|
1003
|
+
comment?: string;
|
|
1004
|
+
payRequest: LnurlPayRequestDetails;
|
|
1005
|
+
feeSats: number;
|
|
1006
|
+
invoiceDetails: Bolt11InvoiceDetails;
|
|
1007
|
+
successAction?: SuccessAction;
|
|
1008
|
+
conversionEstimate?: ConversionEstimate;
|
|
1009
|
+
feePolicy: FeePolicy;
|
|
876
1010
|
}
|
|
877
1011
|
|
|
878
|
-
export interface
|
|
879
|
-
|
|
880
|
-
invoice: string;
|
|
1012
|
+
export interface CheckMessageResponse {
|
|
1013
|
+
isValid: boolean;
|
|
881
1014
|
}
|
|
882
1015
|
|
|
883
|
-
export interface
|
|
1016
|
+
export interface LocalizedName {
|
|
884
1017
|
locale: string;
|
|
885
|
-
|
|
886
|
-
symbol: Symbol;
|
|
1018
|
+
name: string;
|
|
887
1019
|
}
|
|
888
1020
|
|
|
889
|
-
export type
|
|
1021
|
+
export type SuccessActionProcessed = { type: "aes"; result: AesSuccessActionDataResult } | { type: "message"; data: MessageSuccessActionData } | { type: "url"; data: UrlSuccessActionData };
|
|
890
1022
|
|
|
891
|
-
export interface
|
|
892
|
-
|
|
893
|
-
nostrZapReceipt?: string;
|
|
894
|
-
senderComment?: string;
|
|
1023
|
+
export interface CheckLightningAddressRequest {
|
|
1024
|
+
username: string;
|
|
895
1025
|
}
|
|
896
1026
|
|
|
897
|
-
export interface
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
1027
|
+
export interface ConversionInfo {
|
|
1028
|
+
poolId: string;
|
|
1029
|
+
conversionId: string;
|
|
1030
|
+
status: ConversionStatus;
|
|
1031
|
+
fee?: string;
|
|
1032
|
+
purpose?: ConversionPurpose;
|
|
1033
|
+
amountAdjustment?: AmountAdjustmentReason;
|
|
901
1034
|
}
|
|
902
1035
|
|
|
903
|
-
export
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
1036
|
+
export interface UrlSuccessActionData {
|
|
1037
|
+
description: string;
|
|
1038
|
+
url: string;
|
|
1039
|
+
matchesCallbackDomain: boolean;
|
|
907
1040
|
}
|
|
908
1041
|
|
|
909
|
-
export
|
|
910
|
-
username: string;
|
|
911
|
-
description?: string;
|
|
912
|
-
}
|
|
1042
|
+
export type AmountAdjustmentReason = "flooredToMinLimit" | "increasedToAvoidDust";
|
|
913
1043
|
|
|
914
|
-
export
|
|
1044
|
+
export type LnurlCallbackStatus = { type: "ok" } | { type: "errorStatus"; errorDetails: LnurlErrorDetails };
|
|
915
1045
|
|
|
916
1046
|
export interface LnurlWithdrawInfo {
|
|
917
1047
|
withdrawUrl: string;
|
|
918
1048
|
}
|
|
919
1049
|
|
|
920
|
-
export interface
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
speedSlow: SendOnchainSpeedFeeQuote;
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
export interface SparkStatus {
|
|
929
|
-
status: ServiceStatus;
|
|
930
|
-
lastUpdated: number;
|
|
1050
|
+
export interface ConversionEstimate {
|
|
1051
|
+
options: ConversionOptions;
|
|
1052
|
+
amount: bigint;
|
|
1053
|
+
fee: bigint;
|
|
1054
|
+
amountAdjustment?: AmountAdjustmentReason;
|
|
931
1055
|
}
|
|
932
1056
|
|
|
933
|
-
export type
|
|
934
|
-
|
|
935
|
-
export type ConversionPurpose = { type: "ongoingPayment"; paymentRequest: string } | { type: "selfTransfer" } | { type: "autoConversion" };
|
|
1057
|
+
export type AssetFilter = { type: "bitcoin" } | { type: "token"; tokenIdentifier?: string };
|
|
936
1058
|
|
|
937
|
-
export interface
|
|
938
|
-
|
|
1059
|
+
export interface PaymentMetadata {
|
|
1060
|
+
parentPaymentId?: string;
|
|
1061
|
+
lnurlPayInfo?: LnurlPayInfo;
|
|
1062
|
+
lnurlWithdrawInfo?: LnurlWithdrawInfo;
|
|
1063
|
+
lnurlDescription?: string;
|
|
1064
|
+
conversionInfo?: ConversionInfo;
|
|
1065
|
+
conversionStatus?: ConversionStatus;
|
|
939
1066
|
}
|
|
940
1067
|
|
|
941
|
-
export interface
|
|
942
|
-
|
|
943
|
-
signature: string;
|
|
1068
|
+
export interface ListPaymentsResponse {
|
|
1069
|
+
payments: Payment[];
|
|
944
1070
|
}
|
|
945
1071
|
|
|
946
|
-
export interface
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
conversionEstimate?: ConversionEstimate;
|
|
954
|
-
feePolicy: FeePolicy;
|
|
1072
|
+
export interface SparkConfig {
|
|
1073
|
+
coordinatorIdentifier: string;
|
|
1074
|
+
threshold: number;
|
|
1075
|
+
signingOperators: SparkSigningOperator[];
|
|
1076
|
+
sspConfig: SparkSspConfig;
|
|
1077
|
+
expectedWithdrawBondSats: number;
|
|
1078
|
+
expectedWithdrawRelativeBlockLocktime: number;
|
|
955
1079
|
}
|
|
956
1080
|
|
|
957
|
-
export
|
|
1081
|
+
export interface ClaimDepositRequest {
|
|
1082
|
+
txid: string;
|
|
1083
|
+
vout: number;
|
|
1084
|
+
maxFee?: MaxFee;
|
|
1085
|
+
}
|
|
958
1086
|
|
|
959
1087
|
/**
|
|
960
1088
|
* Interface for passkey PRF (Pseudo-Random Function) operations.
|
|
@@ -1008,9 +1136,8 @@ export interface PasskeyPrfProvider {
|
|
|
1008
1136
|
isPrfAvailable(): Promise<boolean>;
|
|
1009
1137
|
}
|
|
1010
1138
|
|
|
1011
|
-
export interface
|
|
1012
|
-
|
|
1013
|
-
impactedTokenAmount: bigint;
|
|
1139
|
+
export interface UnfreezeIssuerTokenRequest {
|
|
1140
|
+
address: string;
|
|
1014
1141
|
}
|
|
1015
1142
|
|
|
1016
1143
|
export interface CreateIssuerTokenRequest {
|
|
@@ -1021,20 +1148,17 @@ export interface CreateIssuerTokenRequest {
|
|
|
1021
1148
|
maxSupply: bigint;
|
|
1022
1149
|
}
|
|
1023
1150
|
|
|
1024
|
-
export interface
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
export interface BurnIssuerTokenRequest {
|
|
1029
|
-
amount: bigint;
|
|
1151
|
+
export interface UnfreezeIssuerTokenResponse {
|
|
1152
|
+
impactedOutputIds: string[];
|
|
1153
|
+
impactedTokenAmount: bigint;
|
|
1030
1154
|
}
|
|
1031
1155
|
|
|
1032
|
-
export interface
|
|
1156
|
+
export interface FreezeIssuerTokenRequest {
|
|
1033
1157
|
address: string;
|
|
1034
1158
|
}
|
|
1035
1159
|
|
|
1036
|
-
export interface
|
|
1037
|
-
|
|
1160
|
+
export interface BurnIssuerTokenRequest {
|
|
1161
|
+
amount: bigint;
|
|
1038
1162
|
}
|
|
1039
1163
|
|
|
1040
1164
|
export interface FreezeIssuerTokenResponse {
|
|
@@ -1042,6 +1166,10 @@ export interface FreezeIssuerTokenResponse {
|
|
|
1042
1166
|
impactedTokenAmount: bigint;
|
|
1043
1167
|
}
|
|
1044
1168
|
|
|
1169
|
+
export interface MintIssuerTokenRequest {
|
|
1170
|
+
amount: bigint;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1045
1173
|
export interface ExternalSigner {
|
|
1046
1174
|
identityPublicKey(): PublicKeyBytes;
|
|
1047
1175
|
derivePublicKey(path: string): Promise<PublicKeyBytes>;
|
|
@@ -1065,17 +1193,13 @@ export interface ExternalSigner {
|
|
|
1065
1193
|
hmacSha256(message: Uint8Array, path: string): Promise<HashedMessageBytes>;
|
|
1066
1194
|
}
|
|
1067
1195
|
|
|
1068
|
-
export
|
|
1069
|
-
id: string;
|
|
1070
|
-
}
|
|
1196
|
+
export type ExternalSecretToSplit = { type: "secretSource"; source: ExternalSecretSource } | { type: "preimage"; data: number[] };
|
|
1071
1197
|
|
|
1072
|
-
export interface
|
|
1073
|
-
|
|
1074
|
-
index: ExternalScalar;
|
|
1075
|
-
share: ExternalScalar;
|
|
1198
|
+
export interface ExternalIdentifier {
|
|
1199
|
+
bytes: number[];
|
|
1076
1200
|
}
|
|
1077
1201
|
|
|
1078
|
-
export interface
|
|
1202
|
+
export interface ExternalFrostSignatureShare {
|
|
1079
1203
|
bytes: number[];
|
|
1080
1204
|
}
|
|
1081
1205
|
|
|
@@ -1084,61 +1208,39 @@ export interface ExternalSigningCommitments {
|
|
|
1084
1208
|
binding: number[];
|
|
1085
1209
|
}
|
|
1086
1210
|
|
|
1087
|
-
export interface IdentifierCommitmentPair {
|
|
1088
|
-
identifier: ExternalIdentifier;
|
|
1089
|
-
commitment: ExternalSigningCommitments;
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
export interface ExternalIdentifier {
|
|
1093
|
-
bytes: number[];
|
|
1094
|
-
}
|
|
1095
|
-
|
|
1096
|
-
export interface ExternalVerifiableSecretShare {
|
|
1097
|
-
secretShare: ExternalSecretShare;
|
|
1098
|
-
proofs: number[][];
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
1211
|
export interface IdentifierPublicKeyPair {
|
|
1102
1212
|
identifier: ExternalIdentifier;
|
|
1103
1213
|
publicKey: number[];
|
|
1104
1214
|
}
|
|
1105
1215
|
|
|
1106
|
-
export interface ExternalEncryptedSecret {
|
|
1107
|
-
ciphertext: number[];
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
export interface ExternalScalar {
|
|
1111
|
-
bytes: number[];
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
1216
|
export interface RecoverableEcdsaSignatureBytes {
|
|
1115
1217
|
bytes: number[];
|
|
1116
1218
|
}
|
|
1117
1219
|
|
|
1118
|
-
export type ExternalSecretToSplit = { type: "secretSource"; source: ExternalSecretSource } | { type: "preimage"; data: number[] };
|
|
1119
|
-
|
|
1120
|
-
export interface MessageBytes {
|
|
1121
|
-
bytes: number[];
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
1220
|
export interface SecretBytes {
|
|
1125
1221
|
bytes: number[];
|
|
1126
1222
|
}
|
|
1127
1223
|
|
|
1128
|
-
export interface
|
|
1129
|
-
|
|
1224
|
+
export interface ExternalSignFrostRequest {
|
|
1225
|
+
message: number[];
|
|
1226
|
+
publicKey: number[];
|
|
1227
|
+
secret: ExternalSecretSource;
|
|
1228
|
+
verifyingKey: number[];
|
|
1229
|
+
selfNonceCommitment: ExternalFrostCommitments;
|
|
1230
|
+
statechainCommitments: IdentifierCommitmentPair[];
|
|
1231
|
+
adaptorPublicKey?: number[];
|
|
1130
1232
|
}
|
|
1131
1233
|
|
|
1132
|
-
export
|
|
1133
|
-
hidingCommitment: number[];
|
|
1134
|
-
bindingCommitment: number[];
|
|
1135
|
-
noncesCiphertext: number[];
|
|
1136
|
-
}
|
|
1234
|
+
export type ExternalSecretSource = { type: "derived"; nodeId: ExternalTreeNodeId } | { type: "encrypted"; key: ExternalEncryptedSecret };
|
|
1137
1235
|
|
|
1138
|
-
export interface
|
|
1236
|
+
export interface ExternalScalar {
|
|
1139
1237
|
bytes: number[];
|
|
1140
1238
|
}
|
|
1141
1239
|
|
|
1240
|
+
export interface ExternalEncryptedSecret {
|
|
1241
|
+
ciphertext: number[];
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1142
1244
|
export interface ExternalAggregateFrostRequest {
|
|
1143
1245
|
message: number[];
|
|
1144
1246
|
statechainSignatures: IdentifierSignaturePair[];
|
|
@@ -1151,27 +1253,47 @@ export interface ExternalAggregateFrostRequest {
|
|
|
1151
1253
|
adaptorPublicKey?: number[];
|
|
1152
1254
|
}
|
|
1153
1255
|
|
|
1154
|
-
export interface
|
|
1256
|
+
export interface IdentifierCommitmentPair {
|
|
1257
|
+
identifier: ExternalIdentifier;
|
|
1258
|
+
commitment: ExternalSigningCommitments;
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
export interface ExternalFrostSignature {
|
|
1155
1262
|
bytes: number[];
|
|
1156
1263
|
}
|
|
1157
1264
|
|
|
1158
|
-
export
|
|
1265
|
+
export interface ExternalVerifiableSecretShare {
|
|
1266
|
+
secretShare: ExternalSecretShare;
|
|
1267
|
+
proofs: number[][];
|
|
1268
|
+
}
|
|
1159
1269
|
|
|
1160
|
-
export interface
|
|
1270
|
+
export interface EcdsaSignatureBytes {
|
|
1161
1271
|
bytes: number[];
|
|
1162
1272
|
}
|
|
1163
1273
|
|
|
1164
|
-
export interface
|
|
1165
|
-
|
|
1166
|
-
publicKey: number[];
|
|
1167
|
-
secret: ExternalSecretSource;
|
|
1168
|
-
verifyingKey: number[];
|
|
1169
|
-
selfNonceCommitment: ExternalFrostCommitments;
|
|
1170
|
-
statechainCommitments: IdentifierCommitmentPair[];
|
|
1171
|
-
adaptorPublicKey?: number[];
|
|
1274
|
+
export interface SchnorrSignatureBytes {
|
|
1275
|
+
bytes: number[];
|
|
1172
1276
|
}
|
|
1173
1277
|
|
|
1174
|
-
export interface
|
|
1278
|
+
export interface MessageBytes {
|
|
1279
|
+
bytes: number[];
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
export interface ExternalTreeNodeId {
|
|
1283
|
+
id: string;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
export interface ExternalFrostCommitments {
|
|
1287
|
+
hidingCommitment: number[];
|
|
1288
|
+
bindingCommitment: number[];
|
|
1289
|
+
noncesCiphertext: number[];
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
export interface PublicKeyBytes {
|
|
1293
|
+
bytes: number[];
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
export interface HashedMessageBytes {
|
|
1175
1297
|
bytes: number[];
|
|
1176
1298
|
}
|
|
1177
1299
|
|
|
@@ -1180,18 +1302,10 @@ export interface IdentifierSignaturePair {
|
|
|
1180
1302
|
signature: ExternalFrostSignatureShare;
|
|
1181
1303
|
}
|
|
1182
1304
|
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
/**
|
|
1188
|
-
* The derived seed.
|
|
1189
|
-
*/
|
|
1190
|
-
seed: Seed;
|
|
1191
|
-
/**
|
|
1192
|
-
* The label used for derivation.
|
|
1193
|
-
*/
|
|
1194
|
-
label: string;
|
|
1305
|
+
export interface ExternalSecretShare {
|
|
1306
|
+
threshold: number;
|
|
1307
|
+
index: ExternalScalar;
|
|
1308
|
+
share: ExternalScalar;
|
|
1195
1309
|
}
|
|
1196
1310
|
|
|
1197
1311
|
/**
|
|
@@ -1211,6 +1325,20 @@ export interface NostrRelayConfig {
|
|
|
1211
1325
|
timeoutSecs?: number;
|
|
1212
1326
|
}
|
|
1213
1327
|
|
|
1328
|
+
/**
|
|
1329
|
+
* A wallet derived from a passkey.
|
|
1330
|
+
*/
|
|
1331
|
+
export interface Wallet {
|
|
1332
|
+
/**
|
|
1333
|
+
* The derived seed.
|
|
1334
|
+
*/
|
|
1335
|
+
seed: Seed;
|
|
1336
|
+
/**
|
|
1337
|
+
* The label used for derivation.
|
|
1338
|
+
*/
|
|
1339
|
+
label: string;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1214
1342
|
export interface Storage {
|
|
1215
1343
|
getCachedItem: (key: string) => Promise<string | null>;
|
|
1216
1344
|
setCachedItem: (key: string, value: string) => Promise<void>;
|
|
@@ -1220,7 +1348,7 @@ export interface Storage {
|
|
|
1220
1348
|
insertPaymentMetadata: (paymentId: string, metadata: PaymentMetadata) => Promise<void>;
|
|
1221
1349
|
getPaymentById: (id: string) => Promise<Payment>;
|
|
1222
1350
|
getPaymentByInvoice: (invoice: string) => Promise<Payment>;
|
|
1223
|
-
addDeposit: (txid: string, vout: number, amount_sats: number) => Promise<void>;
|
|
1351
|
+
addDeposit: (txid: string, vout: number, amount_sats: number, isMature: boolean) => Promise<void>;
|
|
1224
1352
|
deleteDeposit: (txid: string, vout: number) => Promise<void>;
|
|
1225
1353
|
listDeposits: () => Promise<DepositInfo[]>;
|
|
1226
1354
|
updateDeposit: (txid: string, vout: number, payload: UpdateDepositPayload) => Promise<void>;
|
|
@@ -1256,6 +1384,7 @@ export class BreezSdk {
|
|
|
1256
1384
|
claimDeposit(request: ClaimDepositRequest): Promise<ClaimDepositResponse>;
|
|
1257
1385
|
listContacts(request: ListContactsRequest): Promise<Contact[]>;
|
|
1258
1386
|
listPayments(request: ListPaymentsRequest): Promise<ListPaymentsResponse>;
|
|
1387
|
+
listWebhooks(): Promise<Webhook[]>;
|
|
1259
1388
|
deleteContact(id: string): Promise<void>;
|
|
1260
1389
|
lnurlWithdraw(request: LnurlWithdrawRequest): Promise<LnurlWithdrawResponse>;
|
|
1261
1390
|
refundDeposit(request: RefundDepositRequest): Promise<RefundDepositResponse>;
|
|
@@ -1264,10 +1393,12 @@ export class BreezSdk {
|
|
|
1264
1393
|
receivePayment(request: ReceivePaymentRequest): Promise<ReceivePaymentResponse>;
|
|
1265
1394
|
getTokenIssuer(): TokenIssuer;
|
|
1266
1395
|
recommendedFees(): Promise<RecommendedFees>;
|
|
1396
|
+
registerWebhook(request: RegisterWebhookRequest): Promise<RegisterWebhookResponse>;
|
|
1267
1397
|
getUserSettings(): Promise<UserSettings>;
|
|
1268
1398
|
prepareLnurlPay(request: PrepareLnurlPayRequest): Promise<PrepareLnurlPayResponse>;
|
|
1269
1399
|
addEventListener(listener: EventListener): Promise<string>;
|
|
1270
1400
|
claimHtlcPayment(request: ClaimHtlcPaymentRequest): Promise<ClaimHtlcPaymentResponse>;
|
|
1401
|
+
unregisterWebhook(request: UnregisterWebhookRequest): Promise<void>;
|
|
1271
1402
|
getTokensMetadata(request: GetTokensMetadataRequest): Promise<GetTokensMetadataResponse>;
|
|
1272
1403
|
listFiatCurrencies(): Promise<ListFiatCurrenciesResponse>;
|
|
1273
1404
|
prepareSendPayment(request: PrepareSendPaymentRequest): Promise<PrepareSendPaymentResponse>;
|
|
@@ -1276,7 +1407,7 @@ export class BreezSdk {
|
|
|
1276
1407
|
removeEventListener(id: string): Promise<boolean>;
|
|
1277
1408
|
fetchConversionLimits(request: FetchConversionLimitsRequest): Promise<FetchConversionLimitsResponse>;
|
|
1278
1409
|
listUnclaimedDeposits(request: ListUnclaimedDepositsRequest): Promise<ListUnclaimedDepositsResponse>;
|
|
1279
|
-
startLeafOptimization(): void
|
|
1410
|
+
startLeafOptimization(): Promise<void>;
|
|
1280
1411
|
cancelLeafOptimization(): Promise<void>;
|
|
1281
1412
|
deleteLightningAddress(): Promise<void>;
|
|
1282
1413
|
registerLightningAddress(request: RegisterLightningAddressRequest): Promise<LightningAddressInfo>;
|
|
@@ -1388,9 +1519,8 @@ export class SdkBuilder {
|
|
|
1388
1519
|
withChainService(chain_service: BitcoinChainService): SdkBuilder;
|
|
1389
1520
|
withDefaultStorage(storage_dir: string): Promise<SdkBuilder>;
|
|
1390
1521
|
withPaymentObserver(payment_observer: PaymentObserver): SdkBuilder;
|
|
1391
|
-
|
|
1522
|
+
withPostgresBackend(config: PostgresStorageConfig): SdkBuilder;
|
|
1392
1523
|
withRestChainService(url: string, api_type: ChainApiType, credentials?: Credentials | null): SdkBuilder;
|
|
1393
|
-
withPostgresTreeStore(config: PostgresStorageConfig): SdkBuilder;
|
|
1394
1524
|
static new(config: Config, seed: Seed): SdkBuilder;
|
|
1395
1525
|
build(): Promise<BreezSdk>;
|
|
1396
1526
|
}
|