Blockchain data
ChainGate offers additional blockchain data endpoints that let you explore the state of various networks beyond your own addresses. This includes:
- Transaction details
- Latest blocks
- Block transactions
- ...and more.
You can access these endpoints through the BlockchainData
class.
Quick exampleβ
import { BlockchainData } from 'chaingate'
async function fetchBlockchainInfo() {
// Instantiate with your API key
const blockchainData = new BlockchainData('your-api-key')
// Get transaction details (Bitcoin example)
const txDetails = (await blockchainData.BitcoinApi.transactionDetails('e9a66845...')).data
console.log('Transaction details:', txDetails)
// Get the latest Ethereum block
const ethLatestBlock = (await blockchainData.EthereumApi.latestBlock()).data
console.log('Latest Ethereum block:', ethLatestBlock)
}
Available APIsβ
Each supported blockchain includes its own set of APIs under the BlockchainData
class (e.g., BitcoinApi
, EthereumApi
, etc.). You can call methods to retrieve detailed information about transactions, blocks, mempools, and more.
info
For a full list of available endpoints and their parameters, see ChainGate API Documentation.
Key pointsβ
- Independent of wallet: These calls do not require an initialized wallet. They query blockchain data directly from ChainGateβs services.
- Multiple chains: A single
BlockchainData
instance can access endpoints for multiple blockchains. - Exploration: Use these methods to build explorer-like functionality or perform in-depth network analysis.
- Security: You only need your API key. No private keys or mnemonic phrases are involved in reading blockchain data.