From c093f0670ed333d71f3292455c5d2123cb6ff17f Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 16 Nov 2023 23:19:31 +0800 Subject: [PATCH] feat: add manta pacific EBV token Tia --- packages/backend/src/config/chains.ts | 6 ++++ packages/config/src/layer2s/mantapacific.ts | 31 ++++++++++++++++++++- packages/shared-pure/src/types/ChainId.ts | 5 ++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/config/chains.ts b/packages/backend/src/config/chains.ts index f0470287616..619232b6e93 100644 --- a/packages/backend/src/config/chains.ts +++ b/packages/backend/src/config/chains.ts @@ -33,6 +33,12 @@ const chainConfig = [ // https://basescan.org/block/0 minTimestamp: UnixTime.fromDate(new Date('2023-06-15T12:35:47Z')), }, + { + chainId: ChainId.MANTA_PACIFIC, + // ~ Timestamp of block number 0 on MantaPacific + // https://pacific-explorer.manta.network/block/0 + minTimestamp: UnixTime.fromDate(new Date('2023-09-09T01:45:59Z')), + }, ] export function getChainMinTimestamp(chainId: ChainId): UnixTime { diff --git a/packages/config/src/layer2s/mantapacific.ts b/packages/config/src/layer2s/mantapacific.ts index c934155fa9d..41ee1062483 100644 --- a/packages/config/src/layer2s/mantapacific.ts +++ b/packages/config/src/layer2s/mantapacific.ts @@ -1,4 +1,12 @@ -import { EthereumAddress, ProjectId, UnixTime } from '@l2beat/shared-pure' +import { + AssetId, + ChainId, + CoingeckoId, + EthereumAddress, + ProjectId, + Token, + UnixTime, +} from '@l2beat/shared-pure' import { ProjectDiscovery } from '../discovery/ProjectDiscovery' import { HARDCODED } from '../discovery/values/hardcoded' @@ -23,6 +31,26 @@ const upgradesProxy = { upgradeDelay: 'No delay', } +const TOKENS: Omit[] = [ + { + id: AssetId('mantapacific:tia-celestia'), + name: 'Celestia', + symbol: 'TIA', + decimals: 6, + iconUrl: + 'https://assets.coingecko.com/coins/images/31967/large/tia.jpg?1696530772', + address: EthereumAddress('0x6Fae4D9935E2fcb11fC79a64e917fb2BF14DaFaa'), + coingeckoId: CoingeckoId('celestia'), + sinceTimestamp: new UnixTime(1698782429), + category: 'other', + type: 'EBV', + formula: 'totalSupply', + bridgedUsing: { + bridge: 'Hyperlane Nexus', + }, + }, +] + export const mantapacific: Layer2 = { type: 'layer2', id: ProjectId('mantapacific'), @@ -51,6 +79,7 @@ export const mantapacific: Layer2 = { activityDataSource: 'Blockchain RPC', }, config: { + tokenList: TOKENS.map((t) => ({ ...t, chainId: ChainId.MANTA_PACIFIC })), escrows: [ discovery.getEscrowDetails({ address: EthereumAddress('0x9168765EE952de7C6f8fC6FaD5Ec209B960b7622'), diff --git a/packages/shared-pure/src/types/ChainId.ts b/packages/shared-pure/src/types/ChainId.ts index 9192bf30ce1..846c600852b 100644 --- a/packages/shared-pure/src/types/ChainId.ts +++ b/packages/shared-pure/src/types/ChainId.ts @@ -111,6 +111,10 @@ const CHAIN_IDS: Record = { name: 'gnosis', explorer: 'https://gnosisscan.io', }, + 169: { + name: 'manta-pacific', + explorer: 'https://pacific-explorer.manta.network', + }, } as const ChainId.ETHEREUM = chainIdFromName('ethereum') @@ -124,3 +128,4 @@ ChainId.LINEA = chainIdFromName('linea') ChainId.BASE = chainIdFromName('base') ChainId.POLYGON_ZKEVM = chainIdFromName('polygon-zkevm') ChainId.GNOSIS = chainIdFromName('gnosis') +ChainId.MANTA_PACIFIC = chainIdFromName('manta-pacific')