@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.
- package/breez-sdk-spark.tgz +0 -0
- package/bundler/breez_sdk_spark_wasm.d.ts +108 -17
- package/bundler/breez_sdk_spark_wasm_bg.js +69 -107
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +9 -11
- package/bundler/storage/index.js +145 -1
- package/bundler/tree-store/index.js +10 -23
- package/deno/breez_sdk_spark_wasm.d.ts +108 -17
- package/deno/breez_sdk_spark_wasm.js +69 -107
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +9 -11
- package/nodejs/breez_sdk_spark_wasm.d.ts +108 -17
- package/nodejs/breez_sdk_spark_wasm.js +69 -107
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +9 -11
- package/nodejs/mysql-storage/index.cjs +67 -1
- package/nodejs/mysql-storage/migrations.cjs +23 -0
- package/nodejs/mysql-tree-store/index.cjs +4 -5
- package/nodejs/postgres-storage/index.cjs +67 -1
- package/nodejs/postgres-storage/migrations.cjs +23 -0
- package/nodejs/postgres-tree-store/index.cjs +3 -4
- package/nodejs/storage/index.cjs +81 -1
- package/nodejs/storage/migrations.cjs +21 -0
- package/nodejs/tree-store/index.cjs +1 -3
- package/package.json +1 -1
- package/web/breez_sdk_spark_wasm.d.ts +117 -28
- package/web/breez_sdk_spark_wasm.js +69 -107
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +9 -11
- package/web/storage/index.js +145 -1
- package/web/tree-store/index.js +10 -23
|
@@ -190,6 +190,14 @@ export class BreezSdk {
|
|
|
190
190
|
const ret = wasm.breezsdk_checkMessage(this.__wbg_ptr, request);
|
|
191
191
|
return ret;
|
|
192
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* @param {CheckUnilateralExitRequest} request
|
|
195
|
+
* @returns {Promise<CheckUnilateralExitResponse>}
|
|
196
|
+
*/
|
|
197
|
+
checkUnilateralExit(request) {
|
|
198
|
+
const ret = wasm.breezsdk_checkUnilateralExit(this.__wbg_ptr, request);
|
|
199
|
+
return ret;
|
|
200
|
+
}
|
|
193
201
|
/**
|
|
194
202
|
* @param {ClaimDepositRequest} request
|
|
195
203
|
* @returns {Promise<ClaimDepositResponse>}
|
|
@@ -2201,9 +2209,6 @@ export function __wbg_catch_f939343cb181958c(arg0, arg1) {
|
|
|
2201
2209
|
const ret = arg0.catch(arg1);
|
|
2202
2210
|
return ret;
|
|
2203
2211
|
}
|
|
2204
|
-
export function __wbg_clearInterval_d25b0cf526eff7ae(arg0) {
|
|
2205
|
-
globalThis.clearInterval(arg0);
|
|
2206
|
-
}
|
|
2207
2212
|
export function __wbg_clearTimeout_113b1cde814ec762(arg0) {
|
|
2208
2213
|
const ret = clearTimeout(arg0);
|
|
2209
2214
|
return ret;
|
|
@@ -2221,9 +2226,6 @@ export function __wbg_close_931d0c62e2aab92c() { return handleError(function (ar
|
|
|
2221
2226
|
export function __wbg_close_de471367367aa5cb() { return handleError(function (arg0) {
|
|
2222
2227
|
arg0.close();
|
|
2223
2228
|
}, arguments); }
|
|
2224
|
-
export function __wbg_close_f1af935d7d7cec78() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2225
|
-
arg0.close(arg1, getStringFromWasm0(arg2, arg3));
|
|
2226
|
-
}, arguments); }
|
|
2227
2229
|
export function __wbg_code_be6f339819ebb2c4(arg0) {
|
|
2228
2230
|
const ret = arg0.code;
|
|
2229
2231
|
return ret;
|
|
@@ -2889,6 +2891,10 @@ export function __wbg_listTokensOutputs_3fecc3251ae7b71c() { return handleError(
|
|
|
2889
2891
|
const ret = arg0.listTokensOutputs();
|
|
2890
2892
|
return ret;
|
|
2891
2893
|
}, arguments); }
|
|
2894
|
+
export function __wbg_listWatchedDepositAddresses_55fe8af0643e3ea9() { return handleError(function (arg0) {
|
|
2895
|
+
const ret = arg0.listWatchedDepositAddresses();
|
|
2896
|
+
return ret;
|
|
2897
|
+
}, arguments); }
|
|
2892
2898
|
export function __wbg_log_cf86719f8acabfda(arg0, arg1) {
|
|
2893
2899
|
arg0.log(arg1);
|
|
2894
2900
|
}
|
|
@@ -3202,10 +3208,6 @@ export function __wbg_setCrossChainSwap_9047f4cc41fe2eca() { return handleError(
|
|
|
3202
3208
|
const ret = arg0.setCrossChainSwap(arg1);
|
|
3203
3209
|
return ret;
|
|
3204
3210
|
}, arguments); }
|
|
3205
|
-
export function __wbg_setInterval_2aba203c2a1ea83f(arg0, arg1) {
|
|
3206
|
-
const ret = globalThis.setInterval(arg0, arg1);
|
|
3207
|
-
return ret;
|
|
3208
|
-
}
|
|
3209
3211
|
export function __wbg_setLeaves_3a013e3266762f4b() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
3210
3212
|
const ret = arg0.setLeaves(arg1, arg2, arg3);
|
|
3211
3213
|
return ret;
|
|
@@ -3592,6 +3594,18 @@ export function __wbg_updateTokenOutputs_d978e01c817e8230() { return handleError
|
|
|
3592
3594
|
const ret = arg0.updateTokenOutputs(arg1, arg2);
|
|
3593
3595
|
return ret;
|
|
3594
3596
|
}, arguments); }
|
|
3597
|
+
export function __wbg_updateWatchedDepositAddress_260322f77dee1443() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
3598
|
+
let deferred0_0;
|
|
3599
|
+
let deferred0_1;
|
|
3600
|
+
try {
|
|
3601
|
+
deferred0_0 = arg1;
|
|
3602
|
+
deferred0_1 = arg2;
|
|
3603
|
+
const ret = arg0.updateWatchedDepositAddress(getStringFromWasm0(arg1, arg2), arg3);
|
|
3604
|
+
return ret;
|
|
3605
|
+
} finally {
|
|
3606
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
3607
|
+
}
|
|
3608
|
+
}, arguments); }
|
|
3595
3609
|
export function __wbg_url_68fd9a221360e0db(arg0, arg1) {
|
|
3596
3610
|
const ret = arg1.url;
|
|
3597
3611
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -3627,131 +3641,116 @@ export function __wbg_wasmsdkcontext_new(arg0) {
|
|
|
3627
3641
|
return ret;
|
|
3628
3642
|
}
|
|
3629
3643
|
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
3630
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
3631
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3644
|
+
// 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`.
|
|
3645
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a);
|
|
3632
3646
|
return ret;
|
|
3633
3647
|
}
|
|
3634
3648
|
export function __wbindgen_cast_0000000000000002(arg0, arg1) {
|
|
3635
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
3636
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3649
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3650
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25);
|
|
3637
3651
|
return ret;
|
|
3638
3652
|
}
|
|
3639
3653
|
export function __wbindgen_cast_0000000000000003(arg0, arg1) {
|
|
3640
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx:
|
|
3641
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3654
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3655
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2);
|
|
3642
3656
|
return ret;
|
|
3643
3657
|
}
|
|
3644
3658
|
export function __wbindgen_cast_0000000000000004(arg0, arg1) {
|
|
3645
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("
|
|
3646
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3659
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3660
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3);
|
|
3647
3661
|
return ret;
|
|
3648
3662
|
}
|
|
3649
3663
|
export function __wbindgen_cast_0000000000000005(arg0, arg1) {
|
|
3650
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("
|
|
3651
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3664
|
+
// 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`.
|
|
3665
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4);
|
|
3652
3666
|
return ret;
|
|
3653
3667
|
}
|
|
3654
3668
|
export function __wbindgen_cast_0000000000000006(arg0, arg1) {
|
|
3655
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("
|
|
3656
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3669
|
+
// 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`.
|
|
3670
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5);
|
|
3657
3671
|
return ret;
|
|
3658
3672
|
}
|
|
3659
3673
|
export function __wbindgen_cast_0000000000000007(arg0, arg1) {
|
|
3660
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("
|
|
3661
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3674
|
+
// 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`.
|
|
3675
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6);
|
|
3662
3676
|
return ret;
|
|
3663
3677
|
}
|
|
3664
3678
|
export function __wbindgen_cast_0000000000000008(arg0, arg1) {
|
|
3665
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("
|
|
3666
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3679
|
+
// 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`.
|
|
3680
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7);
|
|
3667
3681
|
return ret;
|
|
3668
3682
|
}
|
|
3669
3683
|
export function __wbindgen_cast_0000000000000009(arg0, arg1) {
|
|
3670
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [
|
|
3671
|
-
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_8);
|
|
3672
|
-
return ret;
|
|
3673
|
-
}
|
|
3674
|
-
export function __wbindgen_cast_000000000000000a(arg0, arg1) {
|
|
3675
|
-
// 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`.
|
|
3676
|
-
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522_9);
|
|
3677
|
-
return ret;
|
|
3678
|
-
}
|
|
3679
|
-
export function __wbindgen_cast_000000000000000b(arg0, arg1) {
|
|
3680
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 405, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3684
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 409, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3681
3685
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7);
|
|
3682
3686
|
return ret;
|
|
3683
3687
|
}
|
|
3684
|
-
export function
|
|
3685
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 434, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
|
3686
|
-
const ret = makeClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h0fa3f876e31d2a3e);
|
|
3687
|
-
return ret;
|
|
3688
|
-
}
|
|
3689
|
-
export function __wbindgen_cast_000000000000000d(arg0) {
|
|
3688
|
+
export function __wbindgen_cast_000000000000000a(arg0) {
|
|
3690
3689
|
// Cast intrinsic for `F64 -> Externref`.
|
|
3691
3690
|
const ret = arg0;
|
|
3692
3691
|
return ret;
|
|
3693
3692
|
}
|
|
3694
|
-
export function
|
|
3693
|
+
export function __wbindgen_cast_000000000000000b(arg0) {
|
|
3695
3694
|
// Cast intrinsic for `I64 -> Externref`.
|
|
3696
3695
|
const ret = arg0;
|
|
3697
3696
|
return ret;
|
|
3698
3697
|
}
|
|
3699
|
-
export function
|
|
3698
|
+
export function __wbindgen_cast_000000000000000c(arg0, arg1) {
|
|
3700
3699
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
3701
3700
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
3702
3701
|
return ret;
|
|
3703
3702
|
}
|
|
3704
|
-
export function
|
|
3703
|
+
export function __wbindgen_cast_000000000000000d(arg0, arg1) {
|
|
3705
3704
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
3706
3705
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
3707
3706
|
return ret;
|
|
3708
3707
|
}
|
|
3709
|
-
export function
|
|
3708
|
+
export function __wbindgen_cast_000000000000000e(arg0, arg1) {
|
|
3710
3709
|
// Cast intrinsic for `U128 -> Externref`.
|
|
3711
3710
|
const ret = (BigInt.asUintN(64, arg0) | (BigInt.asUintN(64, arg1) << BigInt(64)));
|
|
3712
3711
|
return ret;
|
|
3713
3712
|
}
|
|
3714
|
-
export function
|
|
3713
|
+
export function __wbindgen_cast_000000000000000f(arg0) {
|
|
3715
3714
|
// Cast intrinsic for `U64 -> Externref`.
|
|
3716
3715
|
const ret = BigInt.asUintN(64, arg0);
|
|
3717
3716
|
return ret;
|
|
3718
3717
|
}
|
|
3719
|
-
export function
|
|
3718
|
+
export function __wbindgen_cast_0000000000000010(arg0, arg1) {
|
|
3720
3719
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
3721
3720
|
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
3722
3721
|
// Cast intrinsic for `Vector(NamedExternref("Contact")) -> Externref`.
|
|
3723
3722
|
const ret = v0;
|
|
3724
3723
|
return ret;
|
|
3725
3724
|
}
|
|
3726
|
-
export function
|
|
3725
|
+
export function __wbindgen_cast_0000000000000011(arg0, arg1) {
|
|
3727
3726
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
3728
3727
|
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
3729
3728
|
// Cast intrinsic for `Vector(NamedExternref("CrossChainRoutePair")) -> Externref`.
|
|
3730
3729
|
const ret = v0;
|
|
3731
3730
|
return ret;
|
|
3732
3731
|
}
|
|
3733
|
-
export function
|
|
3732
|
+
export function __wbindgen_cast_0000000000000012(arg0, arg1) {
|
|
3734
3733
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
3735
3734
|
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
3736
3735
|
// Cast intrinsic for `Vector(NamedExternref("ExternalFrostShareResult")) -> Externref`.
|
|
3737
3736
|
const ret = v0;
|
|
3738
3737
|
return ret;
|
|
3739
3738
|
}
|
|
3740
|
-
export function
|
|
3739
|
+
export function __wbindgen_cast_0000000000000013(arg0, arg1) {
|
|
3741
3740
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
3742
3741
|
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
3743
3742
|
// Cast intrinsic for `Vector(NamedExternref("Webhook")) -> Externref`.
|
|
3744
3743
|
const ret = v0;
|
|
3745
3744
|
return ret;
|
|
3746
3745
|
}
|
|
3747
|
-
export function
|
|
3746
|
+
export function __wbindgen_cast_0000000000000014(arg0, arg1) {
|
|
3748
3747
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
3749
3748
|
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
3750
3749
|
// Cast intrinsic for `Vector(NamedExternref("string")) -> Externref`.
|
|
3751
3750
|
const ret = v0;
|
|
3752
3751
|
return ret;
|
|
3753
3752
|
}
|
|
3754
|
-
export function
|
|
3753
|
+
export function __wbindgen_cast_0000000000000015(arg0, arg1) {
|
|
3755
3754
|
var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
|
|
3756
3755
|
wasm.__wbindgen_free(arg0, arg1 * 1, 1);
|
|
3757
3756
|
// Cast intrinsic for `Vector(U8) -> Externref`.
|
|
@@ -3771,60 +3770,48 @@ function wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7(arg0, arg
|
|
|
3771
3770
|
wasm.wasm_bindgen__convert__closures_____invoke__h484cd36e13f37bd7(arg0, arg1);
|
|
3772
3771
|
}
|
|
3773
3772
|
|
|
3774
|
-
function
|
|
3775
|
-
wasm.
|
|
3773
|
+
function wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25(arg0, arg1, arg2) {
|
|
3774
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25(arg0, arg1, arg2);
|
|
3776
3775
|
}
|
|
3777
3776
|
|
|
3778
|
-
function
|
|
3779
|
-
wasm.
|
|
3777
|
+
function wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2(arg0, arg1, arg2) {
|
|
3778
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_2(arg0, arg1, arg2);
|
|
3780
3779
|
}
|
|
3781
3780
|
|
|
3782
|
-
function
|
|
3783
|
-
wasm.
|
|
3781
|
+
function wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3(arg0, arg1, arg2) {
|
|
3782
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h3b28fbbc8b451a25_3(arg0, arg1, arg2);
|
|
3784
3783
|
}
|
|
3785
3784
|
|
|
3786
|
-
function
|
|
3787
|
-
wasm.
|
|
3788
|
-
}
|
|
3789
|
-
|
|
3790
|
-
function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4(arg0, arg1, arg2) {
|
|
3791
|
-
wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_4(arg0, arg1, arg2);
|
|
3792
|
-
}
|
|
3793
|
-
|
|
3794
|
-
function wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5(arg0, arg1, arg2) {
|
|
3795
|
-
wasm.wasm_bindgen__convert__closures_____invoke__h3120db8c4a8a92b2_5(arg0, arg1, arg2);
|
|
3796
|
-
}
|
|
3797
|
-
|
|
3798
|
-
function wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522(arg0, arg1, arg2) {
|
|
3799
|
-
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h62bc116e0c266522(arg0, arg1, arg2);
|
|
3785
|
+
function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a(arg0, arg1, arg2) {
|
|
3786
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a(arg0, arg1, arg2);
|
|
3800
3787
|
if (ret[1]) {
|
|
3801
3788
|
throw takeFromExternrefTable0(ret[0]);
|
|
3802
3789
|
}
|
|
3803
3790
|
}
|
|
3804
3791
|
|
|
3805
|
-
function
|
|
3806
|
-
const ret = wasm.
|
|
3792
|
+
function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4(arg0, arg1, arg2) {
|
|
3793
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_4(arg0, arg1, arg2);
|
|
3807
3794
|
if (ret[1]) {
|
|
3808
3795
|
throw takeFromExternrefTable0(ret[0]);
|
|
3809
3796
|
}
|
|
3810
3797
|
}
|
|
3811
3798
|
|
|
3812
|
-
function
|
|
3813
|
-
const ret = wasm.
|
|
3799
|
+
function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5(arg0, arg1, arg2) {
|
|
3800
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_5(arg0, arg1, arg2);
|
|
3814
3801
|
if (ret[1]) {
|
|
3815
3802
|
throw takeFromExternrefTable0(ret[0]);
|
|
3816
3803
|
}
|
|
3817
3804
|
}
|
|
3818
3805
|
|
|
3819
|
-
function
|
|
3820
|
-
const ret = wasm.
|
|
3806
|
+
function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6(arg0, arg1, arg2) {
|
|
3807
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_6(arg0, arg1, arg2);
|
|
3821
3808
|
if (ret[1]) {
|
|
3822
3809
|
throw takeFromExternrefTable0(ret[0]);
|
|
3823
3810
|
}
|
|
3824
3811
|
}
|
|
3825
3812
|
|
|
3826
|
-
function
|
|
3827
|
-
const ret = wasm.
|
|
3813
|
+
function wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7(arg0, arg1, arg2) {
|
|
3814
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2f6500191cedbf1a_7(arg0, arg1, arg2);
|
|
3828
3815
|
if (ret[1]) {
|
|
3829
3816
|
throw takeFromExternrefTable0(ret[0]);
|
|
3830
3817
|
}
|
|
@@ -4039,31 +4026,6 @@ function isLikeNone(x) {
|
|
|
4039
4026
|
return x === undefined || x === null;
|
|
4040
4027
|
}
|
|
4041
4028
|
|
|
4042
|
-
function makeClosure(arg0, arg1, f) {
|
|
4043
|
-
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
4044
|
-
const real = (...args) => {
|
|
4045
|
-
|
|
4046
|
-
// First up with a closure we increment the internal reference
|
|
4047
|
-
// count. This ensures that the Rust closure environment won't
|
|
4048
|
-
// be deallocated while we're invoking it.
|
|
4049
|
-
state.cnt++;
|
|
4050
|
-
try {
|
|
4051
|
-
return f(state.a, state.b, ...args);
|
|
4052
|
-
} finally {
|
|
4053
|
-
real._wbg_cb_unref();
|
|
4054
|
-
}
|
|
4055
|
-
};
|
|
4056
|
-
real._wbg_cb_unref = () => {
|
|
4057
|
-
if (--state.cnt === 0) {
|
|
4058
|
-
wasm.__wbindgen_destroy_closure(state.a, state.b);
|
|
4059
|
-
state.a = 0;
|
|
4060
|
-
CLOSURE_DTORS.unregister(state);
|
|
4061
|
-
}
|
|
4062
|
-
};
|
|
4063
|
-
CLOSURE_DTORS.register(real, state, state);
|
|
4064
|
-
return real;
|
|
4065
|
-
}
|
|
4066
|
-
|
|
4067
4029
|
function makeMutClosure(arg0, arg1, f) {
|
|
4068
4030
|
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
4069
4031
|
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
|
|
192
|
-
export const
|
|
193
|
-
export const
|
|
194
|
-
export const
|
|
195
|
-
export const
|
|
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
|
|
198
|
-
export const
|
|
199
|
-
export const
|
|
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;
|
package/bundler/storage/index.js
CHANGED
|
@@ -611,6 +611,19 @@ class MigrationManager {
|
|
|
611
611
|
};
|
|
612
612
|
},
|
|
613
613
|
},
|
|
614
|
+
{
|
|
615
|
+
// Deposit addresses polled on-chain for deposits still in the mempool.
|
|
616
|
+
// Entries are removed once watching them can no longer lead to an early
|
|
617
|
+
// claim, so the store holds only the live watch set.
|
|
618
|
+
name: "Create watched_deposit_addresses store",
|
|
619
|
+
upgrade: (db) => {
|
|
620
|
+
if (!db.objectStoreNames.contains("watched_deposit_addresses")) {
|
|
621
|
+
db.createObjectStore("watched_deposit_addresses", {
|
|
622
|
+
keyPath: "address",
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
},
|
|
614
627
|
];
|
|
615
628
|
}
|
|
616
629
|
}
|
|
@@ -639,7 +652,7 @@ class IndexedDBStorage {
|
|
|
639
652
|
// so existing databases depend on indices never shifting. Never insert,
|
|
640
653
|
// reorder, or delete a migration — only append. dbVersion MUST equal the
|
|
641
654
|
// number of migrations (enforced by the guard in initialize()).
|
|
642
|
-
this.dbVersion =
|
|
655
|
+
this.dbVersion = 22; // Current schema version (= migration count)
|
|
643
656
|
}
|
|
644
657
|
|
|
645
658
|
/**
|
|
@@ -1445,6 +1458,7 @@ class IndexedDBStorage {
|
|
|
1445
1458
|
refundTxId: existing?.refundTxId ?? null,
|
|
1446
1459
|
instantClaimStatus: existing?.instantClaimStatus ?? null,
|
|
1447
1460
|
refundState: existing?.refundState ?? null,
|
|
1461
|
+
maxClaimFee: existing?.maxClaimFee ?? null,
|
|
1448
1462
|
};
|
|
1449
1463
|
|
|
1450
1464
|
const putRequest = store.put(depositToStore);
|
|
@@ -1521,6 +1535,7 @@ class IndexedDBStorage {
|
|
|
1521
1535
|
? JSON.parse(row.instantClaimStatus)
|
|
1522
1536
|
: null,
|
|
1523
1537
|
refundState: row.refundState ? JSON.parse(row.refundState) : null,
|
|
1538
|
+
maxClaimFee: row.maxClaimFee ? JSON.parse(row.maxClaimFee) : null,
|
|
1524
1539
|
}));
|
|
1525
1540
|
resolve(deposits);
|
|
1526
1541
|
};
|
|
@@ -1576,6 +1591,10 @@ class IndexedDBStorage {
|
|
|
1576
1591
|
if (existingDeposit.refundTxId === payload.refundTxid) {
|
|
1577
1592
|
updatedDeposit.refundState = JSON.stringify(payload.state);
|
|
1578
1593
|
}
|
|
1594
|
+
} else if (payload.type === "maxClaimFee") {
|
|
1595
|
+
updatedDeposit.maxClaimFee = payload.maxFee
|
|
1596
|
+
? JSON.stringify(payload.maxFee)
|
|
1597
|
+
: null;
|
|
1579
1598
|
} else {
|
|
1580
1599
|
reject(new StorageError(`Unknown payload type: ${payload.type}`));
|
|
1581
1600
|
return;
|
|
@@ -1606,6 +1625,131 @@ class IndexedDBStorage {
|
|
|
1606
1625
|
});
|
|
1607
1626
|
}
|
|
1608
1627
|
|
|
1628
|
+
async listWatchedDepositAddresses() {
|
|
1629
|
+
if (!this.db) {
|
|
1630
|
+
throw new StorageError("Database not initialized");
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
return new Promise((resolve, reject) => {
|
|
1634
|
+
const transaction = this.db.transaction(
|
|
1635
|
+
"watched_deposit_addresses",
|
|
1636
|
+
"readonly"
|
|
1637
|
+
);
|
|
1638
|
+
const store = transaction.objectStore("watched_deposit_addresses");
|
|
1639
|
+
const request = store.getAll();
|
|
1640
|
+
|
|
1641
|
+
request.onsuccess = () => {
|
|
1642
|
+
const watched = (request.result || []).map((entry) => ({
|
|
1643
|
+
address: entry.address,
|
|
1644
|
+
issuedAt: entry.issuedAt,
|
|
1645
|
+
seen: Boolean(entry.seen),
|
|
1646
|
+
}));
|
|
1647
|
+
// The store is keyed by address, so ordering is applied here rather
|
|
1648
|
+
// than by an index.
|
|
1649
|
+
watched.sort((a, b) => Number(b.issuedAt) - Number(a.issuedAt));
|
|
1650
|
+
resolve(watched);
|
|
1651
|
+
};
|
|
1652
|
+
request.onerror = () =>
|
|
1653
|
+
reject(
|
|
1654
|
+
new StorageError(
|
|
1655
|
+
`Failed to list watched deposit addresses: ${request.error}`
|
|
1656
|
+
)
|
|
1657
|
+
);
|
|
1658
|
+
});
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
async updateWatchedDepositAddress(address, payload) {
|
|
1662
|
+
if (!this.db) {
|
|
1663
|
+
throw new StorageError("Database not initialized");
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
return new Promise((resolve, reject) => {
|
|
1667
|
+
const transaction = this.db.transaction(
|
|
1668
|
+
"watched_deposit_addresses",
|
|
1669
|
+
"readwrite"
|
|
1670
|
+
);
|
|
1671
|
+
const store = transaction.objectStore("watched_deposit_addresses");
|
|
1672
|
+
|
|
1673
|
+
if (payload.type === "watch") {
|
|
1674
|
+
const request = store.put({
|
|
1675
|
+
address,
|
|
1676
|
+
issuedAt: payload.issuedAt,
|
|
1677
|
+
seen: false,
|
|
1678
|
+
});
|
|
1679
|
+
request.onsuccess = () => resolve();
|
|
1680
|
+
request.onerror = () =>
|
|
1681
|
+
reject(
|
|
1682
|
+
new StorageError(
|
|
1683
|
+
`Failed to watch deposit address '${address}': ${request.error}`
|
|
1684
|
+
)
|
|
1685
|
+
);
|
|
1686
|
+
return;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
if (payload.type === "unwatch") {
|
|
1690
|
+
// Conditional on issuedAt, so an address handed out again since the
|
|
1691
|
+
// caller read it is not retired by a decision taken before that. The
|
|
1692
|
+
// get and the delete share one readwrite transaction, so nothing can
|
|
1693
|
+
// interleave between them.
|
|
1694
|
+
const getRequest = store.get(address);
|
|
1695
|
+
getRequest.onsuccess = () => {
|
|
1696
|
+
const existing = getRequest.result;
|
|
1697
|
+
const stale =
|
|
1698
|
+
!existing || String(existing.issuedAt) !== String(payload.issuedAt);
|
|
1699
|
+
if (stale) {
|
|
1700
|
+
resolve();
|
|
1701
|
+
return;
|
|
1702
|
+
}
|
|
1703
|
+
const request = store.delete(address);
|
|
1704
|
+
request.onsuccess = () => resolve();
|
|
1705
|
+
request.onerror = () =>
|
|
1706
|
+
reject(
|
|
1707
|
+
new StorageError(
|
|
1708
|
+
`Failed to unwatch deposit address '${address}': ${request.error}`
|
|
1709
|
+
)
|
|
1710
|
+
);
|
|
1711
|
+
};
|
|
1712
|
+
getRequest.onerror = () =>
|
|
1713
|
+
reject(
|
|
1714
|
+
new StorageError(
|
|
1715
|
+
`Failed to read watched deposit address '${address}': ${getRequest.error}`
|
|
1716
|
+
)
|
|
1717
|
+
);
|
|
1718
|
+
return;
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
if (payload.type === "seen") {
|
|
1722
|
+
const getRequest = store.get(address);
|
|
1723
|
+
getRequest.onsuccess = () => {
|
|
1724
|
+
const existing = getRequest.result;
|
|
1725
|
+
if (!existing) {
|
|
1726
|
+
// Not watched, so there is nothing to mark (matches the SQL stores,
|
|
1727
|
+
// whose UPDATE affects no rows).
|
|
1728
|
+
resolve();
|
|
1729
|
+
return;
|
|
1730
|
+
}
|
|
1731
|
+
const request = store.put({ ...existing, seen: true });
|
|
1732
|
+
request.onsuccess = () => resolve();
|
|
1733
|
+
request.onerror = () =>
|
|
1734
|
+
reject(
|
|
1735
|
+
new StorageError(
|
|
1736
|
+
`Failed to mark deposit address '${address}' seen: ${request.error}`
|
|
1737
|
+
)
|
|
1738
|
+
);
|
|
1739
|
+
};
|
|
1740
|
+
getRequest.onerror = () =>
|
|
1741
|
+
reject(
|
|
1742
|
+
new StorageError(
|
|
1743
|
+
`Failed to read watched deposit address '${address}': ${getRequest.error}`
|
|
1744
|
+
)
|
|
1745
|
+
);
|
|
1746
|
+
return;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
reject(new StorageError(`Unknown payload type: ${payload.type}`));
|
|
1750
|
+
});
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1609
1753
|
async setLnurlMetadata(metadata) {
|
|
1610
1754
|
if (!this.db) {
|
|
1611
1755
|
throw new StorageError("Database not initialized");
|
|
@@ -522,31 +522,18 @@ class WebTreeStore {
|
|
|
522
522
|
|
|
523
523
|
async getVerifiedLeafKeys() {
|
|
524
524
|
try {
|
|
525
|
+
// Every stored leaf passed the ownership check on its way in, whatever
|
|
526
|
+
// its status, so all of them are projected.
|
|
525
527
|
return await this._txRun(
|
|
526
|
-
[STORE_LEAVES
|
|
528
|
+
[STORE_LEAVES],
|
|
527
529
|
"readonly",
|
|
528
|
-
[
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
for (const row of res.leaves) {
|
|
536
|
-
const hasReservation =
|
|
537
|
-
row.reservation_id != null && resIds.has(row.reservation_id);
|
|
538
|
-
// Every reserved leaf plus every Available one; nothing that is
|
|
539
|
-
// neither reserved nor Available.
|
|
540
|
-
if (hasReservation || row.status === "Available") {
|
|
541
|
-
out.push([
|
|
542
|
-
row.id,
|
|
543
|
-
row.verifying_public_key,
|
|
544
|
-
row.signing_public_key,
|
|
545
|
-
]);
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
return out;
|
|
549
|
-
}
|
|
530
|
+
[{ name: "leaves", store: STORE_LEAVES }],
|
|
531
|
+
(res) =>
|
|
532
|
+
res.leaves.map((row) => [
|
|
533
|
+
row.id,
|
|
534
|
+
row.verifying_public_key,
|
|
535
|
+
row.signing_public_key,
|
|
536
|
+
])
|
|
550
537
|
);
|
|
551
538
|
} catch (error) {
|
|
552
539
|
if (error instanceof TreeStoreError) throw error;
|