Skip to content

Latest commit

 

History

History
92 lines (76 loc) · 3.54 KB

File metadata and controls

92 lines (76 loc) · 3.54 KB

Bitcore Node REST API

Base URL pattern: /api/:chain/:network/...

  • :chain: BTC | BCH | ETH | MATIC | XRP | DOGE | LTC
  • :network: mainnet | testnet (lowercase)

Authentication: Most endpoints are public; wallet endpoints require JWT via Auth.authenticateMiddleware.

Address

  • GET /:chain/:network/address/:address — UTXOs
    • Query: unspent=true, limit, since
  • GET /:chain/:network/address/:address/txs — transactions (stream)
  • GET /:chain/:network/address/:address/coins — coins (stream)
  • GET /:chain/:network/address/:address/balance — { confirmed, unconfirmed, balance }

Example:

curl "http://localhost:3000/api/BTC/mainnet/address/12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX/balance"

Transactions

  • GET /:chain/:network/tx — list by blockHeight or blockHash
    • Query: blockHeight or blockHash, limit, since, direction, paging
  • GET /:chain/:network/tx/:txId
  • GET /:chain/:network/tx/:txId/populated — includes input/output coins
  • GET /:chain/:network/tx/:txId/authhead
  • GET /:chain/:network/tx/:txid/coins
  • POST /:chain/:network/tx/send — broadcast raw tx
    • Body: { "rawTx": "<hex>" }

Example broadcast:

curl -X POST "http://localhost:3000/api/BTC/mainnet/tx/send" \
  -H 'Content-Type: application/json' \
  -d '{"rawTx":"<hex>"}'

Blocks

  • GET /:chain/:network/block — stream blocks (query: sinceBlock, date, limit, since, direction, paging)
  • GET /:chain/:network/block/tip — current height
  • GET /:chain/:network/block/:blockId
  • GET /:chain/:network/block/:blockHash/coins/:limit/:pgnum — txids, inputs, outputs for block
  • GET /:chain/:network/block/before-time/:time — block prior to timestamp

Example:

curl "http://localhost:3000/api/BTC/mainnet/block/tip"

Fees

  • GET /:chain/:network/fee/:target — dynamic fee for target blocks (0–100)

Stats

  • GET /:chain/:network/stats/daily-transactions — daily tx counts

Status

Base: /api/status

  • GET /enabled-chains — enabled {chain,network}
  • GET /performance — performance tracker info
  • GET /:chain/:network/sync — { initialSyncComplete }

EVM chain helpers (ETH)

Base: defined in modules/ethereum/api/eth-routes.ts

  • GET /api/ETH/:network/address/:address/txs/count — current nonce
  • POST /api/ETH/:network/gas — estimate gas
    • Body: { from, to, value, data, gasPrice }
  • GET /api/ETH/:network/token/:tokenAddress — ERC20 token info
  • GET /api/ETH/:network/token/:tokenAddress/allowance/:ownerAddress/for/:spenderAddress
  • Multisig (Gnosis Safe):
    • GET /api/ETH/:network/ethmultisig/info/:multisigContractAddress
    • GET /api/ETH/:network/ethmultisig/:sender/instantiation/:txId
    • GET /api/ETH/:network/ethmultisig/txps/:multisigContractAddress
    • GET /api/ETH/:network/ethmultisig/transactions/:multisigContractAddress (stream)

Example estimateGas:

curl -X POST "http://localhost:3000/api/ETH/mainnet/gas" \
  -H 'Content-Type: application/json' \
  -d '{"from":"0x...","to":"0x...","value":"0x0","data":"0x","gasPrice":"0x3b9aca00"}'

EVM chain helpers (MATIC)

Base: modules/matic/api/matic-routes.ts — same shapes as ETH with chain MATIC.

  • Nonce, gas, token info
  • Multisig info, instantiation, txps, transactions (stream)

XRP helpers

  • GET /api/XRP/:network/address/:address/txs/count — account nonce

Notes

  • Full examples for many endpoints exist in packages/bitcore-node/docs/api-documentation.md.
  • Streaming routes keep connections open to push data; prefer a client that can handle chunked responses.