Skip to main content

nexus_getBlockByNumber

Get block by height.
params[0]
string
required
Hex block number or “latest”
params[1]
boolean
Include full transaction objects (default: false)
result
object
Block data
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_getBlockByNumber","params":["0x64", false],"id":1}'
Response
{
  "jsonrpc": "2.0",
  "result": {
    "height": 100,
    "hash": "0x1234...",
    "timestamp": 1704067200,
    "txCount": 5,
    "stateRoot": "0xabcd...",
    "transactions": ["0x1111...", "0x2222..."]
  },
  "id": 1
}

nexus_getBlockByHash

Get block by hash.
params[0]
string
required
32-byte hex block hash
params[1]
boolean
Include full transaction objects (default: false)
result
object
Block data
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_getBlockByHash","params":["0x1234...", true],"id":1}'

nexus_getTransactionByHash

Get transaction by hash.
params[0]
string
required
32-byte hex transaction hash
result
object
Transaction data
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_getTransactionByHash","params":["0x1234..."],"id":1}'
Response
{
  "jsonrpc": "2.0",
  "result": {
    "hash": "0x1234...",
    "from": "0xabcd...",
    "to": "0x5678...",
    "value": "0x2710",
    "gasLimit": "0x5208",
    "gasPrice": "0x1",
    "nonce": "0x5",
    "blockHeight": 100,
    "blockHash": "0x9999...",
    "status": "success"
  },
  "id": 1
}

nexus_getTransactionReceipt

Get transaction receipt (execution result).
params[0]
string
required
32-byte hex transaction hash
result
object
Receipt with status, gas used, logs
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_getTransactionReceipt","params":["0x1234..."],"id":1}'
Response
{
  "jsonrpc": "2.0",
  "result": {
    "transactionHash": "0x1234...",
    "blockHeight": 100,
    "blockHash": "0x9999...",
    "status": "0x1",
    "gasUsed": "0x5208",
    "contractAddress": null,
    "logs": [
      {
        "address": "0xabcd...",
        "topics": ["0x1111..."],
        "data": "0x2222..."
      }
    ]
  },
  "id": 1
}

nexus_getTransactionsByAddress

Get all transactions for an address.
params[0]
string
required
Bitcoin address or hex pubkey
result
array
List of transactions
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_getTransactionsByAddress","params":["bcrt1p..."],"id":1}'

nexus_listRecentTransactions

Get recent transactions across all addresses.
params[0]
number
Max transactions to return (default: 50)
result
array
List of recent transactions
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_listRecentTransactions","params":[100],"id":1}'

nexus_getMempoolStats

Get mempool statistics.
params
array
required
Empty array
result
object
Mempool statistics
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_getMempoolStats","params":[],"id":1}'
Response
{
  "jsonrpc": "2.0",
  "result": {
    "pending_count": 42,
    "total_gas": 1000000,
    "backpressure_active": false,
    "oldest_tx_age_secs": 5
  },
  "id": 1
}

nexus_getFeeMarket

Get EIP-1559 style fee market state.
params
array
required
Empty array
result
object
Fee market state
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_getFeeMarket","params":[],"id":1}'
Response
{
  "jsonrpc": "2.0",
  "result": {
    "base_fee": 1,
    "utilization": 0.45,
    "target_utilization": 0.5,
    "min_base_fee": 1,
    "max_base_fee": 1000
  },
  "id": 1
}

nexus_getFeeHistory

Get fee history for recent blocks.
params[0]
number
Number of blocks (default: 10)
result
object
Historical fee data
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_getFeeHistory","params":[10],"id":1}'