Connect to Shape
Shape Mainnet runs on chain ID 360. Shape Sepolia (testnet) runs on chain ID 11011.
The public RPCs are rate-limited. For production apps, use Alchemy (https://shape-mainnet.g.alchemy.com/v2/YOUR_KEY). Free tier available.
The examples below use viem v2+ and wagmi v2+. Both export shape and shapeSepolia chain definitions.
viem
import { createPublicClient, http } from 'viem';
import { shape } from 'viem/chains';
const client = createPublicClient({
chain: shape,
transport: http('https://mainnet.shape.network'),
});For Shape Sepolia, use shapeSepolia and the testnet RPC:
import { createPublicClient, http } from 'viem';
import { shapeSepolia } from 'viem/chains';
const client = createPublicClient({
chain: shapeSepolia,
transport: http('https://sepolia.shape.network'),
});wagmi
import { http, createConfig } from 'wagmi';
import { shape, shapeSepolia } from 'wagmi/chains';
export const config = createConfig({
chains: [shape, shapeSepolia],
transports: {
[shape.id]: http('https://mainnet.shape.network'),
[shapeSepolia.id]: http('https://sepolia.shape.network'),
},
});Foundry
Add a profile to foundry.toml:
# foundry.toml
[profile.shape-sepolia]
eth_rpc_url = "https://sepolia.shape.network"
chain_id = 11011ethers.js v6
import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider('https://mainnet.shape.network');Network Reference
| Mainnet | Sepolia | |
|---|---|---|
| Chain ID | 360 | 11011 |
| RPC | https://mainnet.shape.network | https://sepolia.shape.network |
| Explorer | shapescan.xyz | explorer-sepolia.shape.network |
| Currency | ETH | ETH |
See Network Information for the full reference.
Last updated on