@dhedge/trading-widget 6.2.2 → 6.3.2

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/dytm-BGpelTOE.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";const A=require("wagmi/chains"),o=require("./gmx-DJ0gqvLq.cjs"),p=require("bignumber.js"),u=require("viem"),dt=typeof window<"u",ut=[{inputs:[{internalType:"address",name:"_pool",type:"address"},{internalType:"address",name:"_asset",type:"address"},{internalType:"uint256",name:"_poolTokenAmount",type:"uint256"}],name:"previewGmTokenAmount",outputs:[{internalType:"uint256",name:"gmTokenAmount",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"ondoGMSwap",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"usdc",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"}],pt=[{type:"tuple",components:[{name:"attestationSignature",type:"bytes"},{name:"quote",type:"tuple",components:[{name:"chainId",type:"uint256"},{name:"attestationId",type:"uint256"},{name:"userId",type:"bytes32"},{name:"asset",type:"address"},{name:"price",type:"uint256"},{name:"quantity",type:"uint256"},{name:"expiration",type:"uint256"},{name:"side",type:"uint8"},{name:"additionalData",type:"bytes32"}]},{name:"amountOutMinimum",type:"uint256"}]}],lt=[{name:"asset",type:"address"},{name:"amount",type:"uint256"},{name:"assetType",type:"uint16"},{name:"isPool",type:"bool"},{name:"isDebt",type:"bool"},{name:"marketId",type:"uint88"},{name:"accountId",type:"uint256"},{name:"tokenId",type:"uint256"},{name:"debtKey",type:"uint248"},{name:"shares",type:"uint256"}],mt=[{inputs:[{internalType:"address",name:"_pool",type:"address"},{internalType:"uint256",name:"_poolTokenAmount",type:"uint256"}],name:"previewWithdrawal",outputs:[{name:"assetData",type:"tuple[]",components:lt}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"dytmWithdrawProcessor",outputs:[{name:"",type:"address"}],stateMutability:"view",type:"function"}],U=[{inputs:[{name:"params",type:"tuple",components:[{name:"account",type:"uint256"},{name:"tokenId",type:"uint256"},{name:"receiver",type:"address"},{name:"assets",type:"uint256"},{name:"shares",type:"uint256"},{name:"extraData",type:"bytes"}]}],name:"withdraw",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"params",type:"tuple",components:[{name:"account",type:"uint256"},{name:"key",type:"uint248"},{name:"withCollateralType",type:"uint8"},{name:"assets",type:"uint256"},{name:"shares",type:"uint256"},{name:"extraData",type:"bytes"}]}],name:"repay",outputs:[{name:"assetsRepaid",type:"uint256"}],stateMutability:"nonpayable",type:"function"}],yt=[{inputs:[{name:"tokenIn",type:"address"},{name:"amountIn",type:"uint256"},{name:"tokenOut",type:"address"},{name:"amountOutMinimum",type:"uint256"},{name:"attestationSignature",type:"bytes"},{name:"quote",type:"tuple",components:[{name:"chainId",type:"uint256"},{name:"attestationId",type:"uint256"},{name:"userId",type:"bytes32"},{name:"asset",type:"address"},{name:"price",type:"uint256"},{name:"quantity",type:"uint256"},{name:"expiration",type:"uint256"},{name:"side",type:"uint8"},{name:"additionalData",type:"bytes32"}]}],name:"swapExactInWithAttestation",outputs:[],stateMutability:"nonpayable",type:"function"}],At=[{type:"tuple",components:[{name:"actions",type:"tuple[]",components:[{name:"to",type:"address"},{name:"data",type:"bytes"}]},{name:"outputAsset",type:"address"},{name:"minOutputAmount",type:"uint256"}]}],S={stringErrors:{"currently closed for trading":{title:"The market for this tokenized asset is closed right now",hint:"Wait until the market reopens (the error message says when) and simply retry."},"Synth exchange suspended. Operation prohibited":{title:"Vault includes deprecated synths in portfolio",hint:"Redeem deprecated synth to be able to withdraw."}},selectorErrors:{"0x54971d46":{signature:"SwapFailed(address,(address,uint256,(bytes32,bytes)),bytes)",title:"The token swap failed to execute",hint:"Your assets are still in your wallet — try again, or retry with a higher slippage tolerance."},"0x81a815ef":{signature:"InsufficientAmountReceived(address,uint256,uint256)",title:"Swap output was below the minimum received amount",hint:"Increase slippage tolerance and try again."}}},v=t=>({stringErrors:{...t.stringErrors,...S.stringErrors},selectorErrors:{...t.selectorErrors,...S.selectorErrors}}),gt=["https://cdn.jsdelivr.net/gh/dhedge/V2-Public@master/readmes/errorCodes/registry.json","https://raw.githubusercontent.com/dhedge/V2-Public/master/readmes/errorCodes/registry.json"],Et=1,Tt=1e4,C=2e6,ht=2e3,St=500,_t=120,ft=300,Dt=4,wt=/^dh\d{1,3}$/i,F=/[\u0000-\u001f\u007f]/,bt=/https?:\/\/|[<>`]/i,Rt=t=>t.length<=_t&&!F.test(t)&&(wt.test(t)||t.length>=Dt),T=t=>typeof t=="string"&&t.length>0&&t.length<=ft&&!F.test(t)&&!bt.test(t);let W=S,f=null;const R=()=>W,G=t=>{W=v(t)},It=t=>{const e=t;if(e?.schemaVersion!==Et)throw new Error(`Unsupported error registry schemaVersion: ${String(e?.schemaVersion)}`);const n={};for(const[a,s]of Object.entries(e.stringErrors??{}))s?.curated===!0&&Rt(a)&&T(s.description)&&T(s.action)&&(n[a]={title:s.description,hint:s.action});const r={};for(const[a,s]of Object.entries(e.selectorErrors??{}))s?.curated===!0&&/^0x[0-9a-f]{8}$/.test(a)&&T(s.signature)&&T(s.description)&&T(s.action)&&(r[a]={signature:s.signature,title:s.description,hint:s.action});if(!Object.keys(n).length)throw new Error("Error registry contained no curated string errors");if(Object.keys(n).length>ht||Object.keys(r).length>St)throw new Error("Error registry exceeded expected entry counts");return{stringErrors:n,selectorErrors:r}},$=async({timeoutMs:t=Tt}={})=>{const e=[];for(const n of gt){const r=new AbortController,a=setTimeout(()=>r.abort(),t);try{const s=await fetch(n,{headers:{accept:"application/json"},signal:r.signal});if(!s.ok)throw new Error(`HTTP ${s.status}`);const i=Number(s.headers.get("content-length"));if(i>C)throw new Error(`Response too large: ${i} bytes`);const c=await s.text();if(c.length>C)throw new Error(`Response too large: ${c.length} chars`);return v(It(JSON.parse(c)))}catch(s){e.push(`${n}: ${s instanceof Error?s.message:String(s)}`)}finally{clearTimeout(a)}}throw new Error(`All error registry sources failed: ${e.join("; ")}`)},Nt=()=>(f??(f=$().then(G).catch(()=>{f=null})),f),Ct=()=>typeof window<"u";function Ot(){return Ct()&&typeof window.ethereum<"u"}async function Pt(t){try{if(Ot())return window.ethereum.request({method:"wallet_watchAsset",params:{type:"ERC20",options:t}})}catch{return!1}return!1}const y=(t,e)=>t?.toLowerCase()===e?.toLowerCase(),Mt=t=>y(t,o.AddressZero$1),h=t=>{if(!t)throw new Error("Cannot prefix an empty hex value");return t.startsWith("0x")?t:`0x${t}`},m=(t,e)=>{try{return BigInt(t)}catch{throw new Error(`Cannot convert "${e}" value "${t}" to bigint`)}},D=t=>t?u.pad(h(t),{size:32}):u.zeroHash,H=t=>{if(!t)throw new Error("Cannot decode an empty base64 string");return u.bytesToHex(Uint8Array.from(atob(t),e=>e.charCodeAt(0)))},Y=(t,e)=>o.contractsAddressesMap[e]?.[t]??o.AddressZero,xt=t=>o.contractsAbisMap[t],Lt=t=>t&&`${t.substring(0,6)}...${t.substring(t.length-4,t.length)}`,Bt=({address:t,chainId:e})=>{const n=Y("aaveLendingPoolV3",e);return y(t,n)},k=({sourceAddress:t,amount:e})=>`${t}_${e}`,Ut=(t,e)=>{const n=t.slice(0,e),r=t.slice(e);return{firstPart:n,secondPart:r}},V=(t,e)=>t/e*100,vt=t=>t<1?4:t<10?3:2,Ft=(t,e=o.DEFAULT_PRECISION)=>new p(t.toString()).shiftedBy(e).toFixed(0),Wt=(t,e,n,r)=>new p(e).dividedBy(n).multipliedBy(t).shiftedBy(-(r||o.DEFAULT_PRECISION)).toNumber(),Gt=t=>BigInt(new p(t||"0").shiftedBy(o.DEFAULT_PRECISION).toFixed(0,p.ROUND_DOWN)),I=t=>{const e=new p(.01),n=new p(t),r=!n.isZero()&&n.lt(e)?e:n;return BigInt(r.multipliedBy(100).toFixed(0))},$t=({chainId:t,slippage:e})=>t===A.hyperEvm.id?BigInt(0):I(e),Ht=({vaultAddress:t,swapData:e,sendTokenAddress:n,sendTokenAmount:r,vaultDepositTokenAddress:a,minVaultTokensReceivedAmount:s,routerKey:i="ONE_INCH",swapDestinationAmount:c,swapSlippage:d})=>{const l=new p(c).multipliedBy(1-d/100).toFixed(0),g=[u.stringToHex(i,{size:32}),e];return[t,[[n,r,g],[a,l]],s]},Yt=({receiveAssetAddress:t,assets:e,swapData:n,slippage:r})=>{const a={srcData:[],destAmount:new p("0")},{srcData:s,destAmount:i}=e?.reduce((c,d)=>{const l=n?.[d.address];if(!l)return c;const g=[u.stringToHex(l.routerKey,{size:32}),l.rawTransaction.data],E=[d.address,d.rawBalance,g];return{srcData:[...c.srcData,E],destAmount:c.destAmount.plus(l.destinationAmount)}},a)??a;return[s,[t,i.times(1-r/100).toFixed(0,p.ROUND_DOWN)]]},K=({assetAddress:t,swapQuotes:e,swapParams:n,slippageToleranceForContractTransaction:r,routerKey:a})=>{if(!n)return{supportedAsset:t,withdrawData:"",slippageTolerance:BigInt(0)};const{srcData:s,dstData:i}=n,c=s.map(({asset:g,amount:E})=>{const _=e?.[k({sourceAddress:g,amount:E.toString()})]?.find(ct=>ct.routerKey===a);return{asset:g,amount:E,swapData:{routerKey:u.stringToHex(_?.routerKey??"",{size:32}),txData:_?.rawTransaction.data??"0x"}}}),d=u.encodeAbiParameters(o.ComplexWithdrawalAssetSrcDataAbiItem,[c]),l=u.encodeAbiParameters(o.ComplexWithdrawalDataAbiItem,[{encodedSrcData:d,dstData:{dstAddress:i.asset,dstAmount:i.amount},slippage:r}]);return{supportedAsset:t,withdrawData:l,slippageTolerance:r}},kt=({chainId:t,txHash:e,error:n})=>{if(t!==A.mainnet.id||!e||!n)return!1;const r=n instanceof Error?n.message:String(n);return/\bNo Result\b/i.test(r)},Vt=({chainId:t,action:e,isRabbyWallet:n})=>e==="update_ondo_prices"&&t===A.mainnet.id&&n?o.ONDO_PRICES_RABBY_SETTLE_DELAY:t?o.TRANSACTION_SETTLE_DELAY[t]??0:0,Kt=(t,e)=>o.CHAIN_NATIVE_TOKENS[e]?.nativeTokenSymbol===t,qt=({nativeTokenBalance:t,tokenDecimals:e,gasPrice:n})=>{const r=new p(n).multipliedBy(o.NATIVE_TOKEN_GAS_RESERVE_UNITS).shiftedBy(-e),a=new p(t).minus(r);return a.gt("0")?a:new p("0")},jt=t=>o.STABLE_TOKEN_SYMBOLS.includes(t),Xt=t=>{const e=Object.values(t).reduce((n,{type:r})=>(n[r]=n[r]+1,n),{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},Zt=(t,e=150)=>t.length>e?t.substring(0,e):t,q=()=>({...R().stringErrors,...o.TRANSACTION_ERRORS}),Qt=()=>[...Object.keys(q()),...Object.keys(o.LIMIT_ORDER_TRANSACTION_ERRORS)],zt=/^dh\d+$/i,Jt=(t,e)=>zt.test(e)?new RegExp(`\\b${e}\\b`,"i").test(t):t.includes(e.toLowerCase()),w=(t,e)=>{const n=t.toLowerCase();return[...e??Qt()].sort((r,a)=>a.length-r.length).find(r=>Jt(n,r))},O=t=>q()[t]??o.LIMIT_ORDER_TRANSACTION_ERRORS[t],te=/\b0x[0-9a-f]{8}\b/i,ee=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ne=t=>{const{selectorErrors:e}=R(),n=t.match(te)?.[0]?.toLowerCase(),r=n?e[n]:void 0;if(r)return{title:r.title,hint:r.hint};const a=Object.values(e).find(s=>new RegExp(`\\b${ee(s.signature.split("(")[0]??"")}\\b`).test(t));return a?{title:a.title,hint:a.hint}:void 0},re=({errorMessage:t,abiErrors:e})=>{if(!t||t.includes("User rejected"))return null;const n=e.find(i=>t.includes(i));if(n){const i=w(n);if(i)return O(i)}const r=w(t);if(r)return O(r);const a=ne(t);if(a)return a;const[s]=t.split(n?".":"Contract").map(i=>i.trim());return{title:"Transaction failed",hint:`${Zt(s??"")} ${n?`: ${n}`:""}`}},se=t=>typeof t=="number"&&Number.isFinite(t),ae=t=>typeof t=="bigint"&&t!==BigInt(0),j=(t,e=o.DEFAULT_PRECISION$1)=>new p(t).shiftedBy(-e).toNumber(),X=t=>!isNaN(parseFloat(t))&&!isNaN(t),Z=({value:t,minimumFractionDigits:e=2,maximumFractionDigits:n=2,compact:r=!1,normalize:a=!1})=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:r?"compact":void 0,minimumFractionDigits:e,maximumFractionDigits:n}).format(a?j(t):Number(t)),b=t=>X(t)?new p(t).toFixed():"",P=["₀","₁","₂","₃","₄","₅","₆","₇","₈","₉"],Q=({value:t,decimals:e=4})=>{const n=new p(t);if(n.isGreaterThan(1)||n.isZero())return b(n.toFixed(e));const a=(/e/i.test(t.toString())?parseFloat(t.toString()).toFixed(o.DEFAULT_PRECISION$1):t.toString()).match(/^0\.(0+)(\d+)$/);if(a){const[,s,i]=a;if(s.length>=e&&s.length<P.length)return`0.0${P[s.length]}${i.slice(0,3)}`}return b(n.toFixed(e))},z=(t,e=0)=>`${t.toLocaleString("en-US",{maximumFractionDigits:e})}%`,oe=t=>t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),ie=(t,e,n=0)=>{const r=V(+t,e);return z(r,n)},ce=({currency:t,value:e})=>t==="USD"?Z({value:e}):`${o.CURRENCY_SYMBOL_MAP[t]} ${Q({value:e,decimals:o.CURRENCY_DECIMALS_MAP[t]})}`,J=(t,e)=>new p(new p(t).toFixed(e,p.ROUND_DOWN)).toString(),tt=(t,e=3,n=2)=>{if(t.length<=5)return t;const r="...";return t.length<=e+n+r.length?t:`${t.slice(0,e)}${r}${t.slice(-n)}`},de=({balance:t,symbol:e,precision:n,truncateSymbol:r})=>`${J(t,n)} ${r?tt(e):e}`,ue=t=>{if(!t)return;const e=t.match(/0x[a-fA-F0-9]{64}/);if(!e)return;const n=e[0];return`${n.slice(0,4)}...${n.slice(-3)}`},pe=t=>y(o.FLATMONEY_EARLY_DEPOSITOR_VAULT_ADDRESS_BASE,t)||y(o.FLATMONEY_DHT_STAKING_VAULT_ADDRESS_BASE,t),le=t=>o.FLAT_MONEY_LEVERAGED_ASSET_ADDRESSES.some(e=>y(e,t)),me=t=>o.FLAT_MONEY_COLLATERAL_MAP[t.toLowerCase()]??{symbol:"",decimals:18,address:o.AddressZero},ye=t=>y(t,o.FLAT_MONEY_V1_UNIT_ADDRESS)?o.FLAT_MONEY_V1_UNIT_LINK:o.FLAT_MONEY_UNIT_LINK,et=t=>`eth_${t}`,Ae=({action:t,log:e,symbol:n,vaultAddress:r,chainId:a})=>{const s={[o.TRADING_LOG_EVENT_PARAM.SYMBOL.NAME]:n,[o.TRADING_LOG_EVENT_PARAM.CHAIN_ID.NAME]:a,[o.TRADING_LOG_EVENT_PARAM.ADDRESS.NAME]:et(r)};o.LOG_EVENT_BY_TRANSACTION_ACTION_MAP[t].forEach(i=>{e?.(i,s)})},ge=t=>o.GMX_MARKET_ASSETS.some(e=>y(e,t)),Ee=t=>o.GMX_WITHDRAW_ASSET_MAP[t.toLowerCase()]??{symbol:"",decimals:18,address:o.AddressZero},Te=t=>o.GMX_WITHDRAW_ASSET_MAP_BY_VAULT_ADDRESS[t.toLowerCase()],nt="0x3333333333333333333333333333333333333333";A.arbitrum.id+"",o.USDC_ARBITRUM.address,A.base.id+"",o.USDC_BASE.address,A.optimism.id+"",o.USDC_OPTIMISM.address,A.polygon.id+"",o.USDC_POLYGON.address,A.mainnet.id+"",o.USDC_MAINNET.address,A.hyperEvm.id+"",o.USDC_HYPEREVM.address;const he=t=>y(t,nt),Se=()=>o.USDC_HYPEREVM,_e=new Map,N=(t,e)=>!e||e.size===0?t:t.map(n=>{const r=e.get(n.supportedAsset.toLowerCase());return r?{...n,withdrawData:r.withdrawData,slippageTolerance:r.slippageTolerance}:n}),rt=t=>{const e=t.find(({swapQuotes:n})=>n);return e?.swapQuotes?Object.values(e.swapQuotes)[0]?.map(({routerKey:n})=>n)??[]:[]},st=(t,e,n)=>t.map(({asset:r,swapParams:a,swapQuotes:s})=>!a||!s?{supportedAsset:r,withdrawData:"",slippageTolerance:n}:K({assetAddress:r,swapQuotes:s,swapParams:a,slippageToleranceForContractTransaction:n,routerKey:e})),at=async(t,e,n,r,a,s)=>{for(const i of t){const c=N(st(e,i,n),s),{error:d}=await r(...a,c);if(!d)return c}return null},fe=(t,e,n)=>{const r=(t??[]).map(a=>({supportedAsset:a,withdrawData:"",slippageTolerance:e}));return N(r,n)},De=async(t,e,n,r,a)=>{for(const s of t){const i=I(s);try{const c=await e(s),d=rt(c),l=await at(d,c,i,n,r,a);if(l)return console.debug(`[Init Withdraw] Auto slippage simulation succeeded: slippage=${s}%`),console.debug("[Init Withdraw] Complex asset data:",l),l}catch(c){console.error(`[Init Withdraw] Failed to fetch quotes for slippage=${s}%:`,c)}}return null},we=async(t,e,{fetchAaveSwapParams:n,fetchAaveSwapQuotes:r,withdrawAmountD18:a,slippage:s})=>Promise.all((t??[]).map(async i=>{if(!y(i,e))return{asset:i};try{const d=await n({withdrawAmountD18:a,slippage:s});if(d?.srcData.length){const l=await r({swapParams:d,slippage:s});return{asset:i,swapParams:d,swapQuotes:l}}return{asset:i}}catch(d){return console.error(d),{asset:i}}})),M=t=>Math.round(t*100)/100,be=({maxSlippage:t,candidates:e=o.SLIPPAGE_AUTO_SIMULATION_CANDIDATES})=>{if(!Number.isFinite(t)||t<=0)return[];const n=M(Math.min(t,100)),r=e.filter(s=>s>0&&s<=n).map(M),a=new Set(r);return a.add(n),a.add(t),Array.from(a).sort((s,i)=>s-i)},x=1000000000000000000n,Re=1000000n,L=10000n,B=100n,Ie=t=>({quotes:t.quotes.map(e=>({chainId:m(e.chainId,"chainId"),attestationId:m(e.attestationId,"attestationId"),userId:h(e.userId),asset:e.asset,price:m(e.price,"price"),quantity:m(e.quantity,"quantity"),expiration:m(e.expiration,"expiration"),side:Number(e.side),additionalData:h(e.additionalData)})),signatures:t.signatures.map(h)}),ot=(t,e,n)=>{const r=BigInt(Math.max(0,Math.round(n*100))),a=r>B?B:r,s=L-a,c=t*e/x*s*Re,d=L*x;return(c+d-1n)/d},it=(t,e)=>({chainId:e,attestationId:m(t.attestationId,"attestationId"),userId:D(t.userId),asset:t.assetAddress,price:m(t.price,"price"),quantity:m(t.tokenAmount,"tokenAmount"),expiration:m(t.expiration,"expiration"),side:Number(t.side),additionalData:D(t.additionalData)}),Ne=({attestation:t,chainId:e,slippagePercent:n})=>{const r=it(t,e);return u.encodeAbiParameters(pt,[{attestationSignature:H(t.signature),quote:r,amountOutMinimum:ot(r.quantity,r.price,n)}])},Ce=t=>[...t.reduce((n,r)=>n.has(r.accountId)?n:n.set(r.accountId,r),new Map).values()].map(({accountId:n,marketId:r})=>({accountId:n,marketId:r,collaterals:t.filter(a=>a.accountId===n&&!a.isDebt),debt:t.find(a=>a.accountId===n&&a.isDebt)})),Oe=({collateral:t,dytmOffice:e,processor:n,gmToken:r,ondoGMSwap:a,usdc:s,gmAmount:i,amountOutMinimum:c,signature:d,quote:l})=>[{to:e,data:u.encodeFunctionData({abi:U,functionName:"withdraw",args:[{account:t.accountId,tokenId:t.tokenId,receiver:n,assets:i,shares:0n,extraData:"0x"}]})},{to:r,data:u.encodeFunctionData({abi:u.erc20Abi,functionName:"approve",args:[a,i]})},{to:a,data:u.encodeFunctionData({abi:yt,functionName:"swapExactInWithAttestation",args:[r,i,s,c,d,l]})}],Pe=({accountId:t,debtKey:e,dytmOffice:n,usdc:r})=>[{to:r,data:u.encodeFunctionData({abi:u.erc20Abi,functionName:"approve",args:[n,u.maxUint256]})},{to:n,data:u.encodeFunctionData({abi:U,functionName:"repay",args:[{account:t,key:e,withCollateralType:0,assets:u.maxUint256,shares:0n,extraData:"0x"}]})}],Me=({actions:t,outputAsset:e,minOutputAmount:n})=>u.encodeAbiParameters(At,[{actions:t,outputAsset:e,minOutputAmount:n}]);exports.DytmOfficeAssetGuardAbi=mt;exports.EMPTY_PER_ASSET_WITHDRAW_DATA=_e;exports.HYPERLIQUID_PERPS_ACCOUNT_ADDRESS=nt;exports.OndoGMTokenAssetGuardAbi=ut;exports.THIRD_PARTY_CONTRACT_ERRORS=S;exports.addTokenToWallet=Pt;exports.applyContractErrorRegistry=G;exports.base64ToHex=H;exports.buildAaveWithdrawAssetTransactionData=K;exports.buildComplexAssetDataForRouter=st;exports.buildDytmActions=Oe;exports.buildDytmRepayActions=Pe;exports.buildSwapQuoteKeyForAave=k;exports.buildSwapWithdrawTransactionData=Yt;exports.buildZapDepositTransactionArguments=Ht;exports.clientSide=dt;exports.commify=oe;exports.computeAmountOutMinimumUsdc=ot;exports.createDefaultComplexAssetData=fe;exports.encodeOndoWithdrawData=Ne;exports.encodeUnwindPlan=Me;exports.enrichAssetsWithSwapQuotes=we;exports.ensureContractErrorRegistryLoaded=Nt;exports.ensureHexPrefix=h;exports.extractAvailableRouterKeys=rt;exports.fetchContractErrorRegistry=$;exports.formatBalance=J;exports.formatByCurrency=ce;exports.formatNumberToLimitedDecimals=Q;exports.formatNumeratorToPercentage=ie;exports.formatPercentage=z;exports.formatToUsd=Z;exports.formatTokenBalance=de;exports.getAutoSlippageSimulationCandidates=be;exports.getComplexAssetDataSlippageTolerance=$t;exports.getContractAbiById=xt;exports.getContractAddressById=Y;exports.getContractErrorRegistry=R;exports.getConventionalTokenPriceDecimals=vt;exports.getErrorKey=w;exports.getFlatMoneyCollateralByLeverageAddress=me;exports.getFlatMoneyLinkByUnitAddress=ye;exports.getGmxWithdrawAssetByLeverageAddress=Ee;exports.getGmxWithdrawAssetByVaultAddress=Te;exports.getHyperliquidWithdrawAsset=Se;exports.getNativeTokenInvestableBalance=qt;exports.getPercent=V;exports.getPoolFraction=Wt;exports.getSettleDelay=Vt;exports.getSlippageToleranceForContractTransaction=I;exports.getTxHashShort=ue;exports.groupPreviewByAccount=Ce;exports.isAaveLendAndBorrowAsset=Bt;exports.isEqualAddress=y;exports.isFlatMoneyLeveragedAsset=le;exports.isFmpAirdropVaultAddress=pe;exports.isGmxLeveragedAsset=ge;exports.isHyperliquidPerpsAsset=he;exports.isNativeToken=Kt;exports.isNumberType=se;exports.isNumeric=X;exports.isStableSymbol=jt;exports.isZeroAddress=Mt;exports.logTransactionByActionType=Ae;exports.mapAttestationToOndoQuote=it;exports.mapOndoApiResponseToUpdatePricesArgs=Ie;exports.nonZeroBigInt=ae;exports.normalizeNumber=j;exports.overlayWithdrawData=N;exports.parseAmountToD18=Gt;exports.parseContractErrorMessage=re;exports.removeInsignificantTrailingZeros=b;exports.shiftBy=Ft;exports.shortenAddress=Lt;exports.shouldSwallowMainnetPollError=kt;exports.sliceByIndex=Ut;exports.toBigInt=m;exports.toBytes32Hex=D;exports.transformAddressForAnalytics=et;exports.truncateString=tt;exports.tryEstimateWithRouters=at;exports.tryEstimateWithSlippageValues=De;exports.validateLoggerEventParams=Xt;