Skip to main content

nexus_blockNumber

Get the current block height.
params
array
required
Empty array
result
string
Hex-encoded block number
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_blockNumber","params":[],"id":1}'
Response
{"jsonrpc":"2.0","result":"0x1a4","id":1}

nexus_getBalance

Get account balance in satoshis.
params[0]
string
required
Bitcoin address or hex-encoded pubkey
result
string
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}'
Response
{"jsonrpc":"2.0","result":"0x186a0","id":1}

nexus_getTransactionCount

Get account nonce (transaction count).
params[0]
string
required
Bitcoin address or hex-encoded pubkey
result
string
Hex-encoded nonce
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_getTransactionCount","params":["bcrt1p..."],"id":1}'
Response
{"jsonrpc":"2.0","result":"0x5","id":1}

nexus_sendRawTransaction

Submit a signed transaction to the mempool.
params[0]
string
required
Hex-encoded signed transaction (bincode serialized)
result
string
Transaction hash
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_sendRawTransaction","params":["0x..."],"id":1}'
Response
{"jsonrpc":"2.0","result":"0x1234567890abcdef...","id":1}

nexus_call

Execute a transaction (view call or state-changing).
params[0]
string
required
Hex-encoded transaction (bincode serialized)
result
string
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).
params[0]
string
required
Contract ID (32-byte hex)
params[1]
string
required
Function name
params[2]
string
Hex-encoded JSON arguments
result
object
Function return value
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.
params[0]
string
required
Hex-encoded transaction
result
string
Estimated gas (hex)
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_estimateGas","params":["0x..."],"id":1}'
Response
{"jsonrpc":"2.0","result":"0x5208","id":1}

nexus_gasPrice

Get suggested gas price for transaction inclusion.
params
array
required
Empty array
result
object
Gas price recommendations
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_gasPrice","params":[],"id":1}'
Response
{
  "jsonrpc": "2.0",
  "result": {
    "base_fee": "0x1",
    "suggested_priority_fee": "0x1",
    "suggested_max_fee": "0x2"
  },
  "id": 1
}

nexus_getNodeInfo

Get node information.
params
array
required
Empty array
result
object
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}'
Response
{
  "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.
params[0]
string
required
Bitcoin address (bcrt1p…, bc1p…, tb1p…)
result
object
Resolved address info
curl -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"nexus_resolveAddress","params":["bcrt1p..."],"id":1}'
Response
{
  "jsonrpc": "2.0",
  "result": {
    "pubkey": "0x1234567890abcdef..."
  },
  "id": 1
}