Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key
Version: 2.2

Cross-Chain EVM Requests

All our API methods are supported for cross-chain calls. You only need to specify the chain parameter. For example, this request will query block info on Polygon:

import Moralis from "moralis";
import { EvmChain } from "@moralisweb3/common-evm-utils";

evmApi.block.getBlock({
blockNumberOrHash: "33000000",
chain: EvmChain.POLYGON,
});

If no chain is specified, it will, by default, be set to the defaultEvmApiChain, which is set in your config (defaults to "Ethereum mainnet").

Change the Default Chain​

To change the default chain, you can specify defaultEvmApiChain in your config:

import Moralis from "moralis";
import { EvmChain } from "@moralisweb3/common-evm-utils";

Moralis.start({
apiKey: "YOUR_API_KEY",
defaultEvmApiChain: EvmChain.POLYGON,
});

Moralis.EvmApi.block.getBlock({
blockNumberOrHash: "33000000",
});

Supported EVM Chains​

NameChain Id (Int)Chain Id (Hex)EvmChainType
Ethereum Mainnet10x1EvmChain.ETHEREUMMainnet
Ethereum Sepolia111551110xaa36a7EvmChain.SEPOLIATestnet
Ethereum Holesky170000x4268EvmChain.HOLESKYTestnet
Polygon Mainnet1370x89EvmChain.POLYGONMainnet
Polygon Amoy800020x13881EvmChain.POLYGON_AMOYTestnet
Binance Smart Chain Mainnet560x38EvmChain.BSCMainnet
Binance Smart Chain Testnet970x61EvmChain.BSC_TESTNETTestnet
Avalanche C-Chain431140xa86aEvmChain.AVALANCHEMainnet
Fantom2500xfaEvmChain.FANTOMMainnet
Cronos Mainnet250x19EvmChain.CRONOSMainnet
Palm112971081090x2a15c308dEvmChain.PALMMainnet
Arbitrum421610xa4b1EvmChain.ARBITRUMMainnet
Gnosis1000x64EvmChain.GNOSISMainnet
Gnosis Chiado102000x27d8EvmChain.GNOSIS_TESTNETTestnet
Base84530x2105EvmChain.BASEMainnet
Base Sepolia845320x14a34EvmChain.BASE_SEPOLIATestnet
Optimism100xaEvmChain.OPTIMISMMainnet
Optimism Sepolia111554200xaa37dcEvmChain.OPTIMISM_SEPOLIATestnet
Linea591440xe708EvmChain.LINEAMainnet
Linea Sepolia591410xe705EvmChain.LINEA_SEPOLIATestnet
Moonbeam12840x504EvmChain.MOONBEAMMainnet
Moonriver12850x505EvmChain.MOONRIVERTestnet
Moonbase12870x507EvmChain.MOONBASETestnet
Chiliz Mainnet888880x15b38EvmChain.CHILIZMainnet
Chiliz Testnet888820x15b32EvmChain.CHILIZ_TESTNETTestnet

Solana​

Change the Default Network​

We have two networks for the Solana API, which you can configure similarly. You can specify the mainnet or devnet:

import Moralis from "moralis";
import { SolNetwork } from "@moralisweb3/common-sol-utils";

Moralis.start({
apiKey: "YOUR_API_KEY",
defaultSolNetwork: SolNetwork.DEVNET,
});

Moralis.SolApi.account.getBalance({
address: "ADDRESS",
});

Supported Solana Networks​

NameSolNetworkType
Solana mainnetSolNetwork.MAINNETMainnet
Solana devnetSolNetwork.DEVNETTestnet