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