@liberfi.io/utils 0.2.7 → 0.2.9
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/dist/index.d.mts +22 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -176,6 +176,27 @@ declare const formatAmount: (num?: BigNumber.Value, options?: FormatAmountOption
|
|
|
176
176
|
* @param options.showPlusGtThanZero - Prefix positive values with "+".
|
|
177
177
|
*/
|
|
178
178
|
declare const formatAmountUSD: (num?: BigNumber.Value, options?: FormatAmountOptions) => string;
|
|
179
|
+
/**
|
|
180
|
+
* Format a raw token / asset amount (no currency symbol) — **compact** variant.
|
|
181
|
+
*
|
|
182
|
+
* Same tier ladder as {@link formatAmountUSDCompact} but without the `"$"`
|
|
183
|
+
* prefix. Suited for space-constrained UIs that need to render an amount
|
|
184
|
+
* alongside a token symbol (e.g. `"15K SOL"`) inside narrow buttons or
|
|
185
|
+
* badges.
|
|
186
|
+
*
|
|
187
|
+
* | Range | Format | Example input → output |
|
|
188
|
+
* |---------------|-------------------------|------------------------------|
|
|
189
|
+
* | < 0.001 | "0" | 0.00001 → "0" |
|
|
190
|
+
* | < 1 | 3 decimal places | 0.56789 → "0.567" |
|
|
191
|
+
* | < 100 | 2 decimal places | 42.678 → "42.67" |
|
|
192
|
+
* | < 1 000 | 0 decimal places | 567.89 → "567" |
|
|
193
|
+
* | ≥ 1 000 | abbreviated, 0 dp, | 15 678 → "15K" |
|
|
194
|
+
* | | rounded to nearest 100 | 1 234 567 → "1M" |
|
|
195
|
+
*
|
|
196
|
+
* @param num - The numeric value.
|
|
197
|
+
* @param options.showPlusGtThanZero - Prefix positive values with "+".
|
|
198
|
+
*/
|
|
199
|
+
declare const formatAmountCompact: (num?: BigNumber.Value, options?: FormatAmountOptions) => string;
|
|
179
200
|
/**
|
|
180
201
|
* Format a USD dollar amount with "$" prefix — **compact** variant.
|
|
181
202
|
*
|
|
@@ -357,4 +378,4 @@ declare function groupBy<T>(array: T[], iteratee: Iteratee<T, string>): Record<s
|
|
|
357
378
|
declare function mapKeys<T>(obj: Record<string, T>, iteratee: (value: T, key: string) => string): Record<string, T>;
|
|
358
379
|
declare function mapValues<T, R>(obj: Record<string, T>, iteratee: (value: T, key: string) => R): Record<string, R>;
|
|
359
380
|
|
|
360
|
-
export { ARBITRUM_TOKENS, AVALANCHE_TOKENS, ApiError, BSC_TOKENS, CHAIN_REGISTRY, CHAIN_TOKENS, type ChainMetadata, type ChainPredefinedTokens, ETHEREUM_TOKENS, type FormatAgeOptions, type FormatAmountOptions, type FormatPercentOptions, type FormatPriceOptions, OPTIMISM_TOKENS, type PredefinedToken, SOLANA_TOKENS, SafeBigNumber, accountExplorerUrl, capitalize, chainColor, chainDisplayName, chainIcon, chainIdBySlug, chainSlug, chainToNamespace, debounce, formatAge, formatAgeInSeconds, formatAmount, formatAmountUSD, formatAmountUSDCompact, formatPercent, formatPrice, formatPriceUSD, formatSymbol, formatTokenProtocolName, getCommonTokenAddresses, getCommonTokenSymbolsMap, getNativeToken, getStablecoins, getWrappedToken, groupBy, httpDelete, httpGet, httpMutate, httpPost, httpPut, httpRequest, intersectionBy, isBinanceChain, isEthereumChain, isSolanaChain, isValidEvmAddress, isValidNumber, isValidSolanaAddress, isValidWalletAddress, keyBy, mapKeys, mapValues, parseTokenProtocolFamily, searchImageUrl, searchTwitterUrl, throttle, truncateAddress, twitterTweetUrl, twitterUserUrl, txExplorerUrl, uniqBy };
|
|
381
|
+
export { ARBITRUM_TOKENS, AVALANCHE_TOKENS, ApiError, BSC_TOKENS, CHAIN_REGISTRY, CHAIN_TOKENS, type ChainMetadata, type ChainPredefinedTokens, ETHEREUM_TOKENS, type FormatAgeOptions, type FormatAmountOptions, type FormatPercentOptions, type FormatPriceOptions, OPTIMISM_TOKENS, type PredefinedToken, SOLANA_TOKENS, SafeBigNumber, accountExplorerUrl, capitalize, chainColor, chainDisplayName, chainIcon, chainIdBySlug, chainSlug, chainToNamespace, debounce, formatAge, formatAgeInSeconds, formatAmount, formatAmountCompact, formatAmountUSD, formatAmountUSDCompact, formatPercent, formatPrice, formatPriceUSD, formatSymbol, formatTokenProtocolName, getCommonTokenAddresses, getCommonTokenSymbolsMap, getNativeToken, getStablecoins, getWrappedToken, groupBy, httpDelete, httpGet, httpMutate, httpPost, httpPut, httpRequest, intersectionBy, isBinanceChain, isEthereumChain, isSolanaChain, isValidEvmAddress, isValidNumber, isValidSolanaAddress, isValidWalletAddress, keyBy, mapKeys, mapValues, parseTokenProtocolFamily, searchImageUrl, searchTwitterUrl, throttle, truncateAddress, twitterTweetUrl, twitterUserUrl, txExplorerUrl, uniqBy };
|
package/dist/index.d.ts
CHANGED
|
@@ -176,6 +176,27 @@ declare const formatAmount: (num?: BigNumber.Value, options?: FormatAmountOption
|
|
|
176
176
|
* @param options.showPlusGtThanZero - Prefix positive values with "+".
|
|
177
177
|
*/
|
|
178
178
|
declare const formatAmountUSD: (num?: BigNumber.Value, options?: FormatAmountOptions) => string;
|
|
179
|
+
/**
|
|
180
|
+
* Format a raw token / asset amount (no currency symbol) — **compact** variant.
|
|
181
|
+
*
|
|
182
|
+
* Same tier ladder as {@link formatAmountUSDCompact} but without the `"$"`
|
|
183
|
+
* prefix. Suited for space-constrained UIs that need to render an amount
|
|
184
|
+
* alongside a token symbol (e.g. `"15K SOL"`) inside narrow buttons or
|
|
185
|
+
* badges.
|
|
186
|
+
*
|
|
187
|
+
* | Range | Format | Example input → output |
|
|
188
|
+
* |---------------|-------------------------|------------------------------|
|
|
189
|
+
* | < 0.001 | "0" | 0.00001 → "0" |
|
|
190
|
+
* | < 1 | 3 decimal places | 0.56789 → "0.567" |
|
|
191
|
+
* | < 100 | 2 decimal places | 42.678 → "42.67" |
|
|
192
|
+
* | < 1 000 | 0 decimal places | 567.89 → "567" |
|
|
193
|
+
* | ≥ 1 000 | abbreviated, 0 dp, | 15 678 → "15K" |
|
|
194
|
+
* | | rounded to nearest 100 | 1 234 567 → "1M" |
|
|
195
|
+
*
|
|
196
|
+
* @param num - The numeric value.
|
|
197
|
+
* @param options.showPlusGtThanZero - Prefix positive values with "+".
|
|
198
|
+
*/
|
|
199
|
+
declare const formatAmountCompact: (num?: BigNumber.Value, options?: FormatAmountOptions) => string;
|
|
179
200
|
/**
|
|
180
201
|
* Format a USD dollar amount with "$" prefix — **compact** variant.
|
|
181
202
|
*
|
|
@@ -357,4 +378,4 @@ declare function groupBy<T>(array: T[], iteratee: Iteratee<T, string>): Record<s
|
|
|
357
378
|
declare function mapKeys<T>(obj: Record<string, T>, iteratee: (value: T, key: string) => string): Record<string, T>;
|
|
358
379
|
declare function mapValues<T, R>(obj: Record<string, T>, iteratee: (value: T, key: string) => R): Record<string, R>;
|
|
359
380
|
|
|
360
|
-
export { ARBITRUM_TOKENS, AVALANCHE_TOKENS, ApiError, BSC_TOKENS, CHAIN_REGISTRY, CHAIN_TOKENS, type ChainMetadata, type ChainPredefinedTokens, ETHEREUM_TOKENS, type FormatAgeOptions, type FormatAmountOptions, type FormatPercentOptions, type FormatPriceOptions, OPTIMISM_TOKENS, type PredefinedToken, SOLANA_TOKENS, SafeBigNumber, accountExplorerUrl, capitalize, chainColor, chainDisplayName, chainIcon, chainIdBySlug, chainSlug, chainToNamespace, debounce, formatAge, formatAgeInSeconds, formatAmount, formatAmountUSD, formatAmountUSDCompact, formatPercent, formatPrice, formatPriceUSD, formatSymbol, formatTokenProtocolName, getCommonTokenAddresses, getCommonTokenSymbolsMap, getNativeToken, getStablecoins, getWrappedToken, groupBy, httpDelete, httpGet, httpMutate, httpPost, httpPut, httpRequest, intersectionBy, isBinanceChain, isEthereumChain, isSolanaChain, isValidEvmAddress, isValidNumber, isValidSolanaAddress, isValidWalletAddress, keyBy, mapKeys, mapValues, parseTokenProtocolFamily, searchImageUrl, searchTwitterUrl, throttle, truncateAddress, twitterTweetUrl, twitterUserUrl, txExplorerUrl, uniqBy };
|
|
381
|
+
export { ARBITRUM_TOKENS, AVALANCHE_TOKENS, ApiError, BSC_TOKENS, CHAIN_REGISTRY, CHAIN_TOKENS, type ChainMetadata, type ChainPredefinedTokens, ETHEREUM_TOKENS, type FormatAgeOptions, type FormatAmountOptions, type FormatPercentOptions, type FormatPriceOptions, OPTIMISM_TOKENS, type PredefinedToken, SOLANA_TOKENS, SafeBigNumber, accountExplorerUrl, capitalize, chainColor, chainDisplayName, chainIcon, chainIdBySlug, chainSlug, chainToNamespace, debounce, formatAge, formatAgeInSeconds, formatAmount, formatAmountCompact, formatAmountUSD, formatAmountUSDCompact, formatPercent, formatPrice, formatPriceUSD, formatSymbol, formatTokenProtocolName, getCommonTokenAddresses, getCommonTokenSymbolsMap, getNativeToken, getStablecoins, getWrappedToken, groupBy, httpDelete, httpGet, httpMutate, httpPost, httpPut, httpRequest, intersectionBy, isBinanceChain, isEthereumChain, isSolanaChain, isValidEvmAddress, isValidNumber, isValidSolanaAddress, isValidWalletAddress, keyBy, mapKeys, mapValues, parseTokenProtocolFamily, searchImageUrl, searchTwitterUrl, throttle, truncateAddress, twitterTweetUrl, twitterUserUrl, txExplorerUrl, uniqBy };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var J=Object.create;var R=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var se=(e,n)=>{for(var s in n)R(e,s,{get:n[s],enumerable:!0})},y=(e,n,s,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of ee(n))!ne.call(e,o)&&o!==s&&R(e,o,{get:()=>n[o],enumerable:!(r=Q(n,o))||r.enumerable});return e};var re=(e,n,s)=>(s=e!=null?J(te(e)):{},y(n||!e||!e.__esModule?R(s,"default",{value:e,enumerable:!0}):s,e)),oe=e=>y(R({},"__esModule",{value:!0}),e);var ut={};se(ut,{ARBITRUM_TOKENS:()=>v,AVALANCHE_TOKENS:()=>$,ApiError:()=>E,BSC_TOKENS:()=>H,CHAIN_REGISTRY:()=>m,CHAIN_TOKENS:()=>h,ETHEREUM_TOKENS:()=>F,OPTIMISM_TOKENS:()=>V,SOLANA_TOKENS:()=>_,SafeBigNumber:()=>g,accountExplorerUrl:()=>st,capitalize:()=>Ve,chainColor:()=>ge,chainDisplayName:()=>pe,chainIcon:()=>me,chainIdBySlug:()=>I,chainSlug:()=>de,chainToNamespace:()=>P,debounce:()=>Y,formatAge:()=>Ne,formatAgeInSeconds:()=>w,formatAmount:()=>we,formatAmountUSD:()=>ke,formatAmountUSDCompact:()=>_e,formatPercent:()=>ve,formatPrice:()=>Fe,formatPriceUSD:()=>He,formatSymbol:()=>Ge,formatTokenProtocolName:()=>ze,getCommonTokenAddresses:()=>Je,getCommonTokenSymbolsMap:()=>Qe,getNativeToken:()=>qe,getStablecoins:()=>je,getWrappedToken:()=>Xe,groupBy:()=>q,httpDelete:()=>Ie,httpGet:()=>Re,httpMutate:()=>xe,httpPost:()=>Oe,httpPut:()=>Ce,httpRequest:()=>f,intersectionBy:()=>Z,isBinanceChain:()=>ce,isEthereumChain:()=>le,isSolanaChain:()=>ue,isValidEvmAddress:()=>U,isValidNumber:()=>N,isValidSolanaAddress:()=>D,isValidWalletAddress:()=>Ae,keyBy:()=>z,mapKeys:()=>X,mapValues:()=>j,parseTokenProtocolFamily:()=>Ze,searchImageUrl:()=>rt,searchTwitterUrl:()=>ot,throttle:()=>G,truncateAddress:()=>$e,twitterTweetUrl:()=>at,twitterUserUrl:()=>it,txExplorerUrl:()=>nt,uniqBy:()=>W});module.exports=oe(ut);var t=require("@liberfi.io/types"),B=new Set([t.Chain.SOLANA,t.Chain.SOLANA_TESTNET,t.Chain.SOLANA_DEVNET]),ie=new Set([t.Chain.ETHEREUM]),ae=new Set([t.Chain.BINANCE,t.Chain.BINANCE_TESTNET]);function P(e){return B.has(e)?t.ChainNamespace.SOLANA:t.ChainNamespace.EVM}function ue(e){return B.has(e)}function le(e){return ie.has(e)}function ce(e){return ae.has(e)}var m={[t.Chain.ETHEREUM]:{slug:"ethereum",abbr:"eth",color:"#627EEA"},[t.Chain.UBIQ]:{slug:"ubiq"},[t.Chain.OPTIMISM]:{slug:"optimism",abbr:"opt",color:"#FF0420"},[t.Chain.FLARE]:{slug:"flare"},[t.Chain.SONGBIRD]:{slug:"songbird"},[t.Chain.ELASTOS]:{slug:"elastos"},[t.Chain.KARDIA]:{slug:"kardia"},[t.Chain.CRONOS]:{slug:"cronos",color:"#002D74"},[t.Chain.RSK]:{slug:"rsk"},[t.Chain.TELOS]:{slug:"telos"},[t.Chain.LUKSO]:{slug:"lukso"},[t.Chain.CRAB]:{slug:"crab"},[t.Chain.DARWINIA]:{slug:"darwinia"},[t.Chain.XDC]:{slug:"xdc"},[t.Chain.CSC]:{slug:"csc"},[t.Chain.ZYX]:{slug:"zyx"},[t.Chain.BINANCE]:{slug:"binance",abbr:"bsc",color:"#F0B90B"},[t.Chain.SYSCOIN]:{slug:"syscoin"},[t.Chain.GOCHAIN]:{slug:"gochain"},[t.Chain.ETHEREUMCLASSIC]:{slug:"ethereumclassic"},[t.Chain.OKEXCHAIN]:{slug:"okexchain"},[t.Chain.HOO]:{slug:"hoo"},[t.Chain.METER]:{slug:"meter"},[t.Chain.NOVA_NETWORK]:{slug:"nova network"},[t.Chain.TOMOCHAIN]:{slug:"tomochain"},[t.Chain.BITKUB]:{slug:"bitkub"},[t.Chain.XDAI]:{slug:"xdai"},[t.Chain.SOLANA]:{slug:"solana",abbr:"sol",color:"#9945FF"},[t.Chain.VELAS]:{slug:"velas"},[t.Chain.THUNDERCORE]:{slug:"thundercore"},[t.Chain.ENULS]:{slug:"enuls"},[t.Chain.FUSE]:{slug:"fuse"},[t.Chain.HECO]:{slug:"heco"},[t.Chain.UNICHAIN]:{slug:"unichain"},[t.Chain.POLYGON]:{slug:"polygon",color:"#8247E5"},[t.Chain.SONIC]:{slug:"sonic",color:"#5B6EF5"},[t.Chain.SHIMMER_EVM]:{slug:"shimmer_evm"},[t.Chain.RBN]:{slug:"rbn"},[t.Chain.OMNI]:{slug:"omni"},[t.Chain.MANTA]:{slug:"manta"},[t.Chain.HSK]:{slug:"hsk"},[t.Chain.WATER]:{slug:"water"},[t.Chain.XLAYER]:{slug:"xlayer"},[t.Chain.XDAIARB]:{slug:"xdaiarb"},[t.Chain.OP_BNB]:{slug:"op_bnb"},[t.Chain.VINUCHAIN]:{slug:"vinuchain"},[t.Chain.ENERGYWEB]:{slug:"energyweb"},[t.Chain.OASYS]:{slug:"oasys"},[t.Chain.FANTOM]:{slug:"fantom"},[t.Chain.FRAXTAL]:{slug:"fraxtal"},[t.Chain.HPB]:{slug:"hpb"},[t.Chain.BOBA]:{slug:"boba"},[t.Chain.OMAX]:{slug:"omax"},[t.Chain.FILECOIN]:{slug:"filecoin"},[t.Chain.KUCOIN]:{slug:"kucoin"},[t.Chain.ZKSYNC_ERA]:{slug:"zksync era"},[t.Chain.SHIDEN]:{slug:"shiden"},[t.Chain.THETA]:{slug:"theta"},[t.Chain.PULSE]:{slug:"pulse"},[t.Chain.CRONOS_ZKEVM]:{slug:"cronos zkevm"},[t.Chain.SX]:{slug:"sx"},[t.Chain.AREON]:{slug:"areon"},[t.Chain.WC]:{slug:"wc"},[t.Chain.CANDLE]:{slug:"candle"},[t.Chain.ROLLUX]:{slug:"rollux"},[t.Chain.ASTAR]:{slug:"astar"},[t.Chain.REDSTONE]:{slug:"redstone"},[t.Chain.MATCHAIN]:{slug:"matchain"},[t.Chain.CALLISTO]:{slug:"callisto"},[t.Chain.TARA]:{slug:"tara"},[t.Chain.WANCHAIN]:{slug:"wanchain"},[t.Chain.LYRA_CHAIN]:{slug:"lyra chain"},[t.Chain.BIFROST]:{slug:"bifrost"},[t.Chain.CONFLUX]:{slug:"conflux"},[t.Chain.METIS]:{slug:"metis"},[t.Chain.DYMENSION]:{slug:"dymension"},[t.Chain.POLYGON_ZKEVM]:{slug:"polygon zkevm"},[t.Chain.CORE]:{slug:"core"},[t.Chain.LISK]:{slug:"lisk"},[t.Chain.ULTRON]:{slug:"ultron"},[t.Chain.STEP]:{slug:"step"},[t.Chain.MOONBEAM]:{slug:"moonbeam"},[t.Chain.MOONRIVER]:{slug:"moonriver"},[t.Chain.SEI]:{slug:"sei"},[t.Chain.LIVING_ASSETS_MAINNET]:{slug:"living assets mainnet"},[t.Chain.STY]:{slug:"sty"},[t.Chain.TENET]:{slug:"tenet"},[t.Chain.GRAVITY]:{slug:"gravity"},[t.Chain.REYA_NETWORK]:{slug:"reya network"},[t.Chain.SONEIUM]:{slug:"soneium"},[t.Chain.SWELLCHAIN]:{slug:"swellchain"},[t.Chain.ONUS]:{slug:"onus"},[t.Chain.HUBBLENET]:{slug:"hubblenet"},[t.Chain.SANKO]:{slug:"sanko"},[t.Chain.DOGECHAIN]:{slug:"dogechain"},[t.Chain.MILKOMEDA]:{slug:"milkomeda"},[t.Chain.MILKOMEDA_A1]:{slug:"milkomeda_a1"},[t.Chain.KAVA]:{slug:"kava"},[t.Chain.SOMA]:{slug:"soma"},[t.Chain.KARAK]:{slug:"karak"},[t.Chain.ABSTRACT]:{slug:"abstract"},[t.Chain.MORPH]:{slug:"morph"},[t.Chain.CROSSFI]:{slug:"crossfi"},[t.Chain.BEAM]:{slug:"beam"},[t.Chain.IOTEX]:{slug:"iotex"},[t.Chain.MANTLE]:{slug:"mantle"},[t.Chain.XLC]:{slug:"xlc"},[t.Chain.NAHMII]:{slug:"nahmii"},[t.Chain.BOUNCEBIT]:{slug:"bouncebit"},[t.Chain.TOMBCHAIN]:{slug:"tombchain"},[t.Chain.ZETACHAIN]:{slug:"zetachain"},[t.Chain.PLANQ]:{slug:"planq"},[t.Chain.BITROCK]:{slug:"bitrock"},[t.Chain.XSAT]:{slug:"xsat"},[t.Chain.CYETH]:{slug:"cyeth"},[t.Chain.CANTO]:{slug:"canto"},[t.Chain.KLAYTN]:{slug:"klaytn"},[t.Chain.THAT]:{slug:"that"},[t.Chain.BASE]:{slug:"base",color:"#0052FF"},[t.Chain.HELA]:{slug:"hela"},[t.Chain.IOTAEVM]:{slug:"iotaevm"},[t.Chain.JBC]:{slug:"jbc"},[t.Chain.EVMOS]:{slug:"evmos"},[t.Chain.CARBON]:{slug:"carbon"},[t.Chain.SMARTBCH]:{slug:"smartbch"},[t.Chain.ARTELA]:{slug:"artela"},[t.Chain.IMMUTABLE_ZKEVM]:{slug:"immutable zkevm"},[t.Chain.LOOP]:{slug:"loop"},[t.Chain.GENESYS]:{slug:"genesys"},[t.Chain.EOS_EVM]:{slug:"eos evm"},[t.Chain.MAP_PROTOCOL]:{slug:"map protocol"},[t.Chain.SAPPHIRE]:{slug:"sapphire"},[t.Chain.BITGERT]:{slug:"bitgert"},[t.Chain.FUSION]:{slug:"fusion"},[t.Chain.ZILLIQA]:{slug:"zilliqa"},[t.Chain.APECHAIN]:{slug:"apechain"},[t.Chain.EDU_CHAIN]:{slug:"edu chain"},[t.Chain.ARBITRUM]:{slug:"arbitrum",abbr:"arb",color:"#28A0F0"},[t.Chain.ARBITRUM_NOVA]:{slug:"arbitrum nova"},[t.Chain.CELO]:{slug:"celo"},[t.Chain.OASIS]:{slug:"oasis"},[t.Chain.ASSETCHAIN]:{slug:"assetchain"},[t.Chain.ETHERLINK]:{slug:"etherlink"},[t.Chain.AVALANCHE]:{slug:"avalanche",abbr:"avax",color:"#E84142"},[t.Chain.REI]:{slug:"rei"},[t.Chain.ZIRCUIT]:{slug:"zircuit"},[t.Chain.SOPHON]:{slug:"sophon"},[t.Chain.ETN]:{slug:"etn"},[t.Chain.SUPERPOSITION]:{slug:"superposition"},[t.Chain.REICHAIN]:{slug:"reichain"},[t.Chain.BOBA_BNB]:{slug:"boba_bnb"},[t.Chain.INK]:{slug:"ink"},[t.Chain.LINEA]:{slug:"linea",color:"#61DFFF"},[t.Chain.BOB]:{slug:"bob"},[t.Chain.GODWOKEN]:{slug:"godwoken"},[t.Chain.BERACHAIN]:{slug:"berachain",color:"#964B00"},[t.Chain.BLAST]:{slug:"blast",color:"#FCFC03"},[t.Chain.CHILIZ]:{slug:"chiliz"},[t.Chain.STRATIS]:{slug:"stratis"},[t.Chain.REAL]:{slug:"real"},[t.Chain.ODYSSEY]:{slug:"odyssey"},[t.Chain.TAIKO]:{slug:"taiko"},[t.Chain.BITLAYER]:{slug:"bitlayer"},[t.Chain.HYDRATION]:{slug:"hydration"},[t.Chain.PAREX]:{slug:"parex"},[t.Chain.POLIS]:{slug:"polis"},[t.Chain.KEKCHAIN]:{slug:"kekchain"},[t.Chain.SCROLL]:{slug:"scroll",color:"#FFEEDA"},[t.Chain.ZERO_NETWORK]:{slug:"zero_network"},[t.Chain.ZKLINK_NOVA]:{slug:"zklink nova"},[t.Chain.VISION]:{slug:"vision"},[t.Chain.SAAKURU]:{slug:"saakuru"},[t.Chain.ZORA]:{slug:"zora"},[t.Chain.CORN]:{slug:"corn"},[t.Chain.NEON]:{slug:"neon"},[t.Chain.LUMIA]:{slug:"lumia"},[t.Chain.AURORA]:{slug:"aurora"},[t.Chain.HARMONY]:{slug:"harmony"},[t.Chain.PALM]:{slug:"palm"},[t.Chain.ZENIQ]:{slug:"zeniq"},[t.Chain.CURIO]:{slug:"curio"},[t.Chain.MODE]:{slug:"mode"}};function ge(e){return m[e]?.color}function de(e){return m[e]?.slug}function me(e){let n=I(e)??e,s=m[n]?.slug;return s?`https://icons.llamao.fi/icons/chains/rsz_${encodeURIComponent(s)}.jpg`:void 0}function pe(e){let n=m[e];return n?n.abbr?n.abbr.toUpperCase():n.slug.replace(/\b\w/g,s=>s.toUpperCase()):e}var Te=(()=>{let e=new Map;for(let[n,s]of Object.entries(m))s?.abbr&&e.set(s.abbr.toLowerCase(),n);for(let[n,s]of Object.entries(m)){let r=s?.slug.toLowerCase();r&&!e.has(r)&&e.set(r,n)}return e})();function I(e){return Te.get(e.toLowerCase())}function Ae(e,n){let s=I(e)??e;switch(P(s)){case t.ChainNamespace.SOLANA:return D(n);case t.ChainNamespace.EVM:return U(n);default:throw new Error(`Unsupported chain: ${e}`)}}var fe=/^0x[0-9a-fA-F]{40}$/;function U(e){return fe.test(e)}var he=/^[1-9A-HJ-NP-Za-km-z]{32,44}$/;function D(e){return he.test(e)}var E=class extends Error{constructor(s,r,o,a){super(s);this.code=r;this.status=o;this.data=a;this.name="ApiError"}};var Ee={justNow:"just now",secondsAgo:"{n}s",minutesAgo:"{n}m",hoursAgo:"{n}h",daysAgo:"{n}d",yearsAgo:"{n}y"};function w(e,n={}){let s={...Ee,...n};return e<10?s.justNow:e<60?s.secondsAgo.replace("{n}",String(e)):e<3600?s.minutesAgo.replace("{n}",String(Math.floor(e/60))):e<86400?s.hoursAgo.replace("{n}",String(Math.floor(e/3600))):e<31536e3?s.daysAgo.replace("{n}",String(Math.floor(e/86400))):s.yearsAgo.replace("{n}",String(Math.floor(e/31536e3)))}function Ne(e,n={}){return w(Math.floor(e/1e3),n)}async function be(e){let n=await e.text().catch(()=>"");if(n)try{return JSON.parse(n)}catch{return}}async function f(e,n){if(!e.startsWith("http"))throw new Error("url must start with http(s)");let s=await fetch(e,{...n,headers:Se(n.headers,n.method)});if(s.ok)return await s.json();let r=await be(s),o=r?.message??(r?.code!==void 0?String(r.code):void 0)??s.statusText;throw s.status===400?new E(o,r?.code??s.status,s.status,r):new Error(o)}function Se(e={},n){let s=new Headers(e);return s.has("Content-Type")||(n!=="DELETE"?s.append("Content-Type","application/json;charset=utf-8"):s.append("Content-Type","application/x-www-form-urlencoded")),s}async function Re(e,n){return await f(e,{method:"GET",...n})}async function Oe(e,n,s){return await f(e,{method:"POST",body:JSON.stringify(n),...s})}async function Ce(e,n,s){return await f(e,{method:"PUT",body:JSON.stringify(n),...s})}async function Ie(e,n){return await f(e,{method:"DELETE",...n})}async function xe(e,n){return await f(e,n)}var l=re(require("bignumber.js")),g=class extends l.default{constructor(n,s){try{if(super(n??0,s),this.isNaN())return new l.default(0,s)}catch(r){console.error("SafeBigNumber constructor error",r),super(0,s)}}},ye=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,N=e=>{if(typeof e=="number")return Number.isFinite(e);if(e instanceof g||e instanceof l.default)return!e.isNaN()&&e.isFinite();if(typeof e!="string")return!1;let n=e.trim();return n===""||!ye.test(n)?!1:Number.isFinite(Number(n))},k=["\u2080","\u2081","\u2082","\u2083","\u2084","\u2085","\u2086","\u2087","\u2088","\u2089","\u2081\u2080","\u2081\u2081","\u2081\u2082","\u2081\u2083","\u2081\u2084","\u2081\u2085","\u2081\u2086","\u2081\u2087","\u2081\u2088","\u2081\u2089","\u2082\u2080","\u2082\u2081","\u2082\u2082","\u2082\u2083","\u2082\u2084","\u2082\u2085","\u2082\u2086","\u2082\u2087","\u2082\u2088","\u2082\u2089","\u2083\u2080","\u2083\u2081","\u2083\u2082","\u2083\u2083","\u2083\u2084","\u2083\u2085","\u2083\u2086","\u2083\u2087","\u2083\u2088","\u2083\u2089","\u2084\u2080"],Be=k.length-1,c=(e,n=0,s=l.default.ROUND_DOWN)=>{let o=new g(e).decimalPlaces(n,s).toString().split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.join(".")},O=(e,n=1)=>{let s=new g(e);return s.lt(1e3)?s.toString():s.lt(1e6)?`${c(s.div(1e3),n)}K`:s.lt(1e9)?`${c(s.div(1e6),n)}M`:s.lt(1e12)?`${c(s.dividedBy(1e9),n)}B`:`${c(s.dividedBy(1e12),n)}T`},Pe=(e,n=5)=>{let s=new g(e);if(s.eq(0))return"0";let[r,o]=s.toFixed().split("."),a=o.split(""),u=a.findIndex(A=>A!=="0");if(u<0||u>Be)return"0";let T=Math.min(a.length-u,n);return`${c(r)}.0`.concat(k[u]).concat(a.slice(u,u+T).join("").replace(/\.?0+$/,""))},Ue=(e,n)=>{let s=e.toString().match(/\.0*/),r=(s?s[0].length-1:0)+n;return c(e,r)},L=(e,n)=>{let s=e.times(100).decimalPlaces(n,l.default.ROUND_HALF_UP);return`${c(s,n)}%`},x=(e,n,s)=>{let{showPlusGtThanZero:r,invalidPlaceholder:o="--",zeroToken:a}=s;if(!N(e))return o;let u=new g(e),T=u.lt(0),A=u.abs(),d=n(A);return a!==void 0&&d===a||d==="0"||Number(d)===0?d:T?`-${d}`:r?`+${d}`:d},De=e=>e.lt(.001)?e.decimalPlaces(5,l.default.ROUND_DOWN).toString():e.lt(1)?e.decimalPlaces(3,l.default.ROUND_DOWN).toString():e.lt(100)?e.decimalPlaces(2,l.default.ROUND_DOWN).toString():e.lt(1e5)?c(e,2):O(e),we=(e="",n={showPlusGtThanZero:!1})=>x(e,De,{showPlusGtThanZero:n?.showPlusGtThanZero}),Le=e=>e.lt(.001)?"$0":e.lt(1)?`$${e.decimalPlaces(3,l.default.ROUND_DOWN)}`:e.lt(100)?`$${e.decimalPlaces(2,l.default.ROUND_DOWN)}`:e.lt(1e4)?`$${c(e,2)}`:`$${O(e)}`,ke=(e="",n={showPlusGtThanZero:!1})=>x(e,Le,{showPlusGtThanZero:n?.showPlusGtThanZero,zeroToken:"$0"}),Me=e=>{if(e.lt(.001))return"$0";if(e.lt(1))return`$${e.decimalPlaces(3,l.default.ROUND_DOWN)}`;if(e.lt(100))return`$${e.decimalPlaces(2,l.default.ROUND_DOWN)}`;if(e.lt(1e3))return`$${e.decimalPlaces(0,l.default.ROUND_DOWN)}`;let n=e.div(100).integerValue(l.default.ROUND_DOWN).times(100);return`$${O(n,0)}`},_e=(e="",n={showPlusGtThanZero:!1})=>x(e,Me,{showPlusGtThanZero:n?.showPlusGtThanZero,zeroToken:"$0"}),M=e=>n=>n.lt(1e-4)?Pe(n,e?4:2):n.lt(1)?e?c(n,4):Ue(n,2):n.lt(100)||n.lt(1e4)?c(n,e?4:2):n.lt(1e5)?c(n,2):O(n),Fe=(e="",n={isHighPrecise:!0})=>{if(!N(e))return"--";let s=new g(e);return s.lt(0)?"--":M(n.isHighPrecise)(s.abs())},He=(e="",n={isHighPrecise:!0})=>{if(!N(e))return"--";let s=new g(e);return s.lt(0)?"--":`$${M(n.isHighPrecise)(s.abs())}`},ve=(e="",n={})=>{if(!N(e))return"-- %";let s=new g(e),r=s.lt(0),o=s.abs(),a=r?"-":n?.showPlusGtThanZero?"+":"";return o.lt(1e-4)?"0%":o.lt(100)?`${a}${L(o,n?.precision??2)}`:o.lt(1e3)?`${a}${L(o,n?.precision??1)}`:`${a}> 99,999%`};function Ve(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function $e(e,n=6,s=4){return e.slice(0,n)+"..."+e.slice(-s)}var Ke=/\{?\b(type|base|quote)\b\}?/g;function Ge(e,n="base-type"){if(!e)return"";let[s="",r="",o=""]=e.split("_");return n.replace(Ke,(a,u)=>u==="type"?s:u==="base"?r:o)}var b=require("@liberfi.io/types"),Ye=new Set(b.SOLANA_TOKEN_PROTOCOLS),We=[...b.SOLANA_TOKEN_PROTOCOLS].sort((e,n)=>n.length-e.length),Ze=(e,n)=>{if(e!==b.Chain.SOLANA)return;let s=n.toLowerCase();return Ye.has(s)?s:We.find(r=>s.includes(r))},ze=e=>e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ");var p=require("@liberfi.io/types"),S="0x0000000000000000000000000000000000000000",_={native:{address:"11111111111111111111111111111111",symbol:"SOL",decimals:9},wrapped:{address:"So11111111111111111111111111111111111111112",symbol:"SOL",decimals:9},stablecoins:{USDC:{address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",symbol:"USDC",decimals:6},USDT:{address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",symbol:"USDT",decimals:6},USD1:{address:"USD1ttGY1N17NEEHLmELoaybftRBUSErhqYiQzvEmuB",symbol:"USD1",decimals:6}}},F={native:{address:S,symbol:"ETH",decimals:18},wrapped:{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",symbol:"WETH",decimals:18},stablecoins:{USDC:{address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",symbol:"USDC",decimals:6},USDT:{address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",symbol:"USDT",decimals:6}}},H={native:{address:S,symbol:"BNB",decimals:18},wrapped:{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",symbol:"WBNB",decimals:18},stablecoins:{USDC:{address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",symbol:"USDC",decimals:18},USDT:{address:"0x55d398326f99059fF775485246999027B3197955",symbol:"USDT",decimals:18}}},v={native:{address:S,symbol:"ETH",decimals:18},wrapped:{address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",symbol:"WETH",decimals:18},stablecoins:{USDC:{address:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",symbol:"USDC",decimals:6},USDT:{address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",symbol:"USDT",decimals:6}}},V={native:{address:S,symbol:"ETH",decimals:18},wrapped:{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",decimals:18},stablecoins:{USDC:{address:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",symbol:"USDC",decimals:6},USDT:{address:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",symbol:"USDT",decimals:6}}},$={native:{address:S,symbol:"AVAX",decimals:18},wrapped:{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",symbol:"WAVAX",decimals:18},stablecoins:{USDC:{address:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",symbol:"USDC",decimals:6},USDT:{address:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",symbol:"USDT",decimals:6}}},h={[p.Chain.SOLANA]:_,[p.Chain.ETHEREUM]:F,[p.Chain.BINANCE]:H,[p.Chain.ARBITRUM]:v,[p.Chain.OPTIMISM]:V,[p.Chain.AVALANCHE]:$};function qe(e){return h[e]?.native}function Xe(e){return h[e]?.wrapped}function je(e){return h[e]?.stablecoins}function Je(e){let n=h[e];return n?[n.native.address,n.wrapped.address,...Object.values(n.stablecoins).map(s=>s.address)]:[]}function Qe(e){let n=h[e];if(!n)return{};let s={[n.native.address]:n.native.symbol,[n.wrapped.address]:n.wrapped.symbol};for(let r of Object.values(n.stablecoins))s[r.address]=r.symbol;return s}var i=require("@liberfi.io/types"),et={[i.Chain.SOLANA]:"https://solscan.io/tx/",[i.Chain.ETHEREUM]:"https://etherscan.io/tx/",[i.Chain.POLYGON]:"https://polygonscan.com/tx/",[i.Chain.BINANCE]:"https://bscscan.com/tx/",[i.Chain.BINANCE_TESTNET]:"https://testnet.bscscan.com/tx/",[i.Chain.AVALANCHE]:"https://snowtrace.io/tx/",[i.Chain.BASE]:"https://basescan.org/tx/",[i.Chain.BLAST]:"https://blastracker.xyz/tx/",[i.Chain.ARBITRUM]:"https://arbiscan.io/tx/",[i.Chain.ARBITRUM_NOVA]:"https://nova.arbiscan.io/tx/",[i.Chain.ARBITRUM_TESTNET_GOERLI]:"https://goerli.arbiscan.io/tx/",[i.Chain.ARBITRUM_TESTNET_SEPOLIA]:"https://sepolia.arbiscan.io/tx/"},tt={[i.Chain.SOLANA]:"https://solscan.io/account/",[i.Chain.ETHEREUM]:"https://etherscan.io/address/",[i.Chain.POLYGON]:"https://polygonscan.com/address/",[i.Chain.BINANCE]:"https://bscscan.com/address/",[i.Chain.BINANCE_TESTNET]:"https://testnet.bscscan.com/address/",[i.Chain.AVALANCHE]:"https://snowtrace.io/address/",[i.Chain.BASE]:"https://basescan.org/address/",[i.Chain.BLAST]:"https://blastracker.xyz/address/",[i.Chain.ARBITRUM]:"https://arbiscan.io/address/",[i.Chain.ARBITRUM_NOVA]:"https://nova.arbiscan.io/address/",[i.Chain.ARBITRUM_TESTNET_GOERLI]:"https://goerli.arbiscan.io/address/",[i.Chain.ARBITRUM_TESTNET_SEPOLIA]:"https://sepolia.arbiscan.io/address/"};function K(e,n,s){let r=e[n];return r?`${r}${s}`:void 0}function nt(e,n){return K(et,e,n)}function st(e,n){return K(tt,e,n)}function rt(e){return`https://lens.google.com/uploadbyurl?url=${encodeURIComponent(e)}`}function ot(e){return`https://x.com/search?q=${encodeURIComponent(e)}`}function it(e){return`https://x.com/${e}`}function at(e){return`https://x.com/i/status/${e}`}function G(e,n){let s=0,r=null,o=null;return(...u)=>{let T=Date.now(),A=n-(T-s);A<=0?(r!==null&&(clearTimeout(r),r=null),s=T,e(...u)):(o=u,r===null&&(r=setTimeout(()=>{s=Date.now(),r=null,o&&(e(...o),o=null)},A)))}}function Y(e,n){let s=null,r=(...o)=>{s!==null&&clearTimeout(s),s=setTimeout(()=>{s=null,e(...o)},n)};return r.cancel=()=>{s!==null&&(clearTimeout(s),s=null)},r}function C(e,n=!1){return typeof e=="function"?e:n?s=>String(s[e]):s=>s[e]}function W(e,n){let s=C(n),r=new Set;return e.filter(o=>{let a=s(o);return r.has(a)?!1:(r.add(a),!0)})}function Z(e,n,s){let r=C(s),o=new Set(n.map(r));return e.filter(a=>o.has(r(a)))}function z(e,n){let s=C(n,!0),r={};for(let o of e)r[s(o)]=o;return r}function q(e,n){let s=C(n,!0),r={};for(let o of e){let a=s(o);(r[a]??=[]).push(o)}return r}function X(e,n){let s={};for(let r of Object.keys(e))s[n(e[r],r)]=e[r];return s}function j(e,n){let s={};for(let r of Object.keys(e))s[r]=n(e[r],r);return s}0&&(module.exports={ARBITRUM_TOKENS,AVALANCHE_TOKENS,ApiError,BSC_TOKENS,CHAIN_REGISTRY,CHAIN_TOKENS,ETHEREUM_TOKENS,OPTIMISM_TOKENS,SOLANA_TOKENS,SafeBigNumber,accountExplorerUrl,capitalize,chainColor,chainDisplayName,chainIcon,chainIdBySlug,chainSlug,chainToNamespace,debounce,formatAge,formatAgeInSeconds,formatAmount,formatAmountUSD,formatAmountUSDCompact,formatPercent,formatPrice,formatPriceUSD,formatSymbol,formatTokenProtocolName,getCommonTokenAddresses,getCommonTokenSymbolsMap,getNativeToken,getStablecoins,getWrappedToken,groupBy,httpDelete,httpGet,httpMutate,httpPost,httpPut,httpRequest,intersectionBy,isBinanceChain,isEthereumChain,isSolanaChain,isValidEvmAddress,isValidNumber,isValidSolanaAddress,isValidWalletAddress,keyBy,mapKeys,mapValues,parseTokenProtocolFamily,searchImageUrl,searchTwitterUrl,throttle,truncateAddress,twitterTweetUrl,twitterUserUrl,txExplorerUrl,uniqBy});
|
|
1
|
+
"use strict";var J=Object.create;var b=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var re=(e,n)=>{for(var r in n)b(e,r,{get:n[r],enumerable:!0})},y=(e,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of ee(n))!ne.call(e,o)&&o!==r&&b(e,o,{get:()=>n[o],enumerable:!(s=Q(n,o))||s.enumerable});return e};var se=(e,n,r)=>(r=e!=null?J(te(e)):{},y(n||!e||!e.__esModule?b(r,"default",{value:e,enumerable:!0}):r,e)),oe=e=>y(b({},"__esModule",{value:!0}),e);var ct={};re(ct,{ARBITRUM_TOKENS:()=>v,AVALANCHE_TOKENS:()=>$,ApiError:()=>E,BSC_TOKENS:()=>H,CHAIN_REGISTRY:()=>m,CHAIN_TOKENS:()=>h,ETHEREUM_TOKENS:()=>F,OPTIMISM_TOKENS:()=>V,SOLANA_TOKENS:()=>_,SafeBigNumber:()=>g,accountExplorerUrl:()=>ot,capitalize:()=>Ke,chainColor:()=>ge,chainDisplayName:()=>pe,chainIcon:()=>me,chainIdBySlug:()=>x,chainSlug:()=>de,chainToNamespace:()=>B,debounce:()=>W,formatAge:()=>Ne,formatAgeInSeconds:()=>w,formatAmount:()=>we,formatAmountCompact:()=>_e,formatAmountUSD:()=>ke,formatAmountUSDCompact:()=>He,formatPercent:()=>$e,formatPrice:()=>ve,formatPriceUSD:()=>Ve,formatSymbol:()=>Ye,formatTokenProtocolName:()=>Xe,getCommonTokenAddresses:()=>et,getCommonTokenSymbolsMap:()=>tt,getNativeToken:()=>je,getStablecoins:()=>Qe,getWrappedToken:()=>Je,groupBy:()=>q,httpDelete:()=>Ie,httpGet:()=>Se,httpMutate:()=>xe,httpPost:()=>be,httpPut:()=>Ce,httpRequest:()=>f,intersectionBy:()=>Z,isBinanceChain:()=>ce,isEthereumChain:()=>le,isSolanaChain:()=>ue,isValidEvmAddress:()=>D,isValidNumber:()=>N,isValidSolanaAddress:()=>U,isValidWalletAddress:()=>Ae,keyBy:()=>z,mapKeys:()=>X,mapValues:()=>j,parseTokenProtocolFamily:()=>qe,searchImageUrl:()=>it,searchTwitterUrl:()=>at,throttle:()=>G,truncateAddress:()=>Ge,twitterTweetUrl:()=>lt,twitterUserUrl:()=>ut,txExplorerUrl:()=>st,uniqBy:()=>Y});module.exports=oe(ct);var t=require("@liberfi.io/types"),P=new Set([t.Chain.SOLANA,t.Chain.SOLANA_TESTNET,t.Chain.SOLANA_DEVNET]),ie=new Set([t.Chain.ETHEREUM]),ae=new Set([t.Chain.BINANCE,t.Chain.BINANCE_TESTNET]);function B(e){return P.has(e)?t.ChainNamespace.SOLANA:t.ChainNamespace.EVM}function ue(e){return P.has(e)}function le(e){return ie.has(e)}function ce(e){return ae.has(e)}var m={[t.Chain.ETHEREUM]:{slug:"ethereum",abbr:"eth",color:"#627EEA"},[t.Chain.UBIQ]:{slug:"ubiq"},[t.Chain.OPTIMISM]:{slug:"optimism",abbr:"opt",color:"#FF0420"},[t.Chain.FLARE]:{slug:"flare"},[t.Chain.SONGBIRD]:{slug:"songbird"},[t.Chain.ELASTOS]:{slug:"elastos"},[t.Chain.KARDIA]:{slug:"kardia"},[t.Chain.CRONOS]:{slug:"cronos",color:"#002D74"},[t.Chain.RSK]:{slug:"rsk"},[t.Chain.TELOS]:{slug:"telos"},[t.Chain.LUKSO]:{slug:"lukso"},[t.Chain.CRAB]:{slug:"crab"},[t.Chain.DARWINIA]:{slug:"darwinia"},[t.Chain.XDC]:{slug:"xdc"},[t.Chain.CSC]:{slug:"csc"},[t.Chain.ZYX]:{slug:"zyx"},[t.Chain.BINANCE]:{slug:"binance",abbr:"bsc",color:"#F0B90B"},[t.Chain.SYSCOIN]:{slug:"syscoin"},[t.Chain.GOCHAIN]:{slug:"gochain"},[t.Chain.ETHEREUMCLASSIC]:{slug:"ethereumclassic"},[t.Chain.OKEXCHAIN]:{slug:"okexchain"},[t.Chain.HOO]:{slug:"hoo"},[t.Chain.METER]:{slug:"meter"},[t.Chain.NOVA_NETWORK]:{slug:"nova network"},[t.Chain.TOMOCHAIN]:{slug:"tomochain"},[t.Chain.BITKUB]:{slug:"bitkub"},[t.Chain.XDAI]:{slug:"xdai"},[t.Chain.SOLANA]:{slug:"solana",abbr:"sol",color:"#9945FF"},[t.Chain.VELAS]:{slug:"velas"},[t.Chain.THUNDERCORE]:{slug:"thundercore"},[t.Chain.ENULS]:{slug:"enuls"},[t.Chain.FUSE]:{slug:"fuse"},[t.Chain.HECO]:{slug:"heco"},[t.Chain.UNICHAIN]:{slug:"unichain"},[t.Chain.POLYGON]:{slug:"polygon",color:"#8247E5"},[t.Chain.SONIC]:{slug:"sonic",color:"#5B6EF5"},[t.Chain.SHIMMER_EVM]:{slug:"shimmer_evm"},[t.Chain.RBN]:{slug:"rbn"},[t.Chain.OMNI]:{slug:"omni"},[t.Chain.MANTA]:{slug:"manta"},[t.Chain.HSK]:{slug:"hsk"},[t.Chain.WATER]:{slug:"water"},[t.Chain.XLAYER]:{slug:"xlayer"},[t.Chain.XDAIARB]:{slug:"xdaiarb"},[t.Chain.OP_BNB]:{slug:"op_bnb"},[t.Chain.VINUCHAIN]:{slug:"vinuchain"},[t.Chain.ENERGYWEB]:{slug:"energyweb"},[t.Chain.OASYS]:{slug:"oasys"},[t.Chain.FANTOM]:{slug:"fantom"},[t.Chain.FRAXTAL]:{slug:"fraxtal"},[t.Chain.HPB]:{slug:"hpb"},[t.Chain.BOBA]:{slug:"boba"},[t.Chain.OMAX]:{slug:"omax"},[t.Chain.FILECOIN]:{slug:"filecoin"},[t.Chain.KUCOIN]:{slug:"kucoin"},[t.Chain.ZKSYNC_ERA]:{slug:"zksync era"},[t.Chain.SHIDEN]:{slug:"shiden"},[t.Chain.THETA]:{slug:"theta"},[t.Chain.PULSE]:{slug:"pulse"},[t.Chain.CRONOS_ZKEVM]:{slug:"cronos zkevm"},[t.Chain.SX]:{slug:"sx"},[t.Chain.AREON]:{slug:"areon"},[t.Chain.WC]:{slug:"wc"},[t.Chain.CANDLE]:{slug:"candle"},[t.Chain.ROLLUX]:{slug:"rollux"},[t.Chain.ASTAR]:{slug:"astar"},[t.Chain.REDSTONE]:{slug:"redstone"},[t.Chain.MATCHAIN]:{slug:"matchain"},[t.Chain.CALLISTO]:{slug:"callisto"},[t.Chain.TARA]:{slug:"tara"},[t.Chain.WANCHAIN]:{slug:"wanchain"},[t.Chain.LYRA_CHAIN]:{slug:"lyra chain"},[t.Chain.BIFROST]:{slug:"bifrost"},[t.Chain.CONFLUX]:{slug:"conflux"},[t.Chain.METIS]:{slug:"metis"},[t.Chain.DYMENSION]:{slug:"dymension"},[t.Chain.POLYGON_ZKEVM]:{slug:"polygon zkevm"},[t.Chain.CORE]:{slug:"core"},[t.Chain.LISK]:{slug:"lisk"},[t.Chain.ULTRON]:{slug:"ultron"},[t.Chain.STEP]:{slug:"step"},[t.Chain.MOONBEAM]:{slug:"moonbeam"},[t.Chain.MOONRIVER]:{slug:"moonriver"},[t.Chain.SEI]:{slug:"sei"},[t.Chain.LIVING_ASSETS_MAINNET]:{slug:"living assets mainnet"},[t.Chain.STY]:{slug:"sty"},[t.Chain.TENET]:{slug:"tenet"},[t.Chain.GRAVITY]:{slug:"gravity"},[t.Chain.REYA_NETWORK]:{slug:"reya network"},[t.Chain.SONEIUM]:{slug:"soneium"},[t.Chain.SWELLCHAIN]:{slug:"swellchain"},[t.Chain.ONUS]:{slug:"onus"},[t.Chain.HUBBLENET]:{slug:"hubblenet"},[t.Chain.SANKO]:{slug:"sanko"},[t.Chain.DOGECHAIN]:{slug:"dogechain"},[t.Chain.MILKOMEDA]:{slug:"milkomeda"},[t.Chain.MILKOMEDA_A1]:{slug:"milkomeda_a1"},[t.Chain.KAVA]:{slug:"kava"},[t.Chain.SOMA]:{slug:"soma"},[t.Chain.KARAK]:{slug:"karak"},[t.Chain.ABSTRACT]:{slug:"abstract"},[t.Chain.MORPH]:{slug:"morph"},[t.Chain.CROSSFI]:{slug:"crossfi"},[t.Chain.BEAM]:{slug:"beam"},[t.Chain.IOTEX]:{slug:"iotex"},[t.Chain.MANTLE]:{slug:"mantle"},[t.Chain.XLC]:{slug:"xlc"},[t.Chain.NAHMII]:{slug:"nahmii"},[t.Chain.BOUNCEBIT]:{slug:"bouncebit"},[t.Chain.TOMBCHAIN]:{slug:"tombchain"},[t.Chain.ZETACHAIN]:{slug:"zetachain"},[t.Chain.PLANQ]:{slug:"planq"},[t.Chain.BITROCK]:{slug:"bitrock"},[t.Chain.XSAT]:{slug:"xsat"},[t.Chain.CYETH]:{slug:"cyeth"},[t.Chain.CANTO]:{slug:"canto"},[t.Chain.KLAYTN]:{slug:"klaytn"},[t.Chain.THAT]:{slug:"that"},[t.Chain.BASE]:{slug:"base",color:"#0052FF"},[t.Chain.HELA]:{slug:"hela"},[t.Chain.IOTAEVM]:{slug:"iotaevm"},[t.Chain.JBC]:{slug:"jbc"},[t.Chain.EVMOS]:{slug:"evmos"},[t.Chain.CARBON]:{slug:"carbon"},[t.Chain.SMARTBCH]:{slug:"smartbch"},[t.Chain.ARTELA]:{slug:"artela"},[t.Chain.IMMUTABLE_ZKEVM]:{slug:"immutable zkevm"},[t.Chain.LOOP]:{slug:"loop"},[t.Chain.GENESYS]:{slug:"genesys"},[t.Chain.EOS_EVM]:{slug:"eos evm"},[t.Chain.MAP_PROTOCOL]:{slug:"map protocol"},[t.Chain.SAPPHIRE]:{slug:"sapphire"},[t.Chain.BITGERT]:{slug:"bitgert"},[t.Chain.FUSION]:{slug:"fusion"},[t.Chain.ZILLIQA]:{slug:"zilliqa"},[t.Chain.APECHAIN]:{slug:"apechain"},[t.Chain.EDU_CHAIN]:{slug:"edu chain"},[t.Chain.ARBITRUM]:{slug:"arbitrum",abbr:"arb",color:"#28A0F0"},[t.Chain.ARBITRUM_NOVA]:{slug:"arbitrum nova"},[t.Chain.CELO]:{slug:"celo"},[t.Chain.OASIS]:{slug:"oasis"},[t.Chain.ASSETCHAIN]:{slug:"assetchain"},[t.Chain.ETHERLINK]:{slug:"etherlink"},[t.Chain.AVALANCHE]:{slug:"avalanche",abbr:"avax",color:"#E84142"},[t.Chain.REI]:{slug:"rei"},[t.Chain.ZIRCUIT]:{slug:"zircuit"},[t.Chain.SOPHON]:{slug:"sophon"},[t.Chain.ETN]:{slug:"etn"},[t.Chain.SUPERPOSITION]:{slug:"superposition"},[t.Chain.REICHAIN]:{slug:"reichain"},[t.Chain.BOBA_BNB]:{slug:"boba_bnb"},[t.Chain.INK]:{slug:"ink"},[t.Chain.LINEA]:{slug:"linea",color:"#61DFFF"},[t.Chain.BOB]:{slug:"bob"},[t.Chain.GODWOKEN]:{slug:"godwoken"},[t.Chain.BERACHAIN]:{slug:"berachain",color:"#964B00"},[t.Chain.BLAST]:{slug:"blast",color:"#FCFC03"},[t.Chain.CHILIZ]:{slug:"chiliz"},[t.Chain.STRATIS]:{slug:"stratis"},[t.Chain.REAL]:{slug:"real"},[t.Chain.ODYSSEY]:{slug:"odyssey"},[t.Chain.TAIKO]:{slug:"taiko"},[t.Chain.BITLAYER]:{slug:"bitlayer"},[t.Chain.HYDRATION]:{slug:"hydration"},[t.Chain.PAREX]:{slug:"parex"},[t.Chain.POLIS]:{slug:"polis"},[t.Chain.KEKCHAIN]:{slug:"kekchain"},[t.Chain.SCROLL]:{slug:"scroll",color:"#FFEEDA"},[t.Chain.ZERO_NETWORK]:{slug:"zero_network"},[t.Chain.ZKLINK_NOVA]:{slug:"zklink nova"},[t.Chain.VISION]:{slug:"vision"},[t.Chain.SAAKURU]:{slug:"saakuru"},[t.Chain.ZORA]:{slug:"zora"},[t.Chain.CORN]:{slug:"corn"},[t.Chain.NEON]:{slug:"neon"},[t.Chain.LUMIA]:{slug:"lumia"},[t.Chain.AURORA]:{slug:"aurora"},[t.Chain.HARMONY]:{slug:"harmony"},[t.Chain.PALM]:{slug:"palm"},[t.Chain.ZENIQ]:{slug:"zeniq"},[t.Chain.CURIO]:{slug:"curio"},[t.Chain.MODE]:{slug:"mode"}};function ge(e){return m[e]?.color}function de(e){return m[e]?.slug}function me(e){let n=x(e)??e,r=m[n]?.slug;return r?`https://icons.llamao.fi/icons/chains/rsz_${encodeURIComponent(r)}.jpg`:void 0}function pe(e){let n=m[e];return n?n.abbr?n.abbr.toUpperCase():n.slug.replace(/\b\w/g,r=>r.toUpperCase()):e}var Te=(()=>{let e=new Map;for(let[n,r]of Object.entries(m))r?.abbr&&e.set(r.abbr.toLowerCase(),n);for(let[n,r]of Object.entries(m)){let s=r?.slug.toLowerCase();s&&!e.has(s)&&e.set(s,n)}return e})();function x(e){return Te.get(e.toLowerCase())}function Ae(e,n){let r=x(e)??e;switch(B(r)){case t.ChainNamespace.SOLANA:return U(n);case t.ChainNamespace.EVM:return D(n);default:throw new Error(`Unsupported chain: ${e}`)}}var fe=/^0x[0-9a-fA-F]{40}$/;function D(e){return fe.test(e)}var he=/^[1-9A-HJ-NP-Za-km-z]{32,44}$/;function U(e){return he.test(e)}var E=class extends Error{constructor(r,s,o,a){super(r);this.code=s;this.status=o;this.data=a;this.name="ApiError"}};var Ee={justNow:"just now",secondsAgo:"{n}s",minutesAgo:"{n}m",hoursAgo:"{n}h",daysAgo:"{n}d",yearsAgo:"{n}y"};function w(e,n={}){let r={...Ee,...n};return e<10?r.justNow:e<60?r.secondsAgo.replace("{n}",String(e)):e<3600?r.minutesAgo.replace("{n}",String(Math.floor(e/60))):e<86400?r.hoursAgo.replace("{n}",String(Math.floor(e/3600))):e<31536e3?r.daysAgo.replace("{n}",String(Math.floor(e/86400))):r.yearsAgo.replace("{n}",String(Math.floor(e/31536e3)))}function Ne(e,n={}){return w(Math.floor(e/1e3),n)}async function Oe(e){let n=await e.text().catch(()=>"");if(n)try{return JSON.parse(n)}catch{return}}async function f(e,n){if(!e.startsWith("http"))throw new Error("url must start with http(s)");let r=await fetch(e,{...n,headers:Re(n.headers,n.method)});if(r.ok)return await r.json();let s=await Oe(r),o=s?.message??(s?.code!==void 0?String(s.code):void 0)??r.statusText;throw r.status===400?new E(o,s?.code??r.status,r.status,s):new Error(o)}function Re(e={},n){let r=new Headers(e);return r.has("Content-Type")||(n!=="DELETE"?r.append("Content-Type","application/json;charset=utf-8"):r.append("Content-Type","application/x-www-form-urlencoded")),r}async function Se(e,n){return await f(e,{method:"GET",...n})}async function be(e,n,r){return await f(e,{method:"POST",body:JSON.stringify(n),...r})}async function Ce(e,n,r){return await f(e,{method:"PUT",body:JSON.stringify(n),...r})}async function Ie(e,n){return await f(e,{method:"DELETE",...n})}async function xe(e,n){return await f(e,n)}var u=se(require("bignumber.js")),g=class extends u.default{constructor(n,r){try{if(super(n??0,r),this.isNaN())return new u.default(0,r)}catch(s){console.error("SafeBigNumber constructor error",s),super(0,r)}}},ye=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,N=e=>{if(typeof e=="number")return Number.isFinite(e);if(e instanceof g||e instanceof u.default)return!e.isNaN()&&e.isFinite();if(typeof e!="string")return!1;let n=e.trim();return n===""||!ye.test(n)?!1:Number.isFinite(Number(n))},k=["\u2080","\u2081","\u2082","\u2083","\u2084","\u2085","\u2086","\u2087","\u2088","\u2089","\u2081\u2080","\u2081\u2081","\u2081\u2082","\u2081\u2083","\u2081\u2084","\u2081\u2085","\u2081\u2086","\u2081\u2087","\u2081\u2088","\u2081\u2089","\u2082\u2080","\u2082\u2081","\u2082\u2082","\u2082\u2083","\u2082\u2084","\u2082\u2085","\u2082\u2086","\u2082\u2087","\u2082\u2088","\u2082\u2089","\u2083\u2080","\u2083\u2081","\u2083\u2082","\u2083\u2083","\u2083\u2084","\u2083\u2085","\u2083\u2086","\u2083\u2087","\u2083\u2088","\u2083\u2089","\u2084\u2080"],Pe=k.length-1,c=(e,n=0,r=u.default.ROUND_DOWN)=>{let o=new g(e).decimalPlaces(n,r).toString().split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.join(".")},O=(e,n=1)=>{let r=new g(e);return r.lt(1e3)?r.toString():r.lt(1e6)?`${c(r.div(1e3),n)}K`:r.lt(1e9)?`${c(r.div(1e6),n)}M`:r.lt(1e12)?`${c(r.dividedBy(1e9),n)}B`:`${c(r.dividedBy(1e12),n)}T`},Be=(e,n=5)=>{let r=new g(e);if(r.eq(0))return"0";let[s,o]=r.toFixed().split("."),a=o.split(""),l=a.findIndex(A=>A!=="0");if(l<0||l>Pe)return"0";let T=Math.min(a.length-l,n);return`${c(s)}.0`.concat(k[l]).concat(a.slice(l,l+T).join("").replace(/\.?0+$/,""))},De=(e,n)=>{let r=e.toString().match(/\.0*/),s=(r?r[0].length-1:0)+n;return c(e,s)},L=(e,n)=>{let r=e.times(100).decimalPlaces(n,u.default.ROUND_HALF_UP);return`${c(r,n)}%`},C=(e,n,r)=>{let{showPlusGtThanZero:s,invalidPlaceholder:o="--",zeroToken:a}=r;if(!N(e))return o;let l=new g(e),T=l.lt(0),A=l.abs(),d=n(A);return a!==void 0&&d===a||d==="0"||Number(d)===0?d:T?`-${d}`:s?`+${d}`:d},Ue=e=>e.lt(.001)?e.decimalPlaces(5,u.default.ROUND_DOWN).toString():e.lt(1)?e.decimalPlaces(3,u.default.ROUND_DOWN).toString():e.lt(100)?e.decimalPlaces(2,u.default.ROUND_DOWN).toString():e.lt(1e5)?c(e,2):O(e),we=(e="",n={showPlusGtThanZero:!1})=>C(e,Ue,{showPlusGtThanZero:n?.showPlusGtThanZero}),Le=e=>e.lt(.001)?"$0":e.lt(1)?`$${e.decimalPlaces(3,u.default.ROUND_DOWN)}`:e.lt(100)?`$${e.decimalPlaces(2,u.default.ROUND_DOWN)}`:e.lt(1e4)?`$${c(e,2)}`:`$${O(e)}`,ke=(e="",n={showPlusGtThanZero:!1})=>C(e,Le,{showPlusGtThanZero:n?.showPlusGtThanZero,zeroToken:"$0"}),Me=e=>{if(e.lt(.001))return"0";if(e.lt(1))return e.decimalPlaces(3,u.default.ROUND_DOWN).toString();if(e.lt(100))return e.decimalPlaces(2,u.default.ROUND_DOWN).toString();if(e.lt(1e3))return e.decimalPlaces(0,u.default.ROUND_DOWN).toString();let n=e.div(100).integerValue(u.default.ROUND_DOWN).times(100);return O(n,0)},_e=(e="",n={showPlusGtThanZero:!1})=>C(e,Me,{showPlusGtThanZero:n?.showPlusGtThanZero,zeroToken:"0"}),Fe=e=>{if(e.lt(.001))return"$0";if(e.lt(1))return`$${e.decimalPlaces(3,u.default.ROUND_DOWN)}`;if(e.lt(100))return`$${e.decimalPlaces(2,u.default.ROUND_DOWN)}`;if(e.lt(1e3))return`$${e.decimalPlaces(0,u.default.ROUND_DOWN)}`;let n=e.div(100).integerValue(u.default.ROUND_DOWN).times(100);return`$${O(n,0)}`},He=(e="",n={showPlusGtThanZero:!1})=>C(e,Fe,{showPlusGtThanZero:n?.showPlusGtThanZero,zeroToken:"$0"}),M=e=>n=>n.lt(1e-4)?Be(n,e?4:2):n.lt(1)?e?c(n,4):De(n,2):n.lt(100)||n.lt(1e4)?c(n,e?4:2):n.lt(1e5)?c(n,2):O(n),ve=(e="",n={isHighPrecise:!0})=>{if(!N(e))return"--";let r=new g(e);return r.lt(0)?"--":M(n.isHighPrecise)(r.abs())},Ve=(e="",n={isHighPrecise:!0})=>{if(!N(e))return"--";let r=new g(e);return r.lt(0)?"--":`$${M(n.isHighPrecise)(r.abs())}`},$e=(e="",n={})=>{if(!N(e))return"-- %";let r=new g(e),s=r.lt(0),o=r.abs(),a=s?"-":n?.showPlusGtThanZero?"+":"";return o.lt(1e-4)?"0%":o.lt(100)?`${a}${L(o,n?.precision??2)}`:o.lt(1e3)?`${a}${L(o,n?.precision??1)}`:`${a}> 99,999%`};function Ke(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function Ge(e,n=6,r=4){return e.slice(0,n)+"..."+e.slice(-r)}var We=/\{?\b(type|base|quote)\b\}?/g;function Ye(e,n="base-type"){if(!e)return"";let[r="",s="",o=""]=e.split("_");return n.replace(We,(a,l)=>l==="type"?r:l==="base"?s:o)}var R=require("@liberfi.io/types"),Ze=new Set(R.SOLANA_TOKEN_PROTOCOLS),ze=[...R.SOLANA_TOKEN_PROTOCOLS].sort((e,n)=>n.length-e.length),qe=(e,n)=>{if(e!==R.Chain.SOLANA)return;let r=n.toLowerCase();return Ze.has(r)?r:ze.find(s=>r.includes(s))},Xe=e=>e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ");var p=require("@liberfi.io/types"),S="0x0000000000000000000000000000000000000000",_={native:{address:"11111111111111111111111111111111",symbol:"SOL",decimals:9},wrapped:{address:"So11111111111111111111111111111111111111112",symbol:"SOL",decimals:9},stablecoins:{USDC:{address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",symbol:"USDC",decimals:6},USDT:{address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",symbol:"USDT",decimals:6},USD1:{address:"USD1ttGY1N17NEEHLmELoaybftRBUSErhqYiQzvEmuB",symbol:"USD1",decimals:6}}},F={native:{address:S,symbol:"ETH",decimals:18},wrapped:{address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",symbol:"WETH",decimals:18},stablecoins:{USDC:{address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",symbol:"USDC",decimals:6},USDT:{address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",symbol:"USDT",decimals:6}}},H={native:{address:S,symbol:"BNB",decimals:18},wrapped:{address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",symbol:"WBNB",decimals:18},stablecoins:{USDC:{address:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",symbol:"USDC",decimals:18},USDT:{address:"0x55d398326f99059fF775485246999027B3197955",symbol:"USDT",decimals:18}}},v={native:{address:S,symbol:"ETH",decimals:18},wrapped:{address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",symbol:"WETH",decimals:18},stablecoins:{USDC:{address:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",symbol:"USDC",decimals:6},USDT:{address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",symbol:"USDT",decimals:6}}},V={native:{address:S,symbol:"ETH",decimals:18},wrapped:{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",decimals:18},stablecoins:{USDC:{address:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",symbol:"USDC",decimals:6},USDT:{address:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",symbol:"USDT",decimals:6}}},$={native:{address:S,symbol:"AVAX",decimals:18},wrapped:{address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",symbol:"WAVAX",decimals:18},stablecoins:{USDC:{address:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",symbol:"USDC",decimals:6},USDT:{address:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",symbol:"USDT",decimals:6}}},h={[p.Chain.SOLANA]:_,[p.Chain.ETHEREUM]:F,[p.Chain.BINANCE]:H,[p.Chain.ARBITRUM]:v,[p.Chain.OPTIMISM]:V,[p.Chain.AVALANCHE]:$};function je(e){return h[e]?.native}function Je(e){return h[e]?.wrapped}function Qe(e){return h[e]?.stablecoins}function et(e){let n=h[e];return n?[n.native.address,n.wrapped.address,...Object.values(n.stablecoins).map(r=>r.address)]:[]}function tt(e){let n=h[e];if(!n)return{};let r={[n.native.address]:n.native.symbol,[n.wrapped.address]:n.wrapped.symbol};for(let s of Object.values(n.stablecoins))r[s.address]=s.symbol;return r}var i=require("@liberfi.io/types"),nt={[i.Chain.SOLANA]:"https://solscan.io/tx/",[i.Chain.ETHEREUM]:"https://etherscan.io/tx/",[i.Chain.POLYGON]:"https://polygonscan.com/tx/",[i.Chain.BINANCE]:"https://bscscan.com/tx/",[i.Chain.BINANCE_TESTNET]:"https://testnet.bscscan.com/tx/",[i.Chain.AVALANCHE]:"https://snowtrace.io/tx/",[i.Chain.BASE]:"https://basescan.org/tx/",[i.Chain.BLAST]:"https://blastracker.xyz/tx/",[i.Chain.ARBITRUM]:"https://arbiscan.io/tx/",[i.Chain.ARBITRUM_NOVA]:"https://nova.arbiscan.io/tx/",[i.Chain.ARBITRUM_TESTNET_GOERLI]:"https://goerli.arbiscan.io/tx/",[i.Chain.ARBITRUM_TESTNET_SEPOLIA]:"https://sepolia.arbiscan.io/tx/"},rt={[i.Chain.SOLANA]:"https://solscan.io/account/",[i.Chain.ETHEREUM]:"https://etherscan.io/address/",[i.Chain.POLYGON]:"https://polygonscan.com/address/",[i.Chain.BINANCE]:"https://bscscan.com/address/",[i.Chain.BINANCE_TESTNET]:"https://testnet.bscscan.com/address/",[i.Chain.AVALANCHE]:"https://snowtrace.io/address/",[i.Chain.BASE]:"https://basescan.org/address/",[i.Chain.BLAST]:"https://blastracker.xyz/address/",[i.Chain.ARBITRUM]:"https://arbiscan.io/address/",[i.Chain.ARBITRUM_NOVA]:"https://nova.arbiscan.io/address/",[i.Chain.ARBITRUM_TESTNET_GOERLI]:"https://goerli.arbiscan.io/address/",[i.Chain.ARBITRUM_TESTNET_SEPOLIA]:"https://sepolia.arbiscan.io/address/"};function K(e,n,r){let s=e[n];return s?`${s}${r}`:void 0}function st(e,n){return K(nt,e,n)}function ot(e,n){return K(rt,e,n)}function it(e){return`https://lens.google.com/uploadbyurl?url=${encodeURIComponent(e)}`}function at(e){return`https://x.com/search?q=${encodeURIComponent(e)}`}function ut(e){return`https://x.com/${e}`}function lt(e){return`https://x.com/i/status/${e}`}function G(e,n){let r=0,s=null,o=null;return(...l)=>{let T=Date.now(),A=n-(T-r);A<=0?(s!==null&&(clearTimeout(s),s=null),r=T,e(...l)):(o=l,s===null&&(s=setTimeout(()=>{r=Date.now(),s=null,o&&(e(...o),o=null)},A)))}}function W(e,n){let r=null,s=(...o)=>{r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,e(...o)},n)};return s.cancel=()=>{r!==null&&(clearTimeout(r),r=null)},s}function I(e,n=!1){return typeof e=="function"?e:n?r=>String(r[e]):r=>r[e]}function Y(e,n){let r=I(n),s=new Set;return e.filter(o=>{let a=r(o);return s.has(a)?!1:(s.add(a),!0)})}function Z(e,n,r){let s=I(r),o=new Set(n.map(s));return e.filter(a=>o.has(s(a)))}function z(e,n){let r=I(n,!0),s={};for(let o of e)s[r(o)]=o;return s}function q(e,n){let r=I(n,!0),s={};for(let o of e){let a=r(o);(s[a]??=[]).push(o)}return s}function X(e,n){let r={};for(let s of Object.keys(e))r[n(e[s],s)]=e[s];return r}function j(e,n){let r={};for(let s of Object.keys(e))r[s]=n(e[s],s);return r}0&&(module.exports={ARBITRUM_TOKENS,AVALANCHE_TOKENS,ApiError,BSC_TOKENS,CHAIN_REGISTRY,CHAIN_TOKENS,ETHEREUM_TOKENS,OPTIMISM_TOKENS,SOLANA_TOKENS,SafeBigNumber,accountExplorerUrl,capitalize,chainColor,chainDisplayName,chainIcon,chainIdBySlug,chainSlug,chainToNamespace,debounce,formatAge,formatAgeInSeconds,formatAmount,formatAmountCompact,formatAmountUSD,formatAmountUSDCompact,formatPercent,formatPrice,formatPriceUSD,formatSymbol,formatTokenProtocolName,getCommonTokenAddresses,getCommonTokenSymbolsMap,getNativeToken,getStablecoins,getWrappedToken,groupBy,httpDelete,httpGet,httpMutate,httpPost,httpPut,httpRequest,intersectionBy,isBinanceChain,isEthereumChain,isSolanaChain,isValidEvmAddress,isValidNumber,isValidSolanaAddress,isValidWalletAddress,keyBy,mapKeys,mapValues,parseTokenProtocolFamily,searchImageUrl,searchTwitterUrl,throttle,truncateAddress,twitterTweetUrl,twitterUserUrl,txExplorerUrl,uniqBy});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|