@dhedge/trading-widget 5.8.1 → 5.11.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/README.md +64 -31
- package/complex-withdraw-asset-data-DKDPznHy.cjs +1 -0
- package/{complex-withdraw-asset-data-Cf9Ea0VI.js → complex-withdraw-asset-data-DzhKTztw.js} +119 -144
- package/const.cjs +1 -1
- package/const.js +32 -32
- package/core-kit/const/gmx.d.ts +1 -1
- package/core-kit/const/logger.d.ts +2 -5
- package/core-kit/const/storage.d.ts +0 -1
- package/core-kit/hooks/state/action.d.ts +1 -1
- package/core-kit/hooks/state/aggregators.d.ts +11 -0
- package/core-kit/hooks/state/index.d.ts +1 -0
- package/core-kit/hooks/trading/deposit-v2/deposit-transaction/use-deposit-common.d.ts +1 -1
- package/core-kit/hooks/trading/deposit-v2/use-get-vault-deposit-transaction-arguments.d.ts +1 -1
- package/core-kit/hooks/trading/deposit-v2/use-vault-deposit-tokens.d.ts +5 -1
- package/core-kit/hooks/trading/index.d.ts +0 -1
- package/core-kit/hooks/web3/index.d.ts +0 -1
- package/core-kit/types/state.types.d.ts +1 -1
- package/core-kit/types/trading-panel.types.d.ts +2 -3
- package/core-kit/utils/deposit.d.ts +1 -1
- package/core-kit/utils/index.d.ts +0 -1
- package/{storage-DhvdxqW3.js → gmx-BroDb_q_.js} +157 -161
- package/gmx-CLiWBUH_.cjs +1 -0
- package/index.cjs +1 -1
- package/index.d.ts +5 -3
- package/index.js +6335 -5493
- package/limit-orders/common/network-check-button.d.ts +7 -0
- package/limit-orders/common/network-check-button.hooks.d.ts +4 -0
- package/limit-orders/common/utils.d.ts +2 -0
- package/limit-orders/index.d.ts +9 -5
- package/limit-orders/limit-buys/component/input-group/input-amount-field.d.ts +2 -0
- package/limit-orders/limit-buys/component/input-group/input-amount-field.hooks.d.ts +11 -0
- package/limit-orders/limit-buys/component/input-group/input-group.d.ts +2 -0
- package/limit-orders/limit-buys/component/input-group/input-group.hooks.d.ts +15 -0
- package/limit-orders/limit-buys/component/input-group/slippage-deadline-fields.d.ts +2 -0
- package/limit-orders/limit-buys/component/input-group/slippage-deadline-fields.hooks.d.ts +5 -0
- package/limit-orders/limit-buys/component/input-group/token-select-overlay.d.ts +10 -0
- package/limit-orders/limit-buys/component/limit-buy-button/sign-limit-buy-button.d.ts +6 -0
- package/limit-orders/limit-buys/component/limit-buy-button/sign-limit-buy-button.hooks.d.ts +6 -0
- package/limit-orders/limit-buys/component/limit-buy-content.d.ts +6 -0
- package/limit-orders/limit-buys/component/limit-buy-order-modal.d.ts +14 -0
- package/limit-orders/limit-buys/component/limit-buy-overlay.d.ts +11 -0
- package/limit-orders/limit-buys/component/terms-confirmation.d.ts +8 -0
- package/limit-orders/limit-buys/constants.d.ts +55 -0
- package/limit-orders/limit-buys/hooks/state.d.ts +2 -0
- package/limit-orders/limit-buys/hooks/use-approve-and-sign-limit-buy.d.ts +7 -0
- package/limit-orders/limit-buys/hooks/use-is-permit2-approved.d.ts +1 -0
- package/limit-orders/limit-buys/hooks/use-permit2-approve-transaction.d.ts +5 -0
- package/limit-orders/limit-buys/hooks/use-sign-limit-buy-order.d.ts +3 -0
- package/limit-orders/limit-buys/providers/state-provider/reducer.d.ts +3 -0
- package/limit-orders/limit-buys/providers/state-provider/state-provider.d.ts +6 -0
- package/limit-orders/limit-buys/providers/state-provider/state-provider.types.d.ts +69 -0
- package/limit-orders/limit-buys/providers/translation-provider/index.d.ts +3 -0
- package/limit-orders/limit-buys/providers/translation-provider/translation-provider.d.ts +4 -0
- package/limit-orders/limit-buys/providers/translation-provider/translation-provider.defaults.d.ts +2 -0
- package/limit-orders/limit-buys/providers/translation-provider/translation-provider.hooks.d.ts +1 -0
- package/limit-orders/limit-buys/providers/translation-provider/translation-provider.types.d.ts +29 -0
- package/limit-orders/limit-buys/types.d.ts +27 -0
- package/limit-orders/limit-buys/utils.d.ts +4 -0
- package/limit-orders/{component → limit-sells/component}/input-group/input-group.hooks.d.ts +0 -2
- package/limit-orders/{component → limit-sells/component}/limit-order-button/approve-and-create-limit-order-button.d.ts +1 -0
- package/limit-orders/{component → limit-sells/component}/limit-order-content.d.ts +1 -1
- package/limit-orders/{component → limit-sells/component}/limit-order-overlay.d.ts +3 -3
- package/limit-orders/{component/limit-order-modal.d.ts → limit-sells/component/limit-sell-order-modal.d.ts} +5 -5
- package/limit-orders/limit-sells/component/terms-confirmation.d.ts +8 -0
- package/limit-orders/{constants.d.ts → limit-sells/constants.d.ts} +2 -2
- package/limit-orders/limit-sells/hooks/use-invalidate-limit-sell-order-query.d.ts +1 -0
- package/limit-orders/{hooks → limit-sells/hooks}/use-on-limit-order-settled.d.ts +1 -1
- package/limit-orders/{hooks/use-user-limit-order.d.ts → limit-sells/hooks/use-user-limit-sell-order.d.ts} +3 -3
- package/limit-orders/{providers → limit-sells/providers}/state-provider/reducer.d.ts +1 -1
- package/limit-orders/{providers → limit-sells/providers}/state-provider/state-provider.d.ts +1 -1
- package/limit-orders/{providers → limit-sells/providers}/state-provider/state-provider.types.d.ts +1 -1
- package/limit-orders/{utils.d.ts → limit-sells/utils.d.ts} +3 -3
- package/limit-orders/providers/translation-provider/translation-provider.types.d.ts +1 -0
- package/package.json +1 -1
- package/{derive-BmKPodpX.js → storage-CSc9iE5L.js} +6 -2
- package/storage-DHoO5PX_.cjs +1 -0
- package/style.css +1 -1
- package/trading-widget/components/deposit/button/valid-deposit-button/valid-deposit-button.hooks.d.ts +0 -2
- package/trading-widget/components/widget/widget-buttons/index.d.ts +1 -0
- package/trading-widget/components/widget/widget-buttons/limit-buy-button/limit-buy-button.d.ts +3 -0
- package/trading-widget/components/widget/widget-overlay/hyper-evm-warning-overlay/hyper-evm-warning-overlay.d.ts +3 -0
- package/trading-widget/components/widget/widget-overlay/index.d.ts +2 -0
- package/trading-widget/components/widget/widget-overlay/limit-buys-overlay/limit-buys-overlay.d.ts +3 -0
- package/trading-widget/components/widget/widget-overlay/limit-buys-overlay/limit-buys-overlay.hooks.d.ts +17 -0
- package/trading-widget/components/widget/widget-settings/index.d.ts +0 -1
- package/trading-widget/components/widget/widget-settings/slippage-selector/slippage-selector.hooks.d.ts +1 -1
- package/trading-widget/hooks/index.d.ts +3 -1
- package/trading-widget/hooks/use-display-limit-buy-overlay.d.ts +1 -0
- package/trading-widget/hooks/use-open-limit-buys-overlay.d.ts +4 -0
- package/trading-widget/hooks/use-show-hyper-evm-deposit-warning.d.ts +1 -0
- package/trading-widget/providers/config-provider/config-provider.types.d.ts +3 -0
- package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +7 -5
- package/trading-widget/types/overlay.types.d.ts +2 -0
- package/utils.cjs +1 -1
- package/utils.js +32 -34
- package/complex-withdraw-asset-data-Cmnlgieq.cjs +0 -1
- package/core-kit/hooks/trading/deposit-v2/deposit-transaction/use-batch-approve-transaction.d.ts +0 -141
- package/core-kit/hooks/trading/deposit-v2/deposit-transaction/use-batch-deposit.d.ts +0 -1
- package/core-kit/hooks/trading/trade-handlers/use-batch-trading-settle-handler.d.ts +0 -5
- package/core-kit/hooks/trading/use-is-batch-contract-writes-trading.d.ts +0 -1
- package/core-kit/hooks/web3/use-custom-send-calls.d.ts +0 -14
- package/core-kit/hooks/web3/use-is-batch-contract-writes-supported.d.ts +0 -1
- package/core-kit/utils/batch-transactions.d.ts +0 -2
- package/derive-CsdqSZEg.cjs +0 -1
- package/limit-orders/component/input-group/terms-content.d.ts +0 -6
- package/limit-orders/component/limit-order-button/network-check-button.d.ts +0 -2
- package/limit-orders/component/limit-order-button/network-check-button.hooks.d.ts +0 -4
- package/limit-orders/hooks/use-invalidate-limit-order-query.d.ts +0 -1
- package/storage-Bbr6G6F3.cjs +0 -1
- package/trading-widget/components/deposit/button/batch-trade-button.d.ts +0 -2
- package/trading-widget/components/widget/widget-settings/batch-transactions-switch/batch-transactions-switch.d.ts +0 -2
- package/trading-widget/components/widget/widget-settings/batch-transactions-switch/batch-transactions-switch.hooks.d.ts +0 -1
- package/trading-widget/hooks/use-trading-type-name.d.ts +0 -2
- /package/limit-orders/{component/common → common}/action-button.d.ts +0 -0
- /package/limit-orders/{component/common → common}/asset-price-panel.d.ts +0 -0
- /package/limit-orders/{component/common → common}/modal-content.d.ts +0 -0
- /package/limit-orders/{component/common → common}/modal-dialog.d.ts +0 -0
- /package/limit-orders/{component/common → common}/percentage-input.d.ts +0 -0
- /package/limit-orders/{component/common → common}/price-input.d.ts +0 -0
- /package/limit-orders/{component/common → common}/switch-panel.d.ts +0 -0
- /package/limit-orders/{component → limit-sells/component}/input-group/input-group.d.ts +0 -0
- /package/limit-orders/{component → limit-sells/component}/limit-order-button/approve-and-create-limit-order-button.hooks.d.ts +0 -0
- /package/limit-orders/{component → limit-sells/component}/limit-order-button/limit-order-delete-button.d.ts +0 -0
- /package/limit-orders/{component → limit-sells/component}/limit-order-button/limit-order-delete-button.hooks.d.ts +0 -0
- /package/limit-orders/{component → limit-sells/component}/limit-order-content.hooks.d.ts +0 -0
- /package/limit-orders/{component → limit-sells/component}/limit-order-modal.hooks.d.ts +0 -0
- /package/limit-orders/{hooks → limit-sells/hooks}/state.d.ts +0 -0
- /package/limit-orders/{hooks → limit-sells/hooks}/use-approve-and-create-limit-order.d.ts +0 -0
- /package/limit-orders/{hooks → limit-sells/hooks}/use-create-limit-order-transaction.d.ts +0 -0
- /package/limit-orders/{hooks → limit-sells/hooks}/use-existing-limit-order-default-prices.d.ts +0 -0
- /package/limit-orders/{hooks → limit-sells/hooks}/use-is-limit-order-approved.d.ts +0 -0
- /package/limit-orders/{hooks → limit-sells/hooks}/use-limit-order-approve-transaction.d.ts +0 -0
- /package/limit-orders/{hooks → limit-sells/hooks}/use-limit-order-covered-vault-amount.d.ts +0 -0
- /package/limit-orders/{hooks → limit-sells/hooks}/use-listen-limit-order-execution.d.ts +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import i from "bignumber.js";
|
|
2
|
-
import {
|
|
3
|
-
import { stringToHex as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
return
|
|
2
|
+
import { aj as L, ah as I, ai as R, b as S, q as T, ak as B, al as b, a3 as C, c as O, a7 as F, ad as M, ac as P, Z as x, am as h, f as $, e as v, M as U, R as K, P as W, an as V, ao as Y, Q as G, N as Z, aa as p, _ as H, W as k, X as Q, U as j } from "./gmx-BroDb_q_.js";
|
|
3
|
+
import { stringToHex as _, encodeAbiParameters as f } from "viem";
|
|
4
|
+
const z = () => typeof window < "u";
|
|
5
|
+
function X() {
|
|
6
|
+
return z() && typeof window.ethereum < "u";
|
|
7
7
|
}
|
|
8
|
-
async function
|
|
8
|
+
async function pt(t) {
|
|
9
9
|
try {
|
|
10
|
-
if (
|
|
10
|
+
if (X())
|
|
11
11
|
return window.ethereum.request({
|
|
12
12
|
method: "wallet_watchAsset",
|
|
13
13
|
params: {
|
|
@@ -20,30 +20,30 @@ async function _t(t) {
|
|
|
20
20
|
}
|
|
21
21
|
return !1;
|
|
22
22
|
}
|
|
23
|
-
const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(),
|
|
23
|
+
const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), St = (t) => d(t, L), q = (t, e) => R[e]?.[t] ?? S, Tt = (t) => I[t], _t = (t) => t && `${t.substring(0, 6)}...${t.substring(
|
|
24
24
|
t.length - 4,
|
|
25
25
|
t.length
|
|
26
|
-
)}`,
|
|
26
|
+
)}`, ft = ({
|
|
27
27
|
address: t,
|
|
28
28
|
chainId: e
|
|
29
29
|
}) => {
|
|
30
|
-
const s =
|
|
30
|
+
const s = q(
|
|
31
31
|
"aaveLendingPoolV3",
|
|
32
32
|
e
|
|
33
33
|
);
|
|
34
34
|
return d(t, s);
|
|
35
|
-
},
|
|
35
|
+
}, J = ({
|
|
36
36
|
sourceAddress: t,
|
|
37
37
|
amount: e
|
|
38
38
|
}) => `${t}_${e}`, Dt = (t, e) => {
|
|
39
39
|
const s = t.slice(0, e), a = t.slice(e);
|
|
40
40
|
return { firstPart: s, secondPart: a };
|
|
41
|
-
},
|
|
42
|
-
new i(t || "0").shiftedBy(
|
|
43
|
-
),
|
|
41
|
+
}, tt = (t, e) => t / e * 100, wt = (t) => t < 1 ? 4 : t < 10 ? 3 : 2, Et = (t, e = T) => new i(t.toString()).shiftedBy(e).toFixed(0), Nt = (t, e, s, a) => new i(e).dividedBy(s).multipliedBy(t).shiftedBy(-(a || T)).toNumber(), ht = (t) => BigInt(
|
|
42
|
+
new i(t || "0").shiftedBy(T).toFixed(0, i.ROUND_DOWN)
|
|
43
|
+
), yt = (t) => {
|
|
44
44
|
const e = new i(0.01), s = new i(t), a = !s.isZero() && s.lt(e) ? e : s;
|
|
45
45
|
return BigInt(a.multipliedBy(100).toFixed(0));
|
|
46
|
-
},
|
|
46
|
+
}, Lt = ({
|
|
47
47
|
vaultAddress: t,
|
|
48
48
|
swapData: e,
|
|
49
49
|
sendTokenAddress: s,
|
|
@@ -54,9 +54,9 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
|
|
|
54
54
|
swapDestinationAmount: c,
|
|
55
55
|
swapSlippage: u
|
|
56
56
|
}) => {
|
|
57
|
-
const l = new i(c).multipliedBy(1 - u / 100).toFixed(0), A = [
|
|
57
|
+
const l = new i(c).multipliedBy(1 - u / 100).toFixed(0), A = [_(o, { size: 32 }), e];
|
|
58
58
|
return [t, [[s, a, A], [n, l]], r];
|
|
59
|
-
},
|
|
59
|
+
}, It = ({
|
|
60
60
|
receiveAssetAddress: t,
|
|
61
61
|
assets: e,
|
|
62
62
|
swapData: s
|
|
@@ -69,7 +69,7 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
|
|
|
69
69
|
if (!c)
|
|
70
70
|
return r;
|
|
71
71
|
const u = [
|
|
72
|
-
|
|
72
|
+
_(c.routerKey, { size: 32 }),
|
|
73
73
|
c.rawTransaction.data
|
|
74
74
|
], l = [o.address, o.rawBalance, u];
|
|
75
75
|
return {
|
|
@@ -86,7 +86,7 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
|
|
|
86
86
|
"0"
|
|
87
87
|
]
|
|
88
88
|
];
|
|
89
|
-
},
|
|
89
|
+
}, et = ({
|
|
90
90
|
assetAddress: t,
|
|
91
91
|
swapQuotes: e,
|
|
92
92
|
swapParams: s,
|
|
@@ -100,22 +100,22 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
|
|
|
100
100
|
slippageTolerance: BigInt(0)
|
|
101
101
|
};
|
|
102
102
|
const { srcData: r, dstData: o } = s, c = r.map(({ asset: A, amount: m }) => {
|
|
103
|
-
const
|
|
103
|
+
const g = e?.[J({
|
|
104
104
|
sourceAddress: A,
|
|
105
105
|
amount: m.toString()
|
|
106
|
-
})]?.find((
|
|
106
|
+
})]?.find((y) => y.routerKey === n);
|
|
107
107
|
return {
|
|
108
108
|
asset: A,
|
|
109
109
|
amount: m,
|
|
110
110
|
swapData: {
|
|
111
|
-
routerKey:
|
|
112
|
-
txData:
|
|
111
|
+
routerKey: _(g?.routerKey ?? "", { size: 32 }),
|
|
112
|
+
txData: g?.rawTransaction.data ?? "0x"
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
115
|
}), u = f(
|
|
116
|
-
|
|
116
|
+
B,
|
|
117
117
|
[c]
|
|
118
|
-
), l = f(
|
|
118
|
+
), l = f(b, [
|
|
119
119
|
{
|
|
120
120
|
encodedSrcData: u,
|
|
121
121
|
dstData: {
|
|
@@ -130,16 +130,16 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
|
|
|
130
130
|
withdrawData: l,
|
|
131
131
|
slippageTolerance: a
|
|
132
132
|
};
|
|
133
|
-
},
|
|
133
|
+
}, Rt = (t, e) => O[e]?.nativeTokenSymbol === t, Bt = ({
|
|
134
134
|
nativeTokenBalance: t,
|
|
135
135
|
tokenDecimals: e,
|
|
136
136
|
gasPrice: s
|
|
137
137
|
}) => {
|
|
138
|
-
const a = new i(s).multipliedBy(
|
|
138
|
+
const a = new i(s).multipliedBy(C).shiftedBy(-e), n = new i(t).minus(
|
|
139
139
|
a
|
|
140
140
|
);
|
|
141
141
|
return n.gt("0") ? n : new i("0");
|
|
142
|
-
},
|
|
142
|
+
}, bt = (t) => F.includes(t), Ct = (t) => {
|
|
143
143
|
const e = Object.values(t).reduce(
|
|
144
144
|
(s, { type: a }) => (s[a] = s[a] + 1, s),
|
|
145
145
|
{ string: 0, number: 0 }
|
|
@@ -149,27 +149,27 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
|
|
|
149
149
|
if (e.number > 40)
|
|
150
150
|
throw new Error("logger params must contain up to 40 numeric values");
|
|
151
151
|
return !0;
|
|
152
|
-
},
|
|
152
|
+
}, st = (t, e = 150) => t.length > e ? t.substring(0, e) : t, D = (t, e = M) => {
|
|
153
153
|
const s = t.toLowerCase();
|
|
154
154
|
return e.sort((a, n) => n.length - a.length).find((a) => s.includes(a.toLowerCase()));
|
|
155
|
-
},
|
|
155
|
+
}, w = (t) => P[t] ?? x[t], Ot = ({
|
|
156
156
|
errorMessage: t,
|
|
157
157
|
abiErrors: e
|
|
158
158
|
}) => {
|
|
159
159
|
if (!t || t.includes("User rejected"))
|
|
160
160
|
return null;
|
|
161
161
|
const s = e.find((r) => t.includes(r));
|
|
162
|
-
if (s &&
|
|
163
|
-
return
|
|
164
|
-
const a =
|
|
162
|
+
if (s && D(s))
|
|
163
|
+
return w(s);
|
|
164
|
+
const a = D(t);
|
|
165
165
|
if (a)
|
|
166
|
-
return
|
|
166
|
+
return w(a);
|
|
167
167
|
const [n] = t.split(s ? "." : "Contract").map((r) => r.trim());
|
|
168
168
|
return {
|
|
169
169
|
title: "Transaction failed",
|
|
170
|
-
hint: `${
|
|
170
|
+
hint: `${st(n ?? "")} ${s ? `: ${s}` : ""}`
|
|
171
171
|
};
|
|
172
|
-
},
|
|
172
|
+
}, Ft = (t) => typeof t == "number" && Number.isFinite(t), Mt = (t) => typeof t == "bigint" && t !== BigInt(0), at = (t, e = h) => new i(t).shiftedBy(-e).toNumber(), nt = (t) => !isNaN(parseFloat(t)) && !isNaN(t), rt = ({
|
|
173
173
|
value: t,
|
|
174
174
|
minimumFractionDigits: e = 2,
|
|
175
175
|
maximumFractionDigits: s = 2,
|
|
@@ -181,42 +181,42 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
|
|
|
181
181
|
notation: a ? "compact" : void 0,
|
|
182
182
|
minimumFractionDigits: e,
|
|
183
183
|
maximumFractionDigits: s
|
|
184
|
-
}).format(n ?
|
|
184
|
+
}).format(n ? at(t) : Number(t)), E = (t) => nt(t) ? new i(t).toFixed() : "", N = ["₀", "₁", "₂", "₃", "₄", "₅", "₆", "₇", "₈", "₉"], ot = ({
|
|
185
185
|
value: t,
|
|
186
186
|
decimals: e = 4
|
|
187
187
|
}) => {
|
|
188
188
|
const s = new i(t);
|
|
189
189
|
if (s.isGreaterThan(1) || s.isZero())
|
|
190
|
-
return
|
|
190
|
+
return E(s.toFixed(e));
|
|
191
191
|
const n = (/e/i.test(t.toString()) ? parseFloat(t.toString()).toFixed(h) : t.toString()).match(/^0\.(0+)(\d+)$/);
|
|
192
192
|
if (n) {
|
|
193
193
|
const [, r, o] = n;
|
|
194
|
-
if (r.length >= e && r.length <
|
|
195
|
-
return `0.0${
|
|
194
|
+
if (r.length >= e && r.length < N.length)
|
|
195
|
+
return `0.0${N[r.length]}${o.slice(0, 3)}`;
|
|
196
196
|
}
|
|
197
|
-
return
|
|
198
|
-
},
|
|
199
|
-
const a =
|
|
200
|
-
return
|
|
201
|
-
},
|
|
197
|
+
return E(s.toFixed(e));
|
|
198
|
+
}, it = (t, e = 0) => `${t.toLocaleString("en-US", { maximumFractionDigits: e })}%`, Pt = (t) => t.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","), xt = (t, e, s = 0) => {
|
|
199
|
+
const a = tt(+t, e);
|
|
200
|
+
return it(a, s);
|
|
201
|
+
}, $t = ({
|
|
202
202
|
currency: t,
|
|
203
203
|
value: e
|
|
204
|
-
}) => t === "USD" ?
|
|
204
|
+
}) => t === "USD" ? rt({ value: e }) : `${$[t]} ${ot({
|
|
205
205
|
value: e,
|
|
206
|
-
decimals:
|
|
207
|
-
})}`,
|
|
206
|
+
decimals: v[t]
|
|
207
|
+
})}`, ct = (t, e) => new i(
|
|
208
208
|
new i(t).toFixed(e, i.ROUND_DOWN)
|
|
209
|
-
).toString(),
|
|
209
|
+
).toString(), ut = (t, e = 3, s = 2) => {
|
|
210
210
|
if (t.length <= 5)
|
|
211
211
|
return t;
|
|
212
212
|
const a = "...";
|
|
213
213
|
return t.length <= e + s + a.length ? t : `${t.slice(0, e)}${a}${t.slice(-s)}`;
|
|
214
|
-
},
|
|
214
|
+
}, vt = ({
|
|
215
215
|
balance: t,
|
|
216
216
|
symbol: e,
|
|
217
217
|
precision: s,
|
|
218
218
|
truncateSymbol: a
|
|
219
|
-
}) => `${
|
|
219
|
+
}) => `${ct(t, s)} ${a ? ut(e) : e}`, Ut = (t) => {
|
|
220
220
|
if (!t)
|
|
221
221
|
return;
|
|
222
222
|
const e = t.match(/0x[a-fA-F0-9]{64}/);
|
|
@@ -224,13 +224,13 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
|
|
|
224
224
|
return;
|
|
225
225
|
const s = e[0];
|
|
226
226
|
return `${s.slice(0, 4)}...${s.slice(-3)}`;
|
|
227
|
-
},
|
|
227
|
+
}, Kt = typeof window < "u", Wt = (t) => d(V, t) || d(Y, t), Vt = (t) => Z.some(
|
|
228
228
|
(e) => d(e, t)
|
|
229
|
-
),
|
|
229
|
+
), Yt = (t) => U[t.toLowerCase()] ?? {
|
|
230
230
|
symbol: "",
|
|
231
231
|
decimals: 18,
|
|
232
|
-
address:
|
|
233
|
-
},
|
|
232
|
+
address: S
|
|
233
|
+
}, Gt = (t) => d(t, G) ? K : W, dt = (t) => `eth_${t}`, Zt = ({
|
|
234
234
|
action: t,
|
|
235
235
|
log: e,
|
|
236
236
|
symbol: s,
|
|
@@ -238,60 +238,37 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
|
|
|
238
238
|
chainId: n
|
|
239
239
|
}) => {
|
|
240
240
|
const r = {
|
|
241
|
-
[
|
|
242
|
-
[
|
|
243
|
-
[
|
|
241
|
+
[p.SYMBOL.NAME]: s,
|
|
242
|
+
[p.CHAIN_ID.NAME]: n,
|
|
243
|
+
[p.ADDRESS.NAME]: dt(a)
|
|
244
244
|
};
|
|
245
|
-
|
|
245
|
+
H[t].forEach((o) => {
|
|
246
246
|
e?.(o, r);
|
|
247
247
|
});
|
|
248
|
-
},
|
|
248
|
+
}, Ht = (t) => j.some((e) => d(e, t)), kt = (t) => k[t.toLowerCase()] ?? {
|
|
249
249
|
symbol: "",
|
|
250
250
|
decimals: 18,
|
|
251
|
-
address:
|
|
252
|
-
},
|
|
253
|
-
function zt() {
|
|
254
|
-
if (I)
|
|
255
|
-
try {
|
|
256
|
-
const t = localStorage.getItem(
|
|
257
|
-
y.IS_BATCH_TRANSACTIONS_ENABLED
|
|
258
|
-
);
|
|
259
|
-
return t ? JSON.parse(t) : void 0;
|
|
260
|
-
} catch {
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
function Xt(t) {
|
|
265
|
-
if (I)
|
|
266
|
-
try {
|
|
267
|
-
localStorage.setItem(
|
|
268
|
-
y.IS_BATCH_TRANSACTIONS_ENABLED,
|
|
269
|
-
JSON.stringify(t)
|
|
270
|
-
);
|
|
271
|
-
} catch (e) {
|
|
272
|
-
console.error("[core-kit]: Failed to persist batch transactions setting", e);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
const qt = (t) => {
|
|
251
|
+
address: S
|
|
252
|
+
}, Qt = (t) => Q[t.toLowerCase()], jt = (t) => {
|
|
276
253
|
const e = t.find(
|
|
277
254
|
({ swapQuotes: s }) => s
|
|
278
255
|
);
|
|
279
256
|
return e?.swapQuotes ? Object.values(e.swapQuotes)[0]?.map(
|
|
280
257
|
({ routerKey: s }) => s
|
|
281
258
|
) ?? [] : [];
|
|
282
|
-
},
|
|
259
|
+
}, lt = (t, e, s) => t.map(({ asset: a, swapParams: n, swapQuotes: r }) => !n || !r ? {
|
|
283
260
|
supportedAsset: a,
|
|
284
261
|
withdrawData: "",
|
|
285
262
|
slippageTolerance: s
|
|
286
|
-
} :
|
|
263
|
+
} : et({
|
|
287
264
|
assetAddress: a,
|
|
288
265
|
swapQuotes: r,
|
|
289
266
|
swapParams: n,
|
|
290
267
|
slippageToleranceForContractTransaction: s,
|
|
291
268
|
routerKey: e
|
|
292
|
-
})),
|
|
269
|
+
})), zt = async (t, e, s, a, n) => {
|
|
293
270
|
for (const r of t) {
|
|
294
|
-
const o =
|
|
271
|
+
const o = lt(
|
|
295
272
|
e,
|
|
296
273
|
r,
|
|
297
274
|
s
|
|
@@ -300,11 +277,11 @@ const qt = (t) => {
|
|
|
300
277
|
return o;
|
|
301
278
|
}
|
|
302
279
|
return null;
|
|
303
|
-
},
|
|
280
|
+
}, Xt = (t, e) => (t ?? []).map((s) => ({
|
|
304
281
|
supportedAsset: s,
|
|
305
282
|
withdrawData: "",
|
|
306
283
|
slippageTolerance: e
|
|
307
|
-
})),
|
|
284
|
+
})), qt = async (t, e, {
|
|
308
285
|
fetchAaveSwapParams: s,
|
|
309
286
|
fetchAaveSwapQuotes: a,
|
|
310
287
|
withdrawAmountD18: n,
|
|
@@ -332,60 +309,58 @@ const qt = (t) => {
|
|
|
332
309
|
})
|
|
333
310
|
);
|
|
334
311
|
export {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
312
|
+
E as $,
|
|
313
|
+
ft as A,
|
|
314
|
+
Vt as B,
|
|
315
|
+
Wt as C,
|
|
316
|
+
Ht as D,
|
|
317
|
+
Rt as E,
|
|
318
|
+
bt as F,
|
|
319
|
+
Zt as G,
|
|
320
|
+
ht as H,
|
|
321
|
+
Ot as I,
|
|
322
|
+
Et as J,
|
|
323
|
+
_t as K,
|
|
324
|
+
Dt as L,
|
|
325
|
+
dt as M,
|
|
326
|
+
ut as N,
|
|
327
|
+
zt as O,
|
|
328
|
+
Ct as P,
|
|
329
|
+
St as Q,
|
|
353
330
|
Ft as R,
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
dt as j,
|
|
375
|
-
Ut as k,
|
|
331
|
+
d as S,
|
|
332
|
+
rt as T,
|
|
333
|
+
Mt as U,
|
|
334
|
+
at as V,
|
|
335
|
+
ot as W,
|
|
336
|
+
pt as X,
|
|
337
|
+
it as Y,
|
|
338
|
+
nt as Z,
|
|
339
|
+
Pt as _,
|
|
340
|
+
lt as a,
|
|
341
|
+
et as b,
|
|
342
|
+
J as c,
|
|
343
|
+
It as d,
|
|
344
|
+
Lt as e,
|
|
345
|
+
Kt as f,
|
|
346
|
+
Xt as g,
|
|
347
|
+
qt as h,
|
|
348
|
+
jt as i,
|
|
349
|
+
ct as j,
|
|
350
|
+
$t as k,
|
|
376
351
|
xt as l,
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
352
|
+
vt as m,
|
|
353
|
+
Tt as n,
|
|
354
|
+
q as o,
|
|
380
355
|
wt as p,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
356
|
+
D as q,
|
|
357
|
+
Yt as r,
|
|
358
|
+
Gt as s,
|
|
359
|
+
kt as t,
|
|
360
|
+
Qt as u,
|
|
361
|
+
Bt as v,
|
|
362
|
+
tt as w,
|
|
363
|
+
Nt as x,
|
|
364
|
+
yt as y,
|
|
365
|
+
Ut as z
|
|
391
366
|
};
|
package/const.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./gmx-CLiWBUH_.cjs"),A=require("./storage-DHoO5PX_.cjs"),E=require("wagmi/chains");exports.ALCHEMY_RPC_URL_MAP=_.ALCHEMY_RPC_URL_MAP;exports.AUTO_TRANSACTION_PUSH_DELAY=_.AUTO_TRANSACTION_PUSH_DELAY;exports.AddressZero=_.AddressZero;exports.BRIDGED_TOKENS_SYMBOLS=_.BRIDGED_TOKENS_SYMBOLS;exports.CHAIN_MAP=_.CHAIN_MAP;exports.CHAIN_NATIVE_TOKENS=_.CHAIN_NATIVE_TOKENS;exports.COMPLETE_WITHDRAW_ACTIONS=_.COMPLETE_WITHDRAW_ACTIONS;exports.CURRENCY_DECIMALS_MAP=_.CURRENCY_DECIMALS_MAP;exports.CURRENCY_SYMBOL_MAP=_.CURRENCY_SYMBOL_MAP;exports.DEFAULT_DEBOUNCE_TIME=_.DEFAULT_DEBOUNCE_TIME;exports.DEFAULT_DEPOSIT_METHOD=_.DEFAULT_DEPOSIT_METHOD;exports.DEFAULT_DEPOSIT_SLIPPAGE=_.DEFAULT_DEPOSIT_SLIPPAGE;exports.DEFAULT_DEPOSIT_SLIPPAGE_SCALE=_.DEFAULT_DEPOSIT_SLIPPAGE_SCALE;exports.DEFAULT_ERROR_MESSAGE=_.DEFAULT_ERROR_MESSAGE;exports.DEFAULT_LOCK_TIME=_.DEFAULT_LOCK_TIME;exports.DEFAULT_MAX_GAS_LIMIT=_.DEFAULT_MAX_GAS_LIMIT;exports.DEFAULT_MULTI_ASSET_WITHDRAW_METHOD=_.DEFAULT_MULTI_ASSET_WITHDRAW_METHOD;exports.DEFAULT_NOTIFICATION_DURATION_MS=_.DEFAULT_NOTIFICATION_DURATION_MS;exports.DEFAULT_NO_SWAP_MIN_DEPOSIT_AMOUNT_GAP=_.DEFAULT_NO_SWAP_MIN_DEPOSIT_AMOUNT_GAP;exports.DEFAULT_POLLING_INTERVAL=_.DEFAULT_POLLING_INTERVAL;exports.DEFAULT_PRECISION=_.DEFAULT_PRECISION;exports.DEFAULT_PROMISE_TIMEOUT_MS=_.DEFAULT_PROMISE_TIMEOUT_MS;exports.DEFAULT_RECEIVED_VALUE_GAP=_.DEFAULT_RECEIVED_VALUE_GAP;exports.DEFAULT_SIMULATION_ERROR=_.DEFAULT_SIMULATION_ERROR;exports.DEFAULT_SWAP_TRANSACTION_SLIPPAGE=_.DEFAULT_SWAP_TRANSACTION_SLIPPAGE;exports.DEFAULT_VAULT_TOKEN_PRICE=_.DEFAULT_VAULT_TOKEN_PRICE;exports.DEFAULT_VISIBLE_ASSETS_LIMIT=_.DEFAULT_VISIBLE_ASSETS_LIMIT;exports.DEFAULT_WITHDRAW_SLIPPAGE=_.DEFAULT_WITHDRAW_SLIPPAGE;exports.DEPOSIT_SWAP_DATA_ERROR=_.DEPOSIT_SWAP_DATA_ERROR;exports.EASY_SWAPPER_V2_COMPLETE_WITHDRAW_METHOD=_.EASY_SWAPPER_V2_COMPLETE_WITHDRAW_METHOD;exports.EASY_SWAPPER_V2_DEPOSIT_METHODS=_.EASY_SWAPPER_V2_DEPOSIT_METHODS;exports.EASY_SWAPPER_V2_INITIATE_WITHDRAW_METHOD=_.EASY_SWAPPER_V2_INITIATE_WITHDRAW_METHOD;exports.EASY_SWAPPER_V2_UNROLL_AND_CLAIM_METHOD=_.EASY_SWAPPER_V2_UNROLL_AND_CLAIM_METHOD;exports.EMPTY_POOL_CONFIG=_.EMPTY_POOL_CONFIG;exports.EXTENDED_DEBOUNCE_TIME=_.EXTENDED_DEBOUNCE_TIME;exports.EXTENDED_POLLING_INTERVAL=_.EXTENDED_POLLING_INTERVAL;exports.EXTREMELY_SHORT_POLLING_INTERVAL=_.EXTREMELY_SHORT_POLLING_INTERVAL;exports.FALLBACK_ASSETS_MAP=_.FALLBACK_ASSETS_MAP;exports.FLAT_MONEY_COLLATERAL_MAP=_.FLAT_MONEY_COLLATERAL_MAP;exports.FLAT_MONEY_LEVERAGED_ASSET_ADDRESSES=_.FLAT_MONEY_LEVERAGED_ASSET_ADDRESSES;exports.FLAT_MONEY_UNIT_ADDRESSES=_.FLAT_MONEY_UNIT_ADDRESSES;exports.FLAT_MONEY_UNIT_LINK=_.FLAT_MONEY_UNIT_LINK;exports.FLAT_MONEY_V1_UNIT_ADDRESS=_.FLAT_MONEY_V1_UNIT_ADDRESS;exports.FLAT_MONEY_V1_UNIT_LINK=_.FLAT_MONEY_V1_UNIT_LINK;exports.GAS_ESTIMATION_ERROR=_.GAS_ESTIMATION_ERROR;exports.GAS_LIMIT_BUFFER_COEFF=_.GAS_LIMIT_BUFFER_COEFF;exports.GMX_MARKET_ASSETS=_.GMX_MARKET_ASSETS;exports.GMX_MARKET_ASSETS_MAP=_.GMX_MARKET_ASSETS_MAP;exports.GMX_WITHDRAW_ASSET_MAP=_.GMX_WITHDRAW_ASSET_MAP;exports.GMX_WITHDRAW_ASSET_MAP_BY_VAULT_ADDRESS=_.GMX_WITHDRAW_ASSET_MAP_BY_VAULT_ADDRESS;exports.INVALID_PRICES_LIMIT_ORDER_TITLE=_.INVALID_PRICES_LIMIT_ORDER_TITLE;exports.LIMIT_ORDER_TRANSACTION_ERRORS=_.LIMIT_ORDER_TRANSACTION_ERRORS;exports.LOG_EVENT_BY_TRANSACTION_ACTION_MAP=_.LOG_EVENT_BY_TRANSACTION_ACTION_MAP;exports.MANAGER_FEE_DENOMINATOR=_.MANAGER_FEE_DENOMINATOR;exports.MAX_GAS_LIMIT_MAP=_.MAX_GAS_LIMIT_MAP;exports.MULTI_ASSET_TOKEN=_.MULTI_ASSET_TOKEN;exports.MaxUint256=_.MaxUint256;exports.NATIVE_TOKEN_DEPOSIT_GAS_LIMIT=_.NATIVE_TOKEN_DEPOSIT_GAS_LIMIT;exports.PYTH_API_LINK=_.PYTH_API_LINK;exports.SHORTEN_POLLING_INTERVAL=_.SHORTEN_POLLING_INTERVAL;exports.SIMULATION_TIMEOUT_ERROR=_.SIMULATION_TIMEOUT_ERROR;exports.STABLE_TOKEN_SYMBOLS=_.STABLE_TOKEN_SYMBOLS;exports.SWAP_FAILED_ERROR=_.SWAP_FAILED_ERROR;exports.SWAP_QUOTE_REFRESH_INTERVAL_MS=_.SWAP_QUOTE_REFRESH_INTERVAL_MS;exports.TRADING_LOG_EVENT_PARAM=_.TRADING_LOG_EVENT_PARAM;exports.TRADING_PANEL_LOG_EVENT=_.TRADING_PANEL_LOG_EVENT;exports.TRANSACTION_ERRORS=_.TRANSACTION_ERRORS;exports.TRANSACTION_ERROR_KEYS=_.TRANSACTION_ERROR_KEYS;exports.WBTC_BY_CHAIN_ID=_.WBTC_BY_CHAIN_ID;exports.WETH_BY_CHAIN_ID=_.WETH_BY_CHAIN_ID;exports.WITHDRAW_SWAP_DATA_ERROR=_.WITHDRAW_SWAP_DATA_ERROR;exports.contractsAbisMap=_.contractsAbisMap;exports.contractsAddressesMap=_.contractsAddressesMap;exports.COVERED_CALL_VAULT_ADDRESSES=A.COVERED_CALL_VAULT_ADDRESSES;exports.LOCAL_STORAGE_KEYS=A.LOCAL_STORAGE_KEYS;Object.defineProperty(exports,"arbitrum",{enumerable:!0,get:()=>E.arbitrum});Object.defineProperty(exports,"base",{enumerable:!0,get:()=>E.base});Object.defineProperty(exports,"hyperEvm",{enumerable:!0,get:()=>E.hyperEvm});Object.defineProperty(exports,"mainnet",{enumerable:!0,get:()=>E.mainnet});Object.defineProperty(exports,"optimism",{enumerable:!0,get:()=>E.optimism});Object.defineProperty(exports,"polygon",{enumerable:!0,get:()=>E.polygon});
|
package/const.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { A, a as T, b as I, B as
|
|
2
|
-
import { C as B_ } from "./
|
|
1
|
+
import { A, a as T, b as I, B as S, C as a, c as L, d as R, e as O, f as s, D as N, g as D, h as M, i as P, j as U, k as C, l as F, m as G, n as W, o as Y, p as H, q as V, r as B, s as K, t as r, u as o, v as e, w as t, x as X, y as m, E as p, z as i, F as n, G as c, H as d, I as b, J as f, K as x, L as g, M as h, N as y, O as l, P as u, Q as v, R as Q, S as Z, T as j, U as k, V as q, W as w, X as z, Y as J, Z as $, _ as __, $ as E_, a0 as A_, a1 as T_, a2 as I_, a3 as S_, a4 as a_, a5 as L_, a6 as R_, a7 as O_, a8 as s_, a9 as N_, aa as D_, ab as M_, ac as P_, ad as U_, ae as C_, af as F_, ag as G_, ah as W_, ai as Y_ } from "./gmx-BroDb_q_.js";
|
|
2
|
+
import { C as V_, L as B_ } from "./storage-CSc9iE5L.js";
|
|
3
3
|
import { arbitrum as r_, base as o_, hyperEvm as e_, mainnet as t_, optimism as X_, polygon as m_ } from "wagmi/chains";
|
|
4
4
|
export {
|
|
5
5
|
A as ALCHEMY_RPC_URL_MAP,
|
|
6
6
|
T as AUTO_TRANSACTION_PUSH_DELAY,
|
|
7
7
|
I as AddressZero,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
S as BRIDGED_TOKENS_SYMBOLS,
|
|
9
|
+
a as CHAIN_MAP,
|
|
10
10
|
L as CHAIN_NATIVE_TOKENS,
|
|
11
11
|
R as COMPLETE_WITHDRAW_ACTIONS,
|
|
12
|
-
|
|
12
|
+
V_ as COVERED_CALL_VAULT_ADDRESSES,
|
|
13
13
|
O as CURRENCY_DECIMALS_MAP,
|
|
14
14
|
s as CURRENCY_SYMBOL_MAP,
|
|
15
15
|
N as DEFAULT_DEBOUNCE_TIME,
|
|
@@ -43,42 +43,42 @@ export {
|
|
|
43
43
|
g as FALLBACK_ASSETS_MAP,
|
|
44
44
|
h as FLAT_MONEY_COLLATERAL_MAP,
|
|
45
45
|
y as FLAT_MONEY_LEVERAGED_ASSET_ADDRESSES,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
l as FLAT_MONEY_UNIT_ADDRESSES,
|
|
47
|
+
u as FLAT_MONEY_UNIT_LINK,
|
|
48
|
+
v as FLAT_MONEY_V1_UNIT_ADDRESS,
|
|
49
|
+
Q as FLAT_MONEY_V1_UNIT_LINK,
|
|
50
|
+
Z as GAS_ESTIMATION_ERROR,
|
|
51
|
+
j as GAS_LIMIT_BUFFER_COEFF,
|
|
52
52
|
k as GMX_MARKET_ASSETS,
|
|
53
53
|
q as GMX_MARKET_ASSETS_MAP,
|
|
54
54
|
w as GMX_WITHDRAW_ASSET_MAP,
|
|
55
55
|
z as GMX_WITHDRAW_ASSET_MAP_BY_VAULT_ADDRESS,
|
|
56
56
|
J as INVALID_PRICES_LIMIT_ORDER_TITLE,
|
|
57
57
|
$ as LIMIT_ORDER_TRANSACTION_ERRORS,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
B_ as LOCAL_STORAGE_KEYS,
|
|
59
|
+
__ as LOG_EVENT_BY_TRANSACTION_ACTION_MAP,
|
|
60
|
+
E_ as MANAGER_FEE_DENOMINATOR,
|
|
61
|
+
A_ as MAX_GAS_LIMIT_MAP,
|
|
62
|
+
T_ as MULTI_ASSET_TOKEN,
|
|
63
|
+
I_ as MaxUint256,
|
|
64
64
|
S_ as NATIVE_TOKEN_DEPOSIT_GAS_LIMIT,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
65
|
+
a_ as PYTH_API_LINK,
|
|
66
|
+
L_ as SHORTEN_POLLING_INTERVAL,
|
|
67
|
+
R_ as SIMULATION_TIMEOUT_ERROR,
|
|
68
|
+
O_ as STABLE_TOKEN_SYMBOLS,
|
|
69
|
+
s_ as SWAP_FAILED_ERROR,
|
|
70
|
+
N_ as SWAP_QUOTE_REFRESH_INTERVAL_MS,
|
|
71
|
+
D_ as TRADING_LOG_EVENT_PARAM,
|
|
72
|
+
M_ as TRADING_PANEL_LOG_EVENT,
|
|
73
|
+
P_ as TRANSACTION_ERRORS,
|
|
74
|
+
U_ as TRANSACTION_ERROR_KEYS,
|
|
75
|
+
C_ as WBTC_BY_CHAIN_ID,
|
|
76
|
+
F_ as WETH_BY_CHAIN_ID,
|
|
77
|
+
G_ as WITHDRAW_SWAP_DATA_ERROR,
|
|
78
78
|
r_ as arbitrum,
|
|
79
79
|
o_ as base,
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
W_ as contractsAbisMap,
|
|
81
|
+
Y_ as contractsAddressesMap,
|
|
82
82
|
e_ as hyperEvm,
|
|
83
83
|
t_ as mainnet,
|
|
84
84
|
X_ as optimism,
|
package/core-kit/const/gmx.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const GMX_MARKET_ASSETS_MAP: {
|
|
|
10
10
|
readonly CRV_ARBITRUM: "0x0e46941f9bff8d0784bffa3d0d7883cdb82d7ae7";
|
|
11
11
|
readonly HYPE_ARBITRUM: "0xbcb8fe13d02b023e8f94f6881cc0192fd918a5c0";
|
|
12
12
|
readonly BNB_ARBITRUM: "0x2d340912aa47e33c90efb078e69e70efe2b34b9b";
|
|
13
|
-
readonly BNB_WBTC_USDC_ARBITRUM: "
|
|
13
|
+
readonly BNB_WBTC_USDC_ARBITRUM: "0x065577d05c3d4c11505ed7bc97bbf85d462a6a6f";
|
|
14
14
|
readonly LINK_ARBITRUM: "0x7f1fa204bb700853d36994da19f830b6ad18455c";
|
|
15
15
|
readonly PUMP_ARBITRUM: "0x4c0bb704529fa49a26bd854802d70206982c6f1b";
|
|
16
16
|
readonly GOLD_ARBITRUM: "0xeb28ad1a2e497f4acc5d9b87e7b496623c93061e";
|
|
@@ -11,9 +11,10 @@ export declare const TRADING_PANEL_LOG_EVENT: {
|
|
|
11
11
|
WITHDRAWAL: string;
|
|
12
12
|
TRADING_SETTINGS_OPENED: string;
|
|
13
13
|
INFINITE_ALLOWANCE_CHANGE: string;
|
|
14
|
-
BATCH_TRANSACTIONS_CHANGE: string;
|
|
15
14
|
CREATE_LIMIT_SELL_ORDER: string;
|
|
15
|
+
CREATE_LIMIT_BUY_ORDER: string;
|
|
16
16
|
OPEN_LIMIT_SELL_VIEW: string;
|
|
17
|
+
OPEN_LIMIT_BUY_VIEW: string;
|
|
17
18
|
LIMIT_ORDER_WITHDRAW: string;
|
|
18
19
|
LIMIT_ORDER_WITHDRAW_DELETE: string;
|
|
19
20
|
};
|
|
@@ -41,10 +42,6 @@ export declare const TRADING_LOG_EVENT_PARAM: {
|
|
|
41
42
|
NAME: string;
|
|
42
43
|
TYPE: string;
|
|
43
44
|
};
|
|
44
|
-
IS_BATCH_TRANSACTIONS_ENABLED: {
|
|
45
|
-
NAME: string;
|
|
46
|
-
TYPE: string;
|
|
47
|
-
};
|
|
48
45
|
SOURCE: {
|
|
49
46
|
NAME: string;
|
|
50
47
|
TYPE: string;
|
|
@@ -11,7 +11,7 @@ export declare const useUpdateTradingSettings: () => (payload: Partial<{
|
|
|
11
11
|
isMaxSlippageLoading: boolean;
|
|
12
12
|
availableAggregators: string[];
|
|
13
13
|
selectedAggregators: string[];
|
|
14
|
-
|
|
14
|
+
aggregatorLimitPerChain?: Partial<Record<number, string[]>> | undefined;
|
|
15
15
|
isForceSendEnabled?: boolean | undefined;
|
|
16
16
|
forceSendGas?: number | undefined;
|
|
17
17
|
}>) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves effective available and selected aggregators for the current pool's chain.
|
|
3
|
+
*
|
|
4
|
+
* When `aggregatorLimitPerChain[chainId]` is set, both lists are filtered
|
|
5
|
+
* to include only the aggregators in that allow-list.
|
|
6
|
+
* Otherwise the global flat lists are returned unchanged.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useEffectiveAggregators: () => {
|
|
9
|
+
effectiveAvailableAggregators: string[];
|
|
10
|
+
effectiveSelectedAggregators: string[];
|
|
11
|
+
};
|
|
@@ -2,6 +2,7 @@ export { useSetTradingType, useUpdateTradingModal, useUpdateSendTokenInput, useS
|
|
|
2
2
|
export { useTradingPanelPoolAddress, useTradingPanelPoolConfig, useTradingPanelPoolConfigs, useTradingPanelPoolFallbackData, useIsPoolAddress, } from '../../hooks/state/pool';
|
|
3
3
|
export { useSendTokenInput, useReceiveTokenInput, } from '../../hooks/state/input';
|
|
4
4
|
export { useTradingPanelSettings, useCustomDepositTokensPerChain, } from '../../hooks/state/settings';
|
|
5
|
+
export { useEffectiveAggregators } from '../../hooks/state/aggregators';
|
|
5
6
|
export { useTradingPanelModal } from '../../hooks/state/modal';
|
|
6
7
|
export { useWithdrawAction } from '../../hooks/state/active-action';
|
|
7
8
|
export { useTradingPanelType, useIsDepositTradingPanelType, } from '../../hooks/state/type';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const useDepositCommon: () => {
|
|
2
2
|
chainId: number;
|
|
3
3
|
depositMethod: import("../../../../types").DepositMethodName;
|
|
4
|
-
buildDepositTransactionArgs: (estimate
|
|
4
|
+
buildDepositTransactionArgs: (estimate: import("../../../../types").EstimateCall) => Promise<import("../../../../utils/deposit").DepositArguments>;
|
|
5
5
|
addPendingTransaction: () => void;
|
|
6
6
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { EstimateCall, VaultDepositParams } from '../../../types';
|
|
2
2
|
import type { DepositArguments } from '../../../utils/deposit';
|
|
3
|
-
export declare const useGetVaultDepositTransactionArguments: ({ depositMethod, vaultDepositTokenAddress, }: VaultDepositParams) => (estimate
|
|
3
|
+
export declare const useGetVaultDepositTransactionArguments: ({ depositMethod, vaultDepositTokenAddress, }: VaultDepositParams) => (estimate: EstimateCall) => Promise<DepositArguments>;
|