Data types
The shared response shapes: ChainInfo, Live, BlockSummary, Block, TxSummary, Tx, Address, Token, Fees and DetailRow.
# Data types
The shapes below are the same ones the [Rarebl Explorer](https://explorer.rarebl.com) uses, so the explorer and the API always agree. Endpoint pages refer to them by name. TypeScript notation, with `T | null` where a value can be unknown.
## ChainInfo
~~~ts
type ChainInfo = {
id: 'btc' | 'ltc' | 'bch' | 'dash' | 'eth' | 'tron'
name: string; symbol: string; decimals: number; kind: 'utxo' | 'account'
status: 'ok' | 'lagging' | 'down' // down = the node did not answer
tip: { height: number; hash: string; time: string } | null
historyFrom: string | null // earliest block time that can be shown
features: { addressHistory: boolean; addressBalance: boolean; tokens: boolean; mempool: boolean; internalTxs: boolean }
}
~~~
## Live
~~~ts
type Live = {
serverTime: string
chains: {
id: Chain
status: 'ok' | 'lagging' | 'down'
tip: { height: number; hash: string; time: string } | null
mempool: { count: number | null; bytes: number | null } | null
fee: { unit: string; standard: string | null } | null
checkedAt: string
}[]
}
~~~
## BlockSummary and Block
~~~ts
type BlockSummary = {
height: number; hash: string; time: string; txCount: number
size: number | null
miner: string | null // coinbase payout address / fee recipient / TRON witness
reward: string | null // native amount
fees: string | null
}
type Block = BlockSummary & {
prevHash: string | null; nextHash: string | null; confirmations: number
details: DetailRow[]
}
~~~
On UTXO chains `reward` is all coinbase outputs and `fees` is the reward minus the subsidy (null on Dash). On ETH, `fees` is everything users paid in the block (burnt plus priority) and `reward` is the priority fees. On TRON, `reward` is null and `fees` is the TRX burnt by the block's transactions.
## TxSummary
~~~ts
type TxSummary = {
hash: string; block: number | null; time: string | null
status: 'success' | 'failed' | 'pending'
from: string | null // UTXO: the first input's address (null for coinbase)
to: string | null // UTXO: the first non-change output's address, best effort
value: string // native amount moved (UTXO: total output)
fee: string | null
method: string | null // ETH/TRON: decoded method or "Transfer"; UTXO: "coinbase" or null
inputs?: number; outputs?: number // UTXO only
token?: { contract: string; symbol: string | null; amount: string | null } // first token transfer, if any
}
~~~
## Tx
~~~ts
type Tx = {
chain: Chain; hash: string; status: 'success' | 'failed' | 'pending'
block: number | null; blockHash: string | null; time: string | null; confirmations: number
value: string; fee: string | null
utxo?: {
size: number; vsize: number | null; weight: number | null; locktime: number; version: number
rbf: boolean | null; coinbase: boolean
inputs: { txid: string | null; vout: number | null; address: string | null; value: string | null; scriptType: string | null; sequence: number | null; coinbase: boolean }[]
outputs: { n: number; address: string | null; value: string; scriptType: string | null; opReturn: string | null; spent: boolean | null }[]
}
account?: {
from: string; to: string | null; contractCreated: string | null
nonce: number | null; type: number | null
gasLimit: string | null; gasUsed: string | null; gasPrice: string | null // Gwei for ETH
maxFeePerGas: string | null; maxPriorityFeePerGas: string | null; baseFee: string | null; burntFee: string | null
input: string | null; methodId: string | null; methodName: string | null
tokenTransfers: TokenTransfer[]
logs: { index: number; address: string; topics: string[]; data: string }[]
tron?: { contractType: string; energyUsed: number | null; energyFee: string | null; bandwidthUsed: number | null; netFee: string | null; result: string | null }
}
details: DetailRow[]
}
type TokenTransfer = {
standard: 'ERC-20' | 'ERC-721' | 'ERC-1155' | 'TRC-20' | 'TRC-721' | 'TRC-10'
contract: string; symbol: string | null; name: string | null; decimals: number | null
from: string; to: string
amount: string | null // formatted with decimals when known
rawAmount: string; tokenId: string | null; logIndex: number | null
}
~~~
On TRON, `gasLimit`, `gasUsed`, `gasPrice`, `maxFeePerGas`, `maxPriorityFeePerGas`, `baseFee`, `burntFee`, `nonce` and `type` are `null`; use the `tron` object instead.
## Address
~~~ts
type Address = {
chain: Chain; address: string; valid: boolean
type: string | null // p2pkh, p2sh, p2wpkh, p2tr, cashaddr, eoa, contract, tron-account, ...
balance: string | null // native
balanceStatus: 'exact' | 'index_pending' // BTC/LTC/BCH: index_pending until the history index exists
received: string | null; sent: string | null; txCount: number | null
tokens: { contract: string; standard: string; symbol: string | null; name: string | null; decimals: number | null; balance: string }[]
isContract: boolean | null
history: { available: boolean; reason: string | null }
details: DetailRow[]
}
~~~
## Token
~~~ts
type Token = {
chain: 'eth' | 'tron'; contract: string; standard: string
name: string | null; symbol: string | null; decimals: number | null; totalSupply: string | null
holders: number | null; transfers: number | null // null until the index exists
details: DetailRow[]
}
~~~
## Fees
~~~ts
type Fees = {
chain: Chain; unit: string // "sat/vB" (UTXO), "Gwei" (ETH), "sun" (TRON)
slow: string | null; standard: string | null; fast: string | null
baseFee: string | null // ETH
details: DetailRow[] // TRON energy/bandwidth prices, ETH priority fee percentiles
updatedAt: string
}
~~~
## DetailRow
Chain-specific overview rows. The API picks and orders them, and a client renders each by its `kind`.
~~~ts
type DetailRow = {
key: string; label: string; value: string | number | boolean | null
kind: 'text' | 'number' | 'amount' | 'hash' | 'address' | 'block' | 'tx' | 'time' | 'bytes' | 'gas' | 'percent' | 'bool' | 'code'
unit?: string // for example "BTC", "Gwei", "sat/vB"
hint?: string // tooltip text
}
~~~