@dhedge/trading-widget 5.7.4 → 5.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +52 -13
  2. package/{complex-withdraw-asset-data-CSbXrln9.js → complex-withdraw-asset-data-Cf9Ea0VI.js} +55 -54
  3. package/complex-withdraw-asset-data-Cmnlgieq.cjs +1 -0
  4. package/const.cjs +1 -1
  5. package/const.js +62 -61
  6. package/core-kit/abi/easy-swapper-v2.d.ts +32 -0
  7. package/core-kit/abi/index.d.ts +1 -1
  8. package/core-kit/const/default-data.d.ts +2 -2
  9. package/core-kit/const/network.d.ts +1 -0
  10. package/core-kit/hooks/pool/multicall/use-pool.static.d.ts +74 -0
  11. package/core-kit/hooks/pool/use-has-single-asset-withdraw-blockers.d.ts +10 -0
  12. package/core-kit/hooks/referral/index.d.ts +2 -1
  13. package/core-kit/hooks/referral/use-legacy-referral-program.d.ts +2 -0
  14. package/core-kit/hooks/referral/use-referral-address.d.ts +15 -0
  15. package/core-kit/hooks/state/action.d.ts +3 -0
  16. package/core-kit/hooks/state/index.d.ts +1 -1
  17. package/core-kit/hooks/trading/deposit-v2/use-deposit-quote-contract-read.d.ts +32 -0
  18. package/core-kit/hooks/trading/use-easy-swapper-tracked-assets.d.ts +32 -0
  19. package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-tracked-assets.d.ts +10 -0
  20. package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-estimated-receive-assets.d.ts +10 -0
  21. package/core-kit/hooks/trading/withdraw-v2/use-withdraw-assets-info.d.ts +10 -0
  22. package/core-kit/hooks/trading/withdraw-v2/use-withdrawal-vault-address.d.ts +32 -0
  23. package/core-kit/types/referral.types.d.ts +6 -1
  24. package/core-kit/types/state.types.d.ts +4 -0
  25. package/core-kit/utils/deposit.d.ts +4 -3
  26. package/index.cjs +1 -1
  27. package/index.d.ts +4 -4
  28. package/index.js +2856 -2798
  29. package/package.json +1 -1
  30. package/storage-Bbr6G6F3.cjs +1 -0
  31. package/{storage-C-fGORin.js → storage-DhvdxqW3.js} +392 -337
  32. package/trading-widget/components/widget/widget-settings/slippage-selector/slippage-selector.hooks.d.ts +2 -0
  33. package/trading-widget/providers/config-provider/config-provider.types.d.ts +1 -1
  34. package/trading-widget/providers/config-provider/index.d.ts +1 -0
  35. package/trading-widget/providers/config-provider/use-resolved-default-withdraw-slippage.d.ts +1 -0
  36. package/utils.cjs +1 -1
  37. package/utils.js +1 -1
  38. package/complex-withdraw-asset-data-PUJePMgr.cjs +0 -1
  39. package/core-kit/abi/pool-factory.d.ts +0 -57
  40. package/core-kit/hooks/referral/use-referral-program.d.ts +0 -2
  41. package/storage-DpKnvEM4.cjs +0 -1
package/README.md CHANGED
@@ -81,19 +81,19 @@ Top level provider component. Headless part of trading logic. API handles params
81
81
  <details>
82
82
  <summary><code>initialState</code> <code><b>/</b></code> <code>Optional initial state of trading panel</code></summary>
83
83
 
84
- > | name | type | default value | description |
85
- > | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------- |
86
- > | `poolAddress` | Address | `AddressZero` | Current active pool address |
87
- > | `poolConfigMap` | Record<Address, PoolConfig> | `{}` | Map of pool configs available for trading |
88
- > | `settings` | { slippage: `number \| 'auto'`; minSlippage?: `number`; isInfiniteAllowance: `boolean`; isMultiAssetWithdrawalEnabled: `boolean`; isCustomDepositOptionsDisabled?: `boolean`; isMaxSlippageLoading: `boolean`; availableAggregators: `string[]` } | { slippage: `'auto'`; isInfiniteAllowance: `false`; isMultiAssetWithdrawalEnabled: `true`; isMaxSlippageLoading: `false`; availableAggregators: `[]` } | Panel settings |
89
- > | `type` | 'deposit' \| 'withdraw' | `'deposit'` | Trading type |
90
- > | `input` | { sendToken: { address: `Address`; symbol: `string`; value: `string`; decimals: `number`; isLoading?: `boolean` }; receiveToken: { address: `Address`; symbol: `string`; value: `string`; decimals: `number`; isLoading?: `boolean` } } | `poolConfigMap[poolAddress]` | Send/receive tokens pair |
91
- > | `entryFee` | { deposit: `number`; depositWithCustomCooldown: `number`; } | { deposit: `0`; depositWithCustomCooldown: `0.1` } | Entry fee config map |
92
- > | `modal` | { isOpen: `boolean`; status: `'Success' \| 'None' \| 'Mining' \| 'Wallet'`; action: `'deposit' \| 'withdraw' \| 'approve \`; link?: `string`; sendToken: TradingToken \| null; receiveToken: TradingToken \| null } | `{ isOpen: `false`,status: `'None'`, receiveToken: `null`, sendToken: `null` }` | Trading modal state |
93
- > | `transactions` | { action: `'deposit' \| 'withdraw' \| 'approve'`; symbol: `string`; chainId: `ChainId`; txHash?: `Address` }[] | `[]` | Pending transactions |
94
- > | `poolFallbackData` | { address: `Address`; managerLogicAddress?: `Address`; poolCompositions: `PoolComposition[]`; tokenPrice?: `string`; apy?: { value: `number`; currency: `'USD' \| 'ETH'` } } | { address: `AddressZero` } | Current active pool fallback data to override or extend contract's response |
95
- > | `defaultChainId` | number (optional) | undefined | Chain id that will be returned from useNetwork wagmi hook when connected to unsupported network |
96
- > | `customDepositTokensPerChain` | Record<ChainId, TradingToken[]> | `undefined` | Per-chain map of extra deposit tokens that are appended to `depositParams.customTokens`. |
84
+ > | name | type | default value | description |
85
+ > | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
86
+ > | `poolAddress` | Address | `AddressZero` | Current active pool address |
87
+ > | `poolConfigMap` | Record<Address, PoolConfig> | `{}` | Map of pool configs available for trading |
88
+ > | `settings` | { slippage: `number \| 'auto'`; minSlippage?: `number`; isInfiniteAllowance: `boolean`; isMultiAssetWithdrawalEnabled: `boolean`; isCustomDepositOptionsDisabled?: `boolean`; isMaxSlippageLoading: `boolean`; availableAggregators: `string[]`; isForceSendEnabled?: `boolean`; forceSendGas?: `number` } | { slippage: `'auto'`; isInfiniteAllowance: `false`; isMultiAssetWithdrawalEnabled: `true`; isMaxSlippageLoading: `false`; availableAggregators: `[]`; isForceSendEnabled: `false`; forceSendGas: `undefined` } | Panel settings (see **Force Send** note below) |
89
+ > | `type` | 'deposit' \| 'withdraw' | `'deposit'` | Trading type |
90
+ > | `input` | { sendToken: { address: `Address`; symbol: `string`; value: `string`; decimals: `number`; isLoading?: `boolean` }; receiveToken: { address: `Address`; symbol: `string`; value: `string`; decimals: `number`; isLoading?: `boolean` } } | `poolConfigMap[poolAddress]` | Send/receive tokens pair |
91
+ > | `entryFee` | { deposit: `number`; depositWithCustomCooldown: `number`; } | { deposit: `0`; depositWithCustomCooldown: `0.1` } | Entry fee config map |
92
+ > | `modal` | { isOpen: `boolean`; status: `'Success' \| 'None' \| 'Mining' \| 'Wallet'`; action: `'deposit' \| 'withdraw' \| 'approve \`; link?: `string`; sendToken: TradingToken \| null; receiveToken: TradingToken \| null } | `{ isOpen: `false`,status: `'None'`, receiveToken: `null`, sendToken: `null` }` | Trading modal state |
93
+ > | `transactions` | { action: `'deposit' \| 'withdraw' \| 'approve'`; symbol: `string`; chainId: `ChainId`; txHash?: `Address` }[] | `[]` | Pending transactions |
94
+ > | `poolFallbackData` | { address: `Address`; managerLogicAddress?: `Address`; poolCompositions: `PoolComposition[]`; tokenPrice?: `string`; apy?: { value: `number`; currency: `'USD' \| 'ETH'` } } | { address: `AddressZero` } | Current active pool fallback data to override or extend contract's response |
95
+ > | `defaultChainId` | number (optional) | undefined | Chain id that will be returned from useNetwork wagmi hook when connected to unsupported network |
96
+ > | `customDepositTokensPerChain` | Record<ChainId, TradingToken[]> | `undefined` | Per-chain map of extra deposit tokens that are appended to `depositParams.customTokens`. |
97
97
 
98
98
  ###### Source: `packages/trading-widget/src/core-kit/providers/index.tsx`
99
99
 
@@ -101,6 +101,45 @@ Top level provider component. Headless part of trading logic. API handles params
101
101
 
102
102
  </details>
103
103
 
104
+ ---
105
+
106
+ #### ⚠️ Force Send (Development Only)
107
+
108
+ > **Do NOT enable in production.** This feature is intended solely for local development and testing.
109
+
110
+ The `settings.isForceSendEnabled` and `settings.forceSendGas` options allow you to bypass gas estimation errors and force-push transactions to the wallet. When gas estimation fails and `isForceSendEnabled` is `true`, the widget skips the `EstimationError` / simulation flow and immediately sends the transaction with the specified gas limit.
111
+
112
+ | setting | type | default | description |
113
+ | -------------------- | --------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------ |
114
+ | `isForceSendEnabled` | `boolean` | `false` | When `true`, failed gas estimations no longer throw — the transaction is pushed to the wallet instead. |
115
+ | `forceSendGas` | `number` | chain max gas (`MAX_GAS_LIMIT_MAP` value) | Custom gas limit for force-sent transactions. If omitted the chain's default max gas limit is used. |
116
+
117
+ **Example (development only):**
118
+
119
+ ```tsx
120
+ <TradingPanelProvider
121
+ initialState={{
122
+ settings: {
123
+ isForceSendEnabled: true,
124
+ forceSendGas: 5_000_000, // optional — defaults to MAX_GAS_LIMIT_MAP for the chain
125
+ },
126
+ }}
127
+ actions={{ getSwapQuotes }}
128
+ >
129
+ {children}
130
+ </TradingPanelProvider>
131
+ ```
132
+
133
+ You can also toggle force send at runtime:
134
+
135
+ ```ts
136
+ const [, updateSettings] = useTradingPanelSettings()
137
+
138
+ updateSettings({ isForceSendEnabled: true, forceSendGas: 10_000_000 })
139
+ ```
140
+
141
+ ---
142
+
104
143
  <details>
105
144
  <summary><code>PoolConfig</code> <code><b>/</b></code> <code>Vault configuration schema</code></summary>
106
145
 
@@ -1,5 +1,5 @@
1
1
  import i from "bignumber.js";
2
- import { aj as B, ah as R, ai as O, b as T, p as _, ak as C, al as b, a3 as F, c as M, a7 as v, ad as P, ac as x, Y as $, am as h, f as U, e as K, L as Y, Q as V, O as W, an as G, ao as H, P as Z, M as k, aa as g, _ as Q, V as j, W as z, T as X, Z as y } from "./storage-C-fGORin.js";
2
+ import { ak as B, ai as R, aj as O, b as T, q as _, al as b, am as C, a4 as F, c as M, a8 as v, ae as P, ad as $, Z as x, an as h, f as U, e as K, M as W, R as Y, P as V, ao as G, ap as H, Q as Z, N as k, ab as g, $ as Q, W as j, X as z, U as X, _ as y } from "./storage-DhvdxqW3.js";
3
3
  import { stringToHex as p, encodeAbiParameters as f } from "viem";
4
4
  const q = () => typeof window < "u";
5
5
  function J() {
@@ -23,7 +23,7 @@ async function _t(t) {
23
23
  const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B), tt = (t, e) => O[e]?.[t] ?? T, ft = (t) => R[t], Et = (t) => t && `${t.substring(0, 6)}...${t.substring(
24
24
  t.length - 4,
25
25
  t.length
26
- )}`, Dt = ({
26
+ )}`, Nt = ({
27
27
  address: t,
28
28
  chainId: e
29
29
  }) => {
@@ -35,7 +35,7 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
35
35
  }, et = ({
36
36
  sourceAddress: t,
37
37
  amount: e
38
- }) => `${t}_${e}`, Nt = (t, e) => {
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
41
  }, st = (t, e) => t / e * 100, wt = (t) => t < 1 ? 4 : t < 10 ? 3 : 2, ht = (t, e = _) => new i(t.toString()).shiftedBy(e).toFixed(0), yt = (t, e, s, a) => new i(e).dividedBy(s).multipliedBy(t).shiftedBy(-(a || _)).toNumber(), It = (t) => BigInt(
@@ -113,9 +113,9 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
113
113
  }
114
114
  };
115
115
  }), u = f(
116
- C,
116
+ b,
117
117
  [c]
118
- ), l = f(b, [
118
+ ), l = f(C, [
119
119
  {
120
120
  encodedSrcData: u,
121
121
  dstData: {
@@ -130,7 +130,7 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
130
130
  withdrawData: l,
131
131
  slippageTolerance: a
132
132
  };
133
- }, Ot = (t, e) => M[e]?.nativeTokenSymbol === t, Ct = ({
133
+ }, Ot = (t, e) => M[e]?.nativeTokenSymbol === t, bt = ({
134
134
  nativeTokenBalance: t,
135
135
  tokenDecimals: e,
136
136
  gasPrice: s
@@ -139,7 +139,7 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
139
139
  a
140
140
  );
141
141
  return n.gt("0") ? n : new i("0");
142
- }, bt = (t) => v.includes(t), Ft = (t) => {
142
+ }, Ct = (t) => v.includes(t), Ft = (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 }
@@ -152,7 +152,7 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
152
152
  }, nt = (t, e = 150) => t.length > e ? t.substring(0, e) : t, E = (t, e = P) => {
153
153
  const s = t.toLowerCase();
154
154
  return e.sort((a, n) => n.length - a.length).find((a) => s.includes(a.toLowerCase()));
155
- }, D = (t) => x[t] ?? $[t], Mt = ({
155
+ }, N = (t) => $[t] ?? x[t], Mt = ({
156
156
  errorMessage: t,
157
157
  abiErrors: e
158
158
  }) => {
@@ -160,16 +160,16 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
160
160
  return null;
161
161
  const s = e.find((r) => t.includes(r));
162
162
  if (s && E(s))
163
- return D(s);
163
+ return N(s);
164
164
  const a = E(t);
165
165
  if (a)
166
- return D(a);
166
+ return N(a);
167
167
  const [n] = t.split(s ? "." : "Contract").map((r) => r.trim());
168
168
  return {
169
169
  title: "Transaction failed",
170
170
  hint: `${nt(n ?? "")} ${s ? `: ${s}` : ""}`
171
171
  };
172
- }, vt = (t) => typeof t == "bigint" && t !== BigInt(0), rt = (t, e = h) => new i(t).shiftedBy(-e).toNumber(), ot = (t) => !isNaN(parseFloat(t)) && !isNaN(t), it = ({
172
+ }, vt = (t) => typeof t == "number" && Number.isFinite(t), Pt = (t) => typeof t == "bigint" && t !== BigInt(0), rt = (t, e = h) => new i(t).shiftedBy(-e).toNumber(), ot = (t) => !isNaN(parseFloat(t)) && !isNaN(t), it = ({
173
173
  value: t,
174
174
  minimumFractionDigits: e = 2,
175
175
  maximumFractionDigits: s = 2,
@@ -181,24 +181,24 @@ 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 ? rt(t) : Number(t)), N = (t) => ot(t) ? new i(t).toFixed() : "", w = ["₀", "₁", "₂", "₃", "₄", "₅", "₆", "₇", "₈", "₉"], ct = ({
184
+ }).format(n ? rt(t) : Number(t)), D = (t) => ot(t) ? new i(t).toFixed() : "", w = ["₀", "₁", "₂", "₃", "₄", "₅", "₆", "₇", "₈", "₉"], ct = ({
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 N(s.toFixed(e));
190
+ return D(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
194
  if (r.length >= e && r.length < w.length)
195
195
  return `0.0${w[r.length]}${o.slice(0, 3)}`;
196
196
  }
197
- return N(s.toFixed(e));
198
- }, ut = (t, e = 0) => `${t.toLocaleString("en-US", { maximumFractionDigits: e })}%`, Pt = (t) => t.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","), xt = (t, e, s = 0) => {
197
+ return D(s.toFixed(e));
198
+ }, ut = (t, e = 0) => `${t.toLocaleString("en-US", { maximumFractionDigits: e })}%`, $t = (t) => t.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","), xt = (t, e, s = 0) => {
199
199
  const a = st(+t, e);
200
200
  return ut(a, s);
201
- }, $t = ({
201
+ }, Ut = ({
202
202
  currency: t,
203
203
  value: e
204
204
  }) => t === "USD" ? it({ value: e }) : `${U[t]} ${ct({
@@ -211,12 +211,12 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
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
- }, Ut = ({
214
+ }, Kt = ({
215
215
  balance: t,
216
216
  symbol: e,
217
217
  precision: s,
218
218
  truncateSymbol: a
219
- }) => `${dt(t, s)} ${a ? lt(e) : e}`, Kt = (t) => {
219
+ }) => `${dt(t, s)} ${a ? lt(e) : e}`, Wt = (t) => {
220
220
  if (!t)
221
221
  return;
222
222
  const e = t.match(/0x[a-fA-F0-9]{64}/);
@@ -226,11 +226,11 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
226
226
  return `${s.slice(0, 4)}...${s.slice(-3)}`;
227
227
  }, I = typeof window < "u", Yt = (t) => d(G, t) || d(H, t), Vt = (t) => k.some(
228
228
  (e) => d(e, t)
229
- ), Wt = (t) => Y[t.toLowerCase()] ?? {
229
+ ), Gt = (t) => W[t.toLowerCase()] ?? {
230
230
  symbol: "",
231
231
  decimals: 18,
232
232
  address: T
233
- }, Gt = (t) => d(t, Z) ? V : W, At = (t) => `eth_${t}`, Ht = ({
233
+ }, Ht = (t) => d(t, Z) ? Y : V, At = (t) => `eth_${t}`, Zt = ({
234
234
  action: t,
235
235
  log: e,
236
236
  symbol: s,
@@ -245,12 +245,12 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
245
245
  Q[t].forEach((o) => {
246
246
  e?.(o, r);
247
247
  });
248
- }, Zt = (t) => X.some((e) => d(e, t)), kt = (t) => j[t.toLowerCase()] ?? {
248
+ }, kt = (t) => X.some((e) => d(e, t)), Qt = (t) => j[t.toLowerCase()] ?? {
249
249
  symbol: "",
250
250
  decimals: 18,
251
251
  address: T
252
- }, Qt = (t) => z[t.toLowerCase()];
253
- function jt() {
252
+ }, jt = (t) => z[t.toLowerCase()];
253
+ function zt() {
254
254
  if (I)
255
255
  try {
256
256
  const t = localStorage.getItem(
@@ -261,7 +261,7 @@ function jt() {
261
261
  return;
262
262
  }
263
263
  }
264
- function zt(t) {
264
+ function Xt(t) {
265
265
  if (I)
266
266
  try {
267
267
  localStorage.setItem(
@@ -272,7 +272,7 @@ function zt(t) {
272
272
  console.error("[core-kit]: Failed to persist batch transactions setting", e);
273
273
  }
274
274
  }
275
- const Xt = (t) => {
275
+ const qt = (t) => {
276
276
  const e = t.find(
277
277
  ({ swapQuotes: s }) => s
278
278
  );
@@ -289,7 +289,7 @@ const Xt = (t) => {
289
289
  swapParams: n,
290
290
  slippageToleranceForContractTransaction: s,
291
291
  routerKey: e
292
- })), qt = async (t, e, s, a, n) => {
292
+ })), Jt = async (t, e, s, a, n) => {
293
293
  for (const r of t) {
294
294
  const o = mt(
295
295
  e,
@@ -300,11 +300,11 @@ const Xt = (t) => {
300
300
  return o;
301
301
  }
302
302
  return null;
303
- }, Jt = (t, e) => (t ?? []).map((s) => ({
303
+ }, te = (t, e) => (t ?? []).map((s) => ({
304
304
  supportedAsset: s,
305
305
  withdrawData: "",
306
306
  slippageTolerance: e
307
- })), te = async (t, e, {
307
+ })), ee = async (t, e, {
308
308
  fetchAaveSwapParams: s,
309
309
  fetchAaveSwapQuotes: a,
310
310
  withdrawAmountD18: n,
@@ -332,59 +332,60 @@ const Xt = (t) => {
332
332
  })
333
333
  );
334
334
  export {
335
- Pt as $,
336
- Kt as A,
337
- Dt as B,
335
+ ot as $,
336
+ Wt as A,
337
+ Nt as B,
338
338
  Vt as C,
339
339
  Yt as D,
340
- Zt as E,
340
+ kt as E,
341
341
  Ot as F,
342
- bt as G,
343
- Ht as H,
342
+ Ct as G,
343
+ Zt as H,
344
344
  It as I,
345
345
  Mt as J,
346
- zt as K,
346
+ Xt as K,
347
347
  ht as L,
348
348
  Et as M,
349
- Nt as N,
349
+ Dt as N,
350
350
  At as O,
351
351
  lt as P,
352
- qt as Q,
352
+ Jt as Q,
353
353
  Ft as R,
354
354
  pt as S,
355
355
  d as T,
356
356
  it as U,
357
- vt as V,
357
+ Pt as V,
358
358
  rt as W,
359
- ct as X,
360
- _t as Y,
361
- ut as Z,
362
- ot as _,
359
+ vt as X,
360
+ ct as Y,
361
+ _t as Z,
362
+ ut as _,
363
363
  mt as a,
364
- N as a0,
364
+ $t as a0,
365
+ D as a1,
365
366
  at as b,
366
367
  et as c,
367
368
  Rt as d,
368
369
  Bt as e,
369
370
  I as f,
370
- Jt as g,
371
- te as h,
372
- Xt as i,
371
+ te as g,
372
+ ee as h,
373
+ qt as i,
373
374
  dt as j,
374
- $t as k,
375
+ Ut as k,
375
376
  xt as l,
376
- Ut as m,
377
+ Kt as m,
377
378
  ft as n,
378
379
  tt as o,
379
380
  wt as p,
380
381
  E as q,
381
- Wt as r,
382
- Gt as s,
383
- kt as t,
384
- Qt as u,
385
- Ct as v,
382
+ Gt as r,
383
+ Ht as s,
384
+ Qt as t,
385
+ jt as u,
386
+ bt as v,
386
387
  st as w,
387
388
  yt as x,
388
389
  Lt as y,
389
- jt as z
390
+ zt as z
390
391
  };
@@ -0,0 +1 @@
1
+ "use strict";const c=require("bignumber.js"),s=require("./storage-Bbr6G6F3.cjs"),m=require("viem"),P=()=>typeof window<"u";function x(){return P()&&typeof window.ethereum<"u"}async function U(t){try{if(x())return window.ethereum.request({method:"wallet_watchAsset",params:{type:"ERC20",options:t}})}catch{return!1}return!1}const A=(t,e)=>t?.toLowerCase()===e?.toLowerCase(),$=t=>A(t,s.AddressZero$1),f=(t,e)=>s.contractsAddressesMap[e]?.[t]??s.AddressZero,G=t=>s.contractsAbisMap[t],W=t=>t&&`${t.substring(0,6)}...${t.substring(t.length-4,t.length)}`,K=({address:t,chainId:e})=>{const r=f("aaveLendingPoolV3",e);return A(t,r)},y=({sourceAddress:t,amount:e})=>`${t}_${e}`,V=(t,e)=>{const r=t.slice(0,e),n=t.slice(e);return{firstPart:r,secondPart:n}},w=(t,e)=>t/e*100,Y=t=>t<1?4:t<10?3:2,Z=(t,e=s.DEFAULT_PRECISION)=>new c(t.toString()).shiftedBy(e).toFixed(0),H=(t,e,r,n)=>new c(e).dividedBy(r).multipliedBy(t).shiftedBy(-(n||s.DEFAULT_PRECISION)).toNumber(),k=t=>BigInt(new c(t||"0").shiftedBy(s.DEFAULT_PRECISION).toFixed(0,c.ROUND_DOWN)),Q=t=>{const e=new c(.01),r=new c(t),n=!r.isZero()&&r.lt(e)?e:r;return BigInt(n.multipliedBy(100).toFixed(0))},q=({vaultAddress:t,swapData:e,sendTokenAddress:r,sendTokenAmount:n,vaultDepositTokenAddress:o,minVaultTokensReceivedAmount:a,routerKey:i="ONE_INCH",swapDestinationAmount:d,swapSlippage:u})=>{const l=new c(d).multipliedBy(1-u/100).toFixed(0),g=[m.stringToHex(i,{size:32}),e];return[t,[[r,n,g],[o,l]],a]},z=({receiveAssetAddress:t,assets:e,swapData:r})=>{const n={srcData:[],destAmount:new c("0")},{srcData:o}=e?.reduce((a,i)=>{const d=r?.[i.address];if(!d)return a;const u=[m.stringToHex(d.routerKey,{size:32}),d.rawTransaction.data],l=[i.address,i.rawBalance,u];return{srcData:[...a.srcData,l],destAmount:a.destAmount.plus(d.destinationAmount)}},n)??n;return[o,[t,"0"]]},h=({assetAddress:t,swapQuotes:e,swapParams:r,slippageToleranceForContractTransaction:n,routerKey:o})=>{if(!r)return{supportedAsset:t,withdrawData:"",slippageTolerance:BigInt(0)};const{srcData:a,dstData:i}=r,d=a.map(({asset:g,amount:T})=>{const S=e?.[y({sourceAddress:g,amount:T.toString()})]?.find(M=>M.routerKey===o);return{asset:g,amount:T,swapData:{routerKey:m.stringToHex(S?.routerKey??"",{size:32}),txData:S?.rawTransaction.data??"0x"}}}),u=m.encodeAbiParameters(s.ComplexWithdrawalAssetSrcDataAbiItem,[d]),l=m.encodeAbiParameters(s.ComplexWithdrawalDataAbiItem,[{encodedSrcData:u,dstData:{dstAddress:i.asset,dstAmount:i.amount},slippage:n}]);return{supportedAsset:t,withdrawData:l,slippageTolerance:n}},j=(t,e)=>s.CHAIN_NATIVE_TOKENS[e]?.nativeTokenSymbol===t,X=({nativeTokenBalance:t,tokenDecimals:e,gasPrice:r})=>{const n=new c(r).multipliedBy(s.NATIVE_TOKEN_DEPOSIT_GAS_LIMIT).shiftedBy(-e),o=new c(t).minus(n);return o.gt("0")?o:new c("0")},J=t=>s.STABLE_TOKEN_SYMBOLS.includes(t),tt=t=>{const e=Object.values(t).reduce((r,{type:n})=>(r[n]=r[n]+1,r),{string:0,number:0});if(e.string>10)throw new Error("logger params must contain up to 10 string values");if(e.number>40)throw new Error("logger params must contain up to 40 numeric values");return!0},et=(t,e=150)=>t.length>e?t.substring(0,e):t,E=(t,e=s.TRANSACTION_ERROR_KEYS)=>{const r=t.toLowerCase();return e.sort((n,o)=>o.length-n.length).find(n=>r.includes(n.toLowerCase()))},D=t=>s.TRANSACTION_ERRORS[t]??s.LIMIT_ORDER_TRANSACTION_ERRORS[t],rt=({errorMessage:t,abiErrors:e})=>{if(!t||t.includes("User rejected"))return null;const r=e.find(a=>t.includes(a));if(r&&E(r))return D(r);const n=E(t);if(n)return D(n);const[o]=t.split(r?".":"Contract").map(a=>a.trim());return{title:"Transaction failed",hint:`${et(o??"")} ${r?`: ${r}`:""}`}},nt=t=>typeof t=="number"&&Number.isFinite(t),st=t=>typeof t=="bigint"&&t!==BigInt(0),B=(t,e=s.DEFAULT_PRECISION$1)=>new c(t).shiftedBy(-e).toNumber(),I=t=>!isNaN(parseFloat(t))&&!isNaN(t),L=({value:t,minimumFractionDigits:e=2,maximumFractionDigits:r=2,compact:n=!1,normalize:o=!1})=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:n?"compact":void 0,minimumFractionDigits:e,maximumFractionDigits:r}).format(o?B(t):Number(t)),_=t=>I(t)?new c(t).toFixed():"",N=["₀","₁","₂","₃","₄","₅","₆","₇","₈","₉"],b=({value:t,decimals:e=4})=>{const r=new c(t);if(r.isGreaterThan(1)||r.isZero())return _(r.toFixed(e));const o=(/e/i.test(t.toString())?parseFloat(t.toString()).toFixed(s.DEFAULT_PRECISION$1):t.toString()).match(/^0\.(0+)(\d+)$/);if(o){const[,a,i]=o;if(a.length>=e&&a.length<N.length)return`0.0${N[a.length]}${i.slice(0,3)}`}return _(r.toFixed(e))},R=(t,e=0)=>`${t.toLocaleString("en-US",{maximumFractionDigits:e})}%`,ot=t=>t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),at=(t,e,r=0)=>{const n=w(+t,e);return R(n,r)},it=({currency:t,value:e})=>t==="USD"?L({value:e}):`${s.CURRENCY_SYMBOL_MAP[t]} ${b({value:e,decimals:s.CURRENCY_DECIMALS_MAP[t]})}`,C=(t,e)=>new c(new c(t).toFixed(e,c.ROUND_DOWN)).toString(),O=(t,e=3,r=2)=>{if(t.length<=5)return t;const n="...";return t.length<=e+r+n.length?t:`${t.slice(0,e)}${n}${t.slice(-r)}`},ct=({balance:t,symbol:e,precision:r,truncateSymbol:n})=>`${C(t,r)} ${n?O(e):e}`,dt=t=>{if(!t)return;const e=t.match(/0x[a-fA-F0-9]{64}/);if(!e)return;const r=e[0];return`${r.slice(0,4)}...${r.slice(-3)}`},p=typeof window<"u",ut=t=>A(s.FLATMONEY_EARLY_DEPOSITOR_VAULT_ADDRESS_BASE,t)||A(s.FLATMONEY_DHT_STAKING_VAULT_ADDRESS_BASE,t),At=t=>s.FLAT_MONEY_LEVERAGED_ASSET_ADDRESSES.some(e=>A(e,t)),lt=t=>s.FLAT_MONEY_COLLATERAL_MAP[t.toLowerCase()]??{symbol:"",decimals:18,address:s.AddressZero},mt=t=>A(t,s.FLAT_MONEY_V1_UNIT_ADDRESS)?s.FLAT_MONEY_V1_UNIT_LINK:s.FLAT_MONEY_UNIT_LINK,F=t=>`eth_${t}`,gt=({action:t,log:e,symbol:r,vaultAddress:n,chainId:o})=>{const a={[s.TRADING_LOG_EVENT_PARAM.SYMBOL.NAME]:r,[s.TRADING_LOG_EVENT_PARAM.CHAIN_ID.NAME]:o,[s.TRADING_LOG_EVENT_PARAM.ADDRESS.NAME]:F(n)};s.LOG_EVENT_BY_TRANSACTION_ACTION_MAP[t].forEach(i=>{e?.(i,a)})},Tt=t=>s.GMX_MARKET_ASSETS.some(e=>A(e,t)),St=t=>s.GMX_WITHDRAW_ASSET_MAP[t.toLowerCase()]??{symbol:"",decimals:18,address:s.AddressZero},Et=t=>s.GMX_WITHDRAW_ASSET_MAP_BY_VAULT_ADDRESS[t.toLowerCase()];function _t(){if(p)try{const t=localStorage.getItem(s.LOCAL_STORAGE_KEYS.IS_BATCH_TRANSACTIONS_ENABLED);return t?JSON.parse(t):void 0}catch{return}}function pt(t){if(p)try{localStorage.setItem(s.LOCAL_STORAGE_KEYS.IS_BATCH_TRANSACTIONS_ENABLED,JSON.stringify(t))}catch(e){console.error("[core-kit]: Failed to persist batch transactions setting",e)}}const Dt=t=>{const e=t.find(({swapQuotes:r})=>r);return e?.swapQuotes?Object.values(e.swapQuotes)[0]?.map(({routerKey:r})=>r)??[]:[]},v=(t,e,r)=>t.map(({asset:n,swapParams:o,swapQuotes:a})=>!o||!a?{supportedAsset:n,withdrawData:"",slippageTolerance:r}:h({assetAddress:n,swapQuotes:a,swapParams:o,slippageToleranceForContractTransaction:r,routerKey:e})),Nt=async(t,e,r,n,o)=>{for(const a of t){const i=v(e,a,r),{error:d}=await n(...o,i);if(!d)return i}return null},ft=(t,e)=>(t??[]).map(r=>({supportedAsset:r,withdrawData:"",slippageTolerance:e})),yt=async(t,e,{fetchAaveSwapParams:r,fetchAaveSwapQuotes:n,withdrawAmountD18:o,slippage:a})=>Promise.all((t??[]).map(async i=>{if(!A(i,e))return{asset:i};try{const u=await r({withdrawAmountD18:o,slippage:a});if(u?.srcData.length){const l=await n({swapParams:u,slippage:a});return{asset:i,swapParams:u,swapQuotes:l}}return{asset:i}}catch(u){return console.error(u),{asset:i}}}));exports.addTokenToWallet=U;exports.buildAaveWithdrawAssetTransactionData=h;exports.buildComplexAssetDataForRouter=v;exports.buildSwapQuoteKeyForAave=y;exports.buildSwapWithdrawTransactionData=z;exports.buildZapDepositTransactionArguments=q;exports.clientSide=p;exports.commify=ot;exports.createDefaultComplexAssetData=ft;exports.enrichAssetsWithSwapQuotes=yt;exports.extractAvailableRouterKeys=Dt;exports.formatBalance=C;exports.formatByCurrency=it;exports.formatNumberToLimitedDecimals=b;exports.formatNumeratorToPercentage=at;exports.formatPercentage=R;exports.formatToUsd=L;exports.formatTokenBalance=ct;exports.getContractAbiById=G;exports.getContractAddressById=f;exports.getConventionalTokenPriceDecimals=Y;exports.getErrorKey=E;exports.getFlatMoneyCollateralByLeverageAddress=lt;exports.getFlatMoneyLinkByUnitAddress=mt;exports.getGmxWithdrawAssetByLeverageAddress=St;exports.getGmxWithdrawAssetByVaultAddress=Et;exports.getNativeTokenInvestableBalance=X;exports.getPercent=w;exports.getPoolFraction=H;exports.getSlippageToleranceForContractTransaction=Q;exports.getStoredBatchTransactionsEnabled=_t;exports.getTxHashShort=dt;exports.isAaveLendAndBorrowAsset=K;exports.isEqualAddress=A;exports.isFlatMoneyLeveragedAsset=At;exports.isFmpAirdropVaultAddress=ut;exports.isGmxLeveragedAsset=Tt;exports.isNativeToken=j;exports.isNumberType=nt;exports.isNumeric=I;exports.isStableSymbol=J;exports.isZeroAddress=$;exports.logTransactionByActionType=gt;exports.nonZeroBigInt=st;exports.normalizeNumber=B;exports.parseAmountToD18=k;exports.parseContractErrorMessage=rt;exports.persistBatchTransactionsEnabled=pt;exports.removeInsignificantTrailingZeros=_;exports.shiftBy=Z;exports.shortenAddress=W;exports.sliceByIndex=V;exports.transformAddressForAnalytics=F;exports.truncateString=O;exports.tryEstimateWithRouters=Nt;exports.validateLoggerEventParams=tt;
package/const.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./storage-DpKnvEM4.cjs"),A=require("./derive-CsdqSZEg.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_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.LOCAL_STORAGE_KEYS=_.LOCAL_STORAGE_KEYS;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;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});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./storage-Bbr6G6F3.cjs"),A=require("./derive-CsdqSZEg.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.LOCAL_STORAGE_KEYS=_.LOCAL_STORAGE_KEYS;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;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 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 m, E as p, y as X, 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 "./storage-C-fGORin.js";
2
- import { C as V_ } from "./derive-BmKPodpX.js";
3
- import { arbitrum as K_, base as r_, hyperEvm as o_, mainnet as e_, optimism as t_, polygon as m_ } from "wagmi/chains";
1
+ import { A, a as T, b as I, B as a, C as S, 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 j, P as l, Q as u, R as v, S as Q, T as Z, 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 a_, a4 as S_, 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_, aj as H_ } from "./storage-DhvdxqW3.js";
2
+ import { C as B_ } from "./derive-BmKPodpX.js";
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
- S as BRIDGED_TOKENS_SYMBOLS,
9
- a as CHAIN_MAP,
8
+ a as BRIDGED_TOKENS_SYMBOLS,
9
+ S as CHAIN_MAP,
10
10
  L as CHAIN_NATIVE_TOKENS,
11
11
  R as COMPLETE_WITHDRAW_ACTIONS,
12
- V_ as COVERED_CALL_VAULT_ADDRESSES,
12
+ B_ 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,
@@ -18,68 +18,69 @@ export {
18
18
  P as DEFAULT_DEPOSIT_SLIPPAGE_SCALE,
19
19
  U as DEFAULT_ERROR_MESSAGE,
20
20
  C as DEFAULT_LOCK_TIME,
21
- F as DEFAULT_MULTI_ASSET_WITHDRAW_METHOD,
22
- G as DEFAULT_NOTIFICATION_DURATION_MS,
23
- W as DEFAULT_NO_SWAP_MIN_DEPOSIT_AMOUNT_GAP,
24
- Y as DEFAULT_POLLING_INTERVAL,
25
- H as DEFAULT_PRECISION,
26
- V as DEFAULT_PROMISE_TIMEOUT_MS,
27
- B as DEFAULT_RECEIVED_VALUE_GAP,
28
- K as DEFAULT_SIMULATION_ERROR,
29
- r as DEFAULT_SWAP_TRANSACTION_SLIPPAGE,
30
- o as DEFAULT_VAULT_TOKEN_PRICE,
31
- e as DEFAULT_VISIBLE_ASSETS_LIMIT,
32
- t as DEFAULT_WITHDRAW_SLIPPAGE,
21
+ F as DEFAULT_MAX_GAS_LIMIT,
22
+ G as DEFAULT_MULTI_ASSET_WITHDRAW_METHOD,
23
+ W as DEFAULT_NOTIFICATION_DURATION_MS,
24
+ Y as DEFAULT_NO_SWAP_MIN_DEPOSIT_AMOUNT_GAP,
25
+ H as DEFAULT_POLLING_INTERVAL,
26
+ V as DEFAULT_PRECISION,
27
+ B as DEFAULT_PROMISE_TIMEOUT_MS,
28
+ K as DEFAULT_RECEIVED_VALUE_GAP,
29
+ r as DEFAULT_SIMULATION_ERROR,
30
+ o as DEFAULT_SWAP_TRANSACTION_SLIPPAGE,
31
+ e as DEFAULT_VAULT_TOKEN_PRICE,
32
+ t as DEFAULT_VISIBLE_ASSETS_LIMIT,
33
+ X as DEFAULT_WITHDRAW_SLIPPAGE,
33
34
  m as DEPOSIT_SWAP_DATA_ERROR,
34
35
  p as EASY_SWAPPER_V2_COMPLETE_WITHDRAW_METHOD,
35
- X as EASY_SWAPPER_V2_DEPOSIT_METHODS,
36
- i as EASY_SWAPPER_V2_INITIATE_WITHDRAW_METHOD,
37
- n as EASY_SWAPPER_V2_UNROLL_AND_CLAIM_METHOD,
38
- c as EMPTY_POOL_CONFIG,
39
- d as EXTENDED_DEBOUNCE_TIME,
40
- b as EXTENDED_POLLING_INTERVAL,
41
- f as EXTREMELY_SHORT_POLLING_INTERVAL,
42
- x as FALLBACK_ASSETS_MAP,
43
- g as FLAT_MONEY_COLLATERAL_MAP,
44
- h as FLAT_MONEY_LEVERAGED_ASSET_ADDRESSES,
45
- y as FLAT_MONEY_UNIT_ADDRESSES,
36
+ i as EASY_SWAPPER_V2_DEPOSIT_METHODS,
37
+ n as EASY_SWAPPER_V2_INITIATE_WITHDRAW_METHOD,
38
+ c as EASY_SWAPPER_V2_UNROLL_AND_CLAIM_METHOD,
39
+ d as EMPTY_POOL_CONFIG,
40
+ b as EXTENDED_DEBOUNCE_TIME,
41
+ f as EXTENDED_POLLING_INTERVAL,
42
+ x as EXTREMELY_SHORT_POLLING_INTERVAL,
43
+ g as FALLBACK_ASSETS_MAP,
44
+ h as FLAT_MONEY_COLLATERAL_MAP,
45
+ y as FLAT_MONEY_LEVERAGED_ASSET_ADDRESSES,
46
+ j as FLAT_MONEY_UNIT_ADDRESSES,
46
47
  l as FLAT_MONEY_UNIT_LINK,
47
48
  u as FLAT_MONEY_V1_UNIT_ADDRESS,
48
49
  v as FLAT_MONEY_V1_UNIT_LINK,
49
50
  Q as GAS_ESTIMATION_ERROR,
50
51
  Z as GAS_LIMIT_BUFFER_COEFF,
51
- j as GMX_MARKET_ASSETS,
52
- k as GMX_MARKET_ASSETS_MAP,
53
- q as GMX_WITHDRAW_ASSET_MAP,
54
- w as GMX_WITHDRAW_ASSET_MAP_BY_VAULT_ADDRESS,
55
- z as INVALID_PRICES_LIMIT_ORDER_TITLE,
56
- J as LIMIT_ORDER_TRANSACTION_ERRORS,
57
- $ as LOCAL_STORAGE_KEYS,
58
- __ as LOG_EVENT_BY_TRANSACTION_ACTION_MAP,
59
- E_ as MANAGER_FEE_DENOMINATOR,
60
- A_ as MAX_GAS_LIMIT_MAP,
61
- T_ as MULTI_ASSET_TOKEN,
62
- I_ as MaxUint256,
52
+ k as GMX_MARKET_ASSETS,
53
+ q as GMX_MARKET_ASSETS_MAP,
54
+ w as GMX_WITHDRAW_ASSET_MAP,
55
+ z as GMX_WITHDRAW_ASSET_MAP_BY_VAULT_ADDRESS,
56
+ J as INVALID_PRICES_LIMIT_ORDER_TITLE,
57
+ $ as LIMIT_ORDER_TRANSACTION_ERRORS,
58
+ __ as LOCAL_STORAGE_KEYS,
59
+ E_ as LOG_EVENT_BY_TRANSACTION_ACTION_MAP,
60
+ A_ as MANAGER_FEE_DENOMINATOR,
61
+ T_ as MAX_GAS_LIMIT_MAP,
62
+ I_ as MULTI_ASSET_TOKEN,
63
+ a_ as MaxUint256,
63
64
  S_ as NATIVE_TOKEN_DEPOSIT_GAS_LIMIT,
64
- a_ as PYTH_API_LINK,
65
- L_ as SHORTEN_POLLING_INTERVAL,
66
- R_ as SIMULATION_TIMEOUT_ERROR,
67
- O_ as STABLE_TOKEN_SYMBOLS,
68
- s_ as SWAP_FAILED_ERROR,
69
- N_ as SWAP_QUOTE_REFRESH_INTERVAL_MS,
70
- D_ as TRADING_LOG_EVENT_PARAM,
71
- M_ as TRADING_PANEL_LOG_EVENT,
72
- P_ as TRANSACTION_ERRORS,
73
- U_ as TRANSACTION_ERROR_KEYS,
74
- C_ as WBTC_BY_CHAIN_ID,
75
- F_ as WETH_BY_CHAIN_ID,
76
- G_ as WITHDRAW_SWAP_DATA_ERROR,
77
- K_ as arbitrum,
78
- r_ as base,
79
- W_ as contractsAbisMap,
80
- Y_ as contractsAddressesMap,
81
- o_ as hyperEvm,
82
- e_ as mainnet,
83
- t_ as optimism,
65
+ L_ as PYTH_API_LINK,
66
+ R_ as SHORTEN_POLLING_INTERVAL,
67
+ O_ as SIMULATION_TIMEOUT_ERROR,
68
+ s_ as STABLE_TOKEN_SYMBOLS,
69
+ N_ as SWAP_FAILED_ERROR,
70
+ D_ as SWAP_QUOTE_REFRESH_INTERVAL_MS,
71
+ M_ as TRADING_LOG_EVENT_PARAM,
72
+ P_ as TRADING_PANEL_LOG_EVENT,
73
+ U_ as TRANSACTION_ERRORS,
74
+ C_ as TRANSACTION_ERROR_KEYS,
75
+ F_ as WBTC_BY_CHAIN_ID,
76
+ G_ as WETH_BY_CHAIN_ID,
77
+ W_ as WITHDRAW_SWAP_DATA_ERROR,
78
+ r_ as arbitrum,
79
+ o_ as base,
80
+ Y_ as contractsAbisMap,
81
+ H_ as contractsAddressesMap,
82
+ e_ as hyperEvm,
83
+ t_ as mainnet,
84
+ X_ as optimism,
84
85
  m_ as polygon
85
86
  };