代码拉取完成,页面将自动刷新
同步操作将从 楠木/etherscan-api 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* Copyright (c) 2018 LI Zhennan
*
* Use of this work is governed by a MIT License.
* You may find a license copy in project root.
*/
package etherscan
import "encoding/json"
// Envelope is the carrier of nearly every response
type Envelope struct {
// 1 for good, 0 for error
Status int `json:"status,string"`
// OK for good, other words when Status equals 0
Message string `json:"message"`
// where response lies
Result json.RawMessage `json:"result"`
}
// AccountBalance account and its balance in pair
type AccountBalance struct {
Account string `json:"account"`
Balance *BigInt `json:"balance"`
}
// NormalTx holds info from normal tx query
type NormalTx struct {
BlockNumber int `json:"blockNumber,string"`
TimeStamp Time `json:"timeStamp"`
Hash string `json:"hash"`
Nonce int `json:"nonce,string"`
BlockHash string `json:"blockHash"`
TransactionIndex int `json:"transactionIndex,string"`
From string `json:"from"`
To string `json:"to"`
Value *BigInt `json:"value"`
Gas int `json:"gas,string"`
GasPrice *BigInt `json:"gasPrice"`
IsError int `json:"isError,string"`
TxReceiptStatus string `json:"txreceipt_status"`
Input string `json:"input"`
ContractAddress string `json:"contractAddress"`
CumulativeGasUsed int `json:"cumulativeGasUsed,string"`
GasUsed int `json:"gasUsed,string"`
Confirmations int `json:"confirmations,string"`
}
// InternalTx holds info from internal tx query
type InternalTx struct {
BlockNumber int `json:"blockNumber,string"`
TimeStamp Time `json:"timeStamp"`
Hash string `json:"hash"`
From string `json:"from"`
To string `json:"to"`
Value *BigInt `json:"value"`
ContractAddress string `json:"contractAddress"`
Input string `json:"input"`
Type string `json:"type"`
Gas int `json:"gas,string"`
GasUsed int `json:"gasUsed,string"`
TraceID string `json:"traceId"`
IsError int `json:"isError,string"`
ErrCode string `json:"errCode"`
}
// ERC20Transfer holds info from ERC20 token transfer event query
type ERC20Transfer struct {
BlockNumber int `json:"blockNumber,string"`
TimeStamp Time `json:"timeStamp"`
Hash string `json:"hash"`
Nonce int `json:"nonce,string"`
BlockHash string `json:"blockHash"`
From string `json:"from"`
ContractAddress string `json:"contractAddress"`
To string `json:"to"`
Value *BigInt `json:"value"`
TokenName string `json:"tokenName"`
TokenSymbol string `json:"tokenSymbol"`
TokenDecimal uint8 `json:"tokenDecimal,string"`
TransactionIndex int `json:"transactionIndex,string"`
Gas int `json:"gas,string"`
GasPrice *BigInt `json:"gasPrice"`
GasUsed int `json:"gasUsed,string"`
CumulativeGasUsed int `json:"cumulativeGasUsed,string"`
Input string `json:"input"`
Confirmations int `json:"confirmations,string"`
}
// MinedBlock holds info from query for mined block by address
type MinedBlock struct {
BlockNumber int `json:"blockNumber,string"`
TimeStamp Time `json:"timeStamp"`
BlockReward *BigInt `json:"blockReward"`
}
// ContractSource holds info from query for contract source code
type ContractSource struct {
SourceCode string `json:"SourceCode"`
ABI string `json:"ABI"`
ContractName string `json:"ContractName"`
CompilerVersion string `json:"CompilerVersion"`
OptimizationUsed int `json:"OptimizationUsed,string"`
Runs int `json:"Runs,string"`
ConstructorArguments string `json:"ConstructorArguments"`
Library string `json:"Library"`
SwarmSource string `json:"SwarmSource"`
}
// ExecutionStatus holds info from query for transaction execution status
type ExecutionStatus struct {
// 0 = pass, 1 = error
IsError int `json:"isError,string"`
ErrDescription string `json:"errDescription"`
}
// BlockRewards holds info from query for block and uncle rewards
type BlockRewards struct {
BlockNumber int `json:"blockNumber,string"`
TimeStamp Time `json:"timeStamp"`
BlockMiner string `json:"blockMiner"`
BlockReward *BigInt `json:"blockReward"`
Uncles []struct {
Miner string `json:"miner"`
UnclePosition int `json:"unclePosition,string"`
BlockReward *BigInt `json:"blockreward"`
} `json:"uncles"`
UncleInclusionReward *BigInt `json:"uncleInclusionReward"`
}
// LatestPrice holds info from query for latest ether price
type LatestPrice struct {
ETHBTC float64 `json:"ethbtc,string"`
ETHBTCTimestamp Time `json:"ethbtc_timestamp"`
ETHUSD float64 `json:"ethusd,string"`
ETHUSDTimestamp Time `json:"ethusd_timestamp"`
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。