@secondts/bark 0.6.3
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/LICENSE +19 -0
- package/README.md +54 -0
- package/bundler/bark_ffi_wasm.d.ts +481 -0
- package/bundler/bark_ffi_wasm.js +9 -0
- package/bundler/bark_ffi_wasm_bg.js +2428 -0
- package/bundler/bark_ffi_wasm_bg.wasm +0 -0
- package/bundler/bark_ffi_wasm_bg.wasm.d.ts +140 -0
- package/package.json +62 -0
- package/web/bark_ffi_wasm.d.ts +646 -0
- package/web/bark_ffi_wasm.js +2527 -0
- package/web/bark_ffi_wasm_bg.wasm +0 -0
- package/web/bark_ffi_wasm_bg.wasm.d.ts +140 -0
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* The `ReadableStreamType` enum.
|
|
5
|
+
*
|
|
6
|
+
* *This API requires the following crate features to be activated: `ReadableStreamType`*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export type ReadableStreamType = "bytes";
|
|
10
|
+
/**
|
|
11
|
+
* A Bitcoin transaction outpoint (reference to a previous output)
|
|
12
|
+
*/
|
|
13
|
+
export interface OutPoint {
|
|
14
|
+
txid: string;
|
|
15
|
+
vout: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A Bitcoin transaction output destination
|
|
20
|
+
*/
|
|
21
|
+
export interface Destination {
|
|
22
|
+
address: string;
|
|
23
|
+
amountSats: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A VTXO that is being unilaterally exited
|
|
28
|
+
*/
|
|
29
|
+
export interface ExitVtxo {
|
|
30
|
+
vtxoId: string;
|
|
31
|
+
amountSats: number;
|
|
32
|
+
state: string;
|
|
33
|
+
isClaimable: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A notification event from the wallet
|
|
38
|
+
*/
|
|
39
|
+
export type WalletNotification = { type: "MovementCreated"; movement: Movement } | { type: "MovementUpdated"; movement: Movement } | { type: "ChannelLagging" };
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A pending round state
|
|
43
|
+
*/
|
|
44
|
+
export interface RoundState {
|
|
45
|
+
id: number;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the round is ongoing
|
|
48
|
+
*/
|
|
49
|
+
ongoing: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Claim transaction for exited funds
|
|
54
|
+
*/
|
|
55
|
+
export interface ExitClaimTransaction {
|
|
56
|
+
psbtBase64: string;
|
|
57
|
+
feeSats: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Detailed status of an exit transaction
|
|
62
|
+
*/
|
|
63
|
+
export interface ExitTransactionStatus {
|
|
64
|
+
vtxoId: string;
|
|
65
|
+
state: string;
|
|
66
|
+
history: string[] | undefined;
|
|
67
|
+
transactionCount: number;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Parameters for creating a CPFP (Child Pays For Parent) transaction
|
|
72
|
+
*/
|
|
73
|
+
export interface CpfpParams {
|
|
74
|
+
txHex: string;
|
|
75
|
+
feesType: string;
|
|
76
|
+
effectiveFeeRateSatPerVb: number;
|
|
77
|
+
currentPackageFeeSats: number | undefined;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Reference to a block in the blockchain
|
|
82
|
+
*/
|
|
83
|
+
export interface BlockRef {
|
|
84
|
+
height: number;
|
|
85
|
+
hash: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Status of an exit progression
|
|
90
|
+
*/
|
|
91
|
+
export interface ExitProgressStatus {
|
|
92
|
+
vtxoId: string;
|
|
93
|
+
state: string;
|
|
94
|
+
error: string | undefined;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface AddressWithIndex {
|
|
98
|
+
address: string;
|
|
99
|
+
index: number;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface ArkInfo {
|
|
103
|
+
network: Network;
|
|
104
|
+
serverPubkey: string;
|
|
105
|
+
roundIntervalSecs: number;
|
|
106
|
+
nbRoundNonces: number;
|
|
107
|
+
vtxoExitDelta: number;
|
|
108
|
+
vtxoExpiryDelta: number;
|
|
109
|
+
htlcSendExpiryDelta: number;
|
|
110
|
+
htlcExpiryDelta: number;
|
|
111
|
+
maxVtxoAmountSats: number | undefined;
|
|
112
|
+
requiredBoardConfirmations: number;
|
|
113
|
+
maxUserInvoiceCltvDelta: number;
|
|
114
|
+
minBoardAmountSats: number;
|
|
115
|
+
lnReceiveAntiDosRequired: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Fee schedule as JSON string (contains board, offboard, refresh, lightning fees)
|
|
118
|
+
*/
|
|
119
|
+
feeScheduleJson: string;
|
|
120
|
+
/**
|
|
121
|
+
* Maximum exit depth (genesis chain length) allowed for a VTXO before the
|
|
122
|
+
* server refuses to cosign further OOR transactions spending it.
|
|
123
|
+
*/
|
|
124
|
+
maxVtxoExitDepth: number;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface Balance {
|
|
128
|
+
spendableSats: number;
|
|
129
|
+
pendingInRoundSats: number;
|
|
130
|
+
pendingExitSats: number;
|
|
131
|
+
pendingLightningSendSats: number;
|
|
132
|
+
claimableLightningReceiveSats: number;
|
|
133
|
+
pendingBoardSats: number;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface Bolt11InvoiceArgs {
|
|
137
|
+
amountSats: number;
|
|
138
|
+
description?: string;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface CheckLightningPaymentArgs {
|
|
142
|
+
paymentHash: string;
|
|
143
|
+
wait: boolean;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface Config {
|
|
147
|
+
serverAddress: string;
|
|
148
|
+
serverAccessToken?: string;
|
|
149
|
+
esploraAddress?: string;
|
|
150
|
+
bitcoindAddress?: string;
|
|
151
|
+
bitcoindCookiefile?: string;
|
|
152
|
+
bitcoindUser?: string;
|
|
153
|
+
bitcoindPass?: string;
|
|
154
|
+
network: Network;
|
|
155
|
+
vtxoRefreshExpiryThreshold?: number;
|
|
156
|
+
vtxoExitMargin?: number;
|
|
157
|
+
htlcRecvClaimDelta?: number;
|
|
158
|
+
fallbackFeeRate?: number;
|
|
159
|
+
roundTxRequiredConfirmations?: number;
|
|
160
|
+
daemonSyncIntervalSecs?: number;
|
|
161
|
+
offboardRequiredConfirmations?: number;
|
|
162
|
+
daemonManualSync?: boolean;
|
|
163
|
+
lightningReceiveClaimRetries?: number;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface DrainExitsArgs {
|
|
167
|
+
vtxoIds: string[];
|
|
168
|
+
address: string;
|
|
169
|
+
feeRateSatPerVb?: number;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface FeeEstimate {
|
|
173
|
+
grossAmountSats: number;
|
|
174
|
+
feeSats: number;
|
|
175
|
+
netAmountSats: number;
|
|
176
|
+
vtxosSpent: string[];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface GetExitStatusArgs {
|
|
180
|
+
vtxoId: string;
|
|
181
|
+
includeHistory: boolean;
|
|
182
|
+
includeTransactions: boolean;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface LightningInvoice {
|
|
186
|
+
invoice: string;
|
|
187
|
+
paymentHash: string;
|
|
188
|
+
amountSats: number;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface LightningReceive {
|
|
192
|
+
paymentHash: string;
|
|
193
|
+
paymentPreimage: string;
|
|
194
|
+
invoice: string;
|
|
195
|
+
amountSats: number;
|
|
196
|
+
hasHtlcVtxos: boolean;
|
|
197
|
+
preimageRevealed: boolean;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export interface LightningSend {
|
|
201
|
+
invoice: string;
|
|
202
|
+
amountSats: number;
|
|
203
|
+
htlcVtxoCount: number;
|
|
204
|
+
preimage: string | undefined;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface Movement {
|
|
208
|
+
id: number;
|
|
209
|
+
status: string;
|
|
210
|
+
subsystemName: string;
|
|
211
|
+
subsystemKind: string;
|
|
212
|
+
metadataJson: string;
|
|
213
|
+
intendedBalanceSats: number;
|
|
214
|
+
effectiveBalanceSats: number;
|
|
215
|
+
offchainFeeSats: number;
|
|
216
|
+
sentToAddresses: string[];
|
|
217
|
+
receivedOnAddresses: string[];
|
|
218
|
+
inputVtxoIds: string[];
|
|
219
|
+
outputVtxoIds: string[];
|
|
220
|
+
exitedVtxoIds: string[];
|
|
221
|
+
createdAt: string;
|
|
222
|
+
updatedAt: string;
|
|
223
|
+
completedAt: string | undefined;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export interface OffboardResult {
|
|
227
|
+
roundId: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export interface OnchainBalance {
|
|
231
|
+
confirmedSats: number;
|
|
232
|
+
pendingSats: number;
|
|
233
|
+
totalSats: number;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface OnchainWalletDefaultArgs {
|
|
237
|
+
mnemonic: string;
|
|
238
|
+
config: Config;
|
|
239
|
+
dbName: string;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface PayLightningInvoiceArgs {
|
|
243
|
+
invoice: string;
|
|
244
|
+
amountSats?: number;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export interface PayLightningOfferArgs {
|
|
248
|
+
offer: string;
|
|
249
|
+
amountSats?: number;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface PendingBoard {
|
|
253
|
+
vtxoId: string;
|
|
254
|
+
amountSats: number;
|
|
255
|
+
txid: string;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export interface ProgressExitsArgs {
|
|
259
|
+
feeRateSatPerVb?: number;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface TryClaimAllLightningReceivesArgs {
|
|
263
|
+
wait: boolean;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface TryClaimLightningReceiveArgs {
|
|
267
|
+
paymentHash: string;
|
|
268
|
+
wait: boolean;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export interface Vtxo {
|
|
272
|
+
id: string;
|
|
273
|
+
amountSats: number;
|
|
274
|
+
expiryHeight: number;
|
|
275
|
+
kind: string;
|
|
276
|
+
state: string;
|
|
277
|
+
/**
|
|
278
|
+
* Genesis chain length. Compare against `ArkInfo.max_vtxo_exit_depth` to
|
|
279
|
+
* detect VTXOs nearing the server\'s OOR-cosign refusal threshold.
|
|
280
|
+
*/
|
|
281
|
+
exitDepth: number;
|
|
282
|
+
/**
|
|
283
|
+
* Weight units of the unilateral exit transaction chain. Lets clients
|
|
284
|
+
* estimate exit cost without loading the full genesis.
|
|
285
|
+
*/
|
|
286
|
+
exitTxWeightWu: number;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export interface WalletCreateArgs {
|
|
290
|
+
mnemonic: string;
|
|
291
|
+
config: Config;
|
|
292
|
+
dbName: string;
|
|
293
|
+
forceRescan: boolean;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export interface WalletOpenArgs {
|
|
297
|
+
mnemonic: string;
|
|
298
|
+
config: Config;
|
|
299
|
+
dbName: string;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export interface WalletProperties {
|
|
303
|
+
network: Network;
|
|
304
|
+
fingerprint: string;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export type Network = "Bitcoin" | "Testnet" | "Signet" | "Regtest";
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
export class IntoUnderlyingByteSource {
|
|
311
|
+
private constructor();
|
|
312
|
+
free(): void;
|
|
313
|
+
[Symbol.dispose](): void;
|
|
314
|
+
cancel(): void;
|
|
315
|
+
pull(controller: ReadableByteStreamController): Promise<any>;
|
|
316
|
+
start(controller: ReadableByteStreamController): void;
|
|
317
|
+
readonly autoAllocateChunkSize: number;
|
|
318
|
+
readonly type: ReadableStreamType;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export class IntoUnderlyingSink {
|
|
322
|
+
private constructor();
|
|
323
|
+
free(): void;
|
|
324
|
+
[Symbol.dispose](): void;
|
|
325
|
+
abort(reason: any): Promise<any>;
|
|
326
|
+
close(): Promise<any>;
|
|
327
|
+
write(chunk: any): Promise<any>;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export class IntoUnderlyingSource {
|
|
331
|
+
private constructor();
|
|
332
|
+
free(): void;
|
|
333
|
+
[Symbol.dispose](): void;
|
|
334
|
+
cancel(): void;
|
|
335
|
+
pull(controller: ReadableStreamDefaultController): Promise<any>;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Pull-based notification handle exposed to JS.
|
|
340
|
+
*
|
|
341
|
+
* Obtain via `wallet.notifications()`. Loop on `await notif.nextNotification()`.
|
|
342
|
+
* Each call to `wallet.notifications()` creates an independent stream — existing
|
|
343
|
+
* holders are unaffected.
|
|
344
|
+
*
|
|
345
|
+
* Single-consumer per holder: concurrent `nextNotification()` calls reject with
|
|
346
|
+
* an `Internal` error.
|
|
347
|
+
*/
|
|
348
|
+
export class NotificationHolder {
|
|
349
|
+
private constructor();
|
|
350
|
+
free(): void;
|
|
351
|
+
[Symbol.dispose](): void;
|
|
352
|
+
/**
|
|
353
|
+
* Cancel the currently pending `nextNotification()` wait.
|
|
354
|
+
*
|
|
355
|
+
* Causes a blocked `nextNotification()` to resolve to `null`. Does NOT
|
|
356
|
+
* destroy the underlying stream — a subsequent call resumes normally.
|
|
357
|
+
*/
|
|
358
|
+
cancelNextNotificationWait(): void;
|
|
359
|
+
/**
|
|
360
|
+
* Wait for the next wallet notification.
|
|
361
|
+
*
|
|
362
|
+
* Resolves to a `WalletNotification` object, or `null` if:
|
|
363
|
+
* - `cancelNextNotificationWait()` was called while pending, or
|
|
364
|
+
* - the wallet's notification source was shut down.
|
|
365
|
+
*/
|
|
366
|
+
nextNotification(): Promise<WalletNotification | undefined>;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export class OnchainWallet {
|
|
370
|
+
private constructor();
|
|
371
|
+
free(): void;
|
|
372
|
+
[Symbol.dispose](): void;
|
|
373
|
+
balance(): Promise<OnchainBalance>;
|
|
374
|
+
/**
|
|
375
|
+
* Open (or create) the onchain wallet against an IndexedDB-backed persister.
|
|
376
|
+
*/
|
|
377
|
+
static default(args: OnchainWalletDefaultArgs): Promise<OnchainWallet>;
|
|
378
|
+
newAddress(): Promise<string>;
|
|
379
|
+
send(address: string, amountSats: number, feeRateSatPerVb: number): Promise<string>;
|
|
380
|
+
sync(): Promise<number>;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export class Wallet {
|
|
384
|
+
private constructor();
|
|
385
|
+
free(): void;
|
|
386
|
+
[Symbol.dispose](): void;
|
|
387
|
+
allExitsClaimableAtHeight(): Promise<number | undefined>;
|
|
388
|
+
allVtxos(): Promise<Vtxo[]>;
|
|
389
|
+
arkInfo(): Promise<ArkInfo | undefined>;
|
|
390
|
+
balance(): Promise<Balance>;
|
|
391
|
+
boardAll(onchainWallet: OnchainWallet): Promise<PendingBoard>;
|
|
392
|
+
boardAmount(onchainWallet: OnchainWallet, amountSats: number): Promise<PendingBoard>;
|
|
393
|
+
bolt11Invoice(args: Bolt11InvoiceArgs): Promise<LightningInvoice>;
|
|
394
|
+
broadcastTx(txHex: string): Promise<string>;
|
|
395
|
+
cancelAllPendingRounds(): Promise<void>;
|
|
396
|
+
cancelLightningReceive(paymentHash: string): Promise<void>;
|
|
397
|
+
cancelPendingRound(roundId: number): Promise<void>;
|
|
398
|
+
checkLightningPayment(args: CheckLightningPaymentArgs): Promise<string | undefined>;
|
|
399
|
+
claimableLightningReceiveBalanceSats(): Promise<number>;
|
|
400
|
+
config(): Promise<Config>;
|
|
401
|
+
static create(args: WalletCreateArgs): Promise<Wallet>;
|
|
402
|
+
static createWithOnchain(onchainWallet: OnchainWallet, args: WalletCreateArgs): Promise<Wallet>;
|
|
403
|
+
drainExits(args: DrainExitsArgs): Promise<ExitClaimTransaction>;
|
|
404
|
+
estimateArkoorPaymentFee(amountSats: number): Promise<FeeEstimate>;
|
|
405
|
+
estimateBoardFee(amountSats: number): Promise<FeeEstimate>;
|
|
406
|
+
estimateLightningReceiveFee(amountSats: number): Promise<FeeEstimate>;
|
|
407
|
+
estimateLightningSendFee(amountSats: number): Promise<FeeEstimate>;
|
|
408
|
+
estimateOffboardAllFee(address: string): Promise<FeeEstimate>;
|
|
409
|
+
estimateOffboardFee(address: string, vtxoIds: string[]): Promise<FeeEstimate>;
|
|
410
|
+
estimateRefreshFee(vtxoIds: string[]): Promise<FeeEstimate>;
|
|
411
|
+
estimateSendOnchainFee(address: string, amountSats: number): Promise<FeeEstimate>;
|
|
412
|
+
fingerprint(): string;
|
|
413
|
+
getExitStatus(args: GetExitStatusArgs): Promise<ExitTransactionStatus | undefined>;
|
|
414
|
+
getExitVtxos(): Promise<ExitVtxo[]>;
|
|
415
|
+
getExpiringVtxos(thresholdBlocks: number): Promise<Vtxo[]>;
|
|
416
|
+
getFirstExpiringVtxoBlockheight(): Promise<number | undefined>;
|
|
417
|
+
getNextRequiredRefreshBlockheight(): Promise<number | undefined>;
|
|
418
|
+
getVtxoById(vtxoId: string): Promise<Vtxo>;
|
|
419
|
+
getVtxosToRefresh(): Promise<Vtxo[]>;
|
|
420
|
+
hasPendingExits(): Promise<boolean>;
|
|
421
|
+
history(): Promise<Movement[]>;
|
|
422
|
+
historyByPaymentMethod(paymentMethodType: string, paymentMethodValue: string): Promise<Movement[]>;
|
|
423
|
+
importVtxo(vtxoBase64: string): Promise<void>;
|
|
424
|
+
lightningReceiveStatus(paymentHash: string): Promise<LightningReceive | undefined>;
|
|
425
|
+
listClaimableExits(): Promise<ExitVtxo[]>;
|
|
426
|
+
mailboxAuthorization(): string;
|
|
427
|
+
mailboxIdentifier(): string;
|
|
428
|
+
maintenance(): Promise<void>;
|
|
429
|
+
maintenanceDelegated(): Promise<void>;
|
|
430
|
+
maintenanceRefresh(): Promise<string | undefined>;
|
|
431
|
+
maintenanceWithOnchain(onchainWallet: OnchainWallet): Promise<void>;
|
|
432
|
+
maintenanceWithOnchainDelegated(onchainWallet: OnchainWallet): Promise<void>;
|
|
433
|
+
maybeScheduleMaintenanceRefresh(): Promise<number | undefined>;
|
|
434
|
+
network(): Promise<Network>;
|
|
435
|
+
newAddress(): Promise<string>;
|
|
436
|
+
newAddressWithIndex(): Promise<AddressWithIndex>;
|
|
437
|
+
nextRoundStartTime(): Promise<number>;
|
|
438
|
+
notifications(): NotificationHolder;
|
|
439
|
+
offboardAll(bitcoinAddress: string): Promise<OffboardResult>;
|
|
440
|
+
offboardVtxos(vtxoIds: string[], bitcoinAddress: string): Promise<string>;
|
|
441
|
+
static open(args: WalletOpenArgs): Promise<Wallet>;
|
|
442
|
+
static openWithOnchain(onchainWallet: OnchainWallet, args: WalletOpenArgs): Promise<Wallet>;
|
|
443
|
+
payLightningInvoice(args: PayLightningInvoiceArgs): Promise<LightningSend>;
|
|
444
|
+
payLightningOffer(args: PayLightningOfferArgs): Promise<LightningSend>;
|
|
445
|
+
peekAddress(index: number): Promise<string>;
|
|
446
|
+
pendingBoardVtxos(): Promise<Vtxo[]>;
|
|
447
|
+
pendingBoards(): Promise<PendingBoard[]>;
|
|
448
|
+
pendingExitsTotalSats(): Promise<number>;
|
|
449
|
+
pendingLightningReceives(): Promise<LightningReceive[]>;
|
|
450
|
+
pendingLightningSendVtxos(): Promise<Vtxo[]>;
|
|
451
|
+
pendingLightningSends(): Promise<LightningSend[]>;
|
|
452
|
+
pendingRoundInputVtxos(): Promise<Vtxo[]>;
|
|
453
|
+
pendingRoundStates(): Promise<RoundState[]>;
|
|
454
|
+
progressExits(onchainWallet: OnchainWallet, args: ProgressExitsArgs): Promise<ExitProgressStatus[]>;
|
|
455
|
+
progressPendingRounds(): Promise<void>;
|
|
456
|
+
properties(): Promise<WalletProperties>;
|
|
457
|
+
refreshServer(): Promise<void>;
|
|
458
|
+
refreshVtxos(vtxoIds: string[]): Promise<string | undefined>;
|
|
459
|
+
refreshVtxosDelegated(vtxoIds: string[]): Promise<RoundState | undefined>;
|
|
460
|
+
sendArkoorPayment(arkAddress: string, amountSats: number): Promise<string>;
|
|
461
|
+
sendOnchain(address: string, amountSats: number): Promise<string>;
|
|
462
|
+
signExitClaimInputs(psbtBase64: string): Promise<string>;
|
|
463
|
+
spendableVtxos(): Promise<Vtxo[]>;
|
|
464
|
+
startExitForEntireWallet(): Promise<void>;
|
|
465
|
+
startExitForVtxos(vtxoIds: string[]): Promise<void>;
|
|
466
|
+
sync(): Promise<void>;
|
|
467
|
+
syncExits(onchainWallet: OnchainWallet): Promise<void>;
|
|
468
|
+
syncPendingBoards(): Promise<void>;
|
|
469
|
+
tryClaimAllLightningReceives(args: TryClaimAllLightningReceivesArgs): Promise<LightningReceive[]>;
|
|
470
|
+
tryClaimLightningReceive(args: TryClaimLightningReceiveArgs): Promise<void>;
|
|
471
|
+
validateArkoorAddress(address: string): Promise<boolean>;
|
|
472
|
+
vtxos(): Promise<Vtxo[]>;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export function extractTxFromPsbt(psbtBase64: string): string;
|
|
476
|
+
|
|
477
|
+
export function generateMnemonic(): string;
|
|
478
|
+
|
|
479
|
+
export function validateArkAddress(address: string): boolean;
|
|
480
|
+
|
|
481
|
+
export function validateMnemonic(mnemonic: string): boolean;
|
|
482
|
+
|
|
483
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
484
|
+
|
|
485
|
+
export interface InitOutput {
|
|
486
|
+
readonly memory: WebAssembly.Memory;
|
|
487
|
+
readonly generateMnemonic: (a: number) => void;
|
|
488
|
+
readonly validateMnemonic: (a: number, b: number, c: number) => void;
|
|
489
|
+
readonly validateArkAddress: (a: number, b: number, c: number) => void;
|
|
490
|
+
readonly extractTxFromPsbt: (a: number, b: number, c: number) => void;
|
|
491
|
+
readonly __wbg_notificationholder_free: (a: number, b: number) => void;
|
|
492
|
+
readonly notificationholder_nextNotification: (a: number) => number;
|
|
493
|
+
readonly notificationholder_cancelNextNotificationWait: (a: number) => void;
|
|
494
|
+
readonly __wbg_onchainwallet_free: (a: number, b: number) => void;
|
|
495
|
+
readonly onchainwallet_default: (a: number) => number;
|
|
496
|
+
readonly onchainwallet_sync: (a: number) => number;
|
|
497
|
+
readonly onchainwallet_balance: (a: number) => number;
|
|
498
|
+
readonly onchainwallet_newAddress: (a: number) => number;
|
|
499
|
+
readonly onchainwallet_send: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
500
|
+
readonly __wbg_wallet_free: (a: number, b: number) => void;
|
|
501
|
+
readonly wallet_create: (a: number) => number;
|
|
502
|
+
readonly wallet_open: (a: number) => number;
|
|
503
|
+
readonly wallet_createWithOnchain: (a: number, b: number) => number;
|
|
504
|
+
readonly wallet_openWithOnchain: (a: number, b: number) => number;
|
|
505
|
+
readonly wallet_sync: (a: number) => number;
|
|
506
|
+
readonly wallet_maintenance: (a: number) => number;
|
|
507
|
+
readonly wallet_maintenanceWithOnchain: (a: number, b: number) => number;
|
|
508
|
+
readonly wallet_maintenanceDelegated: (a: number) => number;
|
|
509
|
+
readonly wallet_maintenanceWithOnchainDelegated: (a: number, b: number) => number;
|
|
510
|
+
readonly wallet_newAddress: (a: number) => number;
|
|
511
|
+
readonly wallet_newAddressWithIndex: (a: number) => number;
|
|
512
|
+
readonly wallet_peekAddress: (a: number, b: number) => number;
|
|
513
|
+
readonly wallet_balance: (a: number) => number;
|
|
514
|
+
readonly wallet_vtxos: (a: number) => number;
|
|
515
|
+
readonly wallet_getVtxoById: (a: number, b: number, c: number) => number;
|
|
516
|
+
readonly wallet_spendableVtxos: (a: number) => number;
|
|
517
|
+
readonly wallet_allVtxos: (a: number) => number;
|
|
518
|
+
readonly wallet_getExpiringVtxos: (a: number, b: number) => number;
|
|
519
|
+
readonly wallet_getVtxosToRefresh: (a: number) => number;
|
|
520
|
+
readonly wallet_offboardAll: (a: number, b: number, c: number) => number;
|
|
521
|
+
readonly wallet_offboardVtxos: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
522
|
+
readonly wallet_payLightningInvoice: (a: number, b: number) => number;
|
|
523
|
+
readonly wallet_payLightningOffer: (a: number, b: number) => number;
|
|
524
|
+
readonly wallet_checkLightningPayment: (a: number, b: number) => number;
|
|
525
|
+
readonly wallet_pendingLightningSends: (a: number) => number;
|
|
526
|
+
readonly wallet_bolt11Invoice: (a: number, b: number) => number;
|
|
527
|
+
readonly wallet_tryClaimAllLightningReceives: (a: number, b: number) => number;
|
|
528
|
+
readonly wallet_pendingLightningReceives: (a: number) => number;
|
|
529
|
+
readonly wallet_claimableLightningReceiveBalanceSats: (a: number) => number;
|
|
530
|
+
readonly wallet_lightningReceiveStatus: (a: number, b: number, c: number) => number;
|
|
531
|
+
readonly wallet_tryClaimLightningReceive: (a: number, b: number) => number;
|
|
532
|
+
readonly wallet_cancelLightningReceive: (a: number, b: number, c: number) => number;
|
|
533
|
+
readonly wallet_sendArkoorPayment: (a: number, b: number, c: number, d: number) => number;
|
|
534
|
+
readonly wallet_validateArkoorAddress: (a: number, b: number, c: number) => number;
|
|
535
|
+
readonly wallet_sendOnchain: (a: number, b: number, c: number, d: number) => number;
|
|
536
|
+
readonly wallet_history: (a: number) => number;
|
|
537
|
+
readonly wallet_historyByPaymentMethod: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
538
|
+
readonly wallet_refreshVtxos: (a: number, b: number, c: number) => number;
|
|
539
|
+
readonly wallet_maintenanceRefresh: (a: number) => number;
|
|
540
|
+
readonly wallet_refreshVtxosDelegated: (a: number, b: number, c: number) => number;
|
|
541
|
+
readonly wallet_properties: (a: number) => number;
|
|
542
|
+
readonly wallet_fingerprint: (a: number, b: number) => void;
|
|
543
|
+
readonly wallet_network: (a: number) => number;
|
|
544
|
+
readonly wallet_config: (a: number) => number;
|
|
545
|
+
readonly wallet_arkInfo: (a: number) => number;
|
|
546
|
+
readonly wallet_nextRoundStartTime: (a: number) => number;
|
|
547
|
+
readonly wallet_boardAmount: (a: number, b: number, c: number) => number;
|
|
548
|
+
readonly wallet_boardAll: (a: number, b: number) => number;
|
|
549
|
+
readonly wallet_syncPendingBoards: (a: number) => number;
|
|
550
|
+
readonly wallet_pendingBoards: (a: number) => number;
|
|
551
|
+
readonly wallet_pendingBoardVtxos: (a: number) => number;
|
|
552
|
+
readonly wallet_pendingRoundInputVtxos: (a: number) => number;
|
|
553
|
+
readonly wallet_pendingLightningSendVtxos: (a: number) => number;
|
|
554
|
+
readonly wallet_startExitForEntireWallet: (a: number) => number;
|
|
555
|
+
readonly wallet_syncExits: (a: number, b: number) => number;
|
|
556
|
+
readonly wallet_progressExits: (a: number, b: number, c: number) => number;
|
|
557
|
+
readonly wallet_startExitForVtxos: (a: number, b: number, c: number) => number;
|
|
558
|
+
readonly wallet_listClaimableExits: (a: number) => number;
|
|
559
|
+
readonly wallet_getExitVtxos: (a: number) => number;
|
|
560
|
+
readonly wallet_hasPendingExits: (a: number) => number;
|
|
561
|
+
readonly wallet_pendingExitsTotalSats: (a: number) => number;
|
|
562
|
+
readonly wallet_drainExits: (a: number, b: number) => number;
|
|
563
|
+
readonly wallet_allExitsClaimableAtHeight: (a: number) => number;
|
|
564
|
+
readonly wallet_getExitStatus: (a: number, b: number) => number;
|
|
565
|
+
readonly wallet_signExitClaimInputs: (a: number, b: number, c: number) => number;
|
|
566
|
+
readonly wallet_pendingRoundStates: (a: number) => number;
|
|
567
|
+
readonly wallet_cancelPendingRound: (a: number, b: number) => number;
|
|
568
|
+
readonly wallet_cancelAllPendingRounds: (a: number) => number;
|
|
569
|
+
readonly wallet_progressPendingRounds: (a: number) => number;
|
|
570
|
+
readonly wallet_refreshServer: (a: number) => number;
|
|
571
|
+
readonly wallet_getFirstExpiringVtxoBlockheight: (a: number) => number;
|
|
572
|
+
readonly wallet_getNextRequiredRefreshBlockheight: (a: number) => number;
|
|
573
|
+
readonly wallet_maybeScheduleMaintenanceRefresh: (a: number) => number;
|
|
574
|
+
readonly wallet_broadcastTx: (a: number, b: number, c: number) => number;
|
|
575
|
+
readonly wallet_mailboxIdentifier: (a: number, b: number) => void;
|
|
576
|
+
readonly wallet_mailboxAuthorization: (a: number, b: number) => void;
|
|
577
|
+
readonly wallet_importVtxo: (a: number, b: number, c: number) => number;
|
|
578
|
+
readonly wallet_estimateBoardFee: (a: number, b: number) => number;
|
|
579
|
+
readonly wallet_estimateOffboardFee: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
580
|
+
readonly wallet_estimateRefreshFee: (a: number, b: number, c: number) => number;
|
|
581
|
+
readonly wallet_estimateLightningSendFee: (a: number, b: number) => number;
|
|
582
|
+
readonly wallet_estimateLightningReceiveFee: (a: number, b: number) => number;
|
|
583
|
+
readonly wallet_estimateArkoorPaymentFee: (a: number, b: number) => number;
|
|
584
|
+
readonly wallet_estimateOffboardAllFee: (a: number, b: number, c: number) => number;
|
|
585
|
+
readonly wallet_estimateSendOnchainFee: (a: number, b: number, c: number, d: number) => number;
|
|
586
|
+
readonly wallet_notifications: (a: number) => number;
|
|
587
|
+
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
588
|
+
readonly intounderlyingbytesource_type: (a: number) => number;
|
|
589
|
+
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
590
|
+
readonly intounderlyingbytesource_start: (a: number, b: number) => void;
|
|
591
|
+
readonly intounderlyingbytesource_pull: (a: number, b: number) => number;
|
|
592
|
+
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
593
|
+
readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
594
|
+
readonly intounderlyingsource_pull: (a: number, b: number) => number;
|
|
595
|
+
readonly intounderlyingsource_cancel: (a: number) => void;
|
|
596
|
+
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
597
|
+
readonly intounderlyingsink_write: (a: number, b: number) => number;
|
|
598
|
+
readonly intounderlyingsink_close: (a: number) => number;
|
|
599
|
+
readonly intounderlyingsink_abort: (a: number, b: number) => number;
|
|
600
|
+
readonly rustsecp256k1_v0_12_context_create: (a: number) => number;
|
|
601
|
+
readonly rustsecp256k1_v0_12_context_destroy: (a: number) => void;
|
|
602
|
+
readonly rustsecp256k1_v0_12_default_illegal_callback_fn: (a: number, b: number) => void;
|
|
603
|
+
readonly rustsecp256k1_v0_12_default_error_callback_fn: (a: number, b: number) => void;
|
|
604
|
+
readonly rustsecp256k1_v0_10_0_context_create: (a: number) => number;
|
|
605
|
+
readonly rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
|
|
606
|
+
readonly rustsecp256k1_v0_10_0_default_illegal_callback_fn: (a: number, b: number) => void;
|
|
607
|
+
readonly rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
|
|
608
|
+
readonly __wasm_bindgen_func_elem_723: (a: number, b: number, c: number, d: number) => void;
|
|
609
|
+
readonly __wasm_bindgen_func_elem_15398: (a: number, b: number, c: number, d: number) => void;
|
|
610
|
+
readonly __wasm_bindgen_func_elem_730: (a: number, b: number, c: number, d: number) => void;
|
|
611
|
+
readonly __wasm_bindgen_func_elem_15400: (a: number, b: number, c: number) => number;
|
|
612
|
+
readonly __wasm_bindgen_func_elem_13601: (a: number, b: number, c: number) => void;
|
|
613
|
+
readonly __wasm_bindgen_func_elem_13350: (a: number, b: number, c: number) => void;
|
|
614
|
+
readonly __wasm_bindgen_func_elem_15401: (a: number, b: number, c: number) => void;
|
|
615
|
+
readonly __wasm_bindgen_func_elem_12910: (a: number, b: number) => void;
|
|
616
|
+
readonly __wasm_bindgen_func_elem_13756: (a: number, b: number) => void;
|
|
617
|
+
readonly __wasm_bindgen_func_elem_19108: (a: number, b: number) => void;
|
|
618
|
+
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
619
|
+
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
620
|
+
readonly __wbindgen_export3: (a: number) => void;
|
|
621
|
+
readonly __wbindgen_export4: (a: number, b: number) => void;
|
|
622
|
+
readonly __wbindgen_export5: (a: number, b: number, c: number) => void;
|
|
623
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
630
|
+
* a precompiled `WebAssembly.Module`.
|
|
631
|
+
*
|
|
632
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
633
|
+
*
|
|
634
|
+
* @returns {InitOutput}
|
|
635
|
+
*/
|
|
636
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
640
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
641
|
+
*
|
|
642
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
643
|
+
*
|
|
644
|
+
* @returns {Promise<InitOutput>}
|
|
645
|
+
*/
|
|
646
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|