@secondts/bark 0.6.3 → 0.8.0
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/bundler/bark_ffi_wasm.d.ts +34 -4
- package/bundler/bark_ffi_wasm_bg.js +281 -234
- package/bundler/bark_ffi_wasm_bg.wasm +0 -0
- package/bundler/bark_ffi_wasm_bg.wasm.d.ts +15 -10
- package/package.json +2 -2
- package/web/bark_ffi_wasm.d.ts +49 -14
- package/web/bark_ffi_wasm.js +281 -234
- package/web/bark_ffi_wasm_bg.wasm +0 -0
- package/web/bark_ffi_wasm_bg.wasm.d.ts +15 -10
|
@@ -94,6 +94,15 @@ export interface ExitProgressStatus {
|
|
|
94
94
|
error: string | undefined;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
/**
|
|
98
|
+
* Terminal/in-flight state of an outgoing lightning send.
|
|
99
|
+
*
|
|
100
|
+
* Mirrors `bark`\'s `LightningSendState`. `pay_lightning_*` and
|
|
101
|
+
* `check_lightning_payment` now return this so callers can drive the
|
|
102
|
+
* crash-safe send flow themselves (initiate with `wait = false`, then poll).
|
|
103
|
+
*/
|
|
104
|
+
export type LightningSendStatus = { type: "unknown" } | { type: "inProgress"; send: LightningSend } | { type: "paid"; payment_hash: string; preimage: string };
|
|
105
|
+
|
|
97
106
|
export interface AddressWithIndex {
|
|
98
107
|
address: string;
|
|
99
108
|
index: number;
|
|
@@ -199,9 +208,23 @@ export interface LightningReceive {
|
|
|
199
208
|
|
|
200
209
|
export interface LightningSend {
|
|
201
210
|
invoice: string;
|
|
211
|
+
/**
|
|
212
|
+
* Amount being paid, in sats (`payment_amount`).
|
|
213
|
+
*/
|
|
202
214
|
amountSats: number;
|
|
215
|
+
/**
|
|
216
|
+
* Routing/ark fee for the send, in sats.
|
|
217
|
+
*/
|
|
218
|
+
feeSats: number;
|
|
219
|
+
/**
|
|
220
|
+
* Number of input VTXOs locked into the in-flight HTLC.
|
|
221
|
+
*/
|
|
203
222
|
htlcVtxoCount: number;
|
|
204
|
-
|
|
223
|
+
/**
|
|
224
|
+
* Whether the send is stuck in the revocation-failed state: the payment
|
|
225
|
+
* failed but revoking the HTLC also failed
|
|
226
|
+
*/
|
|
227
|
+
hasFailedRevocation: boolean;
|
|
205
228
|
}
|
|
206
229
|
|
|
207
230
|
export interface Movement {
|
|
@@ -242,11 +265,13 @@ export interface OnchainWalletDefaultArgs {
|
|
|
242
265
|
export interface PayLightningInvoiceArgs {
|
|
243
266
|
invoice: string;
|
|
244
267
|
amountSats?: number;
|
|
268
|
+
wait: boolean;
|
|
245
269
|
}
|
|
246
270
|
|
|
247
271
|
export interface PayLightningOfferArgs {
|
|
248
272
|
offer: string;
|
|
249
273
|
amountSats?: number;
|
|
274
|
+
wait: boolean;
|
|
250
275
|
}
|
|
251
276
|
|
|
252
277
|
export interface PendingBoard {
|
|
@@ -386,7 +411,9 @@ export class Wallet {
|
|
|
386
411
|
[Symbol.dispose](): void;
|
|
387
412
|
allExitsClaimableAtHeight(): Promise<number | undefined>;
|
|
388
413
|
allVtxos(): Promise<Vtxo[]>;
|
|
414
|
+
allowLightningSendToExit(paymentHash: string): Promise<void>;
|
|
389
415
|
arkInfo(): Promise<ArkInfo | undefined>;
|
|
416
|
+
attemptLightningReceiveExit(paymentHash: string): Promise<void>;
|
|
390
417
|
balance(): Promise<Balance>;
|
|
391
418
|
boardAll(onchainWallet: OnchainWallet): Promise<PendingBoard>;
|
|
392
419
|
boardAmount(onchainWallet: OnchainWallet, amountSats: number): Promise<PendingBoard>;
|
|
@@ -395,7 +422,7 @@ export class Wallet {
|
|
|
395
422
|
cancelAllPendingRounds(): Promise<void>;
|
|
396
423
|
cancelLightningReceive(paymentHash: string): Promise<void>;
|
|
397
424
|
cancelPendingRound(roundId: number): Promise<void>;
|
|
398
|
-
checkLightningPayment(args: CheckLightningPaymentArgs): Promise<
|
|
425
|
+
checkLightningPayment(args: CheckLightningPaymentArgs): Promise<LightningSendStatus>;
|
|
399
426
|
claimableLightningReceiveBalanceSats(): Promise<number>;
|
|
400
427
|
config(): Promise<Config>;
|
|
401
428
|
static create(args: WalletCreateArgs): Promise<Wallet>;
|
|
@@ -421,7 +448,9 @@ export class Wallet {
|
|
|
421
448
|
history(): Promise<Movement[]>;
|
|
422
449
|
historyByPaymentMethod(paymentMethodType: string, paymentMethodValue: string): Promise<Movement[]>;
|
|
423
450
|
importVtxo(vtxoBase64: string): Promise<void>;
|
|
451
|
+
isInvoicePaid(paymentHash: string): Promise<boolean>;
|
|
424
452
|
lightningReceiveStatus(paymentHash: string): Promise<LightningReceive | undefined>;
|
|
453
|
+
lightningSendState(paymentHash: string): Promise<LightningSendStatus>;
|
|
425
454
|
listClaimableExits(): Promise<ExitVtxo[]>;
|
|
426
455
|
mailboxAuthorization(): string;
|
|
427
456
|
mailboxIdentifier(): string;
|
|
@@ -440,8 +469,8 @@ export class Wallet {
|
|
|
440
469
|
offboardVtxos(vtxoIds: string[], bitcoinAddress: string): Promise<string>;
|
|
441
470
|
static open(args: WalletOpenArgs): Promise<Wallet>;
|
|
442
471
|
static openWithOnchain(onchainWallet: OnchainWallet, args: WalletOpenArgs): Promise<Wallet>;
|
|
443
|
-
payLightningInvoice(args: PayLightningInvoiceArgs): Promise<
|
|
444
|
-
payLightningOffer(args: PayLightningOfferArgs): Promise<
|
|
472
|
+
payLightningInvoice(args: PayLightningInvoiceArgs): Promise<LightningSendStatus>;
|
|
473
|
+
payLightningOffer(args: PayLightningOfferArgs): Promise<LightningSendStatus>;
|
|
445
474
|
peekAddress(index: number): Promise<string>;
|
|
446
475
|
pendingBoardVtxos(): Promise<Vtxo[]>;
|
|
447
476
|
pendingBoards(): Promise<PendingBoard[]>;
|
|
@@ -463,6 +492,7 @@ export class Wallet {
|
|
|
463
492
|
spendableVtxos(): Promise<Vtxo[]>;
|
|
464
493
|
startExitForEntireWallet(): Promise<void>;
|
|
465
494
|
startExitForVtxos(vtxoIds: string[]): Promise<void>;
|
|
495
|
+
stuckFailedLightningSends(): Promise<LightningSend[]>;
|
|
466
496
|
sync(): Promise<void>;
|
|
467
497
|
syncExits(onchainWallet: OnchainWallet): Promise<void>;
|
|
468
498
|
syncPendingBoards(): Promise<void>;
|