Skip to content

Commit

Permalink
add oasis (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
namgold authored Mar 23, 2022
1 parent 250c238 commit 07e9a9a
Show file tree
Hide file tree
Showing 11 changed files with 427 additions and 14 deletions.
16 changes: 15 additions & 1 deletion .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,18 @@ REACT_APP_NETWORK_INFO_VELAS_SUBGRAPH_BLOCK_URL=https://velas-graph.kyberenginee
REACT_APP_NETWORK_INFO_VELAS_ETHERSCAN_URL=https://evmexplorer.velas.com
REACT_APP_NETWORK_INFO_VELAS_KNC_ADDRESS=0xfe56d5892bdffc7bf58f2e84be1b2c32d21c308b
REACT_APP_NETWORK_INFO_VELAS_WETH_ADDRESS=0xc579D1f3CF86749E05CD06f7ADe17856c2CE3126
REACT_APP_NETWORK_INFO_VELAS_DEFAULT_START_TIME=1630313700
REACT_APP_NETWORK_INFO_VELAS_DEFAULT_START_TIME=1646672400
#OASIS
REACT_APP_NETWORK_INFO_OASIS_CHAIN_ID=42262
REACT_APP_NETWORK_INFO_OASIS_LIST_ORDER=11
REACT_APP_NETWORK_INFO_OASIS_NAME=Oasis
REACT_APP_NETWORK_INFO_OASIS_URL_KEY=oasis
REACT_APP_NETWORK_INFO_OASIS_DMM_SWAP_URL=https://kyberswap.com/#/
REACT_APP_NETWORK_INFO_OASIS_FACTORY_ADDRESS=0xD9bfE9979e9CA4b2fe84bA5d4Cf963bBcB376974
REACT_APP_NETWORK_INFO_OASIS_SUBGRAPH_NAME=kybernetwork/kyberswap-exchange-oasis
REACT_APP_NETWORK_INFO_OASIS_SUBGRAPH_URL=https://oasis-graph.kyberengineering.io/subgraphs/name/kybernetwork/kyberswap-exchange-oasis
REACT_APP_NETWORK_INFO_OASIS_SUBGRAPH_BLOCK_URL=https://oasis-graph.kyberengineering.io/subgraphs/name/kybernetwork/oasis-blocks
REACT_APP_NETWORK_INFO_OASIS_ETHERSCAN_URL=https://explorer.emerald.oasis.dev
REACT_APP_NETWORK_INFO_OASIS_KNC_ADDRESS=0xfe56d5892bdffc7bf58f2e84be1b2c32d21c308b
REACT_APP_NETWORK_INFO_OASIS_WETH_ADDRESS=0x21C718C22D52d0F3a789b752D4c2fD5908a8A733
REACT_APP_NETWORK_INFO_OASIS_DEFAULT_START_TIME=1647932400
14 changes: 14 additions & 0 deletions .env.testnet
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,17 @@ REACT_APP_NETWORK_INFO_VELAS_ETHERSCAN_URL=https://evmexplorer.velas.com
REACT_APP_NETWORK_INFO_VELAS_KNC_ADDRESS=0xfe56d5892bdffc7bf58f2e84be1b2c32d21c308b
REACT_APP_NETWORK_INFO_VELAS_WETH_ADDRESS=0xc579D1f3CF86749E05CD06f7ADe17856c2CE3126
REACT_APP_NETWORK_INFO_VELAS_DEFAULT_START_TIME=1630313700
#OASIS
REACT_APP_NETWORK_INFO_OASIS_CHAIN_ID=43113
REACT_APP_NETWORK_INFO_OASIS_LIST_ORDER=11
REACT_APP_NETWORK_INFO_OASIS_NAME=Oasis
REACT_APP_NETWORK_INFO_OASIS_URL_KEY=oasis
REACT_APP_NETWORK_INFO_OASIS_DMM_SWAP_URL=https://kyberswap.com/#/
REACT_APP_NETWORK_INFO_OASIS_FACTORY_ADDRESS=0xD9bfE9979e9CA4b2fe84bA5d4Cf963bBcB376974
REACT_APP_NETWORK_INFO_OASIS_SUBGRAPH_NAME=kybernetwork/kyberswap-exchange-oasis
REACT_APP_NETWORK_INFO_OASIS_SUBGRAPH_URL=https://oasis-graph.kyberengineering.io/subgraphs/name/kybernetwork/kyberswap-exchange-oasis
REACT_APP_NETWORK_INFO_OASIS_SUBGRAPH_BLOCK_URL=https://oasis-graph.kyberengineering.io/subgraphs/name/kybernetwork/oasis-blocks
REACT_APP_NETWORK_INFO_OASIS_ETHERSCAN_URL=https://explorer.emerald.oasis.dev
REACT_APP_NETWORK_INFO_OASIS_KNC_ADDRESS=0xfe56d5892bdffc7bf58f2e84be1b2c32d21c308b
REACT_APP_NETWORK_INFO_OASIS_WETH_ADDRESS=0x21C718C22D52d0F3a789b752D4c2fD5908a8A733
REACT_APP_NETWORK_INFO_OASIS_DEFAULT_START_TIME=1647932400
5 changes: 5 additions & 0 deletions src/assets/networks/oasis-network.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/oasis.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/components/TokenLogo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import ARBITRUM_TOKEN_LIST from '../../constants/tokenLists/arbitrum.tokenlist'
import BTTC_TOKEN_LIST from '../../constants/tokenLists/bttc.tokenlist'
import VELAS_TOKEN_LIST from '../../constants/tokenLists/velas.tokenlist'
import AURORA_TOKEN_LIST from '../../constants/tokenLists/aurora.tokenlist'
import OASIS_TOKEN_LIST from '../../constants/tokenLists/oasis.tokenlist'
import { isAddress } from '../../utils/index.js'
import PlaceHolder from '../../assets/placeholder.png'
import EthereumLogo from '../../assets/eth.png'
Expand All @@ -22,6 +23,7 @@ import FantomLogo from '../../assets/networks/fantom-network.png'
import CronosLogo from '../../assets/cronos.svg'
import VelasLogo from '../../assets/velas.png'
import AuroraLogo from '../../assets/aurora.svg'
import OasisLogo from '../../assets/oasis.svg'
import { getMaticTokenLogoURL } from '../../utils/maticTokenMapping'
import { getMumbaiTokenLogoURL } from '../../utils/mumbaiTokenMapping'
import { getBscTestnetTokenLogoURL } from '../../utils/bscTestnetTokenMapping'
Expand Down Expand Up @@ -206,6 +208,19 @@ export function getNativeTokenLogo({ size = '24px', chainId, ...rest }) {
/>
</StyledNativeTokenLogo>
)
case ChainId.OASIS:
return (
<StyledNativeTokenLogo size={size} {...rest}>
<img
src={OasisLogo}
style={{
boxShadow: '0px 6px 10px rgba(0, 0, 0, 0.075)',
borderRadius: '24px',
}}
alt=''
/>
</StyledNativeTokenLogo>
)
default:
return (
<StyledNativeTokenLogo size={size} {...rest}>
Expand Down Expand Up @@ -381,6 +396,13 @@ export default function TokenLogo({ address, header = false, size = '24px', ...r
path = 'error'
break

case ChainId.OASIS:
if (formattedAddress && OASIS_TOKEN_LIST[formattedAddress]) {
return getCustomLogo({ address, src: OASIS_TOKEN_LIST[formattedAddress].logoURI, size, setError, ...rest })
}
path = 'error'
break

default:
if (formattedAddress && ETHEREUM_TOKEN_LIST[formattedAddress]?.logoURI) {
return getCustomLogo({
Expand Down
26 changes: 14 additions & 12 deletions src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,22 @@ export const ChainId = {
BTTC: 199,
VELAS: 106,
AURORA: 1313161554,
OASIS: 42262,
}

export const ANALYTICS_URLS = {
1: 'https://analytics.kyberswap.com',
137: 'https://polygon-analytics.kyberswap.com',
56: 'https://bsc-analytics.kyberswap.com',
43114: 'https://avax-analytics.kyberswap.com',
250: 'https://fantom-analytics.kyberswap.com',
25: 'https://cronos-analytics.kyberswap.com',
[ChainId.ARBITRUM]: 'https://arbitrum-analytics.kyberswap.com',
[ChainId.BTTC]: 'https://bttc-analytics.kyberswap.com',
[ChainId.VELAS]: 'https://velas-analytics.kyberswap.com',
[ChainId.AURORA]: 'https://aurora-analytics.kyberswap.com',
}
// export const ANALYTICS_URLS = {
// 1: 'https://analytics.kyberswap.com',
// 137: 'https://polygon-analytics.kyberswap.com',
// 56: 'https://bsc-analytics.kyberswap.com',
// 43114: 'https://avax-analytics.kyberswap.com',
// 250: 'https://fantom-analytics.kyberswap.com',
// 25: 'https://cronos-analytics.kyberswap.com',
// [ChainId.ARBITRUM]: 'https://arbitrum-analytics.kyberswap.com',
// [ChainId.BTTC]: 'https://bttc-analytics.kyberswap.com',
// [ChainId.VELAS]: 'https://velas-analytics.kyberswap.com',
// [ChainId.AURORA]: 'https://aurora-analytics.kyberswap.com',
// [ChainId.OASIS]: 'https://oasis-analytics.kyberswap.com',
// }

// This variable to handle crazy APR which it can be wrong calculations or a bug
// But now, for FOMO of Pagxy, updated this to 10000 (before we set 2000 for it)
Expand Down
2 changes: 2 additions & 0 deletions src/constants/networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Arbitrum from '../assets/networks/arbitrum-network.svg'
import BitTorrent from '../assets/networks/bittorrent-network.png'
import Velas from '../assets/networks/velas-network.png'
import Aurora from '../assets/networks/aurora-network.svg'
import Oasis from '../assets/networks/oasis-network.svg'
import { ChainId } from '.'

export const NETWORK_ICON = {
Expand All @@ -26,4 +27,5 @@ export const NETWORK_ICON = {
[ChainId.BTTC]: BitTorrent,
[ChainId.VELAS]: Velas,
[ChainId.AURORA]: Aurora,
[ChainId.OASIS]: Oasis,
}
Loading

0 comments on commit 07e9a9a

Please sign in to comment.