@secondts/bark-react-native 0.11.3 → 0.12.1

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.
@@ -1023,11 +1023,21 @@ const FfiConverterTypeLightningInvoice = (() => {
1023
1023
 
1024
1024
  export type LightningReceive = {
1025
1025
  paymentHash: string;
1026
- paymentPreimage: string;
1027
1026
  invoice: string;
1028
1027
  amountSats: /*u64*/ bigint;
1029
- hasHtlcVtxos: boolean;
1030
- preimageRevealed: boolean;
1028
+ /**
1029
+ * Receive progress: "awaiting-payment" | "htlcs-ready" |
1030
+ * "preimage-revealed" | "settled"
1031
+ */
1032
+ state: string;
1033
+ /**
1034
+ * Known while in-progress; present when settled.
1035
+ */
1036
+ paymentPreimage?: string;
1037
+ /**
1038
+ * Unix timestamp (seconds), set only when the receive is settled.
1039
+ */
1040
+ settledAt?: /*i64*/ bigint;
1031
1041
  };
1032
1042
 
1033
1043
  /**
@@ -1053,29 +1063,29 @@ const FfiConverterTypeLightningReceive = (() => {
1053
1063
  read(from: RustBuffer): TypeName {
1054
1064
  return {
1055
1065
  paymentHash: FfiConverterString.read(from),
1056
- paymentPreimage: FfiConverterString.read(from),
1057
1066
  invoice: FfiConverterString.read(from),
1058
1067
  amountSats: FfiConverterUInt64.read(from),
1059
- hasHtlcVtxos: FfiConverterBool.read(from),
1060
- preimageRevealed: FfiConverterBool.read(from),
1068
+ state: FfiConverterString.read(from),
1069
+ paymentPreimage: FfiConverterOptionalString.read(from),
1070
+ settledAt: FfiConverterOptionalInt64.read(from),
1061
1071
  };
1062
1072
  }
1063
1073
  write(value: TypeName, into: RustBuffer): void {
1064
1074
  FfiConverterString.write(value.paymentHash, into);
1065
- FfiConverterString.write(value.paymentPreimage, into);
1066
1075
  FfiConverterString.write(value.invoice, into);
1067
1076
  FfiConverterUInt64.write(value.amountSats, into);
1068
- FfiConverterBool.write(value.hasHtlcVtxos, into);
1069
- FfiConverterBool.write(value.preimageRevealed, into);
1077
+ FfiConverterString.write(value.state, into);
1078
+ FfiConverterOptionalString.write(value.paymentPreimage, into);
1079
+ FfiConverterOptionalInt64.write(value.settledAt, into);
1070
1080
  }
1071
1081
  allocationSize(value: TypeName): number {
1072
1082
  return (
1073
1083
  FfiConverterString.allocationSize(value.paymentHash) +
1074
- FfiConverterString.allocationSize(value.paymentPreimage) +
1075
1084
  FfiConverterString.allocationSize(value.invoice) +
1076
1085
  FfiConverterUInt64.allocationSize(value.amountSats) +
1077
- FfiConverterBool.allocationSize(value.hasHtlcVtxos) +
1078
- FfiConverterBool.allocationSize(value.preimageRevealed)
1086
+ FfiConverterString.allocationSize(value.state) +
1087
+ FfiConverterOptionalString.allocationSize(value.paymentPreimage) +
1088
+ FfiConverterOptionalInt64.allocationSize(value.settledAt)
1079
1089
  );
1080
1090
  }
1081
1091
  }
@@ -2545,35 +2555,19 @@ export interface CustomOnchainWalletCallbacks {
2545
2555
  */
2546
2556
  finishPsbt(psbtBase64: string): /*throws*/ string;
2547
2557
  /**
2548
- * Get a wallet transaction by txid
2558
+ * Whether a script pubkey belongs to the wallet's keychains
2549
2559
  *
2550
2560
  * # Arguments
2551
- * * `txid` - Transaction ID as hex string
2552
- *
2553
- * # Returns
2554
- * Hex-encoded transaction, or null if not found
2561
+ * * `script_pubkey_hex` - Hex-encoded script pubkey
2555
2562
  */
2556
- getWalletTx(txid: string): /*throws*/ string | undefined;
2563
+ isMine(scriptPubkeyHex: string): /*throws*/ boolean;
2557
2564
  /**
2558
- * Get the block hash where a transaction was confirmed
2565
+ * Register an unconfirmed transaction relevant to the wallet
2559
2566
  *
2560
2567
  * # Arguments
2561
- * * `txid` - Transaction ID as hex string
2562
- *
2563
- * # Returns
2564
- * Block reference with height and hash, or null if unconfirmed
2565
- */
2566
- getWalletTxConfirmedBlock(txid: string): /*throws*/ BlockRef | undefined;
2567
- /**
2568
- * Find transaction that spends a given output
2569
- *
2570
- * # Arguments
2571
- * * `outpoint` - Transaction outpoint to check
2572
- *
2573
- * # Returns
2574
- * Hex-encoded spending transaction, or null if unspent
2568
+ * * `tx_hex` - Hex-encoded transaction
2575
2569
  */
2576
- getSpendingTx(outpoint: OutPoint): /*throws*/ string | undefined;
2570
+ registerTx(txHex: string): /*throws*/ void;
2577
2571
  /**
2578
2572
  * Create a signed P2A CPFP transaction
2579
2573
  *
@@ -2734,24 +2728,21 @@ export class CustomOnchainWalletCallbacksImpl
2734
2728
  }
2735
2729
 
2736
2730
  /**
2737
- * Get a wallet transaction by txid
2731
+ * Whether a script pubkey belongs to the wallet's keychains
2738
2732
  *
2739
2733
  * # Arguments
2740
- * * `txid` - Transaction ID as hex string
2741
- *
2742
- * # Returns
2743
- * Hex-encoded transaction, or null if not found
2734
+ * * `script_pubkey_hex` - Hex-encoded script pubkey
2744
2735
  */
2745
- getWalletTx(txid: string): string | undefined /*throws*/ {
2746
- return FfiConverterOptionalString.lift(
2736
+ isMine(scriptPubkeyHex: string): boolean /*throws*/ {
2737
+ return FfiConverterBool.lift(
2747
2738
  uniffiCaller.rustCallWithError(
2748
2739
  /*liftError:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError),
2749
2740
  /*caller:*/ (callStatus) => {
2750
- return nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_get_wallet_tx(
2741
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_is_mine(
2751
2742
  uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer(
2752
2743
  this
2753
2744
  ),
2754
- FfiConverterString.lower(txid),
2745
+ FfiConverterString.lower(scriptPubkeyHex),
2755
2746
  callStatus
2756
2747
  );
2757
2748
  },
@@ -2761,56 +2752,24 @@ export class CustomOnchainWalletCallbacksImpl
2761
2752
  }
2762
2753
 
2763
2754
  /**
2764
- * Get the block hash where a transaction was confirmed
2755
+ * Register an unconfirmed transaction relevant to the wallet
2765
2756
  *
2766
2757
  * # Arguments
2767
- * * `txid` - Transaction ID as hex string
2768
- *
2769
- * # Returns
2770
- * Block reference with height and hash, or null if unconfirmed
2771
- */
2772
- getWalletTxConfirmedBlock(txid: string): BlockRef | undefined /*throws*/ {
2773
- return FfiConverterOptionalTypeBlockRef.lift(
2774
- uniffiCaller.rustCallWithError(
2775
- /*liftError:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError),
2776
- /*caller:*/ (callStatus) => {
2777
- return nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_get_wallet_tx_confirmed_block(
2778
- uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer(
2779
- this
2780
- ),
2781
- FfiConverterString.lower(txid),
2782
- callStatus
2783
- );
2784
- },
2785
- /*liftString:*/ FfiConverterString.lift
2786
- )
2787
- );
2788
- }
2789
-
2790
- /**
2791
- * Find transaction that spends a given output
2792
- *
2793
- * # Arguments
2794
- * * `outpoint` - Transaction outpoint to check
2795
- *
2796
- * # Returns
2797
- * Hex-encoded spending transaction, or null if unspent
2758
+ * * `tx_hex` - Hex-encoded transaction
2798
2759
  */
2799
- getSpendingTx(outpoint: OutPoint): string | undefined /*throws*/ {
2800
- return FfiConverterOptionalString.lift(
2801
- uniffiCaller.rustCallWithError(
2802
- /*liftError:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError),
2803
- /*caller:*/ (callStatus) => {
2804
- return nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_get_spending_tx(
2805
- uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer(
2806
- this
2807
- ),
2808
- FfiConverterTypeOutPoint.lower(outpoint),
2809
- callStatus
2810
- );
2811
- },
2812
- /*liftString:*/ FfiConverterString.lift
2813
- )
2760
+ registerTx(txHex: string): void /*throws*/ {
2761
+ uniffiCaller.rustCallWithError(
2762
+ /*liftError:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError),
2763
+ /*caller:*/ (callStatus) => {
2764
+ nativeModule().ubrn_uniffi_bark_ffi_fn_method_customonchainwalletcallbacks_register_tx(
2765
+ uniffiTypeCustomOnchainWalletCallbacksImplObjectFactory.clonePointer(
2766
+ this
2767
+ ),
2768
+ FfiConverterString.lower(txHex),
2769
+ callStatus
2770
+ );
2771
+ },
2772
+ /*liftString:*/ FfiConverterString.lift
2814
2773
  );
2815
2774
  }
2816
2775
 
@@ -3097,18 +3056,15 @@ const uniffiCallbackInterfaceCustomOnchainWalletCallbacks: {
3097
3056
  );
3098
3057
  return uniffiResult;
3099
3058
  },
3100
- getWalletTx: (uniffiHandle: bigint, txid: Uint8Array) => {
3101
- const uniffiMakeCall = (): string | undefined => {
3059
+ isMine: (uniffiHandle: bigint, scriptPubkeyHex: Uint8Array) => {
3060
+ const uniffiMakeCall = (): boolean => {
3102
3061
  const jsCallback =
3103
3062
  FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
3104
- return jsCallback.getWalletTx(FfiConverterString.lift(txid));
3063
+ return jsCallback.isMine(FfiConverterString.lift(scriptPubkeyHex));
3105
3064
  };
3106
- const uniffiResult = UniffiResult.ready<Uint8Array>();
3065
+ const uniffiResult = UniffiResult.ready<number>();
3107
3066
  const uniffiHandleSuccess = (obj: any) => {
3108
- UniffiResult.writeSuccess(
3109
- uniffiResult,
3110
- FfiConverterOptionalString.lower(obj)
3111
- );
3067
+ UniffiResult.writeSuccess(uniffiResult, FfiConverterBool.lower(obj));
3112
3068
  };
3113
3069
  const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => {
3114
3070
  UniffiResult.writeError(uniffiResult, code, errBuf);
@@ -3123,49 +3079,14 @@ const uniffiCallbackInterfaceCustomOnchainWalletCallbacks: {
3123
3079
  );
3124
3080
  return uniffiResult;
3125
3081
  },
3126
- getWalletTxConfirmedBlock: (uniffiHandle: bigint, txid: Uint8Array) => {
3127
- const uniffiMakeCall = (): BlockRef | undefined => {
3128
- const jsCallback =
3129
- FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
3130
- return jsCallback.getWalletTxConfirmedBlock(
3131
- FfiConverterString.lift(txid)
3132
- );
3133
- };
3134
- const uniffiResult = UniffiResult.ready<Uint8Array>();
3135
- const uniffiHandleSuccess = (obj: any) => {
3136
- UniffiResult.writeSuccess(
3137
- uniffiResult,
3138
- FfiConverterOptionalTypeBlockRef.lower(obj)
3139
- );
3140
- };
3141
- const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => {
3142
- UniffiResult.writeError(uniffiResult, code, errBuf);
3143
- };
3144
- uniffiTraitInterfaceCallWithError(
3145
- /*makeCall:*/ uniffiMakeCall,
3146
- /*handleSuccess:*/ uniffiHandleSuccess,
3147
- /*handleError:*/ uniffiHandleError,
3148
- /*isErrorType:*/ Exception.instanceOf,
3149
- /*lowerError:*/ FfiConverterTypeError.lower.bind(FfiConverterTypeError),
3150
- /*lowerString:*/ FfiConverterString.lower
3151
- );
3152
- return uniffiResult;
3153
- },
3154
- getSpendingTx: (uniffiHandle: bigint, outpoint: Uint8Array) => {
3155
- const uniffiMakeCall = (): string | undefined => {
3082
+ registerTx: (uniffiHandle: bigint, txHex: Uint8Array) => {
3083
+ const uniffiMakeCall = (): void => {
3156
3084
  const jsCallback =
3157
3085
  FfiConverterTypeCustomOnchainWalletCallbacks.lift(uniffiHandle);
3158
- return jsCallback.getSpendingTx(
3159
- FfiConverterTypeOutPoint.lift(outpoint)
3160
- );
3161
- };
3162
- const uniffiResult = UniffiResult.ready<Uint8Array>();
3163
- const uniffiHandleSuccess = (obj: any) => {
3164
- UniffiResult.writeSuccess(
3165
- uniffiResult,
3166
- FfiConverterOptionalString.lower(obj)
3167
- );
3086
+ return jsCallback.registerTx(FfiConverterString.lift(txHex));
3168
3087
  };
3088
+ const uniffiResult = UniffiResult.ready<void>();
3089
+ const uniffiHandleSuccess = (obj: any) => {};
3169
3090
  const uniffiHandleError = (code: number, errBuf: UniffiByteArray) => {
3170
3091
  UniffiResult.writeError(uniffiResult, code, errBuf);
3171
3092
  };
@@ -3854,18 +3775,17 @@ export interface WalletLike {
3854
3775
  asyncOpts_?: { signal: AbortSignal }
3855
3776
  ): /*throws*/ Promise<void>;
3856
3777
  balance(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise<Balance>;
3857
- boardAll(
3858
- onchainWallet: OnchainWalletLike,
3859
- asyncOpts_?: { signal: AbortSignal }
3860
- ): /*throws*/ Promise<PendingBoard>;
3778
+ boardAll(asyncOpts_?: {
3779
+ signal: AbortSignal;
3780
+ }): /*throws*/ Promise<PendingBoard>;
3861
3781
  boardAmount(
3862
- onchainWallet: OnchainWalletLike,
3863
3782
  amountSats: /*u64*/ bigint,
3864
3783
  asyncOpts_?: { signal: AbortSignal }
3865
3784
  ): /*throws*/ Promise<PendingBoard>;
3866
3785
  bolt11Invoice(
3867
3786
  amountSats: /*u64*/ bigint,
3868
3787
  description: string | undefined,
3788
+ token: string | undefined,
3869
3789
  asyncOpts_?: { signal: AbortSignal }
3870
3790
  ): /*throws*/ Promise<LightningInvoice>;
3871
3791
  broadcastTx(
@@ -3978,10 +3898,14 @@ export interface WalletLike {
3978
3898
  paymentHash: string,
3979
3899
  asyncOpts_?: { signal: AbortSignal }
3980
3900
  ): /*throws*/ Promise<boolean>;
3981
- lightningReceiveStatus(
3901
+ /**
3902
+ * Triage a payment hash: settled or in-progress. Errors if no lightning
3903
+ * receive is known for this payment hash.
3904
+ */
3905
+ lightningReceiveState(
3982
3906
  paymentHash: string,
3983
3907
  asyncOpts_?: { signal: AbortSignal }
3984
- ): /*throws*/ Promise<LightningReceive | undefined>;
3908
+ ): /*throws*/ Promise<LightningReceive>;
3985
3909
  lightningSendState(
3986
3910
  paymentHash: string,
3987
3911
  asyncOpts_?: { signal: AbortSignal }
@@ -3998,14 +3922,6 @@ export interface WalletLike {
3998
3922
  maintenanceRefresh(asyncOpts_?: {
3999
3923
  signal: AbortSignal;
4000
3924
  }): /*throws*/ Promise<string | undefined>;
4001
- maintenanceWithOnchain(
4002
- onchainWallet: OnchainWalletLike,
4003
- asyncOpts_?: { signal: AbortSignal }
4004
- ): /*throws*/ Promise<void>;
4005
- maintenanceWithOnchainDelegated(
4006
- onchainWallet: OnchainWalletLike,
4007
- asyncOpts_?: { signal: AbortSignal }
4008
- ): /*throws*/ Promise<void>;
4009
3925
  network(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise<Network>;
4010
3926
  newAddress(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise<string>;
4011
3927
  newAddressWithIndex(asyncOpts_?: {
@@ -4088,7 +4004,6 @@ export interface WalletLike {
4088
4004
  signal: AbortSignal;
4089
4005
  }): /*throws*/ Promise<Array<RoundState>>;
4090
4006
  progressExits(
4091
- onchainWallet: OnchainWalletLike,
4092
4007
  feeRateSatPerVb: /*u64*/ bigint | undefined,
4093
4008
  asyncOpts_?: { signal: AbortSignal }
4094
4009
  ): /*throws*/ Promise<Array<ExitProgressStatus>>;
@@ -4107,10 +4022,11 @@ export interface WalletLike {
4107
4022
  vtxoIds: Array<string>,
4108
4023
  asyncOpts_?: { signal: AbortSignal }
4109
4024
  ): /*throws*/ Promise<RoundState | undefined>;
4110
- runDaemon(
4111
- onchainWallet: OnchainWalletLike | undefined,
4112
- asyncOpts_?: { signal: AbortSignal }
4113
- ): /*throws*/ Promise<void>;
4025
+ /**
4026
+ * Start the background daemon. The onchain wallet used by the daemon is
4027
+ * the one supplied to `Wallet::open` (see `WalletOpenArgs.onchain`).
4028
+ */
4029
+ runDaemon(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise<void>;
4114
4030
  sendArkoorPayment(
4115
4031
  arkAddress: string,
4116
4032
  amountSats: /*u64*/ bigint,
@@ -4140,10 +4056,7 @@ export interface WalletLike {
4140
4056
  signal: AbortSignal;
4141
4057
  }): /*throws*/ Promise<Array<LightningSend>>;
4142
4058
  sync(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise<void>;
4143
- syncExits(
4144
- onchainWallet: OnchainWalletLike,
4145
- asyncOpts_?: { signal: AbortSignal }
4146
- ): /*throws*/ Promise<void>;
4059
+ syncExits(asyncOpts_?: { signal: AbortSignal }): /*throws*/ Promise<void>;
4147
4060
  /**
4148
4061
  * Scan for VTXOs that were force-exited on-chain without the user asking
4149
4062
  * and route them into the unilateral-exit flow so the funds can be claimed.
@@ -4165,7 +4078,7 @@ export interface WalletLike {
4165
4078
  paymentHash: string,
4166
4079
  wait: boolean,
4167
4080
  asyncOpts_?: { signal: AbortSignal }
4168
- ): /*throws*/ Promise<void>;
4081
+ ): /*throws*/ Promise<LightningReceive>;
4169
4082
  validateArkoorAddress(
4170
4083
  address: string,
4171
4084
  asyncOpts_?: { signal: AbortSignal }
@@ -4450,18 +4363,16 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
4450
4363
  }
4451
4364
  }
4452
4365
 
4453
- async boardAll(
4454
- onchainWallet: OnchainWalletLike,
4455
- asyncOpts_?: { signal: AbortSignal }
4456
- ): Promise<PendingBoard> /*throws*/ {
4366
+ async boardAll(asyncOpts_?: {
4367
+ signal: AbortSignal;
4368
+ }): Promise<PendingBoard> /*throws*/ {
4457
4369
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
4458
4370
  try {
4459
4371
  return await uniffiRustCallAsync(
4460
4372
  /*rustCaller:*/ uniffiCaller,
4461
4373
  /*rustFutureFunc:*/ () => {
4462
4374
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_all(
4463
- uniffiTypeWalletObjectFactory.clonePointer(this),
4464
- FfiConverterTypeOnchainWallet.lower(onchainWallet)
4375
+ uniffiTypeWalletObjectFactory.clonePointer(this)
4465
4376
  );
4466
4377
  },
4467
4378
  /*pollFunc:*/ nativeModule()
@@ -4488,7 +4399,6 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
4488
4399
  }
4489
4400
 
4490
4401
  async boardAmount(
4491
- onchainWallet: OnchainWalletLike,
4492
4402
  amountSats: /*u64*/ bigint,
4493
4403
  asyncOpts_?: { signal: AbortSignal }
4494
4404
  ): Promise<PendingBoard> /*throws*/ {
@@ -4499,7 +4409,6 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
4499
4409
  /*rustFutureFunc:*/ () => {
4500
4410
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_board_amount(
4501
4411
  uniffiTypeWalletObjectFactory.clonePointer(this),
4502
- FfiConverterTypeOnchainWallet.lower(onchainWallet),
4503
4412
  FfiConverterUInt64.lower(amountSats)
4504
4413
  );
4505
4414
  },
@@ -4529,6 +4438,7 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
4529
4438
  async bolt11Invoice(
4530
4439
  amountSats: /*u64*/ bigint,
4531
4440
  description: string | undefined,
4441
+ token: string | undefined = undefined,
4532
4442
  asyncOpts_?: { signal: AbortSignal }
4533
4443
  ): Promise<LightningInvoice> /*throws*/ {
4534
4444
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
@@ -4539,7 +4449,8 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
4539
4449
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_bolt11_invoice(
4540
4450
  uniffiTypeWalletObjectFactory.clonePointer(this),
4541
4451
  FfiConverterUInt64.lower(amountSats),
4542
- FfiConverterOptionalString.lower(description)
4452
+ FfiConverterOptionalString.lower(description),
4453
+ FfiConverterOptionalString.lower(token)
4543
4454
  );
4544
4455
  },
4545
4456
  /*pollFunc:*/ nativeModule()
@@ -5573,16 +5484,20 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
5573
5484
  }
5574
5485
  }
5575
5486
 
5576
- async lightningReceiveStatus(
5487
+ /**
5488
+ * Triage a payment hash: settled or in-progress. Errors if no lightning
5489
+ * receive is known for this payment hash.
5490
+ */
5491
+ async lightningReceiveState(
5577
5492
  paymentHash: string,
5578
5493
  asyncOpts_?: { signal: AbortSignal }
5579
- ): Promise<LightningReceive | undefined> /*throws*/ {
5494
+ ): Promise<LightningReceive> /*throws*/ {
5580
5495
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
5581
5496
  try {
5582
5497
  return await uniffiRustCallAsync(
5583
5498
  /*rustCaller:*/ uniffiCaller,
5584
5499
  /*rustFutureFunc:*/ () => {
5585
- return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_lightning_receive_status(
5500
+ return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_lightning_receive_state(
5586
5501
  uniffiTypeWalletObjectFactory.clonePointer(this),
5587
5502
  FfiConverterString.lower(paymentHash)
5588
5503
  );
@@ -5595,8 +5510,8 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
5595
5510
  .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer,
5596
5511
  /*freeFunc:*/ nativeModule()
5597
5512
  .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer,
5598
- /*liftFunc:*/ FfiConverterOptionalTypeLightningReceive.lift.bind(
5599
- FfiConverterOptionalTypeLightningReceive
5513
+ /*liftFunc:*/ FfiConverterTypeLightningReceive.lift.bind(
5514
+ FfiConverterTypeLightningReceive
5600
5515
  ),
5601
5516
  /*liftString:*/ FfiConverterString.lift,
5602
5517
  /*asyncOpts:*/ asyncOpts_,
@@ -5809,72 +5724,6 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
5809
5724
  }
5810
5725
  }
5811
5726
 
5812
- async maintenanceWithOnchain(
5813
- onchainWallet: OnchainWalletLike,
5814
- asyncOpts_?: { signal: AbortSignal }
5815
- ): Promise<void> /*throws*/ {
5816
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
5817
- try {
5818
- return await uniffiRustCallAsync(
5819
- /*rustCaller:*/ uniffiCaller,
5820
- /*rustFutureFunc:*/ () => {
5821
- return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_maintenance_with_onchain(
5822
- uniffiTypeWalletObjectFactory.clonePointer(this),
5823
- FfiConverterTypeOnchainWallet.lower(onchainWallet)
5824
- );
5825
- },
5826
- /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void,
5827
- /*cancelFunc:*/ nativeModule()
5828
- .ubrn_ffi_bark_ffi_rust_future_cancel_void,
5829
- /*completeFunc:*/ nativeModule()
5830
- .ubrn_ffi_bark_ffi_rust_future_complete_void,
5831
- /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void,
5832
- /*liftFunc:*/ (_v) => {},
5833
- /*liftString:*/ FfiConverterString.lift,
5834
- /*asyncOpts:*/ asyncOpts_,
5835
- /*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
5836
- );
5837
- } catch (__error: any) {
5838
- if (uniffiIsDebug && __error instanceof Error) {
5839
- __error.stack = __stack;
5840
- }
5841
- throw __error;
5842
- }
5843
- }
5844
-
5845
- async maintenanceWithOnchainDelegated(
5846
- onchainWallet: OnchainWalletLike,
5847
- asyncOpts_?: { signal: AbortSignal }
5848
- ): Promise<void> /*throws*/ {
5849
- const __stack = uniffiIsDebug ? new Error().stack : undefined;
5850
- try {
5851
- return await uniffiRustCallAsync(
5852
- /*rustCaller:*/ uniffiCaller,
5853
- /*rustFutureFunc:*/ () => {
5854
- return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_maintenance_with_onchain_delegated(
5855
- uniffiTypeWalletObjectFactory.clonePointer(this),
5856
- FfiConverterTypeOnchainWallet.lower(onchainWallet)
5857
- );
5858
- },
5859
- /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void,
5860
- /*cancelFunc:*/ nativeModule()
5861
- .ubrn_ffi_bark_ffi_rust_future_cancel_void,
5862
- /*completeFunc:*/ nativeModule()
5863
- .ubrn_ffi_bark_ffi_rust_future_complete_void,
5864
- /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void,
5865
- /*liftFunc:*/ (_v) => {},
5866
- /*liftString:*/ FfiConverterString.lift,
5867
- /*asyncOpts:*/ asyncOpts_,
5868
- /*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
5869
- );
5870
- } catch (__error: any) {
5871
- if (uniffiIsDebug && __error instanceof Error) {
5872
- __error.stack = __stack;
5873
- }
5874
- throw __error;
5875
- }
5876
- }
5877
-
5878
5727
  async network(asyncOpts_?: {
5879
5728
  signal: AbortSignal;
5880
5729
  }): Promise<Network> /*throws*/ {
@@ -6584,7 +6433,6 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
6584
6433
  }
6585
6434
 
6586
6435
  async progressExits(
6587
- onchainWallet: OnchainWalletLike,
6588
6436
  feeRateSatPerVb: /*u64*/ bigint | undefined,
6589
6437
  asyncOpts_?: { signal: AbortSignal }
6590
6438
  ): Promise<Array<ExitProgressStatus>> /*throws*/ {
@@ -6595,7 +6443,6 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
6595
6443
  /*rustFutureFunc:*/ () => {
6596
6444
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_progress_exits(
6597
6445
  uniffiTypeWalletObjectFactory.clonePointer(this),
6598
- FfiConverterTypeOnchainWallet.lower(onchainWallet),
6599
6446
  FfiConverterOptionalUInt64.lower(feeRateSatPerVb)
6600
6447
  );
6601
6448
  },
@@ -6793,18 +6640,20 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
6793
6640
  }
6794
6641
  }
6795
6642
 
6796
- async runDaemon(
6797
- onchainWallet: OnchainWalletLike | undefined,
6798
- asyncOpts_?: { signal: AbortSignal }
6799
- ): Promise<void> /*throws*/ {
6643
+ /**
6644
+ * Start the background daemon. The onchain wallet used by the daemon is
6645
+ * the one supplied to `Wallet::open` (see `WalletOpenArgs.onchain`).
6646
+ */
6647
+ async runDaemon(asyncOpts_?: {
6648
+ signal: AbortSignal;
6649
+ }): Promise<void> /*throws*/ {
6800
6650
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
6801
6651
  try {
6802
6652
  return await uniffiRustCallAsync(
6803
6653
  /*rustCaller:*/ uniffiCaller,
6804
6654
  /*rustFutureFunc:*/ () => {
6805
6655
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_run_daemon(
6806
- uniffiTypeWalletObjectFactory.clonePointer(this),
6807
- FfiConverterOptionalTypeOnchainWallet.lower(onchainWallet)
6656
+ uniffiTypeWalletObjectFactory.clonePointer(this)
6808
6657
  );
6809
6658
  },
6810
6659
  /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void,
@@ -7127,18 +6976,16 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
7127
6976
  }
7128
6977
  }
7129
6978
 
7130
- async syncExits(
7131
- onchainWallet: OnchainWalletLike,
7132
- asyncOpts_?: { signal: AbortSignal }
7133
- ): Promise<void> /*throws*/ {
6979
+ async syncExits(asyncOpts_?: {
6980
+ signal: AbortSignal;
6981
+ }): Promise<void> /*throws*/ {
7134
6982
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
7135
6983
  try {
7136
6984
  return await uniffiRustCallAsync(
7137
6985
  /*rustCaller:*/ uniffiCaller,
7138
6986
  /*rustFutureFunc:*/ () => {
7139
6987
  return nativeModule().ubrn_uniffi_bark_ffi_fn_method_wallet_sync_exits(
7140
- uniffiTypeWalletObjectFactory.clonePointer(this),
7141
- FfiConverterTypeOnchainWallet.lower(onchainWallet)
6988
+ uniffiTypeWalletObjectFactory.clonePointer(this)
7142
6989
  );
7143
6990
  },
7144
6991
  /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void,
@@ -7270,7 +7117,7 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
7270
7117
  paymentHash: string,
7271
7118
  wait: boolean = false,
7272
7119
  asyncOpts_?: { signal: AbortSignal }
7273
- ): Promise<void> /*throws*/ {
7120
+ ): Promise<LightningReceive> /*throws*/ {
7274
7121
  const __stack = uniffiIsDebug ? new Error().stack : undefined;
7275
7122
  try {
7276
7123
  return await uniffiRustCallAsync(
@@ -7282,13 +7129,17 @@ export class Wallet extends UniffiAbstractObject implements WalletLike {
7282
7129
  FfiConverterBool.lower(wait)
7283
7130
  );
7284
7131
  },
7285
- /*pollFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_poll_void,
7132
+ /*pollFunc:*/ nativeModule()
7133
+ .ubrn_ffi_bark_ffi_rust_future_poll_rust_buffer,
7286
7134
  /*cancelFunc:*/ nativeModule()
7287
- .ubrn_ffi_bark_ffi_rust_future_cancel_void,
7135
+ .ubrn_ffi_bark_ffi_rust_future_cancel_rust_buffer,
7288
7136
  /*completeFunc:*/ nativeModule()
7289
- .ubrn_ffi_bark_ffi_rust_future_complete_void,
7290
- /*freeFunc:*/ nativeModule().ubrn_ffi_bark_ffi_rust_future_free_void,
7291
- /*liftFunc:*/ (_v) => {},
7137
+ .ubrn_ffi_bark_ffi_rust_future_complete_rust_buffer,
7138
+ /*freeFunc:*/ nativeModule()
7139
+ .ubrn_ffi_bark_ffi_rust_future_free_rust_buffer,
7140
+ /*liftFunc:*/ FfiConverterTypeLightningReceive.lift.bind(
7141
+ FfiConverterTypeLightningReceive
7142
+ ),
7292
7143
  /*liftString:*/ FfiConverterString.lift,
7293
7144
  /*asyncOpts:*/ asyncOpts_,
7294
7145
  /*errorHandler:*/ FfiConverterTypeError.lift.bind(FfiConverterTypeError)
@@ -7456,26 +7307,19 @@ const FfiConverterTypeWallet = new FfiConverterObject(
7456
7307
  // FfiConverter for boolean | undefined
7457
7308
  const FfiConverterOptionalBool = new FfiConverterOptional(FfiConverterBool);
7458
7309
 
7310
+ // FfiConverter for /*i64*/bigint | undefined
7311
+ const FfiConverterOptionalInt64 = new FfiConverterOptional(FfiConverterInt64);
7312
+
7459
7313
  // FfiConverter for ArkInfo | undefined
7460
7314
  const FfiConverterOptionalTypeArkInfo = new FfiConverterOptional(
7461
7315
  FfiConverterTypeArkInfo
7462
7316
  );
7463
7317
 
7464
- // FfiConverter for BlockRef | undefined
7465
- const FfiConverterOptionalTypeBlockRef = new FfiConverterOptional(
7466
- FfiConverterTypeBlockRef
7467
- );
7468
-
7469
7318
  // FfiConverter for ExitTransactionStatus | undefined
7470
7319
  const FfiConverterOptionalTypeExitTransactionStatus = new FfiConverterOptional(
7471
7320
  FfiConverterTypeExitTransactionStatus
7472
7321
  );
7473
7322
 
7474
- // FfiConverter for LightningReceive | undefined
7475
- const FfiConverterOptionalTypeLightningReceive = new FfiConverterOptional(
7476
- FfiConverterTypeLightningReceive
7477
- );
7478
-
7479
7323
  // FfiConverter for RoundState | undefined
7480
7324
  const FfiConverterOptionalTypeRoundState = new FfiConverterOptional(
7481
7325
  FfiConverterTypeRoundState
@@ -7674,32 +7518,24 @@ function uniffiEnsureInitialized() {
7674
7518
  );
7675
7519
  }
7676
7520
  if (
7677
- nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_wallet_tx() !==
7678
- 40848
7679
- ) {
7680
- throw new UniffiInternalError.ApiChecksumMismatch(
7681
- "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_wallet_tx"
7682
- );
7683
- }
7684
- if (
7685
- nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_wallet_tx_confirmed_block() !==
7686
- 20505
7521
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_is_mine() !==
7522
+ 18867
7687
7523
  ) {
7688
7524
  throw new UniffiInternalError.ApiChecksumMismatch(
7689
- "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_wallet_tx_confirmed_block"
7525
+ "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_is_mine"
7690
7526
  );
7691
7527
  }
7692
7528
  if (
7693
- nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_spending_tx() !==
7694
- 24154
7529
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_register_tx() !==
7530
+ 17970
7695
7531
  ) {
7696
7532
  throw new UniffiInternalError.ApiChecksumMismatch(
7697
- "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_get_spending_tx"
7533
+ "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_register_tx"
7698
7534
  );
7699
7535
  }
7700
7536
  if (
7701
7537
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp() !==
7702
- 58200
7538
+ 62938
7703
7539
  ) {
7704
7540
  throw new UniffiInternalError.ApiChecksumMismatch(
7705
7541
  "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_make_signed_p2a_cpfp"
@@ -7707,7 +7543,7 @@ function uniffiEnsureInitialized() {
7707
7543
  }
7708
7544
  if (
7709
7545
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp() !==
7710
- 64815
7546
+ 47426
7711
7547
  ) {
7712
7548
  throw new UniffiInternalError.ApiChecksumMismatch(
7713
7549
  "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_store_signed_p2a_cpfp"
@@ -7715,7 +7551,7 @@ function uniffiEnsureInitialized() {
7715
7551
  }
7716
7552
  if (
7717
7553
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_sync() !==
7718
- 29018
7554
+ 12900
7719
7555
  ) {
7720
7556
  throw new UniffiInternalError.ApiChecksumMismatch(
7721
7557
  "uniffi_bark_ffi_checksum_method_customonchainwalletcallbacks_sync"
@@ -7811,7 +7647,7 @@ function uniffiEnsureInitialized() {
7811
7647
  }
7812
7648
  if (
7813
7649
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_all() !==
7814
- 58611
7650
+ 5667
7815
7651
  ) {
7816
7652
  throw new UniffiInternalError.ApiChecksumMismatch(
7817
7653
  "uniffi_bark_ffi_checksum_method_wallet_board_all"
@@ -7819,7 +7655,7 @@ function uniffiEnsureInitialized() {
7819
7655
  }
7820
7656
  if (
7821
7657
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_board_amount() !==
7822
- 51838
7658
+ 54692
7823
7659
  ) {
7824
7660
  throw new UniffiInternalError.ApiChecksumMismatch(
7825
7661
  "uniffi_bark_ffi_checksum_method_wallet_board_amount"
@@ -7827,7 +7663,7 @@ function uniffiEnsureInitialized() {
7827
7663
  }
7828
7664
  if (
7829
7665
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice() !==
7830
- 43491
7666
+ 54959
7831
7667
  ) {
7832
7668
  throw new UniffiInternalError.ApiChecksumMismatch(
7833
7669
  "uniffi_bark_ffi_checksum_method_wallet_bolt11_invoice"
@@ -8066,11 +7902,11 @@ function uniffiEnsureInitialized() {
8066
7902
  );
8067
7903
  }
8068
7904
  if (
8069
- nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_lightning_receive_status() !==
8070
- 27695
7905
+ nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_lightning_receive_state() !==
7906
+ 27834
8071
7907
  ) {
8072
7908
  throw new UniffiInternalError.ApiChecksumMismatch(
8073
- "uniffi_bark_ffi_checksum_method_wallet_lightning_receive_status"
7909
+ "uniffi_bark_ffi_checksum_method_wallet_lightning_receive_state"
8074
7910
  );
8075
7911
  }
8076
7912
  if (
@@ -8129,22 +7965,6 @@ function uniffiEnsureInitialized() {
8129
7965
  "uniffi_bark_ffi_checksum_method_wallet_maintenance_refresh"
8130
7966
  );
8131
7967
  }
8132
- if (
8133
- nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_maintenance_with_onchain() !==
8134
- 16119
8135
- ) {
8136
- throw new UniffiInternalError.ApiChecksumMismatch(
8137
- "uniffi_bark_ffi_checksum_method_wallet_maintenance_with_onchain"
8138
- );
8139
- }
8140
- if (
8141
- nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_maintenance_with_onchain_delegated() !==
8142
- 40766
8143
- ) {
8144
- throw new UniffiInternalError.ApiChecksumMismatch(
8145
- "uniffi_bark_ffi_checksum_method_wallet_maintenance_with_onchain_delegated"
8146
- );
8147
- }
8148
7968
  if (
8149
7969
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_network() !==
8150
7970
  2007
@@ -8307,7 +8127,7 @@ function uniffiEnsureInitialized() {
8307
8127
  }
8308
8128
  if (
8309
8129
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_progress_exits() !==
8310
- 7089
8130
+ 6255
8311
8131
  ) {
8312
8132
  throw new UniffiInternalError.ApiChecksumMismatch(
8313
8133
  "uniffi_bark_ffi_checksum_method_wallet_progress_exits"
@@ -8355,7 +8175,7 @@ function uniffiEnsureInitialized() {
8355
8175
  }
8356
8176
  if (
8357
8177
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_run_daemon() !==
8358
- 3475
8178
+ 9520
8359
8179
  ) {
8360
8180
  throw new UniffiInternalError.ApiChecksumMismatch(
8361
8181
  "uniffi_bark_ffi_checksum_method_wallet_run_daemon"
@@ -8434,7 +8254,7 @@ function uniffiEnsureInitialized() {
8434
8254
  }
8435
8255
  if (
8436
8256
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_sync_exits() !==
8437
- 22078
8257
+ 12141
8438
8258
  ) {
8439
8259
  throw new UniffiInternalError.ApiChecksumMismatch(
8440
8260
  "uniffi_bark_ffi_checksum_method_wallet_sync_exits"
@@ -8466,7 +8286,7 @@ function uniffiEnsureInitialized() {
8466
8286
  }
8467
8287
  if (
8468
8288
  nativeModule().ubrn_uniffi_bark_ffi_checksum_method_wallet_try_claim_lightning_receive() !==
8469
- 45229
8289
+ 43209
8470
8290
  ) {
8471
8291
  throw new UniffiInternalError.ApiChecksumMismatch(
8472
8292
  "uniffi_bark_ffi_checksum_method_wallet_try_claim_lightning_receive"