Skip to content

Commit

Permalink
feat: aw (#579)
Browse files Browse the repository at this point in the history
* feat: archway

---------

Co-authored-by: worrex <[email protected]>
  • Loading branch information
nick134-bit and worrex authored Oct 21, 2024
1 parent 1229aa5 commit f67ac10
Show file tree
Hide file tree
Showing 15 changed files with 222 additions and 50 deletions.
36 changes: 0 additions & 36 deletions .husky/_/husky.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions components/Finder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions components/Layout/RadialGradient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
20 changes: 11 additions & 9 deletions components/Pages/Trade/Pools/Pools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -261,7 +261,7 @@ const Pools = () => {
{myPools?.length > 0 && (
<Box width={'100%'} px={{ base: 5 }}>
<Text as="h2" fontSize="24" fontWeight="700" paddingTop={10} paddingBottom={5}>
Supplied
Supplied
</Text>
<MyPoolsTable
show={true}
Expand All @@ -276,8 +276,10 @@ const Pools = () => {
)}

<Box width={'100%'} px={{ base: 5 }}>
<HStack justifyContent="space-between" width={{ base: 'full',
xl: 'container.xl' }} paddingTop={10} paddingBottom={5}>
<HStack justifyContent="space-between" width={{
base: 'full',
xl: 'container.xl'
}} paddingTop={10} paddingBottom={5}>
<Text as="h2" fontSize="24" fontWeight="700">
All Pools
</Text>
Expand Down
10 changes: 10 additions & 0 deletions components/Pages/Trade/Swap/defaultTokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@
"tokenSymbol": "WHALE",
"amount": 0
}
],
"archway": [
{
"tokenSymbol": "ampWHALE",
"amount": 0
},
{
"tokenSymbol": "WHALE",
"amount": 0
}
]
},
"testnet": {
Expand Down
10 changes: 9 additions & 1 deletion constants/endpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,13 @@
"rest": [
"https://osmosis-rest.publicnode.com"
]
},
"archway": {
"rpc": [
"https://archway.rpc.kjnodes.com"
],
"rest": [
"https://archway.api.kjnodes.com"
]
}
}
}
8 changes: 6 additions & 2 deletions constants/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -32,6 +33,7 @@ export const ACTIVE_NETWORKS_WALLET_NAMES = {
'sei',
'terra',
'osmosis',
'archway',
],
testnet: [
'injectivetestnet',
Expand Down Expand Up @@ -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 = [
Expand All @@ -71,6 +74,7 @@ export const ACTIVE_BONDING_NETWORKS = [
'columbus-5',
'injective-1',
'osmosis-1',
'archway-1',
]
export const ACTIVE_INCENTIVE_NETWORKS = [
'chihuahua-1',
Expand Down Expand Up @@ -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" }
2 changes: 1 addition & 1 deletion constants/vaultRouterAddresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"injective-1": "inj1hyja4uyjktpeh0fxzuw2fmjudr85rk2qxgqkvu",
"migaloo-1": "migaloo19pze0n07guzj6yla2708q2feh38q9n8gxmkk8fjnuprfh6y9ngjqs90hcy",
"osmosis-1": "osmo1ldkya0zakj380tlkd7dry0wj689t0r4x0kyxf6qn4pvvaat0l9tqsly68j"
}
}
41 changes: 41 additions & 0 deletions public/mainnet/archway-1/config.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
79 changes: 79 additions & 0 deletions public/mainnet/archway-1/pools_list.json
Original file line number Diff line number Diff line change
@@ -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": []
}
]
}
5 changes: 5 additions & 0 deletions public/mainnet/archway-1/vaults_list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"factory": "archway132netq0uv85fqfq9dln93qy3gpukhzytk344u2a6phukmfa02c6qud97lr",
"vaults": [
]
}
49 changes: 49 additions & 0 deletions public/mainnet/chain_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
]
3 changes: 2 additions & 1 deletion services/useAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit f67ac10

Please sign in to comment.