@breeztech/breez-sdk-spark 0.24.1 → 0.26.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.
@@ -193,6 +193,14 @@ class BreezSdk {
193
193
  const ret = wasm.breezsdk_checkMessage(this.__wbg_ptr, request);
194
194
  return ret;
195
195
  }
196
+ /**
197
+ * @param {CheckUnilateralExitRequest} request
198
+ * @returns {Promise<CheckUnilateralExitResponse>}
199
+ */
200
+ checkUnilateralExit(request) {
201
+ const ret = wasm.breezsdk_checkUnilateralExit(this.__wbg_ptr, request);
202
+ return ret;
203
+ }
196
204
  /**
197
205
  * @param {ClaimDepositRequest} request
198
206
  * @returns {Promise<ClaimDepositResponse>}
@@ -2245,9 +2253,6 @@ function __wbg_get_imports() {
2245
2253
  const ret = arg0.catch(arg1);
2246
2254
  return ret;
2247
2255
  },
2248
- __wbg_clearInterval_d25b0cf526eff7ae: function(arg0) {
2249
- globalThis.clearInterval(arg0);
2250
- },
2251
2256
  __wbg_clearTimeout_113b1cde814ec762: function(arg0) {
2252
2257
  const ret = clearTimeout(arg0);
2253
2258
  return ret;
@@ -2265,9 +2270,6 @@ function __wbg_get_imports() {
2265
2270
  __wbg_close_de471367367aa5cb: function() { return handleError(function (arg0) {
2266
2271
  arg0.close();
2267
2272
  }, arguments); },
2268
- __wbg_close_f1af935d7d7cec78: function() { return handleError(function (arg0, arg1, arg2, arg3) {
2269
- arg0.close(arg1, getStringFromWasm0(arg2, arg3));
2270
- }, arguments); },
2271
2273
  __wbg_code_be6f339819ebb2c4: function(arg0) {
2272
2274
  const ret = arg0.code;
2273
2275
  return ret;
@@ -2933,6 +2935,10 @@ function __wbg_get_imports() {
2933
2935
  const ret = arg0.listTokensOutputs();
2934
2936
  return ret;
2935
2937
  }, arguments); },
2938
+ __wbg_listWatchedDepositAddresses_55fe8af0643e3ea9: function() { return handleError(function (arg0) {
2939
+ const ret = arg0.listWatchedDepositAddresses();
2940
+ return ret;
2941
+ }, arguments); },
2936
2942
  __wbg_log_cf86719f8acabfda: function(arg0, arg1) {
2937
2943
  arg0.log(arg1);
2938
2944
  },
@@ -3246,10 +3252,6 @@ function __wbg_get_imports() {
3246
3252
  const ret = arg0.setCrossChainSwap(arg1);
3247
3253
  return ret;
3248
3254
  }, arguments); },
3249
- __wbg_setInterval_2aba203c2a1ea83f: function(arg0, arg1) {
3250
- const ret = globalThis.setInterval(arg0, arg1);
3251
- return ret;
3252
- },
3253
3255
  __wbg_setLeaves_3a013e3266762f4b: function() { return handleError(function (arg0, arg1, arg2, arg3) {
3254
3256
  const ret = arg0.setLeaves(arg1, arg2, arg3);
3255
3257
  return ret;
@@ -3636,6 +3638,18 @@ function __wbg_get_imports() {
3636
3638
  const ret = arg0.updateTokenOutputs(arg1, arg2);
3637
3639
  return ret;
3638
3640
  }, arguments); },
3641
+ __wbg_updateWatchedDepositAddress_260322f77dee1443: function() { return handleError(function (arg0, arg1, arg2, arg3) {
3642
+ let deferred0_0;
3643
+ let deferred0_1;
3644
+ try {
3645
+ deferred0_0 = arg1;
3646
+ deferred0_1 = arg2;
3647
+ const ret = arg0.updateWatchedDepositAddress(getStringFromWasm0(arg1, arg2), arg3);
3648
+ return ret;
3649
+ } finally {
3650
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3651
+ }
3652
+ }, arguments); },
3639
3653
  __wbg_url_68fd9a221360e0db: function(arg0, arg1) {
3640
3654
  const ret = arg1.url;
3641
3655
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -3671,131 +3685,116 @@ function __wbg_get_imports() {
3671
3685
  return ret;
3672
3686
  },
3673
3687
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
3674
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 22, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3675
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522);
3688
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3689
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a);
3676
3690
  return ret;
3677
3691
  },
3678
3692
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
3679
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3680
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2);
3693
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3694
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25);
3681
3695
  return ret;
3682
3696
  },
3683
3697
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
3684
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3685
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_2);
3698
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3699
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2);
3686
3700
  return ret;
3687
3701
  },
3688
3702
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
3689
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3690
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_3);
3703
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3704
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3);
3691
3705
  return ret;
3692
3706
  },
3693
3707
  __wbindgen_cast_0000000000000005: function(arg0, arg1) {
3694
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3695
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4);
3708
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("SessionStore")], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3709
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4);
3696
3710
  return ret;
3697
3711
  },
3698
3712
  __wbindgen_cast_0000000000000006: function(arg0, arg1) {
3699
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 400, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3700
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5);
3713
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Storage")], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3714
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5);
3701
3715
  return ret;
3702
3716
  },
3703
3717
  __wbindgen_cast_0000000000000007: function(arg0, arg1) {
3704
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("SessionStore")], shim_idx: 22, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3705
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6);
3718
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TokenStore")], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3719
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6);
3706
3720
  return ret;
3707
3721
  },
3708
3722
  __wbindgen_cast_0000000000000008: function(arg0, arg1) {
3709
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Storage")], shim_idx: 22, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3710
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7);
3723
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TreeStore")], shim_idx: 21, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3724
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7);
3711
3725
  return ret;
3712
3726
  },
3713
3727
  __wbindgen_cast_0000000000000009: function(arg0, arg1) {
3714
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TokenStore")], shim_idx: 22, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3715
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_8);
3716
- return ret;
3717
- },
3718
- __wbindgen_cast_000000000000000a: function(arg0, arg1) {
3719
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("TreeStore")], shim_idx: 22, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3720
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_9);
3721
- return ret;
3722
- },
3723
- __wbindgen_cast_000000000000000b: function(arg0, arg1) {
3724
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3728
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 409, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3725
3729
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7);
3726
3730
  return ret;
3727
3731
  },
3728
- __wbindgen_cast_000000000000000c: function(arg0, arg1) {
3729
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 434, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
3730
- const ret = makeClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e);
3731
- return ret;
3732
- },
3733
- __wbindgen_cast_000000000000000d: function(arg0) {
3732
+ __wbindgen_cast_000000000000000a: function(arg0) {
3734
3733
  // Cast intrinsic for `F64 -> Externref`.
3735
3734
  const ret = arg0;
3736
3735
  return ret;
3737
3736
  },
3738
- __wbindgen_cast_000000000000000e: function(arg0) {
3737
+ __wbindgen_cast_000000000000000b: function(arg0) {
3739
3738
  // Cast intrinsic for `I64 -> Externref`.
3740
3739
  const ret = arg0;
3741
3740
  return ret;
3742
3741
  },
3743
- __wbindgen_cast_000000000000000f: function(arg0, arg1) {
3742
+ __wbindgen_cast_000000000000000c: function(arg0, arg1) {
3744
3743
  // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
3745
3744
  const ret = getArrayU8FromWasm0(arg0, arg1);
3746
3745
  return ret;
3747
3746
  },
3748
- __wbindgen_cast_0000000000000010: function(arg0, arg1) {
3747
+ __wbindgen_cast_000000000000000d: function(arg0, arg1) {
3749
3748
  // Cast intrinsic for `Ref(String) -> Externref`.
3750
3749
  const ret = getStringFromWasm0(arg0, arg1);
3751
3750
  return ret;
3752
3751
  },
3753
- __wbindgen_cast_0000000000000011: function(arg0, arg1) {
3752
+ __wbindgen_cast_000000000000000e: function(arg0, arg1) {
3754
3753
  // Cast intrinsic for `U128 -> Externref`.
3755
3754
  const ret = (BigInt.asUintN(64, arg0) | (BigInt.asUintN(64, arg1) << BigInt(64)));
3756
3755
  return ret;
3757
3756
  },
3758
- __wbindgen_cast_0000000000000012: function(arg0) {
3757
+ __wbindgen_cast_000000000000000f: function(arg0) {
3759
3758
  // Cast intrinsic for `U64 -> Externref`.
3760
3759
  const ret = BigInt.asUintN(64, arg0);
3761
3760
  return ret;
3762
3761
  },
3763
- __wbindgen_cast_0000000000000013: function(arg0, arg1) {
3762
+ __wbindgen_cast_0000000000000010: function(arg0, arg1) {
3764
3763
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3765
3764
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3766
3765
  // Cast intrinsic for `Vector(NamedExternref("Contact")) -> Externref`.
3767
3766
  const ret = v0;
3768
3767
  return ret;
3769
3768
  },
3770
- __wbindgen_cast_0000000000000014: function(arg0, arg1) {
3769
+ __wbindgen_cast_0000000000000011: function(arg0, arg1) {
3771
3770
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3772
3771
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3773
3772
  // Cast intrinsic for `Vector(NamedExternref("CrossChainRoutePair")) -> Externref`.
3774
3773
  const ret = v0;
3775
3774
  return ret;
3776
3775
  },
3777
- __wbindgen_cast_0000000000000015: function(arg0, arg1) {
3776
+ __wbindgen_cast_0000000000000012: function(arg0, arg1) {
3778
3777
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3779
3778
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3780
3779
  // Cast intrinsic for `Vector(NamedExternref("ExternalFrostShareResult")) -> Externref`.
3781
3780
  const ret = v0;
3782
3781
  return ret;
3783
3782
  },
3784
- __wbindgen_cast_0000000000000016: function(arg0, arg1) {
3783
+ __wbindgen_cast_0000000000000013: function(arg0, arg1) {
3785
3784
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3786
3785
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3787
3786
  // Cast intrinsic for `Vector(NamedExternref("Webhook")) -> Externref`.
3788
3787
  const ret = v0;
3789
3788
  return ret;
3790
3789
  },
3791
- __wbindgen_cast_0000000000000017: function(arg0, arg1) {
3790
+ __wbindgen_cast_0000000000000014: function(arg0, arg1) {
3792
3791
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3793
3792
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3794
3793
  // Cast intrinsic for `Vector(NamedExternref("string")) -> Externref`.
3795
3794
  const ret = v0;
3796
3795
  return ret;
3797
3796
  },
3798
- __wbindgen_cast_0000000000000018: function(arg0, arg1) {
3797
+ __wbindgen_cast_0000000000000015: function(arg0, arg1) {
3799
3798
  var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
3800
3799
  wasm.__wbindgen_free(arg0, arg1 * 1, 1);
3801
3800
  // Cast intrinsic for `Vector(U8) -> Externref`.
@@ -3822,60 +3821,48 @@ function wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7(arg0, arg
3822
3821
  wasm.wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7(arg0, arg1);
3823
3822
  }
3824
3823
 
3825
- function wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e(arg0, arg1) {
3826
- wasm.wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e(arg0, arg1);
3824
+ function wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25(arg0, arg1, arg2) {
3825
+ wasm.wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25(arg0, arg1, arg2);
3827
3826
  }
3828
3827
 
3829
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2(arg0, arg1, arg2) {
3830
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2(arg0, arg1, arg2);
3828
+ function wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2(arg0, arg1, arg2) {
3829
+ wasm.wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2(arg0, arg1, arg2);
3831
3830
  }
3832
3831
 
3833
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_2(arg0, arg1, arg2) {
3834
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_2(arg0, arg1, arg2);
3832
+ function wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3(arg0, arg1, arg2) {
3833
+ wasm.wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3(arg0, arg1, arg2);
3835
3834
  }
3836
3835
 
3837
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_3(arg0, arg1, arg2) {
3838
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_3(arg0, arg1, arg2);
3839
- }
3840
-
3841
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4(arg0, arg1, arg2) {
3842
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4(arg0, arg1, arg2);
3843
- }
3844
-
3845
- function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5(arg0, arg1, arg2) {
3846
- wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5(arg0, arg1, arg2);
3847
- }
3848
-
3849
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522(arg0, arg1, arg2) {
3850
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522(arg0, arg1, arg2);
3836
+ function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a(arg0, arg1, arg2) {
3837
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a(arg0, arg1, arg2);
3851
3838
  if (ret[1]) {
3852
3839
  throw takeFromExternrefTable0(ret[0]);
3853
3840
  }
3854
3841
  }
3855
3842
 
3856
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6(arg0, arg1, arg2) {
3857
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6(arg0, arg1, arg2);
3843
+ function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4(arg0, arg1, arg2) {
3844
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4(arg0, arg1, arg2);
3858
3845
  if (ret[1]) {
3859
3846
  throw takeFromExternrefTable0(ret[0]);
3860
3847
  }
3861
3848
  }
3862
3849
 
3863
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7(arg0, arg1, arg2) {
3864
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7(arg0, arg1, arg2);
3850
+ function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5(arg0, arg1, arg2) {
3851
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5(arg0, arg1, arg2);
3865
3852
  if (ret[1]) {
3866
3853
  throw takeFromExternrefTable0(ret[0]);
3867
3854
  }
3868
3855
  }
3869
3856
 
3870
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_8(arg0, arg1, arg2) {
3871
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_8(arg0, arg1, arg2);
3857
+ function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6(arg0, arg1, arg2) {
3858
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6(arg0, arg1, arg2);
3872
3859
  if (ret[1]) {
3873
3860
  throw takeFromExternrefTable0(ret[0]);
3874
3861
  }
3875
3862
  }
3876
3863
 
3877
- function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_9(arg0, arg1, arg2) {
3878
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_9(arg0, arg1, arg2);
3864
+ function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7(arg0, arg1, arg2) {
3865
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7(arg0, arg1, arg2);
3879
3866
  if (ret[1]) {
3880
3867
  throw takeFromExternrefTable0(ret[0]);
3881
3868
  }
@@ -4090,31 +4077,6 @@ function isLikeNone(x) {
4090
4077
  return x === undefined || x === null;
4091
4078
  }
4092
4079
 
4093
- function makeClosure(arg0, arg1, f) {
4094
- const state = { a: arg0, b: arg1, cnt: 1 };
4095
- const real = (...args) => {
4096
-
4097
- // First up with a closure we increment the internal reference
4098
- // count. This ensures that the Rust closure environment won't
4099
- // be deallocated while we're invoking it.
4100
- state.cnt++;
4101
- try {
4102
- return f(state.a, state.b, ...args);
4103
- } finally {
4104
- real._wbg_cb_unref();
4105
- }
4106
- };
4107
- real._wbg_cb_unref = () => {
4108
- if (--state.cnt === 0) {
4109
- wasm.__wbindgen_destroy_closure(state.a, state.b);
4110
- state.a = 0;
4111
- CLOSURE_DTORS.unregister(state);
4112
- }
4113
- };
4114
- CLOSURE_DTORS.register(real, state, state);
4115
- return real;
4116
- }
4117
-
4118
4080
  function makeMutClosure(arg0, arg1, f) {
4119
4081
  const state = { a: arg0, b: arg1, cnt: 1 };
4120
4082
  const real = (...args) => {
Binary file
@@ -28,6 +28,7 @@ export const breezsdk_buildUnsignedTransferPackage: (a: number, b: any) => any;
28
28
  export const breezsdk_buyBitcoin: (a: number, b: any) => any;
29
29
  export const breezsdk_checkLightningAddressAvailable: (a: number, b: any) => any;
30
30
  export const breezsdk_checkMessage: (a: number, b: any) => any;
31
+ export const breezsdk_checkUnilateralExit: (a: number, b: any) => any;
31
32
  export const breezsdk_claimDeposit: (a: number, b: any) => any;
32
33
  export const breezsdk_claimHtlcPayment: (a: number, b: any) => any;
33
34
  export const breezsdk_claimLightningAddressTransfer: (a: number, b: any) => any;
@@ -188,19 +189,16 @@ export const __wbg_externalsparksignerhandle_free: (a: number, b: number) => voi
188
189
  export const __wbg_signingonlyexternalsigners_free: (a: number, b: number) => void;
189
190
  export const signingonlyexternalsigners_breezSigner: (a: number) => number;
190
191
  export const signingonlyexternalsigners_sparkSigner: (a: number) => number;
191
- export const wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522: (a: number, b: number, c: any) => [number, number];
192
- export const wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_6: (a: number, b: number, c: any) => [number, number];
193
- export const wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_7: (a: number, b: number, c: any) => [number, number];
194
- export const wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_8: (a: number, b: number, c: any) => [number, number];
195
- export const wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_9: (a: number, b: number, c: any) => [number, number];
192
+ export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a: (a: number, b: number, c: any) => [number, number];
193
+ export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4: (a: number, b: number, c: any) => [number, number];
194
+ export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5: (a: number, b: number, c: any) => [number, number];
195
+ export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6: (a: number, b: number, c: any) => [number, number];
196
+ export const wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7: (a: number, b: number, c: any) => [number, number];
196
197
  export const wasm_bindgen__convert__closures_____invoke__h41057d61edf43a32: (a: number, b: number, c: any, d: any) => void;
197
- export const wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2: (a: number, b: number, c: any) => void;
198
- export const wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_2: (a: number, b: number, c: any) => void;
199
- export const wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_3: (a: number, b: number, c: any) => void;
200
- export const wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4: (a: number, b: number, c: any) => void;
201
- export const wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5: (a: number, b: number, c: any) => void;
198
+ export const wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25: (a: number, b: number, c: any) => void;
199
+ export const wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2: (a: number, b: number, c: any) => void;
200
+ export const wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3: (a: number, b: number, c: any) => void;
202
201
  export const wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7: (a: number, b: number) => void;
203
- export const wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e: (a: number, b: number) => void;
204
202
  export const __wbindgen_malloc: (a: number, b: number) => number;
205
203
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
206
204
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
@@ -801,7 +801,7 @@ class MysqlStorage {
801
801
  async listDeposits() {
802
802
  try {
803
803
  const [rows] = await this.pool.query(
804
- "SELECT txid, vout, amount_sats, is_mature, claim_error, refund_tx, refund_tx_id, instant_claim_status, refund_state FROM brz_unclaimed_deposits WHERE user_id = ?",
804
+ "SELECT txid, vout, amount_sats, is_mature, claim_error, refund_tx, refund_tx_id, instant_claim_status, refund_state, max_claim_fee FROM brz_unclaimed_deposits WHERE user_id = ?",
805
805
  [this.identity]
806
806
  );
807
807
 
@@ -816,6 +816,7 @@ class MysqlStorage {
816
816
  refundTxId: row.refund_tx_id,
817
817
  instantClaimStatus: parseJson(row.instant_claim_status),
818
818
  refundState: parseJson(row.refund_state),
819
+ maxClaimFee: parseJson(row.max_claim_fee),
819
820
  }));
820
821
  } catch (error) {
821
822
  throw new StorageError(
@@ -868,6 +869,18 @@ class MysqlStorage {
868
869
  payload.refundTxid,
869
870
  ]
870
871
  );
872
+ } else if (payload.type === "maxClaimFee") {
873
+ await this.pool.query(
874
+ `UPDATE brz_unclaimed_deposits
875
+ SET max_claim_fee = ?
876
+ WHERE user_id = ? AND txid = ? AND vout = ?`,
877
+ [
878
+ payload.maxFee ? JSON.stringify(payload.maxFee) : null,
879
+ this.identity,
880
+ txid,
881
+ vout,
882
+ ]
883
+ );
871
884
  } else {
872
885
  throw new StorageError(`Unknown payload type: ${payload.type}`);
873
886
  }
@@ -880,6 +893,59 @@ class MysqlStorage {
880
893
  }
881
894
  }
882
895
 
896
+ async listWatchedDepositAddresses() {
897
+ try {
898
+ const [rows] = await this.pool.query(
899
+ `SELECT address, issued_at, seen FROM brz_watched_deposit_addresses
900
+ WHERE user_id = ? ORDER BY issued_at DESC`,
901
+ [this.identity]
902
+ );
903
+ return rows.map((row) => ({
904
+ address: row.address,
905
+ issuedAt: BigInt(row.issued_at),
906
+ seen: toBool(row.seen) ?? false,
907
+ }));
908
+ } catch (error) {
909
+ throw new StorageError(
910
+ `Failed to list watched deposit addresses: ${error.message}`,
911
+ error
912
+ );
913
+ }
914
+ }
915
+
916
+ async updateWatchedDepositAddress(address, payload) {
917
+ try {
918
+ if (payload.type === "watch") {
919
+ await this.pool.query(
920
+ `INSERT INTO brz_watched_deposit_addresses (user_id, address, issued_at, seen)
921
+ VALUES (?, ?, ?, FALSE)
922
+ ON DUPLICATE KEY UPDATE issued_at = VALUES(issued_at), seen = FALSE`,
923
+ [this.identity, address, String(payload.issuedAt)]
924
+ );
925
+ } else if (payload.type === "seen") {
926
+ await this.pool.query(
927
+ `UPDATE brz_watched_deposit_addresses SET seen = TRUE
928
+ WHERE user_id = ? AND address = ?`,
929
+ [this.identity, address]
930
+ );
931
+ } else if (payload.type === "unwatch") {
932
+ await this.pool.query(
933
+ `DELETE FROM brz_watched_deposit_addresses
934
+ WHERE user_id = ? AND address = ? AND issued_at = ?`,
935
+ [this.identity, address, String(payload.issuedAt)]
936
+ );
937
+ } else {
938
+ throw new StorageError(`Unknown payload type: ${payload.type}`);
939
+ }
940
+ } catch (error) {
941
+ if (error instanceof StorageError) throw error;
942
+ throw new StorageError(
943
+ `Failed to update watched deposit address '${address}': ${error.message}`,
944
+ error
945
+ );
946
+ }
947
+ }
948
+
883
949
  async setLnurlMetadata(metadata) {
884
950
  try {
885
951
  await this._withTransaction(async (conn) => {
@@ -584,6 +584,29 @@ class MysqlMigrationManager {
584
584
  `ALTER TABLE brz_unclaimed_deposits ADD COLUMN refund_state JSON NULL`,
585
585
  ],
586
586
  },
587
+ {
588
+ // Deposit addresses polled on-chain for deposits still in the mempool.
589
+ // Rows are removed once watching them can no longer lead to an early
590
+ // claim, so the table holds only the live watch set.
591
+ name: "Add brz_watched_deposit_addresses",
592
+ sql: [
593
+ `CREATE TABLE IF NOT EXISTS brz_watched_deposit_addresses (
594
+ user_id VARBINARY(33) NOT NULL,
595
+ address VARCHAR(255) NOT NULL,
596
+ issued_at BIGINT NOT NULL,
597
+ seen BOOLEAN NOT NULL DEFAULT FALSE,
598
+ PRIMARY KEY (user_id, address)
599
+ )`,
600
+ ],
601
+ },
602
+ {
603
+ // The fee ceiling standing for one deposit as a JSON-encoded MaxFee,
604
+ // overriding the configured one. NULL when the configured one applies.
605
+ name: "Add max claim fee to brz_unclaimed_deposits",
606
+ sql: [
607
+ `ALTER TABLE brz_unclaimed_deposits ADD COLUMN max_claim_fee JSON NULL`,
608
+ ],
609
+ },
587
610
  ];
588
611
  }
589
612
  }
@@ -441,9 +441,9 @@ class MysqlTreeStore {
441
441
  async getVerifiedLeafKeys() {
442
442
  try {
443
443
  // Project just the two pubkeys out of the JSON, skipping each leaf's
444
- // `data` blob (up to five transactions). The filter matches the verified
445
- // categories the SDK expects: every reserved leaf plus every Available
446
- // one, and nothing non-Available and unreserved.
444
+ // `data` blob (up to five transactions). Every stored leaf passed the
445
+ // ownership check on its way in, whatever its status, so all are
446
+ // projected.
447
447
  const [rows] = await this.pool.query(
448
448
  `SELECT l.id AS id,
449
449
  l.verifying_public_key AS verifying,
@@ -451,8 +451,7 @@ class MysqlTreeStore {
451
451
  FROM brz_tree_leaves l
452
452
  LEFT JOIN brz_tree_reservations r
453
453
  ON l.reservation_id = r.id AND l.user_id = r.user_id
454
- WHERE l.user_id = ?
455
- AND (r.purpose IS NOT NULL OR l.status = 'Available')`,
454
+ WHERE l.user_id = ?`,
456
455
  [this.identity]
457
456
  );
458
457
  return rows.map((row) => [row.id, row.verifying, row.keyshare]);
@@ -730,7 +730,7 @@ class PostgresStorage {
730
730
  async listDeposits() {
731
731
  try {
732
732
  const result = await this.pool.query(
733
- "SELECT txid, vout, amount_sats, is_mature, claim_error, refund_tx, refund_tx_id, instant_claim_status, refund_state FROM brz_unclaimed_deposits WHERE user_id = $1",
733
+ "SELECT txid, vout, amount_sats, is_mature, claim_error, refund_tx, refund_tx_id, instant_claim_status, refund_state, max_claim_fee FROM brz_unclaimed_deposits WHERE user_id = $1",
734
734
  [this.identity]
735
735
  );
736
736
 
@@ -744,6 +744,7 @@ class PostgresStorage {
744
744
  refundTxId: row.refund_tx_id,
745
745
  instantClaimStatus: row.instant_claim_status || null,
746
746
  refundState: row.refund_state || null,
747
+ maxClaimFee: row.max_claim_fee || null,
747
748
  }));
748
749
  } catch (error) {
749
750
  throw new StorageError(
@@ -796,6 +797,18 @@ class PostgresStorage {
796
797
  payload.refundTxid,
797
798
  ]
798
799
  );
800
+ } else if (payload.type === "maxClaimFee") {
801
+ await this.pool.query(
802
+ `UPDATE brz_unclaimed_deposits
803
+ SET max_claim_fee = $1
804
+ WHERE user_id = $2 AND txid = $3 AND vout = $4`,
805
+ [
806
+ payload.maxFee ? JSON.stringify(payload.maxFee) : null,
807
+ this.identity,
808
+ txid,
809
+ vout,
810
+ ]
811
+ );
799
812
  } else {
800
813
  throw new StorageError(`Unknown payload type: ${payload.type}`);
801
814
  }
@@ -808,6 +821,59 @@ class PostgresStorage {
808
821
  }
809
822
  }
810
823
 
824
+ async listWatchedDepositAddresses() {
825
+ try {
826
+ const result = await this.pool.query(
827
+ `SELECT address, issued_at, seen FROM brz_watched_deposit_addresses
828
+ WHERE user_id = $1 ORDER BY issued_at DESC`,
829
+ [this.identity]
830
+ );
831
+ return result.rows.map((row) => ({
832
+ address: row.address,
833
+ issuedAt: BigInt(row.issued_at),
834
+ seen: row.seen ?? false,
835
+ }));
836
+ } catch (error) {
837
+ throw new StorageError(
838
+ `Failed to list watched deposit addresses: ${error.message}`,
839
+ error
840
+ );
841
+ }
842
+ }
843
+
844
+ async updateWatchedDepositAddress(address, payload) {
845
+ try {
846
+ if (payload.type === "watch") {
847
+ await this.pool.query(
848
+ `INSERT INTO brz_watched_deposit_addresses (user_id, address, issued_at, seen)
849
+ VALUES ($1, $2, $3, FALSE)
850
+ ON CONFLICT(user_id, address) DO UPDATE SET issued_at = EXCLUDED.issued_at, seen = FALSE`,
851
+ [this.identity, address, String(payload.issuedAt)]
852
+ );
853
+ } else if (payload.type === "seen") {
854
+ await this.pool.query(
855
+ `UPDATE brz_watched_deposit_addresses SET seen = TRUE
856
+ WHERE user_id = $1 AND address = $2`,
857
+ [this.identity, address]
858
+ );
859
+ } else if (payload.type === "unwatch") {
860
+ await this.pool.query(
861
+ `DELETE FROM brz_watched_deposit_addresses
862
+ WHERE user_id = $1 AND address = $2 AND issued_at = $3`,
863
+ [this.identity, address, String(payload.issuedAt)]
864
+ );
865
+ } else {
866
+ throw new StorageError(`Unknown payload type: ${payload.type}`);
867
+ }
868
+ } catch (error) {
869
+ if (error instanceof StorageError) throw error;
870
+ throw new StorageError(
871
+ `Failed to update watched deposit address '${address}': ${error.message}`,
872
+ error
873
+ );
874
+ }
875
+ }
876
+
811
877
  async setLnurlMetadata(metadata) {
812
878
  try {
813
879
  await this._withTransaction(async (client) => {
@@ -540,6 +540,29 @@ class PostgresMigrationManager {
540
540
  `ALTER TABLE brz_unclaimed_deposits ADD COLUMN refund_state JSONB`,
541
541
  ],
542
542
  },
543
+ {
544
+ // Deposit addresses polled on-chain for deposits still in the mempool.
545
+ // Rows are removed once watching them can no longer lead to an early
546
+ // claim, so the table holds only the live watch set.
547
+ name: "Add brz_watched_deposit_addresses",
548
+ sql: [
549
+ `CREATE TABLE IF NOT EXISTS brz_watched_deposit_addresses (
550
+ user_id BYTEA NOT NULL,
551
+ address TEXT NOT NULL,
552
+ issued_at BIGINT NOT NULL,
553
+ seen BOOLEAN NOT NULL DEFAULT FALSE,
554
+ PRIMARY KEY (user_id, address)
555
+ )`,
556
+ ],
557
+ },
558
+ {
559
+ // The fee ceiling standing for one deposit as a JSON-encoded MaxFee,
560
+ // overriding the configured one. NULL when the configured one applies.
561
+ name: "Add max claim fee to brz_unclaimed_deposits",
562
+ sql: [
563
+ `ALTER TABLE brz_unclaimed_deposits ADD COLUMN max_claim_fee JSONB`,
564
+ ],
565
+ },
543
566
  ];
544
567
  }
545
568
  }