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​
Supported Chains
See the table below for all supported RPC Nodes. For wider chains we support across all products, check the full list of supported chains.
Name | Type | Chain ID | EvmChain | chain Query Parameters |
---|---|---|---|---|
Ethereum Mainnet | Mainnet | 0x1 (1) | EvmChain.ETHEREUM |
|
Ethereum Sepolia | Testnet | 0xaa36a7 (11155111) | EvmChain.SEPOLIA |
|
Ethereum Holesky | Testnet | 0x4268 (17000) | EvmChain.HOLESKY |
|
Polygon Mainnet | Mainnet | 0x89 (137) | EvmChain.POLYGON |
|
Polygon Amoy | Testnet | 0x13882 (80002) | EvmChain.POLYGON_AMOY |
|
Binance Smart Chain Mainnet | Mainnet | 0x38 (56) | EvmChain.BSC |
|
Binance Smart Chain Testnet | Testnet | 0x61 (97) | EvmChain.BSC_TESTNET |
|
Arbitrum | Mainnet | 0xa4b1 (42161) | EvmChain.ARBITRUM |
|
Base | Mainnet | 0x2105 (8453) | EvmChain.BASE |
|
Base Sepolia | Testnet | 0x14a34 (84532) | EvmChain.BASE_SEPOLIA |
|
Optimism | Mainnet | 0xa (10) | EvmChain.OPTIMISM |
|
NewLinea | Mainnet | 0xe708 (59144) | EvmChain.LINEA |
|
NewLinea Sepolia | Testnet | 0xe705 (59141) | EvmChain.LINEA_SEPOLIA |
|
Avalanche | Mainnet | 0xa86a (43114) | EvmChain.AVALANCHE |
|
Fantom Mainnet | Mainnet | 0xfa (250) | EvmChain.FANTOM |
|
Cronos Mainnet | Mainnet | 0x19 (25) | EvmChain.CRONOS |
|
Palm | Mainnet | 0x2a15c308d (11297108109) | EvmChain.PALM |
|
Gnosis | Mainnet | 0x64 (100) | EvmChain.GNOSIS |
|
Gnosis Chiado | Testnet | 0x27d8 (10200) | EvmChain.GNOSIS_TESTNET |
|
Chiliz Mainnet | Mainnet | 0x15b38 (88888) | EvmChain.CHILIZ |
|
Chiliz Testnet | Testnet | 0x15b32 (88882) | EvmChain.CHILIZ_TESTNET |
|
NewMoonbeam | Mainnet | 0x504 (1284) | EvmChain.MOONBEAM |
|
NewMoonriver | Testnet | 0x505 (1285) | EvmChain.MOONRIVER |
|
NewMoonbase | Testnet | 0x507 (1287) | EvmChain.MOONBASE |
|
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​
Name | SolNetwork |
---|---|
Solana mainnet | SolNetwork.MAINNET |
Solana devnet | SolNetwork.DEVNET |