From a9f48e5a49b654b8367dc6278cf9a345ece3e155 Mon Sep 17 00:00:00 2001 From: Piotr Matlak Date: Wed, 21 Aug 2024 15:31:24 +0200 Subject: [PATCH 1/2] add mainnet --- src/components/Header/Header.tsx | 10 +++--- src/store/consts/static.ts | 56 +++++++++++++++++++++++++++++--- src/store/consts/utils.ts | 28 +++++++++++----- 3 files changed, 76 insertions(+), 18 deletions(-) diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 69c622e..cabdab1 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -133,12 +133,10 @@ export const Header: React.FC = ({ data.rpc === defaultMainnetRPC)?.rpcName ?? 'Custom' - // }, + { + networkType: NetworkType.MAINNET, + rpc: EclipseNetworks.MAIN + }, { networkType: NetworkType.TESTNET, rpc: EclipseNetworks.TEST }, { networkType: NetworkType.DEVNET, rpc: EclipseNetworks.DEV_EU } ]} diff --git a/src/store/consts/static.ts b/src/store/consts/static.ts index d4790d5..339327a 100644 --- a/src/store/consts/static.ts +++ b/src/store/consts/static.ts @@ -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'), @@ -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' @@ -131,7 +173,7 @@ export const tokensPrices: Record> = } export const tokens: Record = { Devnet: [USDC_DEV, BTC_DEV], - Mainnet: [], + Mainnet: [USDC_MAIN, USDT_MAIN, SOL_MAIN, ETH_MAIN, WBTC_MAIN], Testnet: [USDC_TEST, BTC_TEST], Localnet: [] } @@ -232,7 +274,13 @@ export const bestTiers: Record = { export const commonTokensForNetworks: Record = { 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: [] } diff --git a/src/store/consts/utils.ts b/src/store/consts/utils.ts index 307b914..ffe3131 100644 --- a/src/store/consts/utils.ts +++ b/src/store/consts/utils.ts @@ -19,15 +19,20 @@ import { Token as SPLToken } from '@solana/spl-token' 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' @@ -390,14 +395,21 @@ export const getNetworkTokensList = (networkType: NetworkType): Record = {} 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, From cb9c3ad356510402ba64bec6c87b05fcf39f0b6e Mon Sep 17 00:00:00 2001 From: Piotr Matlak Date: Wed, 21 Aug 2024 15:40:15 +0200 Subject: [PATCH 2/2] fix lint --- src/store/consts/utils.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/store/consts/utils.ts b/src/store/consts/utils.ts index ffe3131..04111db 100644 --- a/src/store/consts/utils.ts +++ b/src/store/consts/utils.ts @@ -36,7 +36,6 @@ import { 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'