RPC Passthrough
Send raw JSON-RPC calls directly to a sandbox
Send any JSON-RPC method call directly to a BuildBear sandbox and print the result. Useful for debugging, inspecting chain state, or invoking BuildBear-specific RPC extensions without writing custom scripts.
Arguments:
| Argument | Required | Description |
|---|---|---|
rpcUrl | No | BuildBear RPC URL. If omitted, reads from .buildbear.json |
Options:
| Flag | Type | Required | Description |
|---|---|---|---|
--method <method> | string | Yes | JSON-RPC method name (e.g. eth_blockNumber) |
--params <json> | string | No | JSON array of parameters, or @path/to/file.json to read params from a file. Defaults to [] |
--quiet | flag | No | Suppress output except errors |
[!NOTE]
buildbear rpcalways outputs JSON — the--jsonflag is implicit and cannot be disabled.
Examples
Get the current block number:
Get the balance of an address:
Call a contract function (raw eth_call):
Read params from a file:
Use an explicit RPC URL:
Common JSON-RPC methods
| Method | Description |
|---|---|
eth_blockNumber | Latest block number |
eth_chainId | Chain ID of the sandbox |
eth_getBalance | Native token balance of an address |
eth_call | Call a contract function without a transaction |
eth_gasPrice | Current gas price |
net_version | Network version |
BuildBear-specific RPC methods
BuildBear sandboxes extend the standard JSON-RPC API with custom methods:
| Method | Description |
|---|---|
buildbear_nativeFaucet | Fund native tokens to an address |
buildbear_ERC20Faucet | Mint ERC-20 tokens to an address |
evm_snapshot | Take a state snapshot |
evm_revert | Revert to a snapshot |
The buildbear faucet and buildbear snapshot commands are wrappers around these methods. Use buildbear rpc when you need direct access or when building custom tooling.
Output format
The output is always a JSON object with two keys: