Skip to main content
POST
/
rpc
curl --request POST \
--url https://midl-regtest.gomaestro-api.org/v0/rpc \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1b4"
}
MIDL provides a single JSON-RPC endpoint that supports all standard Ethereum 2.0 JSON-RPC methods, making it a drop-in replacement for EVM-compatible blockchain interactions.

JSON-RPC Methods:

Block Methods

eth_getBlockByNumber

Get block information by block number. Parameters:
  1. blockNumber (string): Block number in hex or “latest”, “earliest”, “pending”
  2. includeTransactions (boolean): If true, returns full transaction objects
Example Request:
{
  "jsonrpc": "2.0",
  "method": "eth_getBlockByNumber",
  "params": ["latest", true],
  "id": 1
}
Example Response:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "number": "0x1b4",
    "hash": "0x1234567890abcdef...",
    "parentHash": "0x...",
    "gasLimit": "0x1c9c380",
    "gasUsed": "0x...",
    "timestamp": "0x...",
    "transactions": [...]
  }
}

eth_getBlockByHash

Get block information by block hash. Parameters:
  1. blockHash (string): Block hash in hexadecimal format
  2. includeTransactions (boolean): If true, returns full transaction objects
Example Request:
{
  "jsonrpc": "2.0",
  "method": "eth_getBlockByHash",
  "params": ["0x1234567890abcdef...", true],
  "id": 1
}

eth_blockNumber

Get the current block number. Parameters: None Example Request:
{
  "jsonrpc": "2.0",
  "method": "eth_blockNumber",
  "params": [],
  "id": 1
}
Example Response:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x4b7"
}

Transaction Methods

eth_getTransactionByHash

Get transaction information by transaction hash. Parameters:
  1. transactionHash (string): Transaction hash in hexadecimal format
Example Request:
{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionByHash",
  "params": ["0x1234567890abcdef..."],
  "id": 1
}
Example Response:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "hash": "0x1234567890abcdef...",
    "blockNumber": "0x1b4",
    "blockHash": "0x...",
    "transactionIndex": "0x0",
    "from": "0x...",
    "to": "0x...",
    "value": "0x...",
    "gas": "0x5208",
    "gasPrice": "0x...",
    "input": "0x"
  }
}

eth_getTransactionReceipt

Get transaction receipt by transaction hash. Parameters:
  1. transactionHash (string): Transaction hash in hexadecimal format
Example Request:
{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionReceipt",
  "params": ["0x1234567890abcdef..."],
  "id": 1
}
Example Response:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "transactionHash": "0x1234567890abcdef...",
    "blockNumber": "0x1b4",
    "blockHash": "0x...",
    "transactionIndex": "0x0",
    "from": "0x...",
    "to": "0x...",
    "gasUsed": "0x5208",
    "cumulativeGasUsed": "0x5208",
    "status": "0x1",
    "logs": []
  }
}

Account Methods

eth_getBalance

Get account balance for a specific address. Parameters:
  1. address (string): Account address in hexadecimal format
  2. blockParameter (string): Block number in hex, or “latest”, “earliest”, “pending”
Example Request:
{
  "jsonrpc": "2.0",
  "method": "eth_getBalance",
  "params": ["0x1234567890abcdef...", "latest"],
  "id": 1
}
Example Response:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x0234c8a3397aab58"
}

eth_getTransactionCount

Get the transaction count (nonce) for an account. Parameters:
  1. address (string): Account address in hexadecimal format
  2. blockParameter (string): Block number in hex, or “latest”, “earliest”, “pending”
Example Request:
{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionCount",
  "params": ["0x1234567890abcdef...", "latest"],
  "id": 1
}
Example Response:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x1"
}

Network Methods

eth_gasPrice

Get the current gas price. Parameters: None Example Request:
{
  "jsonrpc": "2.0",
  "method": "eth_gasPrice",
  "params": [],
  "id": 1
}
Example Response:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x09184e72a000"
}

eth_chainId

Get the network chain ID. Parameters: None Example Request:
{
  "jsonrpc": "2.0",
  "method": "eth_chainId",
  "params": [],
  "id": 1
}
Example Response:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x1"
}

Error Handling

Standard JSON-RPC 2.0 error responses:
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32601,
    "message": "Method not found"
  }
}

Integration Examples

Web3.js

const Web3 = require('web3');
const web3 = new Web3('https://midl-mainnet.gomaestro-api.org/v0');

// Set default headers for API key
web3.currentProvider.headers = {
  'api-key': 'YOUR_API_KEY'
};

// Get latest block
const block = await web3.eth.getBlock('latest');

Ethers.js

const { JsonRpcProvider } = require('ethers');

const provider = new JsonRpcProvider('https://midl-mainnet.gomaestro-api.org/v0', {
  headers: {
    'api-key': 'YOUR_API_KEY'
  }
});

// Get account balance
const balance = await provider.getBalance('0x...');

Rate Limits

API calls are subject to your plan’s rate limits. See billing documentation for details on threshold billing and plan limits.

Authorizations

api-key
string
header
required

Project API Key

Body

application/json

JSON-RPC request payload

jsonrpc
enum<string>
required

JSON-RPC version

Available options:
2.0
method
enum<string>
required

The RPC method to call

Available options:
eth_getBlockByNumber,
eth_getBlockByHash,
eth_blockNumber,
eth_getTransactionByHash,
eth_getTransactionReceipt,
eth_getBalance,
eth_getTransactionCount,
eth_gasPrice,
eth_chainId
id
required

Request identifier

params
any[]

Method parameters

Response

JSON-RPC response payload

jsonrpc
enum<string>
required
Available options:
2.0
id
required
result
any

Result data (present on success)

error
object

Error object (present on error)

I