Skip to main content
Version: 2.0

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 Holesky170000x4268EvmChain.HOLESKYTestnet
Ethereum Görli50x5EvmChain.GOERLITestnet
Ethereum Sepolia111551110xaa36a7EvmChain.SEPOLIATestnet
Polygon Mainnet1370x89EvmChain.POLYGONMainnet
Polygon Mumbai800010x13881EvmChain.MUMBAITestnet
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 Goerli845310x14a33EvmChain.BASE_GOERLITestnet
Base Sepolia845320x14a34EvmChain.BASE_SEPOLIATestnet
Optimism100xaEvmChain.OPTIMISMMainnet

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​

NameSolNetwork
Solana mainnetSolNetwork.MAINNET
Solana devnetSolNetwork.DEVNET