nexus_blockNumber
Get the current block height.
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_blockNumber","params":[],"id":1}'
{"jsonrpc":"2.0","result":"0x1a4","id":1}
nexus_getBalance
Get account balance in satoshis.
Bitcoin address or hex-encoded pubkey
Balance in satoshis (hex)
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_getBalance","params":["bcrt1p..."],"id":1}'
{"jsonrpc":"2.0","result":"0x186a0","id":1}
nexus_getTransactionCount
Get account nonce (transaction count).
Bitcoin address or hex-encoded pubkey
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_getTransactionCount","params":["bcrt1p..."],"id":1}'
{"jsonrpc":"2.0","result":"0x5","id":1}
nexus_sendRawTransaction
Submit a signed transaction to the mempool.
Hex-encoded signed transaction (bincode serialized)
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_sendRawTransaction","params":["0x..."],"id":1}'
{"jsonrpc":"2.0","result":"0x1234567890abcdef...","id":1}
nexus_call
Execute a transaction (view call or state-changing).
Hex-encoded transaction (bincode serialized)
Hex-encoded execution result
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_call","params":["0x..."],"id":1}'
nexus_viewCall
Execute a read-only contract call (no state changes).
Contract ID (32-byte hex)
Hex-encoded JSON arguments
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_viewCall","params":["0x1234...", "balanceOf", "0x..."],"id":1}'
nexus_estimateGas
Estimate gas required for a transaction.
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_estimateGas","params":["0x..."],"id":1}'
{"jsonrpc":"2.0","result":"0x5208","id":1}
nexus_gasPrice
Get suggested gas price for transaction inclusion.
Gas price recommendations
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_gasPrice","params":[],"id":1}'
{
"jsonrpc": "2.0",
"result": {
"base_fee": "0x1",
"suggested_priority_fee": "0x1",
"suggested_max_fee": "0x2"
},
"id": 1
}
nexus_getNodeInfo
Get node information.
Node information including protocol key
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_getNodeInfo","params":[],"id":1}'
{
"jsonrpc": "2.0",
"result": {
"version": "0.1.0",
"network": "regtest",
"mode": "primary",
"block_height": 1234,
"protocol_public_key": "1234567890abcdef...",
"peer_count": 5
},
"id": 1
}
nexus_resolveAddress
Convert Bitcoin address to internal hex pubkey representation.
Bitcoin address (bcrt1p…, bc1p…, tb1p…)
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nexus_resolveAddress","params":["bcrt1p..."],"id":1}'
{
"jsonrpc": "2.0",
"result": {
"pubkey": "0x1234567890abcdef..."
},
"id": 1
}