Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mainnet #55

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,10 @@ export const Header: React.FC<IHeader> = ({
<SelectNetworkButton
name={typeOfNetwork}
networks={[
// {
// networkType: NetworkType.MAINNET,
// rpc: defaultMainnetRPC,
// rpcName:
// mainnetRPCs.find(data => data.rpc === defaultMainnetRPC)?.rpcName ?? 'Custom'
// },
{
networkType: NetworkType.MAINNET,
rpc: EclipseNetworks.MAIN
},
{ networkType: NetworkType.TESTNET, rpc: EclipseNetworks.TEST },
{ networkType: NetworkType.DEVNET, rpc: EclipseNetworks.DEV_EU }
]}
Expand Down
56 changes: 52 additions & 4 deletions src/store/consts/static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,48 @@ export interface Token {
isUnknown?: boolean
}
export const PRICE_DECIMAL = 24

export const USDC_MAIN: Token = {
symbol: 'USDC',
address: new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'),
decimals: 6,
name: 'USDC',
logoURI: 'https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694',
coingeckoId: ''
}
export const USDT_MAIN: Token = {
symbol: 'USDT',
address: new PublicKey('Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'),
decimals: 6,
name: 'Tether',
logoURI: 'https://coin-images.coingecko.com/coins/images/325/large/Tether.png?1696501661',
coingeckoId: ''
}
export const SOL_MAIN: Token = {
symbol: 'SOL',
address: new PublicKey('So11111111111111111111111111111111111111112'),
decimals: 9,
name: 'Wrapped Solana',
logoURI: 'https://coin-images.coingecko.com/coins/images/21629/large/solana.jpg?1696520989',
coingeckoId: ''
}
export const ETH_MAIN: Token = {
symbol: 'ETH',
address: new PublicKey('7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs'),
decimals: 8,
name: 'Ethereum (Wormhole)',
logoURI: 'https://coin-images.coingecko.com/coins/images/22990/large/ETH_wh_small.png?1696522286',
coingeckoId: ''
}
export const WBTC_MAIN: Token = {
symbol: 'WBTC',
address: new PublicKey('3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh'),
decimals: 8,
name: 'Wrapped BTC (Wormhole)',
logoURI:
'https://coin-images.coingecko.com/coins/images/23004/large/WBTC_wh_small.png?1696522299',
coingeckoId: ''
}
export const USDC_DEV: Token = {
symbol: 'USDC',
address: new PublicKey('GEds1ARB3oywy2sSdiNGDyxz9MhpfqPkFYYStdZmHaiN'),
Expand Down Expand Up @@ -100,8 +142,8 @@ export const S22_TEST: Token = {
}

enum EclipseNetworks {
TEST = 'https://testnet.dev2.eclipsenetwork.xyz', // TODO: TEST and MAIN temporarily set to the same endpoint as DEV; they are unvailable to change to on frontend anyways
MAIN = 'https://staging-rpc-eu.dev2.eclipsenetwork.xyz',
MAIN = 'https://mainnetbeta-rpc.eclipse.xyz',
TEST = 'https://testnet.dev2.eclipsenetwork.xyz',
DEV = 'https://staging-rpc.dev2.eclipsenetwork.xyz',
DEV_EU = 'https://staging-rpc-eu.dev2.eclipsenetwork.xyz',
LOCAL = 'http://127.0.0.1:8899'
Expand Down Expand Up @@ -131,7 +173,7 @@ export const tokensPrices: Record<NetworkType, Record<string, TokenPriceData>> =
}
export const tokens: Record<NetworkType, Token[]> = {
Devnet: [USDC_DEV, BTC_DEV],
Mainnet: [],
Mainnet: [USDC_MAIN, USDT_MAIN, SOL_MAIN, ETH_MAIN, WBTC_MAIN],
Testnet: [USDC_TEST, BTC_TEST],
Localnet: []
}
Expand Down Expand Up @@ -232,7 +274,13 @@ export const bestTiers: Record<NetworkType, BestTier[]> = {

export const commonTokensForNetworks: Record<NetworkType, PublicKey[]> = {
Devnet: [USDC_DEV.address, BTC_DEV.address, WETH_DEV.address],
Mainnet: [],
Mainnet: [
USDC_MAIN.address,
USDT_MAIN.address,
SOL_MAIN.address,
ETH_MAIN.address,
WBTC_MAIN.address
],
Testnet: [USDC_TEST.address, BTC_TEST.address, WETH_TEST.address],
Localnet: []
}
Expand Down
29 changes: 20 additions & 9 deletions src/store/consts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,23 @@
import {
BTC_DEV,
BTC_TEST,
ETH_MAIN,
MAX_U64,
MOON_TEST,
NetworkType,
PRICE_DECIMAL,
S22_TEST,
SOL_MAIN,
Token,
tokensPrices,
USDC_DEV,
USDC_MAIN,
USDC_TEST,
USDT_MAIN,
WBTC_MAIN,
WETH_DEV,
WETH_TEST
} from './static'
import mainnetList from './tokenLists/mainnet.json'
import { Connection, Keypair, PublicKey } from '@solana/web3.js'
import { PoolWithAddress } from '@reducers/pools'
import { Market, Tickmap, TICK_CROSSES_PER_IX } from '@invariant-labs/sdk-eclipse/lib/market'
Expand Down Expand Up @@ -387,17 +391,24 @@
}

export const getNetworkTokensList = (networkType: NetworkType): Record<string, Token> => {
const obj: Record<string, Token> = {}

Check failure on line 394 in src/store/consts/utils.ts

View workflow job for this annotation

GitHub Actions / Trunk Check

eslint(@typescript-eslint/no-unused-vars-experimental)

[new] Variable 'obj' is declared but its value is never read. Allowed unused names must match /^_/.
switch (networkType) {
case NetworkType.MAINNET:
;(mainnetList as any[]).forEach(token => {
obj[token.address] = {
...token,
address: new PublicKey(token.address),
coingeckoId: token?.extensions?.coingeckoId
}
})
return obj
// ;(mainnetList as any[]).forEach(token => {
// obj[token.address] = {
// ...token,
// address: new PublicKey(token.address),
// coingeckoId: token?.extensions?.coingeckoId
// }
// })
// return obj
return {
[USDC_MAIN.address.toString()]: USDC_MAIN,
[USDT_MAIN.address.toString()]: USDT_MAIN,
[SOL_MAIN.address.toString()]: SOL_MAIN,
[ETH_MAIN.address.toString()]: ETH_MAIN,
[WBTC_MAIN.address.toString()]: WBTC_MAIN
}
case NetworkType.DEVNET:
return {
[USDC_DEV.address.toString()]: USDC_DEV,
Expand Down
Loading