@lombard.finance/sdk 4.2.0 → 4.3.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/CHANGELOG.md +0 -94
- package/README.md +10 -59
- package/dist/api.cjs +1 -1
- package/dist/api.js +5 -5
- package/dist/bridge/lib/ccip-config.d.ts.map +1 -1
- package/dist/bridge/lib/config.d.ts +3 -3
- package/dist/bridge/lib/config.d.ts.map +1 -1
- package/dist/bridge.cjs +1 -1
- package/dist/bridge.js +1 -1
- package/dist/btc.cjs +1 -1
- package/dist/btc.js +2 -2
- package/dist/chunks/{BtcActions-D9eBmDj6.cjs → BtcActions-ByhBml_1.cjs} +2 -2
- package/dist/chunks/{BtcActions-D9eBmDj6.cjs.map → BtcActions-ByhBml_1.cjs.map} +1 -1
- package/dist/chunks/{BtcActions-DGqmtxjd.js → BtcActions-C_A1dUQ0.js} +20 -20
- package/dist/chunks/{BtcActions-DGqmtxjd.js.map → BtcActions-C_A1dUQ0.js.map} +1 -1
- package/dist/chunks/{EvmActions-BOwYPThp.cjs → EvmActions-DoYIhj61.cjs} +2 -2
- package/dist/chunks/{EvmActions-BOwYPThp.cjs.map → EvmActions-DoYIhj61.cjs.map} +1 -1
- package/dist/chunks/{EvmActions-MW5mNmqs.js → EvmActions-DucgT60w.js} +45 -45
- package/dist/chunks/{EvmActions-MW5mNmqs.js.map → EvmActions-DucgT60w.js.map} +1 -1
- package/dist/chunks/{ReferralsClient-DUwyIUe3.cjs → ReferralsClient-BC-1wT1q.cjs} +2 -2
- package/dist/chunks/{ReferralsClient-DUwyIUe3.cjs.map → ReferralsClient-BC-1wT1q.cjs.map} +1 -1
- package/dist/chunks/{ReferralsClient-JjWLlIO4.js → ReferralsClient-DbFWWtVi.js} +20 -20
- package/dist/chunks/{ReferralsClient-JjWLlIO4.js.map → ReferralsClient-DbFWWtVi.js.map} +1 -1
- package/dist/chunks/approveLBTC-B5-ZWqct.js +26 -0
- package/dist/chunks/{approveLBTC-DOP0wsm3.js.map → approveLBTC-B5-ZWqct.js.map} +1 -1
- package/dist/chunks/{approveLBTC-CN6rJF6_.cjs → approveLBTC-CZiZmdcX.cjs} +2 -2
- package/dist/chunks/{approveLBTC-CN6rJF6_.cjs.map → approveLBTC-CZiZmdcX.cjs.map} +1 -1
- package/dist/chunks/blockchain-identifier-BmadkNtK.js +113 -0
- package/dist/chunks/blockchain-identifier-BmadkNtK.js.map +1 -0
- package/dist/chunks/{blockchain-identifier-DtIGGlIi.cjs → blockchain-identifier-BzMQWh-C.cjs} +2 -2
- package/dist/chunks/blockchain-identifier-BzMQWh-C.cjs.map +1 -0
- package/dist/chunks/bridge-BzRlY9pP.cjs +12 -0
- package/dist/chunks/bridge-BzRlY9pP.cjs.map +1 -0
- package/dist/chunks/{bridge-DyAiDpxD.js → bridge-CTsiodO1.js} +72 -95
- package/dist/chunks/bridge-CTsiodO1.js.map +1 -0
- package/dist/chunks/{config-_8X_2sG4.js → config-hFKqUyg3.js} +2 -2
- package/dist/chunks/{config-_8X_2sG4.js.map → config-hFKqUyg3.js.map} +1 -1
- package/dist/chunks/{config-DqbLaiRi.cjs → config-l4ZaZw_g.cjs} +2 -2
- package/dist/chunks/{config-DqbLaiRi.cjs.map → config-l4ZaZw_g.cjs.map} +1 -1
- package/dist/chunks/{defi-registry-NGWlyxAY.cjs → defi-registry-BIRv_zkp.cjs} +2 -2
- package/dist/chunks/{defi-registry-NGWlyxAY.cjs.map → defi-registry-BIRv_zkp.cjs.map} +1 -1
- package/dist/chunks/{defi-registry-dhrQMy94.js → defi-registry-wNFN3qyB.js} +7 -7
- package/dist/chunks/{defi-registry-dhrQMy94.js.map → defi-registry-wNFN3qyB.js.map} +1 -1
- package/dist/chunks/{depositStatus-K6gky8zH.cjs → depositStatus-C3-EgT2a.cjs} +2 -2
- package/dist/chunks/{depositStatus-K6gky8zH.cjs.map → depositStatus-C3-EgT2a.cjs.map} +1 -1
- package/dist/chunks/{depositStatus-DeCO-K5Q.js → depositStatus-DM7fRmbN.js} +8 -8
- package/dist/chunks/{depositStatus-DeCO-K5Q.js.map → depositStatus-DM7fRmbN.js.map} +1 -1
- package/dist/chunks/{events-DIKZG4SZ.cjs → events-BTtwgCev.cjs} +2 -2
- package/dist/chunks/{events-DIKZG4SZ.cjs.map → events-BTtwgCev.cjs.map} +1 -1
- package/dist/chunks/{events-CLVUaKQS.js → events-DPi6MDRA.js} +35 -35
- package/dist/chunks/{events-CLVUaKQS.js.map → events-DPi6MDRA.js.map} +1 -1
- package/dist/chunks/{get-exchange-ratio-CM8W0jTw.cjs → get-exchange-ratio-C-7DadfD.cjs} +2 -2
- package/dist/chunks/{get-exchange-ratio-CM8W0jTw.cjs.map → get-exchange-ratio-C-7DadfD.cjs.map} +1 -1
- package/dist/chunks/get-exchange-ratio-NtnkG1kZ.js +20 -0
- package/dist/chunks/{get-exchange-ratio-B0CNEGOB.js.map → get-exchange-ratio-NtnkG1kZ.js.map} +1 -1
- package/dist/chunks/{get-positions-summary-Cled5YPA.js → get-positions-summary-B_MmGHLv.js} +4 -4
- package/dist/chunks/{get-positions-summary-Cled5YPA.js.map → get-positions-summary-B_MmGHLv.js.map} +1 -1
- package/dist/chunks/{get-positions-summary-Co7RZBiK.cjs → get-positions-summary-DkZZYbGP.cjs} +2 -2
- package/dist/chunks/{get-positions-summary-Co7RZBiK.cjs.map → get-positions-summary-DkZZYbGP.cjs.map} +1 -1
- package/dist/chunks/{get-vault-tvl-Bydlvlrv.cjs → get-vault-tvl-DmTUbOY7.cjs} +2 -2
- package/dist/chunks/{get-vault-tvl-Bydlvlrv.cjs.map → get-vault-tvl-DmTUbOY7.cjs.map} +1 -1
- package/dist/chunks/{get-vault-tvl-DxjO9xDs.js → get-vault-tvl-YAXePAW3.js} +4 -4
- package/dist/chunks/{get-vault-tvl-DxjO9xDs.js.map → get-vault-tvl-YAXePAW3.js.map} +1 -1
- package/dist/chunks/{get-vault-withdrawals-CSQqKFB8.js → get-vault-withdrawals-BrpZlt6s.js} +3 -3
- package/dist/chunks/{get-vault-withdrawals-CSQqKFB8.js.map → get-vault-withdrawals-BrpZlt6s.js.map} +1 -1
- package/dist/chunks/{get-vault-withdrawals-DBA3ok0m.cjs → get-vault-withdrawals-CWcYy_sH.cjs} +2 -2
- package/dist/chunks/{get-vault-withdrawals-DBA3ok0m.cjs.map → get-vault-withdrawals-CWcYy_sH.cjs.map} +1 -1
- package/dist/chunks/{getSharesByAddress-De7as74h.cjs → getSharesByAddress-U48H_ygt.cjs} +2 -2
- package/dist/chunks/{getSharesByAddress-De7as74h.cjs.map → getSharesByAddress-U48H_ygt.cjs.map} +1 -1
- package/dist/chunks/{getSharesByAddress-CK2q7gBI.js → getSharesByAddress-cUtkrKTq.js} +14 -14
- package/dist/chunks/{getSharesByAddress-CK2q7gBI.js.map → getSharesByAddress-cUtkrKTq.js.map} +1 -1
- package/dist/chunks/{getUserStakeAndBakeSignature--XsK93Lb.cjs → getUserStakeAndBakeSignature-BxRq2cI1.cjs} +2 -2
- package/dist/chunks/{getUserStakeAndBakeSignature--XsK93Lb.cjs.map → getUserStakeAndBakeSignature-BxRq2cI1.cjs.map} +1 -1
- package/dist/chunks/{getUserStakeAndBakeSignature-2xPkL9v_.js → getUserStakeAndBakeSignature-NGGblnJl.js} +11 -11
- package/dist/chunks/{getUserStakeAndBakeSignature-2xPkL9v_.js.map → getUserStakeAndBakeSignature-NGGblnJl.js.map} +1 -1
- package/dist/chunks/index-BKzxeh1Y.cjs.map +1 -1
- package/dist/chunks/index-CfcQ_g3t.js.map +1 -1
- package/dist/chunks/{lbtc-addresses-NHg9Gk5y.js → lbtc-addresses-BLRmtR3c.js} +2 -2
- package/dist/chunks/{lbtc-addresses-NHg9Gk5y.js.map → lbtc-addresses-BLRmtR3c.js.map} +1 -1
- package/dist/chunks/{lbtc-addresses-bj--zuK9.cjs → lbtc-addresses-xyTYV7hx.cjs} +2 -2
- package/dist/chunks/{lbtc-addresses-bj--zuK9.cjs.map → lbtc-addresses-xyTYV7hx.cjs.map} +1 -1
- package/dist/chunks/{statusConstants-ZJia15m2.js → statusConstants-CJk6vOiM.js} +844 -853
- package/dist/chunks/statusConstants-CJk6vOiM.js.map +1 -0
- package/dist/chunks/statusConstants-fmtIEEEM.cjs +2 -0
- package/dist/chunks/statusConstants-fmtIEEEM.cjs.map +1 -0
- package/dist/chunks/{storeNetworkFeeSignature-BZUZOxns.js → storeNetworkFeeSignature-BZGL2Zn_.js} +8 -8
- package/dist/chunks/{storeNetworkFeeSignature-BZUZOxns.js.map → storeNetworkFeeSignature-BZGL2Zn_.js.map} +1 -1
- package/dist/chunks/{storeNetworkFeeSignature-pV7xUOSo.cjs → storeNetworkFeeSignature-D7yo6lDV.cjs} +2 -2
- package/dist/chunks/{storeNetworkFeeSignature-pV7xUOSo.cjs.map → storeNetworkFeeSignature-D7yo6lDV.cjs.map} +1 -1
- package/dist/chunks/token-addresses-DRBecUa7.cjs +2 -0
- package/dist/chunks/token-addresses-DRBecUa7.cjs.map +1 -0
- package/dist/chunks/token-addresses-FKpA3uc4.js +541 -0
- package/dist/chunks/token-addresses-FKpA3uc4.js.map +1 -0
- package/dist/chunks/{tokens-Bw35TZqd.js → tokens-C6qZHzph.js} +28 -30
- package/dist/chunks/tokens-C6qZHzph.js.map +1 -0
- package/dist/chunks/tokens-D_HeVB5p.cjs +2 -0
- package/dist/chunks/tokens-D_HeVB5p.cjs.map +1 -0
- package/dist/chunks/{unstakeLBTC-Huy_ncVl.js → unstakeLBTC-B4Rwf65e.js} +141 -129
- package/dist/chunks/unstakeLBTC-B4Rwf65e.js.map +1 -0
- package/dist/chunks/unstakeLBTC-Wlfi14de.cjs +2 -0
- package/dist/chunks/unstakeLBTC-Wlfi14de.cjs.map +1 -0
- package/dist/chunks/{withdraw-Z77x7Hj4.cjs → withdraw-C1fMFSwy.cjs} +2 -2
- package/dist/chunks/{withdraw-Z77x7Hj4.cjs.map → withdraw-C1fMFSwy.cjs.map} +1 -1
- package/dist/chunks/{withdraw-CVNVJ7-x.js → withdraw-hHueI2p7.js} +9 -9
- package/dist/chunks/{withdraw-CVNVJ7-x.js.map → withdraw-hHueI2p7.js.map} +1 -1
- package/dist/clients/rpc-url-config.d.ts.map +1 -1
- package/dist/common/chains.d.ts +343 -112
- package/dist/common/chains.d.ts.map +1 -1
- package/dist/common/feature-config.d.ts.map +1 -1
- package/dist/contract-functions/getLBTCMintingFee/getLBTCMintingFee.d.ts +27 -0
- package/dist/contract-functions/getLBTCMintingFee/getLBTCMintingFee.d.ts.map +1 -1
- package/dist/contract-functions/signLbtcDestionationAddr/signLbtcDestinationAddr.d.ts +26 -0
- package/dist/contract-functions/signLbtcDestionationAddr/signLbtcDestinationAddr.d.ts.map +1 -1
- package/dist/contracts.cjs +1 -1
- package/dist/contracts.js +26 -24
- package/dist/core/chains/catalog.d.ts.map +1 -1
- package/dist/core/chains/types.d.ts +0 -1
- package/dist/core/chains/types.d.ts.map +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +29 -29
- package/dist/defi.cjs +1 -1
- package/dist/defi.js +3 -3
- package/dist/entries/contracts.d.ts +2 -2
- package/dist/entries/contracts.d.ts.map +1 -1
- package/dist/entries/evm.d.ts +1 -1
- package/dist/entries/evm.d.ts.map +1 -1
- package/dist/entries/utils.d.ts +1 -1
- package/dist/entries/utils.d.ts.map +1 -1
- package/dist/evm.cjs +1 -1
- package/dist/evm.js +34 -35
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +188 -187
- package/dist/metrics.cjs +1 -1
- package/dist/metrics.js +1 -1
- package/dist/stories/components/decorators/wagmi-decorator.d.ts.map +1 -1
- package/dist/tokens/token-addresses.d.ts.map +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +48 -49
- package/dist/vaults.cjs +1 -1
- package/dist/vaults.js +15 -15
- package/package.json +2 -2
- package/dist/chunks/approveLBTC-DOP0wsm3.js +0 -26
- package/dist/chunks/blockchain-identifier-DtIGGlIi.cjs.map +0 -1
- package/dist/chunks/blockchain-identifier-PNEhu-QU.js +0 -113
- package/dist/chunks/blockchain-identifier-PNEhu-QU.js.map +0 -1
- package/dist/chunks/bridge-DkZMwO7c.cjs +0 -12
- package/dist/chunks/bridge-DkZMwO7c.cjs.map +0 -1
- package/dist/chunks/bridge-DyAiDpxD.js.map +0 -1
- package/dist/chunks/get-exchange-ratio-B0CNEGOB.js +0 -20
- package/dist/chunks/statusConstants-DTDi_4Go.cjs +0 -2
- package/dist/chunks/statusConstants-DTDi_4Go.cjs.map +0 -1
- package/dist/chunks/statusConstants-ZJia15m2.js.map +0 -1
- package/dist/chunks/token-addresses-D859i6tX.cjs +0 -2
- package/dist/chunks/token-addresses-D859i6tX.cjs.map +0 -1
- package/dist/chunks/token-addresses-DmAr89jP.js +0 -579
- package/dist/chunks/token-addresses-DmAr89jP.js.map +0 -1
- package/dist/chunks/tokens-Bw35TZqd.js.map +0 -1
- package/dist/chunks/tokens-DLGMNeqZ.cjs +0 -2
- package/dist/chunks/tokens-DLGMNeqZ.cjs.map +0 -1
- package/dist/chunks/unstakeLBTC-CqZzj9WL.cjs +0 -2
- package/dist/chunks/unstakeLBTC-CqZzj9WL.cjs.map +0 -1
- package/dist/chunks/unstakeLBTC-Huy_ncVl.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { h as U, m as w,
|
|
2
|
-
import {
|
|
1
|
+
import { h as U, m as w, b as f, i as k, g as X, e as ee, t as K, f as j, U as te, r as ne } from "./tokens-C6qZHzph.js";
|
|
2
|
+
import { o as d, A, U as R, b as O, D as _, G as Ae, B as ge, I as Ce, F as he, a as v } from "./token-addresses-FKpA3uc4.js";
|
|
3
3
|
import { f as V } from "./satoshi-Ch6y8aYG.js";
|
|
4
|
-
import { p as G, d as
|
|
5
|
-
import { getContract as ae, decodeFunctionData as Z, encodeAbiParameters as
|
|
6
|
-
import {
|
|
4
|
+
import { p as G, d as Me } from "./index-CfcQ_g3t.js";
|
|
5
|
+
import { getContract as ae, decodeFunctionData as Z, encodeAbiParameters as ve, keccak256 as se, zeroAddress as Re, parseGwei as W, createWalletClient as De, http as xe, isHex as Ee, encodeFunctionData as Ie } from "viem";
|
|
6
|
+
import { D as ke, b as Se, a as $ } from "./defi-registry-wNFN3qyB.js";
|
|
7
7
|
import g from "bignumber.js";
|
|
8
8
|
import { t as ie, n as re, D as oe, e as Y } from "./time-QPeEEEnQ.js";
|
|
9
|
-
import { g as
|
|
9
|
+
import { g as Be } from "./get-exchange-ratio-NtnkG1kZ.js";
|
|
10
10
|
import { t as I } from "./numbers-CM-lcmt4.js";
|
|
11
|
-
import { i as H, a as
|
|
11
|
+
import { i as H, a as Ne } from "./parameters-CDV-6Hk5.js";
|
|
12
12
|
const S = [
|
|
13
13
|
{
|
|
14
14
|
inputs: [],
|
|
@@ -1975,13 +1975,13 @@ const S = [
|
|
|
1975
1975
|
type: "function"
|
|
1976
1976
|
}
|
|
1977
1977
|
];
|
|
1978
|
-
async function
|
|
1979
|
-
return Ne({ token: d.LBTC, ...e });
|
|
1980
|
-
}
|
|
1981
|
-
async function bt(e) {
|
|
1978
|
+
async function Tt(e) {
|
|
1982
1979
|
return _e({ token: d.LBTC, ...e });
|
|
1983
1980
|
}
|
|
1984
|
-
async function
|
|
1981
|
+
async function ft(e) {
|
|
1982
|
+
return pe({ token: d.LBTC, ...e });
|
|
1983
|
+
}
|
|
1984
|
+
async function _e({
|
|
1985
1985
|
token: e,
|
|
1986
1986
|
chainId: n,
|
|
1987
1987
|
rpcUrl: a,
|
|
@@ -2019,7 +2019,7 @@ async function Ne({
|
|
|
2019
2019
|
});
|
|
2020
2020
|
return V(String(o));
|
|
2021
2021
|
}
|
|
2022
|
-
async function
|
|
2022
|
+
async function pe({
|
|
2023
2023
|
token: e,
|
|
2024
2024
|
chainId: n,
|
|
2025
2025
|
rpcUrl: a,
|
|
@@ -2065,7 +2065,7 @@ async function _e({
|
|
|
2065
2065
|
});
|
|
2066
2066
|
return V(String(p));
|
|
2067
2067
|
}
|
|
2068
|
-
async function
|
|
2068
|
+
async function Pe({
|
|
2069
2069
|
token: e,
|
|
2070
2070
|
chainId: n,
|
|
2071
2071
|
rpcUrl: a,
|
|
@@ -2099,13 +2099,20 @@ async function Tt({
|
|
|
2099
2099
|
p = 2000n;
|
|
2100
2100
|
return V(String(p));
|
|
2101
2101
|
}
|
|
2102
|
+
async function wt(e) {
|
|
2103
|
+
const [n, a] = await Promise.all([
|
|
2104
|
+
pe(e),
|
|
2105
|
+
Pe(e)
|
|
2106
|
+
]);
|
|
2107
|
+
return n.plus(a);
|
|
2108
|
+
}
|
|
2102
2109
|
class P extends Error {
|
|
2103
2110
|
constructor(n, a, t) {
|
|
2104
2111
|
super(a), this.code = n, this.context = t, this.name = "StakeAndBakeValidationError";
|
|
2105
2112
|
}
|
|
2106
2113
|
}
|
|
2107
|
-
function
|
|
2108
|
-
const s =
|
|
2114
|
+
function ye(e, n, a, t) {
|
|
2115
|
+
const s = ke[e];
|
|
2109
2116
|
if (!s)
|
|
2110
2117
|
throw new P(
|
|
2111
2118
|
"UNSUPPORTED_VAULT",
|
|
@@ -2147,23 +2154,23 @@ function pe(e, n, a, t) {
|
|
|
2147
2154
|
...p
|
|
2148
2155
|
};
|
|
2149
2156
|
}
|
|
2150
|
-
const
|
|
2157
|
+
const Fe = {
|
|
2151
2158
|
[$.Veda]: d.LBTC,
|
|
2152
2159
|
[$.Silo]: d.BTCb
|
|
2153
2160
|
};
|
|
2154
|
-
async function
|
|
2161
|
+
async function At({
|
|
2155
2162
|
protocol: e = $.Veda,
|
|
2156
2163
|
token: n,
|
|
2157
2164
|
chainId: a,
|
|
2158
2165
|
env: t = G,
|
|
2159
2166
|
rpcUrl: s
|
|
2160
2167
|
}) {
|
|
2161
|
-
const r =
|
|
2168
|
+
const r = Se[e];
|
|
2162
2169
|
if (!r)
|
|
2163
2170
|
throw new Error(`Unknown protocol: ${e}`);
|
|
2164
|
-
const i = n ??
|
|
2171
|
+
const i = n ?? Fe[e];
|
|
2165
2172
|
try {
|
|
2166
|
-
const o =
|
|
2173
|
+
const o = ye(
|
|
2167
2174
|
e,
|
|
2168
2175
|
i,
|
|
2169
2176
|
a,
|
|
@@ -2186,15 +2193,18 @@ async function ft({
|
|
|
2186
2193
|
);
|
|
2187
2194
|
}
|
|
2188
2195
|
}
|
|
2189
|
-
|
|
2196
|
+
function Le(e) {
|
|
2197
|
+
return `destination chain id is ${e}`;
|
|
2198
|
+
}
|
|
2199
|
+
async function gt({
|
|
2190
2200
|
account: e,
|
|
2191
2201
|
chainId: n,
|
|
2192
2202
|
provider: a
|
|
2193
2203
|
}) {
|
|
2194
|
-
const t = R({ chainId: n, provider: a }), s =
|
|
2204
|
+
const t = R({ chainId: n, provider: a }), s = Le(n);
|
|
2195
2205
|
return await t.signMessage({ account: e, message: s });
|
|
2196
2206
|
}
|
|
2197
|
-
async function
|
|
2207
|
+
async function Ct({
|
|
2198
2208
|
fee: e,
|
|
2199
2209
|
expiry: n = ie(re() + oe),
|
|
2200
2210
|
account: a,
|
|
@@ -2242,7 +2252,7 @@ async function At({
|
|
|
2242
2252
|
)
|
|
2243
2253
|
};
|
|
2244
2254
|
}
|
|
2245
|
-
async function
|
|
2255
|
+
async function Oe({
|
|
2246
2256
|
owner: e,
|
|
2247
2257
|
chainId: n,
|
|
2248
2258
|
rpcUrl: a,
|
|
@@ -2260,19 +2270,19 @@ async function Fe({
|
|
|
2260
2270
|
});
|
|
2261
2271
|
return String(p);
|
|
2262
2272
|
}
|
|
2263
|
-
const
|
|
2273
|
+
const $e = [
|
|
2264
2274
|
{ name: "name", type: "string" },
|
|
2265
2275
|
{ name: "version", type: "string" },
|
|
2266
2276
|
{ name: "chainId", type: "uint256" },
|
|
2267
2277
|
{ name: "verifyingContract", type: "address" }
|
|
2268
|
-
],
|
|
2278
|
+
], ue = [
|
|
2269
2279
|
{ name: "owner", type: "address" },
|
|
2270
2280
|
{ name: "spender", type: "address" },
|
|
2271
2281
|
{ name: "value", type: "uint256" },
|
|
2272
2282
|
{ name: "nonce", type: "uint256" },
|
|
2273
2283
|
{ name: "deadline", type: "uint256" }
|
|
2274
|
-
],
|
|
2275
|
-
function
|
|
2284
|
+
], Ue = ue;
|
|
2285
|
+
function Ve(e) {
|
|
2276
2286
|
const n = e.mode === "permit" ? "Permit" : "Approve";
|
|
2277
2287
|
return {
|
|
2278
2288
|
account: e.account,
|
|
@@ -2283,8 +2293,8 @@ function $e(e) {
|
|
|
2283
2293
|
verifyingContract: e.verifyingContract
|
|
2284
2294
|
},
|
|
2285
2295
|
types: {
|
|
2286
|
-
EIP712Domain:
|
|
2287
|
-
[n]: e.mode === "permit" ?
|
|
2296
|
+
EIP712Domain: $e,
|
|
2297
|
+
[n]: e.mode === "permit" ? ue : Ue
|
|
2288
2298
|
},
|
|
2289
2299
|
primaryType: n,
|
|
2290
2300
|
message: {
|
|
@@ -2296,13 +2306,13 @@ function $e(e) {
|
|
|
2296
2306
|
}
|
|
2297
2307
|
};
|
|
2298
2308
|
}
|
|
2299
|
-
function
|
|
2309
|
+
function de(e) {
|
|
2300
2310
|
return JSON.stringify(
|
|
2301
2311
|
e,
|
|
2302
2312
|
(n, a) => typeof a == "bigint" ? a.toString() : a
|
|
2303
2313
|
);
|
|
2304
2314
|
}
|
|
2305
|
-
async function
|
|
2315
|
+
async function Ge(e) {
|
|
2306
2316
|
const {
|
|
2307
2317
|
account: n,
|
|
2308
2318
|
chainId: a,
|
|
@@ -2338,29 +2348,29 @@ async function Ue(e) {
|
|
|
2338
2348
|
return {
|
|
2339
2349
|
mode: "approve",
|
|
2340
2350
|
signature: "",
|
|
2341
|
-
typedData:
|
|
2351
|
+
typedData: de(o),
|
|
2342
2352
|
approvalTxHash: l
|
|
2343
2353
|
};
|
|
2344
2354
|
}
|
|
2345
|
-
async function
|
|
2355
|
+
async function We(e) {
|
|
2346
2356
|
const { chainId: n, provider: a, typedData: t } = e;
|
|
2347
2357
|
return {
|
|
2348
2358
|
mode: "permit",
|
|
2349
2359
|
signature: await R({ chainId: n, provider: a }).signTypedData(t),
|
|
2350
|
-
typedData:
|
|
2360
|
+
typedData: de(t)
|
|
2351
2361
|
};
|
|
2352
2362
|
}
|
|
2353
|
-
const
|
|
2354
|
-
async function
|
|
2363
|
+
const He = async (e, n, a) => !e || e === "BTC" || e === d.LBTC ? await f(d.LBTC, n, a) : await f(e, n, a, A.Token);
|
|
2364
|
+
async function ze(e, n) {
|
|
2355
2365
|
var a;
|
|
2356
2366
|
try {
|
|
2357
|
-
const s = ((a = (await
|
|
2367
|
+
const s = ((a = (await Be({ env: n })).LBTC) == null ? void 0 : a.BTCTokenRatio) || new g(1);
|
|
2358
2368
|
return new g(e).dividedBy(s);
|
|
2359
2369
|
} catch {
|
|
2360
2370
|
throw new Error("Failed to get exchange ratio for stake and bake");
|
|
2361
2371
|
}
|
|
2362
2372
|
}
|
|
2363
|
-
async function
|
|
2373
|
+
async function ht({
|
|
2364
2374
|
account: e,
|
|
2365
2375
|
expiry: n = ie(re() + oe),
|
|
2366
2376
|
value: a,
|
|
@@ -2372,7 +2382,7 @@ async function gt({
|
|
|
2372
2382
|
rpcUrl: p,
|
|
2373
2383
|
env: o = G
|
|
2374
2384
|
}) {
|
|
2375
|
-
const u =
|
|
2385
|
+
const u = ye(t, s, r, o), y = u.spenderContract.address, m = u.amountStrategy === "btcToLbtc" ? await ze(a, o) : new g(a), b = await He(s, r, o), l = b.address, c = b.abi, C = u.approval.deadlineStrategy === "zero" ? 0n : BigInt(n), h = u.approval.nonceStrategy === "chain" ? BigInt(await Oe({ owner: e, chainId: r, rpcUrl: p, env: o })) : 0n, M = Ve({
|
|
2376
2386
|
mode: u.approval.mode,
|
|
2377
2387
|
account: e,
|
|
2378
2388
|
chainId: r,
|
|
@@ -2384,7 +2394,7 @@ async function gt({
|
|
|
2384
2394
|
nonce: h,
|
|
2385
2395
|
deadline: C
|
|
2386
2396
|
});
|
|
2387
|
-
return u.approval.mode === "approve" ?
|
|
2397
|
+
return u.approval.mode === "approve" ? Ge({
|
|
2388
2398
|
account: e,
|
|
2389
2399
|
chainId: r,
|
|
2390
2400
|
provider: i,
|
|
@@ -2394,9 +2404,9 @@ async function gt({
|
|
|
2394
2404
|
spenderAddress: y,
|
|
2395
2405
|
typedData: M,
|
|
2396
2406
|
requiredAmount: BigInt(m.toFixed(0, g.ROUND_DOWN))
|
|
2397
|
-
}) :
|
|
2407
|
+
}) : We({ chainId: r, provider: i, typedData: M });
|
|
2398
2408
|
}
|
|
2399
|
-
const J = "0xe288fb4a", Q = "0x155b6b13",
|
|
2409
|
+
const J = "0xe288fb4a", Q = "0x155b6b13", Ke = {
|
|
2400
2410
|
type: "function",
|
|
2401
2411
|
name: "MessageV1",
|
|
2402
2412
|
inputs: [
|
|
@@ -2407,7 +2417,7 @@ const J = "0xe288fb4a", Q = "0x155b6b13", He = {
|
|
|
2407
2417
|
{ name: "msgDestinationCaller", type: "bytes32" },
|
|
2408
2418
|
{ name: "msgBody", type: "bytes" }
|
|
2409
2419
|
]
|
|
2410
|
-
},
|
|
2420
|
+
}, je = {
|
|
2411
2421
|
type: "function",
|
|
2412
2422
|
name: "mint",
|
|
2413
2423
|
inputs: [
|
|
@@ -2416,7 +2426,7 @@ const J = "0xe288fb4a", Q = "0x155b6b13", He = {
|
|
|
2416
2426
|
{ name: "amount", type: "uint256" }
|
|
2417
2427
|
]
|
|
2418
2428
|
};
|
|
2419
|
-
function
|
|
2429
|
+
function qe(e) {
|
|
2420
2430
|
if (!e.startsWith("0x"))
|
|
2421
2431
|
throw new Error("Payload must be 0x-prefixed hex");
|
|
2422
2432
|
const n = e.slice(0, 10);
|
|
@@ -2425,7 +2435,7 @@ function ze(e) {
|
|
|
2425
2435
|
`Invalid GMP selector: expected ${J}, got ${n}`
|
|
2426
2436
|
);
|
|
2427
2437
|
const a = Z({
|
|
2428
|
-
abi: [
|
|
2438
|
+
abi: [Ke],
|
|
2429
2439
|
data: e
|
|
2430
2440
|
});
|
|
2431
2441
|
if (!a.args)
|
|
@@ -2439,7 +2449,7 @@ function ze(e) {
|
|
|
2439
2449
|
`Invalid mint selector in body: expected ${Q}, got ${u}`
|
|
2440
2450
|
);
|
|
2441
2451
|
const y = Z({
|
|
2442
|
-
abi: [
|
|
2452
|
+
abi: [je],
|
|
2443
2453
|
data: o
|
|
2444
2454
|
});
|
|
2445
2455
|
if (!y.args)
|
|
@@ -2461,8 +2471,8 @@ function ze(e) {
|
|
|
2461
2471
|
}
|
|
2462
2472
|
};
|
|
2463
2473
|
}
|
|
2464
|
-
function
|
|
2465
|
-
const { msgNonce: a, mint: t } = e, s =
|
|
2474
|
+
function Ze(e, n) {
|
|
2475
|
+
const { msgNonce: a, mint: t } = e, s = ve(
|
|
2466
2476
|
[
|
|
2467
2477
|
{ name: "nonce", type: "uint256" },
|
|
2468
2478
|
{ name: "chainId", type: "uint256" },
|
|
@@ -2485,7 +2495,7 @@ function je(e, n) {
|
|
|
2485
2495
|
);
|
|
2486
2496
|
return se(s);
|
|
2487
2497
|
}
|
|
2488
|
-
const
|
|
2498
|
+
const Ye = [
|
|
2489
2499
|
{
|
|
2490
2500
|
inputs: [
|
|
2491
2501
|
{ internalType: "address", name: "aDefaultAdmin", type: "address" },
|
|
@@ -3137,9 +3147,9 @@ const qe = [
|
|
|
3137
3147
|
stateMutability: "view",
|
|
3138
3148
|
type: "function"
|
|
3139
3149
|
}
|
|
3140
|
-
], Ze = /* @__PURE__ */ JSON.parse('[{"inputs":[{"internalType":"address","name":"aDefaultAdmin","type":"address"},{"internalType":"address","name":"aPauser","type":"address"},{"internalType":"address","name":"aDepositReporter","type":"address"},{"internalType":"address","name":"aWithdrawalValidator","type":"address"},{"internalType":"uint256","name":"aMaxDeposits","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"uint48","name":"schedule","type":"uint48"}],"name":"AccessControlEnforcedDefaultAdminDelay","type":"error"},{"inputs":[],"name":"AccessControlEnforcedDefaultAdminRules","type":"error"},{"inputs":[{"internalType":"address","name":"defaultAdmin","type":"address"}],"name":"AccessControlInvalidDefaultAdmin","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"}],"name":"AlreadyReported","type":"error"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"},{"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"AlreadyWithdrawn","type":"error"},{"inputs":[],"name":"BadDepositReport","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"uint8","name":"bits","type":"uint8"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeCastOverflowedUintDowncast","type":"error"},{"inputs":[],"name":"SameValidationThreshold","type":"error"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"},{"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"WithdrawalFailedValidation","type":"error"},{"anonymous":false,"inputs":[],"name":"DefaultAdminDelayChangeCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint48","name":"newDelay","type":"uint48"},{"indexed":false,"internalType":"uint48","name":"effectSchedule","type":"uint48"}],"name":"DefaultAdminDelayChangeScheduled","type":"event"},{"anonymous":false,"inputs":[],"name":"DefaultAdminTransferCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"},{"indexed":false,"internalType":"uint48","name":"acceptSchedule","type":"uint48"}],"name":"DefaultAdminTransferScheduled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"reportId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"numDeposits","type":"uint256"}],"name":"DepositsReported","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"numDeposits","type":"uint256"}],"name":"MaxDepositsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldThreshold","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newThreshold","type":"uint256"}],"name":"UpdateValidateThreshold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"depositID","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"WithdrawalNotValidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"depositID","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"WithdrawalValidated","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSIT_REPORTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VALIDATION_GUARDIAN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWAL_VALIDATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"beginDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint48","name":"newDelay","type":"uint48"}],"name":"changeDefaultAdminDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdminDelay","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdminDelayIncreaseWait","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"}],"name":"depositHistory","outputs":[{"internalType":"enum Bascule.DepositState","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdmin","outputs":[{"internalType":"address","name":"newAdmin","type":"address"},{"internalType":"uint48","name":"schedule","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdminDelay","outputs":[{"internalType":"uint48","name":"newDelay","type":"uint48"},{"internalType":"uint48","name":"schedule","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"reportId","type":"bytes32"},{"internalType":"bytes32[]","name":"depositIDs","type":"bytes32[]"}],"name":"reportDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rollbackDefaultAdminDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"aMaxDeposits","type":"uint256"}],"name":"setMaxDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newThreshold","type":"uint256"}],"name":"updateValidateThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"validateThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"},{"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"validateWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"}]');
|
|
3150
|
+
], Je = /* @__PURE__ */ JSON.parse('[{"inputs":[{"internalType":"address","name":"aDefaultAdmin","type":"address"},{"internalType":"address","name":"aPauser","type":"address"},{"internalType":"address","name":"aDepositReporter","type":"address"},{"internalType":"address","name":"aWithdrawalValidator","type":"address"},{"internalType":"uint256","name":"aMaxDeposits","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"uint48","name":"schedule","type":"uint48"}],"name":"AccessControlEnforcedDefaultAdminDelay","type":"error"},{"inputs":[],"name":"AccessControlEnforcedDefaultAdminRules","type":"error"},{"inputs":[{"internalType":"address","name":"defaultAdmin","type":"address"}],"name":"AccessControlInvalidDefaultAdmin","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"}],"name":"AlreadyReported","type":"error"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"},{"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"AlreadyWithdrawn","type":"error"},{"inputs":[],"name":"BadDepositReport","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"uint8","name":"bits","type":"uint8"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeCastOverflowedUintDowncast","type":"error"},{"inputs":[],"name":"SameValidationThreshold","type":"error"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"},{"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"WithdrawalFailedValidation","type":"error"},{"anonymous":false,"inputs":[],"name":"DefaultAdminDelayChangeCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint48","name":"newDelay","type":"uint48"},{"indexed":false,"internalType":"uint48","name":"effectSchedule","type":"uint48"}],"name":"DefaultAdminDelayChangeScheduled","type":"event"},{"anonymous":false,"inputs":[],"name":"DefaultAdminTransferCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"},{"indexed":false,"internalType":"uint48","name":"acceptSchedule","type":"uint48"}],"name":"DefaultAdminTransferScheduled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"reportId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"numDeposits","type":"uint256"}],"name":"DepositsReported","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"numDeposits","type":"uint256"}],"name":"MaxDepositsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldThreshold","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newThreshold","type":"uint256"}],"name":"UpdateValidateThreshold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"depositID","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"WithdrawalNotValidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"depositID","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"WithdrawalValidated","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSIT_REPORTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VALIDATION_GUARDIAN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWAL_VALIDATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"beginDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint48","name":"newDelay","type":"uint48"}],"name":"changeDefaultAdminDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdminDelay","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdminDelayIncreaseWait","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"}],"name":"depositHistory","outputs":[{"internalType":"enum Bascule.DepositState","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdmin","outputs":[{"internalType":"address","name":"newAdmin","type":"address"},{"internalType":"uint48","name":"schedule","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdminDelay","outputs":[{"internalType":"uint48","name":"newDelay","type":"uint48"},{"internalType":"uint48","name":"schedule","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"reportId","type":"bytes32"},{"internalType":"bytes32[]","name":"depositIDs","type":"bytes32[]"}],"name":"reportDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rollbackDefaultAdminDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"aMaxDeposits","type":"uint256"}],"name":"setMaxDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newThreshold","type":"uint256"}],"name":"updateValidateThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"validateThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"},{"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"validateWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"}]');
|
|
3141
3151
|
var L = /* @__PURE__ */ ((e) => (e[e.UNREPORTED = 0] = "UNREPORTED", e[e.REPORTED = 1] = "REPORTED", e[e.WITHDRAWN = 2] = "WITHDRAWN", e))(L || {});
|
|
3142
|
-
async function
|
|
3152
|
+
async function Qe({
|
|
3143
3153
|
deposit: e,
|
|
3144
3154
|
rawPayload: n,
|
|
3145
3155
|
provider: a,
|
|
@@ -3183,18 +3193,18 @@ async function Ye({
|
|
|
3183
3193
|
address: u.address,
|
|
3184
3194
|
functionName: "Bascule"
|
|
3185
3195
|
});
|
|
3186
|
-
if (y ===
|
|
3196
|
+
if (y === Re)
|
|
3187
3197
|
return 1;
|
|
3188
3198
|
let m;
|
|
3189
3199
|
if (a ? m = R({ provider: a, chainId: t }) : m = w({ chainId: t, rpcUrl: s }), !m)
|
|
3190
3200
|
throw new Error(
|
|
3191
3201
|
"Could not determine the client for the contract interactions. Please provide the 'provider' and 'chainId' parameters or 'chainId' and optionally the 'rpcUrl' parameter."
|
|
3192
3202
|
);
|
|
3193
|
-
const b = (_(t) ||
|
|
3203
|
+
const b = (_(t) || Ae(t) || ge(t) || Ce(t) || he(t)) && i === d.LBTC;
|
|
3194
3204
|
try {
|
|
3195
3205
|
if (b) {
|
|
3196
|
-
const h = p.startsWith("0x") ? p : `0x${p}`, M =
|
|
3197
|
-
abi:
|
|
3206
|
+
const h = p.startsWith("0x") ? p : `0x${p}`, M = qe(h), B = Ze(M, t), [, D] = await o.readContract({
|
|
3207
|
+
abi: Ye,
|
|
3198
3208
|
address: y,
|
|
3199
3209
|
functionName: "mintHistory",
|
|
3200
3210
|
args: [B]
|
|
@@ -3205,7 +3215,7 @@ async function Ye({
|
|
|
3205
3215
|
Buffer.from(p.slice(8), "hex")
|
|
3206
3216
|
);
|
|
3207
3217
|
return await ae({
|
|
3208
|
-
abi:
|
|
3218
|
+
abi: Je,
|
|
3209
3219
|
address: y,
|
|
3210
3220
|
client: o
|
|
3211
3221
|
}).read.depositHistory([
|
|
@@ -3215,7 +3225,7 @@ async function Ye({
|
|
|
3215
3225
|
throw new Error(X(l));
|
|
3216
3226
|
}
|
|
3217
3227
|
}
|
|
3218
|
-
async function
|
|
3228
|
+
async function Mt({
|
|
3219
3229
|
account: e,
|
|
3220
3230
|
token: n,
|
|
3221
3231
|
spender: a,
|
|
@@ -3229,7 +3239,7 @@ async function Ct({
|
|
|
3229
3239
|
if (!y)
|
|
3230
3240
|
throw new Error(`Token info not found for ${n} on chain ${s}`);
|
|
3231
3241
|
const m = I(
|
|
3232
|
-
|
|
3242
|
+
K(g(t), y.decimals)
|
|
3233
3243
|
), { request: b } = await o.simulateContract({
|
|
3234
3244
|
address: y.address,
|
|
3235
3245
|
account: e,
|
|
@@ -3240,7 +3250,7 @@ async function Ct({
|
|
|
3240
3250
|
});
|
|
3241
3251
|
return await u.writeContract(b);
|
|
3242
3252
|
}
|
|
3243
|
-
async function
|
|
3253
|
+
async function vt({
|
|
3244
3254
|
token: e,
|
|
3245
3255
|
owner: n,
|
|
3246
3256
|
spender: a,
|
|
@@ -3259,7 +3269,7 @@ async function ht({
|
|
|
3259
3269
|
});
|
|
3260
3270
|
return j(o.toString(), p.decimals);
|
|
3261
3271
|
}
|
|
3262
|
-
const
|
|
3272
|
+
const z = async (e, n, a) => {
|
|
3263
3273
|
const t = await e.estimateFeesPerGas(), s = g(String(t.maxFeePerGas)).dividedBy(
|
|
3264
3274
|
String(t.maxPriorityFeePerGas)
|
|
3265
3275
|
), r = a || t.maxPriorityFeePerGas, i = a ? BigInt(
|
|
@@ -3271,7 +3281,7 @@ const K = async (e, n, a) => {
|
|
|
3271
3281
|
maxPriorityFeePerGas: r
|
|
3272
3282
|
};
|
|
3273
3283
|
};
|
|
3274
|
-
async function
|
|
3284
|
+
async function Xe({
|
|
3275
3285
|
data: e,
|
|
3276
3286
|
proofSignature: n,
|
|
3277
3287
|
account: a,
|
|
@@ -3290,7 +3300,7 @@ async function Je({
|
|
|
3290
3300
|
t,
|
|
3291
3301
|
i,
|
|
3292
3302
|
A.Adapter
|
|
3293
|
-
), u = await
|
|
3303
|
+
), u = await Qe({
|
|
3294
3304
|
chainId: t,
|
|
3295
3305
|
rawPayload: e,
|
|
3296
3306
|
env: i,
|
|
@@ -3318,13 +3328,13 @@ async function Je({
|
|
|
3318
3328
|
abi: o.abi,
|
|
3319
3329
|
functionName: p === d.BTCK || p === d.BTCb ? "mintV1" : "mint",
|
|
3320
3330
|
args: [Y(e), Y(n)]
|
|
3321
|
-
}, l = _(t) ? await
|
|
3331
|
+
}, l = _(t) ? await z(y, b, W("1")) : {}, { request: c } = await y.simulateContract({
|
|
3322
3332
|
...b,
|
|
3323
3333
|
...l
|
|
3324
3334
|
});
|
|
3325
3335
|
return await m.writeContract(c);
|
|
3326
3336
|
}
|
|
3327
|
-
async function
|
|
3337
|
+
async function Rt({
|
|
3328
3338
|
data: e,
|
|
3329
3339
|
proofSignature: n,
|
|
3330
3340
|
account: a,
|
|
@@ -3333,7 +3343,7 @@ async function Mt({
|
|
|
3333
3343
|
rpcUrl: r,
|
|
3334
3344
|
env: i
|
|
3335
3345
|
}) {
|
|
3336
|
-
return
|
|
3346
|
+
return Xe({
|
|
3337
3347
|
data: e,
|
|
3338
3348
|
proofSignature: n,
|
|
3339
3349
|
account: a,
|
|
@@ -3344,13 +3354,13 @@ async function Mt({
|
|
|
3344
3354
|
token: d.LBTC
|
|
3345
3355
|
});
|
|
3346
3356
|
}
|
|
3347
|
-
const
|
|
3357
|
+
const et = [
|
|
3348
3358
|
{
|
|
3349
3359
|
tokenIn: d.BTCb,
|
|
3350
3360
|
tokenOut: d.LBTC
|
|
3351
3361
|
}
|
|
3352
3362
|
];
|
|
3353
|
-
async function
|
|
3363
|
+
async function Dt({
|
|
3354
3364
|
tokenIn: e,
|
|
3355
3365
|
chainId: n,
|
|
3356
3366
|
env: a,
|
|
@@ -3368,7 +3378,7 @@ async function vt({
|
|
|
3368
3378
|
functionName: "getAssetRouter"
|
|
3369
3379
|
});
|
|
3370
3380
|
}
|
|
3371
|
-
async function
|
|
3381
|
+
async function xt({
|
|
3372
3382
|
account: e,
|
|
3373
3383
|
amount: n,
|
|
3374
3384
|
chainId: a,
|
|
@@ -3378,7 +3388,7 @@ async function Rt({
|
|
|
3378
3388
|
tokenIn: i = d.BTCb,
|
|
3379
3389
|
tokenOut: p = d.LBTC
|
|
3380
3390
|
}) {
|
|
3381
|
-
if (!
|
|
3391
|
+
if (!et.find(
|
|
3382
3392
|
(N) => N.tokenIn === i && N.tokenOut === p
|
|
3383
3393
|
))
|
|
3384
3394
|
throw new te(i, p, a, t);
|
|
@@ -3406,7 +3416,7 @@ async function Rt({
|
|
|
3406
3416
|
address: m.address,
|
|
3407
3417
|
abi: m.abi,
|
|
3408
3418
|
functionName: "getAssetRouter"
|
|
3409
|
-
}), h = g(n), M = I(
|
|
3419
|
+
}), h = g(n), M = I(K(h, c.decimals)), B = await u.readContract({
|
|
3410
3420
|
address: c.address,
|
|
3411
3421
|
abi: c.abi,
|
|
3412
3422
|
functionName: "balanceOf",
|
|
@@ -3430,7 +3440,7 @@ class T extends Error {
|
|
|
3430
3440
|
super(a), this.code = n, this.context = t, this.name = "SignerError";
|
|
3431
3441
|
}
|
|
3432
3442
|
}
|
|
3433
|
-
function
|
|
3443
|
+
function le(e, n = "transaction") {
|
|
3434
3444
|
if (!e.from)
|
|
3435
3445
|
throw new T(
|
|
3436
3446
|
"MISSING_FROM_ADDRESS",
|
|
@@ -3443,7 +3453,7 @@ function de(e, n = "transaction") {
|
|
|
3443
3453
|
`Missing 'to' address for ${n}`,
|
|
3444
3454
|
{ transaction: e, operation: n }
|
|
3445
3455
|
);
|
|
3446
|
-
if (e.data !== void 0 && !
|
|
3456
|
+
if (e.data !== void 0 && !Ee(e.data))
|
|
3447
3457
|
throw new T(
|
|
3448
3458
|
"INVALID_DATA",
|
|
3449
3459
|
`Transaction data must be valid hex string for ${n}`,
|
|
@@ -3456,7 +3466,7 @@ function de(e, n = "transaction") {
|
|
|
3456
3466
|
{ transaction: e, operation: n, chainId: e.chainId }
|
|
3457
3467
|
);
|
|
3458
3468
|
}
|
|
3459
|
-
function
|
|
3469
|
+
function tt(e, n, a) {
|
|
3460
3470
|
const t = v[a];
|
|
3461
3471
|
if (!t)
|
|
3462
3472
|
throw new T(
|
|
@@ -3485,7 +3495,7 @@ function Xe(e, n, a) {
|
|
|
3485
3495
|
chainId: r.chainId ? `0x${r.chainId.toString(16)}` : `0x${t.id.toString(16)}`,
|
|
3486
3496
|
nonce: r.nonce
|
|
3487
3497
|
};
|
|
3488
|
-
|
|
3498
|
+
le(i, "signTransaction");
|
|
3489
3499
|
let p;
|
|
3490
3500
|
if (await e.sign(i, async (o) => (p = o, o)), !p)
|
|
3491
3501
|
throw new T(
|
|
@@ -3519,7 +3529,7 @@ function Xe(e, n, a) {
|
|
|
3519
3529
|
}
|
|
3520
3530
|
};
|
|
3521
3531
|
}
|
|
3522
|
-
function
|
|
3532
|
+
function Et(e, n, a) {
|
|
3523
3533
|
const t = v[a];
|
|
3524
3534
|
if (!t)
|
|
3525
3535
|
throw new T(
|
|
@@ -3527,11 +3537,11 @@ function Dt(e, n, a) {
|
|
|
3527
3537
|
`Chain ID ${a} is not supported`,
|
|
3528
3538
|
{ chainId: a }
|
|
3529
3539
|
);
|
|
3530
|
-
const s =
|
|
3531
|
-
return
|
|
3540
|
+
const s = tt(e, n, a);
|
|
3541
|
+
return De({
|
|
3532
3542
|
account: s,
|
|
3533
3543
|
chain: t,
|
|
3534
|
-
transport:
|
|
3544
|
+
transport: xe()
|
|
3535
3545
|
// Uses default RPC
|
|
3536
3546
|
});
|
|
3537
3547
|
}
|
|
@@ -3542,7 +3552,7 @@ async function F({
|
|
|
3542
3552
|
simulateArgs: t,
|
|
3543
3553
|
operation: s
|
|
3544
3554
|
}) {
|
|
3545
|
-
if (!H(e) && !
|
|
3555
|
+
if (!H(e) && !Ne(e))
|
|
3546
3556
|
throw new T(
|
|
3547
3557
|
"INVALID_PARAMETERS",
|
|
3548
3558
|
'Must provide either "provider" or "signer" in parameters',
|
|
@@ -3607,7 +3617,7 @@ async function F({
|
|
|
3607
3617
|
`Chain ${e.chainId} not supported`,
|
|
3608
3618
|
{ chainId: e.chainId }
|
|
3609
3619
|
);
|
|
3610
|
-
const u =
|
|
3620
|
+
const u = Ie({
|
|
3611
3621
|
abi: t.abi,
|
|
3612
3622
|
functionName: t.functionName,
|
|
3613
3623
|
args: t.args
|
|
@@ -3621,7 +3631,7 @@ async function F({
|
|
|
3621
3631
|
maxPriorityFeePerGas: i.maxPriorityFeePerGas,
|
|
3622
3632
|
chainId: `0x${o.id.toString(16)}`
|
|
3623
3633
|
};
|
|
3624
|
-
|
|
3634
|
+
le(y, s), p = await e.signer.sign(y, async (m) => await n.sendRawTransaction({
|
|
3625
3635
|
serializedTransaction: m
|
|
3626
3636
|
}));
|
|
3627
3637
|
} catch (o) {
|
|
@@ -3637,7 +3647,7 @@ async function F({
|
|
|
3637
3647
|
}
|
|
3638
3648
|
return { txHash: p, request: i };
|
|
3639
3649
|
}
|
|
3640
|
-
async function
|
|
3650
|
+
async function nt(e, n, a) {
|
|
3641
3651
|
try {
|
|
3642
3652
|
const t = await e.waitForTransactionReceipt({
|
|
3643
3653
|
hash: n
|
|
@@ -3668,7 +3678,7 @@ async function et(e, n, a) {
|
|
|
3668
3678
|
);
|
|
3669
3679
|
}
|
|
3670
3680
|
}
|
|
3671
|
-
const
|
|
3681
|
+
const at = [
|
|
3672
3682
|
// Redeem to BTC
|
|
3673
3683
|
{ tokenIn: d.LBTC },
|
|
3674
3684
|
// -> BTC
|
|
@@ -3682,7 +3692,7 @@ const tt = [
|
|
|
3682
3692
|
{ tokenIn: d.LBTC, tokenOut: d.BTCK }
|
|
3683
3693
|
// -> Native LBTC
|
|
3684
3694
|
];
|
|
3685
|
-
async function
|
|
3695
|
+
async function st(e) {
|
|
3686
3696
|
const {
|
|
3687
3697
|
account: n,
|
|
3688
3698
|
amount: a,
|
|
@@ -3693,7 +3703,7 @@ async function nt(e) {
|
|
|
3693
3703
|
tokenIn: p = d.LBTC,
|
|
3694
3704
|
tokenOut: o
|
|
3695
3705
|
} = e;
|
|
3696
|
-
if (!
|
|
3706
|
+
if (!at.find(
|
|
3697
3707
|
(x) => x.tokenIn === p && x.tokenOut === o
|
|
3698
3708
|
))
|
|
3699
3709
|
throw new te(p, o || "BTC", s, r);
|
|
@@ -3708,7 +3718,7 @@ async function nt(e) {
|
|
|
3708
3718
|
throw new Error(
|
|
3709
3719
|
`Could not retrieve the properties of ${p} on ${s}`
|
|
3710
3720
|
);
|
|
3711
|
-
const c =
|
|
3721
|
+
const c = K(a, l.decimals), C = await y.readContract({
|
|
3712
3722
|
address: l.address,
|
|
3713
3723
|
abi: l.abi,
|
|
3714
3724
|
functionName: "balanceOf",
|
|
@@ -3721,25 +3731,25 @@ async function nt(e) {
|
|
|
3721
3731
|
if (!o) {
|
|
3722
3732
|
if (!t)
|
|
3723
3733
|
throw new Error("Missing parameter: `btcAddress`.");
|
|
3724
|
-
const x = await
|
|
3734
|
+
const x = await Me(t, r);
|
|
3725
3735
|
if (p === d.BTCb && (s === O.avalanche || s === O.avalancheFuji)) {
|
|
3726
3736
|
const E = await f(
|
|
3727
3737
|
p,
|
|
3728
3738
|
s,
|
|
3729
3739
|
r,
|
|
3730
3740
|
A.Adapter
|
|
3731
|
-
),
|
|
3741
|
+
), be = await y.readContract({
|
|
3732
3742
|
address: E.address,
|
|
3733
3743
|
abi: E.abi,
|
|
3734
3744
|
functionName: "getAssetRouter"
|
|
3735
|
-
}),
|
|
3745
|
+
}), Te = await y.readContract({
|
|
3736
3746
|
address: l.address,
|
|
3737
3747
|
abi: l.abi,
|
|
3738
3748
|
functionName: "allowance",
|
|
3739
3749
|
args: [n, E.address]
|
|
3740
3750
|
});
|
|
3741
|
-
if (c.isGreaterThan(
|
|
3742
|
-
const { txHash:
|
|
3751
|
+
if (c.isGreaterThan(Te)) {
|
|
3752
|
+
const { txHash: we } = await F({
|
|
3743
3753
|
params: e,
|
|
3744
3754
|
publicClient: y,
|
|
3745
3755
|
walletClient: m,
|
|
@@ -3751,9 +3761,9 @@ async function nt(e) {
|
|
|
3751
3761
|
args: [E.address, I(c)]
|
|
3752
3762
|
},
|
|
3753
3763
|
operation: "BTC.b approval"
|
|
3754
|
-
}), q = await
|
|
3764
|
+
}), q = await nt(
|
|
3755
3765
|
y,
|
|
3756
|
-
|
|
3766
|
+
we,
|
|
3757
3767
|
"BTC.b approval"
|
|
3758
3768
|
);
|
|
3759
3769
|
console.info(
|
|
@@ -3762,12 +3772,12 @@ async function nt(e) {
|
|
|
3762
3772
|
q.status
|
|
3763
3773
|
);
|
|
3764
3774
|
}
|
|
3765
|
-
const { txHash:
|
|
3775
|
+
const { txHash: fe } = await F({
|
|
3766
3776
|
params: e,
|
|
3767
3777
|
publicClient: y,
|
|
3768
3778
|
walletClient: m,
|
|
3769
3779
|
simulateArgs: {
|
|
3770
|
-
address:
|
|
3780
|
+
address: be,
|
|
3771
3781
|
abi: S,
|
|
3772
3782
|
account: n,
|
|
3773
3783
|
functionName: "redeemForBtc",
|
|
@@ -3780,7 +3790,7 @@ async function nt(e) {
|
|
|
3780
3790
|
},
|
|
3781
3791
|
operation: "BTC.b redeemForBtc"
|
|
3782
3792
|
});
|
|
3783
|
-
return
|
|
3793
|
+
return fe;
|
|
3784
3794
|
}
|
|
3785
3795
|
const N = {
|
|
3786
3796
|
abi: l.abi,
|
|
@@ -3790,18 +3800,18 @@ async function nt(e) {
|
|
|
3790
3800
|
functionName: k(l.abi) || p === d.BTCb ? "redeemForBtc" : "redeem",
|
|
3791
3801
|
// legacy
|
|
3792
3802
|
args: [x, I(c)]
|
|
3793
|
-
},
|
|
3803
|
+
}, me = _(s) ? await z(y, N, W("1")) : {}, { txHash: ce } = await F({
|
|
3794
3804
|
params: e,
|
|
3795
3805
|
publicClient: y,
|
|
3796
3806
|
walletClient: m,
|
|
3797
3807
|
simulateArgs: {
|
|
3798
3808
|
...N,
|
|
3799
3809
|
account: n,
|
|
3800
|
-
...
|
|
3810
|
+
...me
|
|
3801
3811
|
},
|
|
3802
3812
|
operation: `${p} redeem to BTC`
|
|
3803
3813
|
});
|
|
3804
|
-
return
|
|
3814
|
+
return ce;
|
|
3805
3815
|
}
|
|
3806
3816
|
if (!k(l.abi))
|
|
3807
3817
|
throw new Error(
|
|
@@ -3814,7 +3824,7 @@ async function nt(e) {
|
|
|
3814
3824
|
chain: v[s],
|
|
3815
3825
|
functionName: "redeem",
|
|
3816
3826
|
args: [I(c)]
|
|
3817
|
-
}, B = _(s) ? await
|
|
3827
|
+
}, B = _(s) ? await z(y, M, W("1")) : {}, { txHash: D } = await F({
|
|
3818
3828
|
params: e,
|
|
3819
3829
|
publicClient: y,
|
|
3820
3830
|
walletClient: m,
|
|
@@ -3827,8 +3837,8 @@ async function nt(e) {
|
|
|
3827
3837
|
});
|
|
3828
3838
|
return D;
|
|
3829
3839
|
}
|
|
3830
|
-
async function
|
|
3831
|
-
return
|
|
3840
|
+
async function It(e) {
|
|
3841
|
+
return st({
|
|
3832
3842
|
...e,
|
|
3833
3843
|
tokenIn: d.LBTC,
|
|
3834
3844
|
tokenOut: void 0
|
|
@@ -3838,29 +3848,31 @@ export {
|
|
|
3838
3848
|
S as A,
|
|
3839
3849
|
L as B,
|
|
3840
3850
|
T as S,
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3851
|
+
Mt as a,
|
|
3852
|
+
tt as b,
|
|
3853
|
+
Rt as c,
|
|
3854
|
+
Et as d,
|
|
3855
|
+
xt as e,
|
|
3856
|
+
Dt as f,
|
|
3857
|
+
Le as g,
|
|
3858
|
+
Qe as h,
|
|
3859
|
+
ft as i,
|
|
3860
|
+
Tt as j,
|
|
3861
|
+
Pe as k,
|
|
3862
|
+
wt as l,
|
|
3863
|
+
_e as m,
|
|
3864
|
+
Oe as n,
|
|
3865
|
+
pe as o,
|
|
3866
|
+
ye as p,
|
|
3867
|
+
At as q,
|
|
3868
|
+
vt as r,
|
|
3869
|
+
Xe as s,
|
|
3870
|
+
st as t,
|
|
3871
|
+
gt as u,
|
|
3872
|
+
Ct as v,
|
|
3873
|
+
ht as w,
|
|
3874
|
+
It as x,
|
|
3875
|
+
le as y,
|
|
3876
|
+
z
|
|
3865
3877
|
};
|
|
3866
|
-
//# sourceMappingURL=unstakeLBTC-
|
|
3878
|
+
//# sourceMappingURL=unstakeLBTC-B4Rwf65e.js.map
|