Step 1
- To access the available Base methods, use the native access endpoint with
/http-rpc
at the end. - To access the available Optimism methods, use the native access endpoint with
/op-http-rpc
at the end.- Network: Base Testnet
- Request Type: POST
https://svc.blockdaemon.com/base/testnet/native/http-rpc
Step 2
You should authorize your request. Learn more: Authentication Guide
Step 3
Specify a Base method in the request body:
{
"jsonrpc": "2.0",
"id": 1,
"method": "YOUR_METHOD",
"params": []
}
Example Request
Here is a cURL example for using eth_blockNumber to get the current block number in Base Testnet:
curl -X \
POST https://svc.blockdaemon.com/base/testnet/native/http-rpc \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}'
The following is a typical response you will get:
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x17ba022"
}
Example Request Using Optimism Methods
Here is a cURL example to get the current optimism version:
curl -X \
POST https://svc.blockdaemon.com/base/testnet/native/op-http-rpc \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"jsonrpc": "2.0", "id": 1, "method": "optimism_version", "params": []}'