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