@dhedge/trading-widget 5.4.0 → 5.6.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 (33) hide show
  1. package/complex-withdraw-asset-data-CJHcItJS.cjs +1 -0
  2. package/{complex-withdraw-asset-data-CsznXzIE.js → complex-withdraw-asset-data-Dcnjfbe1.js} +2 -2
  3. package/const.cjs +1 -1
  4. package/const.js +22 -21
  5. package/core-kit/const/network.d.ts +64 -2
  6. package/core-kit/hooks/state/active-action.d.ts +5 -0
  7. package/core-kit/hooks/state/index.d.ts +1 -1
  8. package/core-kit/types/state.types.d.ts +14 -5
  9. package/core-kit/types/trading-panel.types.d.ts +0 -7
  10. package/core-kit/types/trading.types.d.ts +1 -1
  11. package/index.cjs +1 -1
  12. package/index.d.ts +3 -3
  13. package/index.js +2898 -2776
  14. package/limit-orders/component/limit-order-button/approve-and-create-limit-order-button.d.ts +6 -0
  15. package/limit-orders/component/limit-order-button/{limit-order-button.hooks.d.ts → approve-and-create-limit-order-button.hooks.d.ts} +4 -4
  16. package/limit-orders/hooks/use-approve-and-create-limit-order.d.ts +11 -0
  17. package/limit-orders/hooks/use-create-limit-order-transaction.d.ts +8 -0
  18. package/limit-orders/hooks/use-limit-order-approve-transaction.d.ts +1 -1
  19. package/limit-orders/providers/translation-provider/translation-provider.types.d.ts +3 -0
  20. package/package.json +1 -1
  21. package/{storage-DL2GNx3e.js → storage-CHA9ReGl.js} +337 -323
  22. package/storage-DWlbZwWV.cjs +1 -0
  23. package/trading-widget/components/widget/widget-overlay/trading-overlay/withdrawals/success-withdrawal-overlay.hooks.d.ts +2 -1
  24. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/withdraw-stepper-overlay.hooks.d.ts +4 -3
  25. package/trading-widget/components/withdraw/complete-step/button/claim-button/claim-button.hooks.d.ts +2 -2
  26. package/utils.cjs +1 -1
  27. package/utils.js +1 -1
  28. package/complex-withdraw-asset-data-ColnUVfL.cjs +0 -1
  29. package/core-kit/hooks/state/stepper.d.ts +0 -5
  30. package/limit-orders/component/limit-order-button/limit-order-approve-button.d.ts +0 -2
  31. package/limit-orders/component/limit-order-button/limit-order-approve-button.hooks.d.ts +0 -6
  32. package/limit-orders/component/limit-order-button/limit-order-button.d.ts +0 -6
  33. package/storage-Dk8i88bn.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";const c=require("bignumber.js"),s=require("./storage-DWlbZwWV.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 l=(t,e)=>t?.toLowerCase()===e?.toLowerCase(),$=t=>l(t,s.AddressZero$1),N=(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=N("aaveLendingPoolV3",e);return l(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:A})=>{const u=new c(d).multipliedBy(1-A/100).toFixed(0),g=[m.stringToHex(i,{size:32}),e];return[t,[[r,n,g],[o,u]],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 A=[m.stringToHex(d.routerKey,{size:32}),d.rawTransaction.data],u=[i.address,i.rawBalance,A];return{srcData:[...a.srcData,u],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"}}}),A=m.encodeAbiParameters(s.ComplexWithdrawalAssetSrcDataAbiItem,[d]),u=m.encodeAbiParameters(s.ComplexWithdrawalDataAbiItem,[{encodedSrcData:A,dstData:{dstAddress:i.asset,dstAmount:i.amount},slippage:n}]);return{supportedAsset:t,withdrawData:u,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=="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():"",f=["₀","₁","₂","₃","₄","₅","₆","₇","₈","₉"],R=({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<f.length)return`0.0${f[a.length]}${i.slice(0,3)}`}return _(r.toFixed(e))},C=(t,e=0)=>`${t.toLocaleString("en-US",{maximumFractionDigits:e})}%`,st=t=>t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),ot=(t,e,r=0)=>{const n=w(+t,e);return C(n,r)},at=({currency:t,value:e})=>t==="USD"?L({value:e}):`${s.CURRENCY_SYMBOL_MAP[t]} ${R({value:e,decimals:s.CURRENCY_DECIMALS_MAP[t]})}`,b=(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)}`},it=({balance:t,symbol:e,precision:r,truncateSymbol:n})=>`${b(t,r)} ${n?O(e):e}`,ct=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",dt=t=>l(s.FLATMONEY_EARLY_DEPOSITOR_VAULT_ADDRESS_BASE,t)||l(s.FLATMONEY_DHT_STAKING_VAULT_ADDRESS_BASE,t),At=t=>s.FLAT_MONEY_LEVERAGED_ASSET_ADDRESSES.some(e=>l(e,t)),lt=t=>s.FLAT_MONEY_COLLATERAL_MAP[t.toLowerCase()]??{symbol:"",decimals:18,address:s.AddressZero},ut=t=>l(t,s.FLAT_MONEY_V1_UNIT_ADDRESS)?s.FLAT_MONEY_V1_UNIT_LINK:s.FLAT_MONEY_UNIT_LINK,F=t=>`eth_${t}`,mt=({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)})},gt=t=>s.GMX_MARKET_ASSETS.some(e=>l(e,t)),Tt=t=>s.GMX_WITHDRAW_ASSET_MAP[t.toLowerCase()]??{symbol:"",decimals:18,address:s.AddressZero},St=t=>s.GMX_WITHDRAW_ASSET_MAP_BY_VAULT_ADDRESS[t.toLowerCase()];function Et(){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 _t(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 pt=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})),Dt=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})),Nt=async(t,e,{fetchAaveSwapParams:r,fetchAaveSwapQuotes:n,withdrawAmountD18:o,slippage:a})=>Promise.all((t??[]).map(async i=>{if(!l(i,e))return{asset:i};try{const A=await r({withdrawAmountD18:o,slippage:a});if(A?.srcData.length){const u=await n({swapParams:A,slippage:a});return{asset:i,swapParams:A,swapQuotes:u}}return{asset:i}}catch(A){return console.error(A),{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=st;exports.createDefaultComplexAssetData=ft;exports.enrichAssetsWithSwapQuotes=Nt;exports.extractAvailableRouterKeys=pt;exports.formatBalance=b;exports.formatByCurrency=at;exports.formatNumberToLimitedDecimals=R;exports.formatNumeratorToPercentage=ot;exports.formatPercentage=C;exports.formatToUsd=L;exports.formatTokenBalance=it;exports.getContractAbiById=G;exports.getContractAddressById=N;exports.getConventionalTokenPriceDecimals=Y;exports.getErrorKey=E;exports.getFlatMoneyCollateralByLeverageAddress=lt;exports.getFlatMoneyLinkByUnitAddress=ut;exports.getGmxWithdrawAssetByLeverageAddress=Tt;exports.getGmxWithdrawAssetByVaultAddress=St;exports.getNativeTokenInvestableBalance=X;exports.getPercent=w;exports.getPoolFraction=H;exports.getSlippageToleranceForContractTransaction=Q;exports.getStoredBatchTransactionsEnabled=Et;exports.getTxHashShort=ct;exports.isAaveLendAndBorrowAsset=K;exports.isEqualAddress=l;exports.isFlatMoneyLeveragedAsset=At;exports.isFmpAirdropVaultAddress=dt;exports.isGmxLeveragedAsset=gt;exports.isNativeToken=j;exports.isNumeric=I;exports.isStableSymbol=J;exports.isZeroAddress=$;exports.logTransactionByActionType=mt;exports.nonZeroBigInt=nt;exports.normalizeNumber=B;exports.parseAmountToD18=k;exports.parseContractErrorMessage=rt;exports.persistBatchTransactionsEnabled=_t;exports.removeInsignificantTrailingZeros=_;exports.shiftBy=Z;exports.shortenAddress=W;exports.sliceByIndex=V;exports.transformAddressForAnalytics=F;exports.truncateString=O;exports.tryEstimateWithRouters=Dt;exports.validateLoggerEventParams=tt;
@@ -1,5 +1,5 @@
1
1
  import i from "bignumber.js";
2
- import { ai as B, ag as R, ah as O, b as T, p as _, aj as C, ak as b, a3 as F, c as M, a7 as v, ac as P, ab as x, Y as $, al as h, f as U, e as K, L as Y, Q as V, O as W, am as G, an as H, P as Z, M as k, a9 as S, _ as Q, V as j, W as z, T as X, Z as y } from "./storage-DL2GNx3e.js";
2
+ import { ai as B, ag as R, ah as O, b as T, p as _, aj as C, ak as b, a3 as F, c as M, a7 as v, ac as P, ab as x, Y as $, al as h, f as U, e as K, L as Y, Q as V, O as W, am as G, an as H, P as Z, M as k, a9 as S, _ as Q, V as j, W as z, T as X, Z as y } from "./storage-CHA9ReGl.js";
3
3
  import { stringToHex as p, encodeAbiParameters as f } from "viem";
4
4
  const q = () => typeof window < "u";
5
5
  function J() {
@@ -183,7 +183,7 @@ const d = (t, e) => t?.toLowerCase() === e?.toLowerCase(), pt = (t) => d(t, B),
183
183
  maximumFractionDigits: s
184
184
  }).format(n ? rt(t) : Number(t)), N = (t) => ot(t) ? new i(t).toFixed() : "", w = ["₀", "₁", "₂", "₃", "₄", "₅", "₆", "₇", "₈", "₉"], ct = ({
185
185
  value: t,
186
- decimals: e
186
+ decimals: e = 4
187
187
  }) => {
188
188
  const s = new i(t);
189
189
  if (s.isGreaterThan(1) || s.isZero())
package/const.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./storage-Dk8i88bn.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_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;Object.defineProperty(exports,"arbitrum",{enumerable:!0,get:()=>E.arbitrum});Object.defineProperty(exports,"base",{enumerable:!0,get:()=>E.base});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-DWlbZwWV.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_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;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,5 +1,5 @@
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 t, w as e, x as X, E as i, y as m, z as n, F as p, G as c, H as d, I as b, J as f, K as x, L as g, M as h, N as l, O as u, P as y, Q, R as Z, S as j, T as k, U as q, V as v, 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_ } from "./storage-DL2GNx3e.js";
2
- import { arbitrum as H_, base as V_, mainnet as B_, optimism as K_, polygon as r_ } 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 e, v as o, w as t, x as X, E as m, y 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 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_ } from "./storage-CHA9ReGl.js";
2
+ import { arbitrum as H_, base as V_, hyperEvm as B_, mainnet as K_, optimism as r_, polygon as e_ } from "wagmi/chains";
3
3
  export {
4
4
  A as ALCHEMY_RPC_URL_MAP,
5
5
  T as AUTO_TRANSACTION_PUSH_DELAY,
@@ -25,14 +25,14 @@ export {
25
25
  B as DEFAULT_RECEIVED_VALUE_GAP,
26
26
  K as DEFAULT_SIMULATION_ERROR,
27
27
  r as DEFAULT_SWAP_TRANSACTION_SLIPPAGE,
28
- o as DEFAULT_VAULT_TOKEN_PRICE,
29
- t as DEFAULT_VISIBLE_ASSETS_LIMIT,
30
- e as DEFAULT_WITHDRAW_SLIPPAGE,
28
+ e as DEFAULT_VAULT_TOKEN_PRICE,
29
+ o as DEFAULT_VISIBLE_ASSETS_LIMIT,
30
+ t as DEFAULT_WITHDRAW_SLIPPAGE,
31
31
  X as DEPOSIT_SWAP_DATA_ERROR,
32
- i as EASY_SWAPPER_V2_COMPLETE_WITHDRAW_METHOD,
33
- m as EASY_SWAPPER_V2_DEPOSIT_METHODS,
34
- n as EASY_SWAPPER_V2_INITIATE_WITHDRAW_METHOD,
35
- p as EASY_SWAPPER_V2_UNROLL_AND_CLAIM_METHOD,
32
+ m as EASY_SWAPPER_V2_COMPLETE_WITHDRAW_METHOD,
33
+ p as EASY_SWAPPER_V2_DEPOSIT_METHODS,
34
+ i as EASY_SWAPPER_V2_INITIATE_WITHDRAW_METHOD,
35
+ n as EASY_SWAPPER_V2_UNROLL_AND_CLAIM_METHOD,
36
36
  c as EMPTY_POOL_CONFIG,
37
37
  d as EXTENDED_DEBOUNCE_TIME,
38
38
  b as EXTENDED_POLLING_INTERVAL,
@@ -40,15 +40,15 @@ export {
40
40
  x as FALLBACK_ASSETS_MAP,
41
41
  g as FLAT_MONEY_COLLATERAL_MAP,
42
42
  h as FLAT_MONEY_LEVERAGED_ASSET_ADDRESSES,
43
- l as FLAT_MONEY_UNIT_ADDRESSES,
44
- u as FLAT_MONEY_UNIT_LINK,
45
- y as FLAT_MONEY_V1_UNIT_ADDRESS,
46
- Q as FLAT_MONEY_V1_UNIT_LINK,
47
- Z as GAS_ESTIMATION_ERROR,
48
- j as GAS_LIMIT_BUFFER_COEFF,
49
- k as GMX_MARKET_ASSETS,
50
- q as GMX_MARKET_ASSETS_MAP,
51
- v as GMX_WITHDRAW_ASSET_MAP,
43
+ y as FLAT_MONEY_UNIT_ADDRESSES,
44
+ l as FLAT_MONEY_UNIT_LINK,
45
+ u as FLAT_MONEY_V1_UNIT_ADDRESS,
46
+ v as FLAT_MONEY_V1_UNIT_LINK,
47
+ Q as GAS_ESTIMATION_ERROR,
48
+ Z as GAS_LIMIT_BUFFER_COEFF,
49
+ j as GMX_MARKET_ASSETS,
50
+ k as GMX_MARKET_ASSETS_MAP,
51
+ q as GMX_WITHDRAW_ASSET_MAP,
52
52
  w as GMX_WITHDRAW_ASSET_MAP_BY_VAULT_ADDRESS,
53
53
  z as INVALID_PRICES_LIMIT_ORDER_TITLE,
54
54
  J as LIMIT_ORDER_TRANSACTION_ERRORS,
@@ -75,7 +75,8 @@ export {
75
75
  V_ as base,
76
76
  G_ as contractsAbisMap,
77
77
  W_ as contractsAddressesMap,
78
- B_ as mainnet,
79
- K_ as optimism,
80
- r_ as polygon
78
+ B_ as hyperEvm,
79
+ K_ as mainnet,
80
+ r_ as optimism,
81
+ e_ as polygon
81
82
  };
@@ -1,4 +1,4 @@
1
- import { arbitrum, base, mainnet, optimism, polygon } from 'wagmi/chains';
1
+ import { arbitrum, base, hyperEvm, mainnet, optimism, polygon } from 'wagmi/chains';
2
2
  import type { ChainId, ChainNativeTokenMap } from '../types';
3
3
  export declare const CHAIN_MAP: {
4
4
  readonly 1: {
@@ -847,8 +847,70 @@ export declare const CHAIN_MAP: {
847
847
  uid?: undefined;
848
848
  } | undefined>, parameters: import("viem").VerifyHashActionParameters) => Promise<boolean>) | undefined;
849
849
  };
850
+ readonly 999: {
851
+ blockExplorers: {
852
+ readonly default: {
853
+ readonly name: "HyperEVMScan";
854
+ readonly url: "https://hyperevmscan.io";
855
+ };
856
+ };
857
+ blockTime?: number | undefined;
858
+ contracts?: {
859
+ [x: string]: import("viem").ChainContract | {
860
+ [sourceId: number]: import("viem").ChainContract | undefined;
861
+ } | undefined;
862
+ ensRegistry?: import("viem").ChainContract | undefined;
863
+ ensUniversalResolver?: import("viem").ChainContract | undefined;
864
+ multicall3?: import("viem").ChainContract | undefined;
865
+ erc6492Verifier?: import("viem").ChainContract | undefined;
866
+ } | undefined;
867
+ ensTlds?: readonly string[] | undefined;
868
+ id: 999;
869
+ name: "HyperEVM";
870
+ nativeCurrency: {
871
+ readonly name: "HYPE";
872
+ readonly symbol: "HYPE";
873
+ readonly decimals: 18;
874
+ };
875
+ experimental_preconfirmationTime?: number | undefined;
876
+ rpcUrls: {
877
+ readonly default: {
878
+ readonly http: readonly ["https://rpc.hyperliquid.xyz/evm"];
879
+ };
880
+ };
881
+ sourceId?: number | undefined;
882
+ testnet: false;
883
+ custom?: Record<string, unknown> | undefined;
884
+ extendSchema?: Record<string, unknown> | undefined;
885
+ fees?: import("viem").ChainFees<undefined> | undefined;
886
+ formatters?: undefined;
887
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters<import("wagmi/chains").Chain | undefined, import("viem").Account | undefined, import("wagmi/chains").Chain | undefined, `0x${string}` | import("viem").Account | undefined, import("viem").PrepareTransactionRequestRequest<import("wagmi/chains").Chain | undefined, import("wagmi/chains").Chain | undefined, import("wagmi/chains").Chain | undefined>>, options: {
888
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
889
+ }) => Promise<import("viem").PrepareTransactionRequestParameters<import("wagmi/chains").Chain | undefined, import("viem").Account | undefined, import("wagmi/chains").Chain | undefined, `0x${string}` | import("viem").Account | undefined, import("viem").PrepareTransactionRequestRequest<import("wagmi/chains").Chain | undefined, import("wagmi/chains").Chain | undefined, import("wagmi/chains").Chain | undefined>>>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters<import("wagmi/chains").Chain | undefined, import("viem").Account | undefined, import("wagmi/chains").Chain | undefined, `0x${string}` | import("viem").Account | undefined, import("viem").PrepareTransactionRequestRequest<import("wagmi/chains").Chain | undefined, import("wagmi/chains").Chain | undefined, import("wagmi/chains").Chain | undefined>>, options: {
890
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
891
+ }) => Promise<import("viem").PrepareTransactionRequestParameters<import("wagmi/chains").Chain | undefined, import("viem").Account | undefined, import("wagmi/chains").Chain | undefined, `0x${string}` | import("viem").Account | undefined, import("viem").PrepareTransactionRequestRequest<import("wagmi/chains").Chain | undefined, import("wagmi/chains").Chain | undefined, import("wagmi/chains").Chain | undefined>>>) | undefined, options: {
892
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
893
+ }] | undefined;
894
+ serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable<bigint, number>> | undefined;
895
+ verifyHash?: ((client: import('../types').Client<import("viem").Transport, import("wagmi/chains").Chain | undefined, import("viem").Account | undefined, undefined, {
896
+ [x: string]: unknown;
897
+ account?: undefined;
898
+ batch?: undefined;
899
+ cacheTime?: undefined;
900
+ ccipRead?: undefined;
901
+ chain?: undefined;
902
+ experimental_blockTag?: undefined;
903
+ key?: undefined;
904
+ name?: undefined;
905
+ pollingInterval?: undefined;
906
+ request?: undefined;
907
+ transport?: undefined;
908
+ type?: undefined;
909
+ uid?: undefined;
910
+ } | undefined>, parameters: import("viem").VerifyHashActionParameters) => Promise<boolean>) | undefined;
911
+ };
850
912
  };
851
913
  export declare const CHAIN_NATIVE_TOKENS: ChainNativeTokenMap;
852
914
  export declare const MAX_GAS_LIMIT_MAP: Record<ChainId, number>;
853
915
  export declare const ALCHEMY_RPC_URL_MAP: Record<number, string>;
854
- export { polygon, optimism, arbitrum, base, mainnet };
916
+ export { polygon, optimism, arbitrum, base, mainnet, hyperEvm };
@@ -0,0 +1,5 @@
1
+ import type { TradingPanelActionsState, TradingPanelState } from '../../types/state.types';
2
+ export declare const useWithdrawAction: () => [
3
+ TradingPanelState['withdrawAction'],
4
+ TradingPanelActionsState['updateWithdrawAction']
5
+ ];
@@ -3,7 +3,7 @@ export { useTradingPanelPoolAddress, useTradingPanelPoolConfig, useTradingPanelP
3
3
  export { useSendTokenInput, useReceiveTokenInput, } from '../../hooks/state/input';
4
4
  export { useTradingPanelSettings, useCustomDepositTokensPerChain, } from '../../hooks/state/settings';
5
5
  export { useTradingPanelModal } from '../../hooks/state/modal';
6
- export { useTradingPanelStepper } from '../../hooks/state/stepper';
6
+ export { useWithdrawAction } from '../../hooks/state/active-action';
7
7
  export { useTradingPanelType, useIsDepositTradingPanelType, } from '../../hooks/state/type';
8
8
  export { useTradingPanelTransactions } from '../../hooks/state/transaction';
9
9
  export { useTradingPanelActions, useTradingPanelState, } from '../../hooks/state/context';
@@ -1,7 +1,7 @@
1
1
  import type { SwapDataRequest, SwapDataResponse, TradingToken } from '@shared/types';
2
2
  import type { EstimationError } from '../models';
3
3
  import type { PoolConfig, PoolFallbackData } from '../types/config.types';
4
- import type { DynamicTradingToken, PendingTransaction, StepperState, TokenSelectorPayload, TradingModalStatus, TradingPanelType, TransactionAction, UpdateTransactionsArguments } from '../types/trading-panel.types';
4
+ import type { DynamicTradingToken, PendingTransaction, TokenSelectorPayload, TradingModalStatus, TradingPanelType, TransactionAction, UpdateTransactionsArguments } from '../types/trading-panel.types';
5
5
  import type { Address, ChainId, SimulateTransactionParams, SimulateTransactionResponse, WaitForTransactionReceiptReturnType } from '../types/web3.types';
6
6
  export interface TradingPanelStateModal {
7
7
  isOpen: boolean;
@@ -14,6 +14,15 @@ export interface TradingPanelStateModal {
14
14
  withdrawPercentage?: number;
15
15
  };
16
16
  }
17
+ export interface ActiveActionToken {
18
+ symbol: string;
19
+ amount?: string;
20
+ }
21
+ export interface WithdrawActiveAction {
22
+ sendToken: ActiveActionToken;
23
+ receiveTokens: ActiveActionToken[];
24
+ }
25
+ export type UpdateWithdrawActionPayload = Partial<WithdrawActiveAction> | null;
17
26
  export interface TradingPanelState {
18
27
  settings: {
19
28
  slippage: number | 'auto';
@@ -32,7 +41,7 @@ export interface TradingPanelState {
32
41
  receiveToken: DynamicTradingToken;
33
42
  };
34
43
  modal: TradingPanelStateModal;
35
- stepper: StepperState | null;
44
+ withdrawAction: WithdrawActiveAction | null;
36
45
  poolAddress: PoolConfig['address'];
37
46
  poolConfigMap: Record<PoolConfig['address'], PoolConfig>;
38
47
  transactions: PendingTransaction[];
@@ -47,7 +56,7 @@ export interface TradingPanelSetters {
47
56
  updateTradingSettings: (payload: Partial<TradingPanelState['settings']>) => void;
48
57
  setTradingType: (payload: TradingPanelState['type']) => void;
49
58
  updateTradingModal: (payload: Partial<TradingPanelState['modal']>) => void;
50
- updateStepper: (payload: TradingPanelState['stepper']) => void;
59
+ updateWithdrawAction: (payload: UpdateWithdrawActionPayload) => void;
51
60
  updateTransactions: (payload: UpdateTransactionsArguments) => void;
52
61
  updatePoolFallbackData: (payload: PoolFallbackData) => void;
53
62
  updatePoolConfig: (payload: Record<PoolConfig['address'], Pick<PoolConfig, 'maintenance' | 'maintenanceDeposits' | 'maintenanceWithdrawals' | 'depositCapacity'>>) => void;
@@ -93,8 +102,8 @@ export type TradingPanelAction = {
93
102
  type: 'UPDATE_TRADING_MODAL';
94
103
  payload: Partial<TradingPanelState['modal']>;
95
104
  } | {
96
- type: 'UPDATE_STEPPER';
97
- payload: TradingPanelState['stepper'];
105
+ type: 'UPDATE_WITHDRAW_ACTION';
106
+ payload: UpdateWithdrawActionPayload;
98
107
  } | {
99
108
  type: 'UPDATE_TRADING_TRANSACTIONS';
100
109
  payload: UpdateTransactionsArguments;
@@ -24,13 +24,6 @@ type RemoveTransaction = {
24
24
  export type UpdateTransactionsArguments = AddTransaction | UpdateTransaction | RemoveTransaction;
25
25
  export type TradingPanelType = 'deposit' | 'withdraw';
26
26
  export type TransactionAction = 'deposit' | 'multi_withdraw' | 'single_withdraw' | 'approve' | 'swap' | 'claim' | 'single_withdraw_and_claim' | 'create_limit_sell_order' | 'limit_order_withdraw' | 'delete_limit_order_withdraw';
27
- export interface StepperState {
28
- type: TradingPanelType;
29
- sendTokenAmount?: string;
30
- sendTokenSymbol: string;
31
- receiveTokenAmount?: string;
32
- receiveTokenSymbol: string;
33
- }
34
27
  export type SwapEntity = 'token' | 'pool';
35
28
  export interface TokenSelectorPayload {
36
29
  isOpen: boolean;
@@ -1,5 +1,5 @@
1
1
  import type { Address, ChainId } from '../types/web3.types';
2
- export type NativeTokenSymbol = 'ETH' | 'POL';
2
+ export type NativeTokenSymbol = 'ETH' | 'POL' | 'HYPE';
3
3
  export type ChainNativeTokenMap = {
4
4
  [key in ChainId]?: {
5
5
  nativeTokenSymbol: NativeTokenSymbol;