Documentation

Custom RPC Methods

Snapshot a Sandbox, get native tokens, and mint ERC-20 tokens via the BuildBear Sandbox RPC API.

Snapshot a Sandbox

Properties

POST
https://rpc.buildbear.io/{sandboxId}
segments
sandboxId(string)
RequiredThe ID of the sandbox to query
body
jsonrpc(string)
RequiredThe JSON-RPC version (2.0)
method(string)
RequiredThe method to call (evm_snapshot)
params(array)
RequiredThe parameters to pass to the method
id(integer)
RequiredThe request ID

Request Example

curl -X POST \
  https://rpc.buildbear.io/yielding-mysterio-055e0fb6 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "method": "evm_snapshot",
    "params": [],
    "id": 1
  }'

Response

A successful response returns a snapshot identifier in hex format:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x2"
}

Native Token Faucet

Fund Native Token (ether) to any wallet/address within your sandbox. The balance field is specified in wei by default.

Properties

POST
https://rpc.buildbear.io/{sandboxId}
segments
sandboxId(string)
RequiredThe ID of the sandbox to query
body
jsonrpc(string)
RequiredThe JSON-RPC version (2.0)
method(string)
RequiredThe method to call (buildbear_nativeFaucet)
params(array)
RequiredThe parameters to pass to the method
id(integer)
RequiredThe request ID

Request Example

  curl -X POST \
  https://rpc.buildbear.io/yielding-mysterio-055e0fb6 \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "buildbear_nativeFaucet",
  "params": [
      {
       "address": "0xc014ba5ec014ba5ec014ba5ec014ba5ec014ba5e",
       "balance": "10000000000000000000",
       "unit":"wei"
      }
    ]
  }'

Response

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "id": "",
        "jsonrpc": "2.0",
        "result": "0x074cf35f81b06a286bd87bc175a731c0329d14ba49f3e305b31db717fc7b1684"
    }
}

ERC-20 Token Faucet

Fund ERC20 Tokens to any wallet/address within your sandbox. The balance field is specified in wei by default.

Properties

POST
https://rpc.buildbear.io/{sandboxId}
segments
sandboxId(string)
RequiredThe ID of the sandbox to query
body
jsonrpc(string)
RequiredThe JSON-RPC version (2.0)
method(string)
RequiredThe method to call (buildbear_ERC20Faucet)
params(array)
RequiredThe parameters to pass to the method
id(integer)
RequiredThe request ID

Request Example

curl -X POST \
  https://rpc.buildbear.io/yielding-mysterio-055e0fb6 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "buildbear_ERC20Faucet",
    "params": [
          {
           "address": "0xa72e562f24515c060f36a2da07e0442899d39d2c",
           "token": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",
           "balance": "10000000",
           "unit": "wei"
          }
      ]
    }'

Response

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "Success"
}