@stratosphere-network/shared
Version:
Shared utilities and types for StratoSphere SDK
200 lines • 7.7 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ViemPublicClientChains = exports.CHAIN_CONFIGS = exports.SupportedChain = void 0;
const viem_1 = require("viem");
const chains_1 = require("viem/chains");
// Chain definitions
var SupportedChain;
(function (SupportedChain) {
SupportedChain["ETHEREUM_MAINNET"] = "ethereum-mainnet";
SupportedChain["ETHEREUM_SEPOLIA"] = "ethereum-sepolia";
SupportedChain["POLYGON_MAINNET"] = "polygon-mainnet";
SupportedChain["POLYGON_MUMBAI"] = "polygon-mumbai";
SupportedChain["BSC_MAINNET"] = "bsc-mainnet";
SupportedChain["BSC_TESTNET"] = "bsc-testnet";
SupportedChain["ARBITRUM_MAINNET"] = "arbitrum-mainnet";
SupportedChain["ARBITRUM_SEPOLIA"] = "arbitrum-sepolia";
SupportedChain["OPTIMISM_MAINNET"] = "optimism-mainnet";
SupportedChain["OPTIMISM_SEPOLIA"] = "optimism-sepolia";
SupportedChain["BASE_MAINNET"] = "base-mainnet";
SupportedChain["BASE_SEPOLIA"] = "base-sepolia";
SupportedChain["BERACHAIN_MAINNET"] = "berachain-mainnet";
SupportedChain["BERACHAIN_TESTNET"] = "berachain-testnet";
})(SupportedChain || (exports.SupportedChain = SupportedChain = {}));
// Chain configurations map
exports.CHAIN_CONFIGS = {
[]: {
chainId: 1,
name: "Ethereum Mainnet",
rpcUrl: "https://ethereum.publicnode.com",
blockExplorer: "https://etherscan.io",
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
},
[]: {
chainId: 11155111,
name: "Ethereum Sepolia",
rpcUrl: "https://ethereum-sepolia.publicnode.com",
blockExplorer: "https://sepolia.etherscan.io",
nativeCurrency: {
name: "Sepolia Ether",
symbol: "SepoliaETH",
decimals: 18,
},
},
[]: {
chainId: 137,
name: "Polygon Mainnet",
rpcUrl: "https://polygon.llamarpc.com",
blockExplorer: "https://polygonscan.com",
nativeCurrency: { name: "Polygon", symbol: "MATIC", decimals: 18 },
},
[]: {
chainId: 80001,
name: "Polygon Mumbai",
rpcUrl: "https://rpc-mumbai.maticvigil.com",
blockExplorer: "https://mumbai.polygonscan.com",
nativeCurrency: { name: "Mumbai MATIC", symbol: "MATIC", decimals: 18 },
},
[]: {
chainId: 56,
name: "BSC Mainnet",
rpcUrl: "https://bsc-dataseed1.binance.org",
blockExplorer: "https://bscscan.com",
nativeCurrency: { name: "BNB", symbol: "BNB", decimals: 18 },
},
[]: {
chainId: 97,
name: "BSC Testnet",
rpcUrl: "https://data-seed-prebsc-1-s1.binance.org:8545",
blockExplorer: "https://testnet.bscscan.com",
nativeCurrency: { name: "Test BNB", symbol: "tBNB", decimals: 18 },
},
[]: {
chainId: 42161,
name: "Arbitrum One",
rpcUrl: "https://arb1.arbitrum.io/rpc",
blockExplorer: "https://arbiscan.io",
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
},
[]: {
chainId: 421614,
name: "Arbitrum Sepolia",
rpcUrl: "https://sepolia-rollup.arbitrum.io/rpc",
blockExplorer: "https://sepolia.arbiscan.io",
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
},
[]: {
chainId: 10,
name: "Optimism",
rpcUrl: "https://mainnet.optimism.io",
blockExplorer: "https://optimistic.etherscan.io",
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
},
[]: {
chainId: 11155420,
name: "Optimism Sepolia",
rpcUrl: "https://sepolia.optimism.io",
blockExplorer: "https://sepolia-optimism.etherscan.io",
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
},
[]: {
chainId: 8453,
name: "Base",
rpcUrl: "https://mainnet.base.org",
blockExplorer: "https://basescan.org",
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
},
[]: {
chainId: 84532,
name: "Base Sepolia",
rpcUrl: "https://sepolia.base.org",
blockExplorer: "https://sepolia.basescan.org",
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
},
[]: {
chainId: 80094,
name: "Berachain",
rpcUrl: "https://rpc.berachain.com/",
blockExplorer: "https://berascan.com/",
nativeCurrency: { name: "BERA", symbol: "BERA", decimals: 18 },
},
[]: {
chainId: 80069,
name: "Berachain Bepolia",
rpcUrl: "https://bepolia.rpc.berachain.com/",
blockExplorer: "https://bepolia.beratrail.io/",
nativeCurrency: { name: "BERA", symbol: "BERA", decimals: 18 },
},
};
// Viem public client chains
exports.ViemPublicClientChains = {
[]: chains_1.mainnet,
[]: chains_1.sepolia,
[]: chains_1.polygon,
[]: chains_1.polygonMumbai,
[]: chains_1.bsc,
[]: chains_1.bscTestnet,
[]: chains_1.arbitrum,
[]: chains_1.arbitrumSepolia,
[]: chains_1.optimism,
[]: chains_1.optimismSepolia,
[]: chains_1.base,
[]: chains_1.baseSepolia,
[]: (0, viem_1.defineChain)({
id: 80094,
network: "berachain",
name: "Berachain",
nativeCurrency: { name: "BERA", symbol: "BERA", decimals: 18 },
rpcUrls: {
default: {
http: ["https://rpc.berachain.com/"],
},
public: {
http: ["https://rpc.berachain.com/"],
},
},
blockExplorers: {
default: {
name: "Berascan",
url: "https://berascan.com/",
},
},
testnet: false,
sourceId: 80094, // berachain
contracts: {
multicall3: {
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
blockCreated: 1382922,
},
},
}),
[]: (0, viem_1.defineChain)({
id: 80069,
network: "berachain-bepolia",
name: "Berachain Bepolia",
nativeCurrency: { name: "BERA", symbol: "BERA", decimals: 18 },
rpcUrls: {
default: {
http: ["https://bepolia.rpc.berachain.com/"],
},
public: {
http: ["https://bepolia.rpc.berachain.com/"],
},
},
blockExplorers: {
default: {
name: "Beratrail",
url: "https://bepolia.beratrail.io/",
},
},
testnet: true,
sourceId: 80069, // berachain
contracts: {
multicall3: {
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
blockCreated: 1382922,
},
},
}),
};
//# sourceMappingURL=chains.js.map