@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.
Binary file
@@ -39,7 +39,11 @@ export const wallet_offboardVtxos: (a: number, b: number, c: number, d: number,
39
39
  export const wallet_payLightningInvoice: (a: number, b: number) => number;
40
40
  export const wallet_payLightningOffer: (a: number, b: number) => number;
41
41
  export const wallet_checkLightningPayment: (a: number, b: number) => number;
42
+ export const wallet_lightningSendState: (a: number, b: number, c: number) => number;
43
+ export const wallet_isInvoicePaid: (a: number, b: number, c: number) => number;
42
44
  export const wallet_pendingLightningSends: (a: number) => number;
45
+ export const wallet_stuckFailedLightningSends: (a: number) => number;
46
+ export const wallet_allowLightningSendToExit: (a: number, b: number, c: number) => number;
43
47
  export const wallet_bolt11Invoice: (a: number, b: number) => number;
44
48
  export const wallet_tryClaimAllLightningReceives: (a: number, b: number) => number;
45
49
  export const wallet_pendingLightningReceives: (a: number) => number;
@@ -47,6 +51,7 @@ export const wallet_claimableLightningReceiveBalanceSats: (a: number) => number;
47
51
  export const wallet_lightningReceiveStatus: (a: number, b: number, c: number) => number;
48
52
  export const wallet_tryClaimLightningReceive: (a: number, b: number) => number;
49
53
  export const wallet_cancelLightningReceive: (a: number, b: number, c: number) => number;
54
+ export const wallet_attemptLightningReceiveExit: (a: number, b: number, c: number) => number;
50
55
  export const wallet_sendArkoorPayment: (a: number, b: number, c: number, d: number) => number;
51
56
  export const wallet_validateArkoorAddress: (a: number, b: number, c: number) => number;
52
57
  export const wallet_sendOnchain: (a: number, b: number, c: number, d: number) => number;
@@ -122,16 +127,16 @@ export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
122
127
  export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
123
128
  export const rustsecp256k1_v0_10_0_default_illegal_callback_fn: (a: number, b: number) => void;
124
129
  export const rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
125
- export const __wasm_bindgen_func_elem_723: (a: number, b: number, c: number, d: number) => void;
126
- export const __wasm_bindgen_func_elem_15398: (a: number, b: number, c: number, d: number) => void;
127
- export const __wasm_bindgen_func_elem_730: (a: number, b: number, c: number, d: number) => void;
128
- export const __wasm_bindgen_func_elem_15400: (a: number, b: number, c: number) => number;
129
- export const __wasm_bindgen_func_elem_13601: (a: number, b: number, c: number) => void;
130
- export const __wasm_bindgen_func_elem_13350: (a: number, b: number, c: number) => void;
131
- export const __wasm_bindgen_func_elem_15401: (a: number, b: number, c: number) => void;
132
- export const __wasm_bindgen_func_elem_12910: (a: number, b: number) => void;
133
- export const __wasm_bindgen_func_elem_13756: (a: number, b: number) => void;
134
- export const __wasm_bindgen_func_elem_19108: (a: number, b: number) => void;
130
+ export const __wasm_bindgen_func_elem_724: (a: number, b: number, c: number, d: number) => void;
131
+ export const __wasm_bindgen_func_elem_15466: (a: number, b: number, c: number, d: number) => void;
132
+ export const __wasm_bindgen_func_elem_746: (a: number, b: number, c: number, d: number) => void;
133
+ export const __wasm_bindgen_func_elem_15469: (a: number, b: number, c: number) => number;
134
+ export const __wasm_bindgen_func_elem_13646: (a: number, b: number, c: number) => void;
135
+ export const __wasm_bindgen_func_elem_13406: (a: number, b: number, c: number) => void;
136
+ export const __wasm_bindgen_func_elem_15468: (a: number, b: number, c: number) => void;
137
+ export const __wasm_bindgen_func_elem_12908: (a: number, b: number) => void;
138
+ export const __wasm_bindgen_func_elem_13800: (a: number, b: number) => void;
139
+ export const __wasm_bindgen_func_elem_19235: (a: number, b: number) => void;
135
140
  export const __wbindgen_export: (a: number, b: number) => number;
136
141
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
137
142
  export const __wbindgen_export3: (a: number) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secondts/bark",
3
- "version": "0.6.3",
3
+ "version": "0.8.0",
4
4
  "description": "Bark FFI bindings for the browser via WebAssembly (IndexedDB persister)",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -58,5 +58,5 @@
58
58
  "registry": "https://registry.npmjs.org/",
59
59
  "access": "public"
60
60
  },
61
- "releaseTag": "v0.6.3+bark.0.2.1"
61
+ "releaseTag": "v0.8.0+bark.0.2.3"
62
62
  }
@@ -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
- preimage: string | undefined;
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<string | undefined>;
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<LightningSend>;
444
- payLightningOffer(args: PayLightningOfferArgs): Promise<LightningSend>;
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>;
@@ -522,7 +552,11 @@ export interface InitOutput {
522
552
  readonly wallet_payLightningInvoice: (a: number, b: number) => number;
523
553
  readonly wallet_payLightningOffer: (a: number, b: number) => number;
524
554
  readonly wallet_checkLightningPayment: (a: number, b: number) => number;
555
+ readonly wallet_lightningSendState: (a: number, b: number, c: number) => number;
556
+ readonly wallet_isInvoicePaid: (a: number, b: number, c: number) => number;
525
557
  readonly wallet_pendingLightningSends: (a: number) => number;
558
+ readonly wallet_stuckFailedLightningSends: (a: number) => number;
559
+ readonly wallet_allowLightningSendToExit: (a: number, b: number, c: number) => number;
526
560
  readonly wallet_bolt11Invoice: (a: number, b: number) => number;
527
561
  readonly wallet_tryClaimAllLightningReceives: (a: number, b: number) => number;
528
562
  readonly wallet_pendingLightningReceives: (a: number) => number;
@@ -530,6 +564,7 @@ export interface InitOutput {
530
564
  readonly wallet_lightningReceiveStatus: (a: number, b: number, c: number) => number;
531
565
  readonly wallet_tryClaimLightningReceive: (a: number, b: number) => number;
532
566
  readonly wallet_cancelLightningReceive: (a: number, b: number, c: number) => number;
567
+ readonly wallet_attemptLightningReceiveExit: (a: number, b: number, c: number) => number;
533
568
  readonly wallet_sendArkoorPayment: (a: number, b: number, c: number, d: number) => number;
534
569
  readonly wallet_validateArkoorAddress: (a: number, b: number, c: number) => number;
535
570
  readonly wallet_sendOnchain: (a: number, b: number, c: number, d: number) => number;
@@ -605,16 +640,16 @@ export interface InitOutput {
605
640
  readonly rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
606
641
  readonly rustsecp256k1_v0_10_0_default_illegal_callback_fn: (a: number, b: number) => void;
607
642
  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;
643
+ readonly __wasm_bindgen_func_elem_724: (a: number, b: number, c: number, d: number) => void;
644
+ readonly __wasm_bindgen_func_elem_15466: (a: number, b: number, c: number, d: number) => void;
645
+ readonly __wasm_bindgen_func_elem_746: (a: number, b: number, c: number, d: number) => void;
646
+ readonly __wasm_bindgen_func_elem_15469: (a: number, b: number, c: number) => number;
647
+ readonly __wasm_bindgen_func_elem_13646: (a: number, b: number, c: number) => void;
648
+ readonly __wasm_bindgen_func_elem_13406: (a: number, b: number, c: number) => void;
649
+ readonly __wasm_bindgen_func_elem_15468: (a: number, b: number, c: number) => void;
650
+ readonly __wasm_bindgen_func_elem_12908: (a: number, b: number) => void;
651
+ readonly __wasm_bindgen_func_elem_13800: (a: number, b: number) => void;
652
+ readonly __wasm_bindgen_func_elem_19235: (a: number, b: number) => void;
618
653
  readonly __wbindgen_export: (a: number, b: number) => number;
619
654
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
620
655
  readonly __wbindgen_export3: (a: number) => void;