- Transaction data structure in database
interface {
_id: string
hash: string
nonce: number
blockHash: string
blockNumber: number
transactionIndex: number
from: string
to: string
gas: number
gasPrice: string
value: string
input: string
v: string | null
r: string | null
s: string | null
timestamp: number
receipt: {
transactionHash: string
transactionIndex: number
blockHash: string
blockNumber: number
cumulativeGasUsed: number
gasUsed: number
contractAddress: string | null
from: string
to: string
root: string
status: string
logsBloom: string
}
txType: 'remasc' | 'contract call' | 'normal' | 'bridge'
txId: string
}
- Grouped Transaction Structure
interface {
_id: string // %Y-%m-%d
gas: number
transactions: {
name: string
total: number
}[]
}
- RESULT: Summarized Transaction Structure
interface {
id: string // %Y-%m-%d
gas: number
contract_call?: { name: string; total: number; gas: number }
contract_deploy?: { name: string; total: number; gas: number }
bridge?: { name: string; total: number; gas: number }
remasc?: { name: string; total: number; gas: number }
normal?: { name: string; total: number; gas: number }
}
- Stats Structure in database
interface {
_id: string // %Y-%m-%d
circulating: {
circulatingSupply: string
totalSupply: number
bridgeBalance: string
} | null
timestamp: number
hashrate: number
activeAccounts: number
}
- RESULT: Grouped and Summarized Stats Structure
interface {
id: string // %Y-%m-%d
hashrate: number
activeAccounts: number
circulatingSupply: number
count: number
}