diff --git a/.husky/_/husky.sh b/.husky/_/husky.sh index 00bf2b41..e69de29b 100644 --- a/.husky/_/husky.sh +++ b/.husky/_/husky.sh @@ -1,36 +0,0 @@ -#!/usr/bin/env sh -if [ -z "$husky_skip_init" ]; then - debug () { - if [ "$HUSKY_DEBUG" = "1" ]; then - echo "husky (debug) - $1" - fi - } - - readonly hook_name="$(basename -- "$0")" - debug "starting $hook_name..." - - if [ "$HUSKY" = "0" ]; then - debug "HUSKY env variable is set to 0, skipping hook" - exit 0 - fi - - if [ -f ~/.huskyrc ]; then - debug "sourcing ~/.huskyrc" - . ~/.huskyrc - fi - - readonly husky_skip_init=1 - export husky_skip_init - sh -e "$0" "$@" - exitCode="$?" - - if [ $exitCode != 0 ]; then - echo "husky - $hook_name hook exited with code $exitCode (error)" - fi - - if [ $exitCode = 127 ]; then - echo "husky - command not found in PATH=$PATH" - fi - - exit $exitCode -fi diff --git a/components/Finder.tsx b/components/Finder.tsx index ad83f9ca..bf13964b 100644 --- a/components/Finder.tsx +++ b/components/Finder.tsx @@ -38,6 +38,8 @@ const getUrl = (chainId: string, txHash: string) => { return `https://ping.pub/terra-luna/tx/${txHash}` case ChainId.osmosis: return `https://mintscan.io/osmosis/txs/${txHash}` + case ChainId.archway: + return `https://mintscan.io/archway/txs/${txHash}` default: return null } diff --git a/components/Layout/RadialGradient.tsx b/components/Layout/RadialGradient.tsx index f0222ef0..d0be7552 100644 --- a/components/Layout/RadialGradient.tsx +++ b/components/Layout/RadialGradient.tsx @@ -35,6 +35,8 @@ export const backgrounds = { 'linear-gradient(90deg, rgba(60, 205, 100, 0.25) 2.83%, rgba(255, 255, 0, 0.25) 50%, rgba(0, 117, 255, 0.25) 97.47%)', 'osmosis-1': 'linear-gradient(135deg, rgba(255, 20, 147, 0.8) 0%, rgba(147, 112, 219, 0.8) 50%, rgba(255, 20, 147, 0.8) 100%)', + 'archway-1': + 'linear-gradient(90deg, rgba(236, 91, 41, 1) 0%, rgba(236, 91, 41, 1) 50%, rgba(255, 91, 41, 1) 100%)', } const RadialGradient: FC = () => { diff --git a/components/Pages/Trade/Pools/Pools.tsx b/components/Pages/Trade/Pools/Pools.tsx index faf3a70e..a9664efe 100644 --- a/components/Pages/Trade/Pools/Pools.tsx +++ b/components/Pages/Trade/Pools/Pools.tsx @@ -69,7 +69,7 @@ const Pools = () => { const chains: any = useChainInfos() const currentChainPrefix = useMemo(() => chains.find((row: { chainId: string }) => row.chainId === chainId)?.bech32Config?. bech32PrefixAccAddr, - [chains, chainId]) + [chains, chainId]) const { flowPoolData: incentivePoolInfos, @@ -107,8 +107,8 @@ const Pools = () => { const _allPools = await Promise.all(pools.map((pool) => { const isUSDPool = - STABLE_COIN_LIST.includes(pool?.pool_assets[0].symbol) || - STABLE_COIN_LIST.includes(pool?.pool_assets[1].symbol) + STABLE_COIN_LIST.includes(pool?.pool_assets[0].symbol) || + STABLE_COIN_LIST.includes(pool?.pool_assets[1].symbol) if (externalStatsLoading) { setExternalStatsLoading((pool?.liquidity?.reserves?.totalAssetsInDollar || 0) === 0) @@ -150,10 +150,10 @@ const Pools = () => { useEffect(() => { if (pairInfos.length === 0) { - return + return; } let updatedPools = allPools.map((pool) => { - const pairInfo = pairInfos.find((pairInfo) => pairInfo.pool_id === pool.poolId) + const pairInfo = pairInfos?.find((pairInfo) => pairInfo.pool_id === pool.poolId) return { ...pool, volume24hr: pairInfo?.usdVolume24h, @@ -183,7 +183,7 @@ const Pools = () => { const flowLength = useMemo(() => incentivePoolInfos?. map((info) => info.flowData?.length ?? 0). reduce((a, b) => a + b, 0) ?? 0, - [incentivePoolInfos]) + [incentivePoolInfos]) useEffect(() => { const updatedPools = allPools.map((pool) => { @@ -261,7 +261,7 @@ const Pools = () => { {myPools?.length > 0 && ( - Supplied + Supplied { )} - + All Pools diff --git a/components/Pages/Trade/Swap/defaultTokens.json b/components/Pages/Trade/Swap/defaultTokens.json index 22adb939..7a9d48dd 100644 --- a/components/Pages/Trade/Swap/defaultTokens.json +++ b/components/Pages/Trade/Swap/defaultTokens.json @@ -89,6 +89,16 @@ "tokenSymbol": "WHALE", "amount": 0 } + ], + "archway": [ + { + "tokenSymbol": "ampWHALE", + "amount": 0 + }, + { + "tokenSymbol": "WHALE", + "amount": 0 + } ] }, "testnet": { diff --git a/constants/endpoints.json b/constants/endpoints.json index 77ebd3cf..f98f87a8 100644 --- a/constants/endpoints.json +++ b/constants/endpoints.json @@ -70,5 +70,13 @@ "rest": [ "https://osmosis-rest.publicnode.com" ] + }, + "archway": { + "rpc": [ + "https://archway.rpc.kjnodes.com" + ], + "rest": [ + "https://archway.api.kjnodes.com" + ] } -} \ No newline at end of file +} diff --git a/constants/networks.ts b/constants/networks.ts index 8d4f33d3..b2526f5c 100644 --- a/constants/networks.ts +++ b/constants/networks.ts @@ -9,6 +9,7 @@ export const ACTIVE_NETWORKS = { sei: 'pacific-1', 'terra-classic': 'columbus-5', osmosis: 'osmosis-1', + archway: 'archway-1', }, testnet: { comdex: 'comdex-test2', @@ -32,6 +33,7 @@ export const ACTIVE_NETWORKS_WALLET_NAMES = { 'sei', 'terra', 'osmosis', + 'archway', ], testnet: [ 'injectivetestnet', @@ -59,6 +61,7 @@ export const WALLET_CHAIN_NAMES_BY_CHAIN_ID = { 'atlantic-1': 'seitestnet', 'rebel-2': 'terra', 'osmosis-1': 'osmosis', + 'archway-1': 'archway', } export const ACTIVE_BONDING_NETWORKS = [ @@ -71,6 +74,7 @@ export const ACTIVE_BONDING_NETWORKS = [ 'columbus-5', 'injective-1', 'osmosis-1', + 'archway-1', ] export const ACTIVE_INCENTIVE_NETWORKS = [ 'chihuahua-1', @@ -113,6 +117,6 @@ export const NETWORK_MAP = { } // Chain names by cosmos kit -export enum WalletChainName { terrac = 'terra', terra = 'terra2', migaloo= 'migaloo', juno= 'juno', sei= 'sei', comdex= 'comdex', injective= 'injective', chihuahua= 'chihuahua', osmosis= 'osmosis' } +export enum WalletChainName { terrac = 'terra', terra = 'terra2', migaloo= 'migaloo', juno= 'juno', sei= 'sei', comdex= 'comdex', injective= 'injective', chihuahua= 'chihuahua', osmosis= 'osmosis', archway= 'archway' } export const CHAIN_NAMES = [...ACTIVE_NETWORKS_WALLET_NAMES.mainnet, ...ACTIVE_NETWORKS_WALLET_NAMES.testnet] -export enum ChainId { terrac = 'columbus-5', terra = 'phoenix-1', migaloo = 'migaloo-1', juno = 'juno-1', sei = 'pacific-1', comdex = 'comdex-1', injective = 'injective-1', chihuahua = 'chihuahua-1', narwhal = 'narwhal-1', pisco = 'pisco-1', osmosis = 'osmosis-1' } +export enum ChainId { terrac = 'columbus-5', terra = 'phoenix-1', migaloo = 'migaloo-1', juno = 'juno-1', sei = 'pacific-1', comdex = 'comdex-1', injective = 'injective-1', chihuahua = 'chihuahua-1', narwhal = 'narwhal-1', pisco = 'pisco-1', osmosis = 'osmosis-1', archway = "archway-1" } diff --git a/constants/vaultRouterAddresses.json b/constants/vaultRouterAddresses.json index 6b1b4837..c2436a12 100644 --- a/constants/vaultRouterAddresses.json +++ b/constants/vaultRouterAddresses.json @@ -5,4 +5,4 @@ "injective-1": "inj1hyja4uyjktpeh0fxzuw2fmjudr85rk2qxgqkvu", "migaloo-1": "migaloo19pze0n07guzj6yla2708q2feh38q9n8gxmkk8fjnuprfh6y9ngjqs90hcy", "osmosis-1": "osmo1ldkya0zakj380tlkd7dry0wj689t0r4x0kyxf6qn4pvvaat0l9tqsly68j" -} \ No newline at end of file +} diff --git a/public/mainnet/archway-1/config.json b/public/mainnet/archway-1/config.json new file mode 100644 index 00000000..cb74324f --- /dev/null +++ b/public/mainnet/archway-1/config.json @@ -0,0 +1,41 @@ +{ + "whale_lair": "archway1a2hawz66n3nuh8964t0kw6yvcvqww2rnucsvacga2g4360nxs2tsyzftg8", + "incentive_factory": "archway1wc6wu89rl42fhyru4gff7jwy5cf3m0qz22yn7szvt8ac3m8al3rsp68vug", + "fee_distributor": "archway19sd5pzm9davt53735nc020ewemtw8dq5znp4sdtynlwmveqy3jfqltvnws", + "frontend_helper": "archway1yuxk5envmnvn8c36gakhzd650jsfjpj5pf5vm3wa0uf4ltj3r6hqzdp8dg", + "whale_base_token": { + "name": "WHALE", + "denom": "ibc/3FED3F9CE7B16BDCB7920FECEC085F8FA58E21C0EAB99703E4B816E5F666E3B9", + "decimals": 6 + }, + "bonding_tokens": [ + { + "id": "eris-amplified-whale", + "chain_id": "archway-1", + "token_address": "ibc/6F78565CB5D0A8E854A4AD895B0881D0067F9147E5A56DC015EAC3476D9E17E4", + "symbol": "ampWHALE", + "name": "ampWHALE", + "decimals": 6, + "logoURI": "/logos/ampWhale.svg", + "tags": [ + "native" + ], + "native": true, + "denom": "ibc/6F78565CB5D0A8E854A4AD895B0881D0067F9147E5A56DC015EAC3476D9E17E4" + }, + { + "id": "backbone-labs-staked-whale", + "chain_id": "archway-1", + "token_address": "ibc/DD9FFDD2E0B4EE93EBFD1C433501A008C8B7593DAB158944AE6C990500788D05", + "symbol": "bWHALE", + "name": "bWHALE", + "decimals": 6, + "logoURI": "https://raw.githubusercontent.com/cosmos/chain-registry/master/migaloo/images/bWHALE.png", + "tags": [ + "native" + ], + "native": true, + "denom": "ibc/DD9FFDD2E0B4EE93EBFD1C433501A008C8B7593DAB158944AE6C990500788D05" + } + ] +} diff --git a/public/mainnet/archway-1/pools_list.json b/public/mainnet/archway-1/pools_list.json new file mode 100644 index 00000000..f40a8a4d --- /dev/null +++ b/public/mainnet/archway-1/pools_list.json @@ -0,0 +1,79 @@ +{ + "name": "Pools list on mainnet", + "logoURI": "/img/logo.svg", + "keywords": [ + "special tokens" + ], + "tags": { + "ProjectName": { + "name": "White Whale", + "description": "Tokens that are listed on Project" + } + }, + "timestamp": "2024-01-23T15:01:19+0000", + "base_token": { + "id": "archway", + "chain_id": "archway-1", + "token_address": "", + "symbol": "ARCH", + "name": "Archway", + "decimals": 18, + "logoURI": "https://raw.githubusercontent.com/cosmos/chain-registry/master/archway/images/archway.svg", + "tags": [ + "native" + ], + "native": true, + "denom": "aarch" + }, + "routerAddress": "archway1y0eyqu78q8zz93swaplvg90la0qkk0fueht3yxu6huc96yktrmcqntwe67", + "pools": [ + { + "pool_id": "bARCH-ARCH", + "lpOrder": [ + "bARCH", + "ARCH" + ], + "assetOrder": [ + "bARCH", + "ARCH" + ], + "displayName": "bARCH-ARCH", + "displayLogo1": "https://raw.githubusercontent.com/cosmos/chain-registry/master/archway/images/barch.png", + "displayLogo2": "https://raw.githubusercontent.com/cosmos/chain-registry/master/archway/images/arch.svg", + "pool_assets": [ + { + "id": "", + "chain_id": "archway-1", + "token_address": "archway17e3z7cr6d29uj54k4ucs6dtqvlxsxhwnwzetqgnp6zeu40cvq7dsd8q60x", + "symbol": "bARCH", + "name": "bARCH", + "decimals": 18, + "logoURI": "https://raw.githubusercontent.com/cosmos/chain-registry/master/archway/images/barch.png", + "tags": [ + "" + ], + "native": false, + "denom": "archway17e3z7cr6d29uj54k4ucs6dtqvlxsxhwnwzetqgnp6zeu40cvq7dsd8q60x" + }, + { + "id": "archway", + "chain_id": "archway-1", + "token_address": "aarch", + "symbol": "ARCH", + "name": "ARCH", + "decimals": 18, + "logoURI": "https://raw.githubusercontent.com/cosmos/chain-registry/master/archway/images/arch.svg", + "tags": [ + "native" + ], + "native": true, + "denom": "aarch" + } + ], + "lp_token": "archway1a2xz3c9cfjnf6u3ave0q76mkcm50pdcjqt68hasxkw0ys23h9vfq8wsv6x", + "swap_address": "archway19lcq9nsssqplxly8uxnjnlmkz8sy42cpd2d0wnjhcp64r795qdqq0re2x3", + "staking_address": "", + "rewards_tokens": [] + } + ] +} diff --git a/public/mainnet/archway-1/vaults_list.json b/public/mainnet/archway-1/vaults_list.json new file mode 100644 index 00000000..5a2c59bd --- /dev/null +++ b/public/mainnet/archway-1/vaults_list.json @@ -0,0 +1,5 @@ +{ + "factory": "archway132netq0uv85fqfq9dln93qy3gpukhzytk344u2a6phukmfa02c6qud97lr", + "vaults": [ + ] +} diff --git a/public/mainnet/chain_info.json b/public/mainnet/chain_info.json index 30636002..f66e2ce6 100644 --- a/public/mainnet/chain_info.json +++ b/public/mainnet/chain_info.json @@ -448,5 +448,54 @@ "ibc-go" ], "beta": true + }, + { + "chainId": "archway-1", + "chainName": "Archway Mainnet", + "label": "Archway", + "icon": "https://raw.githubusercontent.com/cosmos/chain-registry/master/archway/images/archway.svg", + "rpc": "https://archway.rpc.kjnodes.com", + "rest": "https://archway.api.kjnodes.com", + "stakeCurrency": { + "coinDenom": "ARCH", + "coinMinimalDenom": "aarch", + "coinDecimals": 18 + }, + "bip44": { + "coinType": 118 + }, + "bech32Config": { + "bech32PrefixAccAddr": "arch", + "bech32PrefixAccPub": "archpub", + "bech32PrefixValAddr": "archvaloper", + "bech32PrefixValPub": "archvaloperpub", + "bech32PrefixConsAddr": "archvalcons", + "bech32PrefixConsPub": "archvalconspub" + }, + "currencies": [ + { + "coinDenom": "ARCH", + "coinMinimalDenom": "aarch", + "coinDecimals": 18, + "coinGeckoId": "archway" + } + ], + "feeCurrencies": [ + { + "coinDenom": "ARCH", + "coinMinimalDenom": "aarch", + "coinDecimals": 18, + "coinGeckoId": "archway" + } + ], + "coinType": 118, + "gasPriceStep": { + "low": 140000000000, + "average": 225400000000, + "high": 254800000000 + }, + "features": [ + "cosmwasm" + ] } ] diff --git a/services/useAPI.ts b/services/useAPI.ts index 4bb03108..f11ab808 100644 --- a/services/useAPI.ts +++ b/services/useAPI.ts @@ -154,7 +154,8 @@ export const getPairAprAndDailyVolumeAPI = async (chain_name: string) => { try { const response = await fetchWithTimeout(`${await getFastestAPI()}/api/pools/${chain_name}`, 50000) const json = await response.json() - return json?.data || null + + return Array.isArray(json?.data) ? json?.data : null } catch (error) { console.error(error) return null diff --git a/util/getChainLogoUrlByName.ts b/util/getChainLogoUrlByName.ts index 4abae87d..55e03ba4 100644 --- a/util/getChainLogoUrlByName.ts +++ b/util/getChainLogoUrlByName.ts @@ -20,6 +20,8 @@ export const getChainLogoUrlByName = (chainName: string) : string => { return '/logos/terra.png' case WalletChainName.osmosis: return '/logos/osmo.svg' + case WalletChainName.archway: + return 'https://raw.githubusercontent.com/cosmos/chain-registry/master/archway/images/archway.svg' default: return null } diff --git a/util/getColorByChainName.ts b/util/getColorByChainName.ts index dc962b78..a2f57da2 100644 --- a/util/getColorByChainName.ts +++ b/util/getColorByChainName.ts @@ -20,6 +20,9 @@ export const getColorByChainName = (chainName: string) : string => { return '#00FF00' case WalletChainName.osmosis: return '#800080' + case WalletChainName.archway: + return '#ff8a22' + default: return null }