From 43616b9e969ea0d71d96b02715644f6324362d29 Mon Sep 17 00:00:00 2001 From: Ken Date: Mon, 22 Jan 2024 06:20:29 +0000 Subject: [PATCH] feat: Add BASE chain (#191) --- src/constants/addresses.ts | 26 ++++++++++++++++++++++++++ src/constants/chains.ts | 24 ++++++++++++++++++++++++ src/types.ts | 2 ++ 3 files changed, 52 insertions(+) diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index c31635d..0a337e4 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -60,6 +60,30 @@ const arbitrumMainnetAddresses: Addresses = { AGGREGATOR_UNISWAP_V3: "", }; +const baseMainnetAddresses: Addresses = { + LOOKS: "", + EXCHANGE_V2: "", + TRANSFER_MANAGER_V2: "", + WETH: "", + ORDER_VALIDATOR_V2: "", + REVERSE_RECORDS: "", + LOOKS_LP_V3: "", + STAKING_POOL_FOR_LOOKS_LP: "", + AGGREGATOR_UNISWAP_V3: "", +}; + +const baseSepoliaAddresses: Addresses = { + LOOKS: "", + EXCHANGE_V2: "", + TRANSFER_MANAGER_V2: "", + WETH: "", + ORDER_VALIDATOR_V2: "", + REVERSE_RECORDS: "", + LOOKS_LP_V3: "", + STAKING_POOL_FOR_LOOKS_LP: "", + AGGREGATOR_UNISWAP_V3: "", +}; + /** * List of useful contract addresses */ @@ -70,4 +94,6 @@ export const addressesByNetwork: { [chainId in ChainId]: Addresses } = { [ChainId.SEPOLIA]: sepoliaAddresses, [ChainId.ARB_SEPOLIA]: arbitrumSepoliaAddresses, [ChainId.ARB_MAINNET]: arbitrumMainnetAddresses, + [ChainId.BASE_MAINNET]: baseMainnetAddresses, + [ChainId.BASE_SEPOLIA]: baseSepoliaAddresses, }; diff --git a/src/constants/chains.ts b/src/constants/chains.ts index 3d0fcff..46fe5d8 100644 --- a/src/constants/chains.ts +++ b/src/constants/chains.ts @@ -61,6 +61,30 @@ export const chainInfo: { [chainId in ChainId]: ChainInfo } = { cloudinaryUrl: "https://looksrare.mo.cloudinary.net/sepolia", wsUrl: "wss://ws-sepolia.looksrare.org/ws", }, + [ChainId.BASE_MAINNET]: { + label: "Base Mainnet", + appUrl: "https://looksrare.org", + explorer: "https://basescan.org", + rpcUrl: "https://base-mainnet.g.alchemy.com/v2", + baseApiUrl: "https://graphql.looksrare.org", + osApiUrl: "https://api.opensea.io", + cdnUrl: "https://static.looksnice.org", + rewardsSubgraphUrl: "https://api.thegraph.com/subgraphs/name/looksrare/looks-distribution", + cloudinaryUrl: "https://looksrare.mo.cloudinary.net", + wsUrl: "wss://ws.looksrare.org/ws", + }, + [ChainId.BASE_SEPOLIA]: { + label: "Base Sepolia", + appUrl: "https://sepolia.looksrare.org", + explorer: "https://sepolia-explorer.base.org", + rpcUrl: "https://base-sepolia.g.alchemy.com/v2", + baseApiUrl: "https://graphql-sepolia.looksrare.org", + osApiUrl: "https://testnets-api.opensea.io", + cdnUrl: "https://static-sepolia.looksnice.org", + rewardsSubgraphUrl: "https://api.thegraph.com/subgraphs/name/0xjurassicpunk/looks-distribution", + cloudinaryUrl: "https://looksrare.mo.cloudinary.net/sepolia", + wsUrl: "wss://ws-sepolia.looksrare.org/ws", + }, [ChainId.HARDHAT]: { label: "Hardhat", appUrl: "http://localhost:3000", diff --git a/src/types.ts b/src/types.ts index 622fad5..f66831f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -22,6 +22,8 @@ export enum ChainId { HARDHAT = 31337, ARB_MAINNET = 42161, ARB_SEPOLIA = 421614, + BASE_MAINNET = 8453, + BASE_SEPOLIA = 84532, } /** ChainInfo data used to interact with LooksRare ecosystem */