New Block Endpoints & Deprecations
· 2 min read
ChainGate API v0.21 introduces new dedicated block endpoints for EVM and UTXO networks. These are more powerful, standardized, and ready for modern applications.
✨ What’s new
1. New blockByHeight and blockByHash endpoints
| Network type | By height | By hash |
|---|---|---|
| EVM | /evm/{currency}/blockByHeight?blockHeight=… | /evm/{currency}/blockByHash?blockHash=… |
| UTXO | /utxo/{currency}/blockByHeight?blockHeight=… | /utxo/{currency}/blockByHash?blockHash=… |
All these endpoints return a consistent JSON:
{
"hash": "0x… or 0000…",
"parentHash": "0x… or 0000…",
"height": 12345678,
"timestamp": 1609459200,
"sizeBytes": 123456,
"nonce": 1234
"difficulty": 1234567890,
"txs": ["txid1", "txid2", "…"]
}
2. Deprecated endpoints
Several older endpoints are now deprecated and will be removed in a future release. This includes:
| Deprecated | Use instead |
|---|---|
/getBlockHeight | Use blockByHeight |
/blockTransactions | Use blockBy* |
Root-level /bitcoin, /ethereum, etc. | Use /utxo/{currency} or /evm/{currency} for all supported blockchains |
⚠️ Legacy routes will be removed soon — please migrate as early as possible.
3. Bug Fixes
- 🐛 Fixed an issue where some transactions showed negative fees due to malformed raw data.
- 🐛 Fixed cases where addresses appeared as
nullorfalsein edge-case transactions (especially in UTXO networks). - 🧹 Minor improvements to block serialization and transaction parsing to ensure consistency across networks.
🛠 Upgrade checklist
- Replace all block fetch logic to use the new
/evm/or/utxo/routes. - Remove any usage of
/getBlockHeight,/blockTransactions, or root-level currency routes like/bitcoin,/ethereum, etc. - Test and deploy your updates.