Quickstart

Get started in 30 seconds.

Just replace your RPC URL with the RPCLAW endpoint and you are ready to build on Base.

Base endpoint:

https://rpc.rpclaw.net/v1/base

Ethers.js

import { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider('https://rpc.rpclaw.net/v1/base');
const blockNumber = await provider.getBlockNumber();
console.log('Base block', blockNumber.toLocaleString());

Viem

import { createPublicClient, http } from 'viem';
import { base } from 'viem/chains';

const client = createPublicClient({
  chain: base,
  transport: http('https://rpc.rpclaw.net/v1/base'),
});

const block = await client.getBlockNumber();
console.log('Base block', block.toLocaleString());

curl

curl -X POST https://rpc.rpclaw.net/v1/base \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

Python (web3.py)

from web3 import Web3

provider = Web3(Web3.HTTPProvider('https://rpc.rpclaw.net/v1/base'))
print('Base block', provider.eth.block_number)