Documentation
¶
Index ¶
- func GetUrlAndKey(network string) (urlHead string, apiKey string, err error)
- type AbiStruct
- type BlockscanErc20Txs
- type BlockscanEvents
- type BlockscanGasPriceReq
- type BlockscanGetBalanceReq
- type BlockscanGetBalancesReq
- type BlockscanGetErc20TxsReq
- type BlockscanGetEventsReq
- type BlockscanGetInternalTxsReq
- type BlockscanGetNormalTxsReq
- type BlockscanInternalTxs
- type BlockscanNormalTxs
- type BlockscanResultStringReq
- type BlockscanSourceCodeReq
- type Scanner
- func (s *Scanner) GetBalance(address string) (balance int, err error)
- func (s *Scanner) GetBalances(addresses []string) (res BlockscanGetBalancesReq, err error)
- func (s *Scanner) GetBlockNumberByTimestamp(timestamp string) (blockNumber int, err error)
- func (s *Scanner) GetContractAbi(address string) (abi AbiStruct, err error)
- func (s *Scanner) GetContractName(address string) (name string, err error)
- func (s *Scanner) GetErc20Transactions(address string, startBlock int, endBlock any) (res BlockscanGetErc20TxsReq, err error)
- func (s *Scanner) GetErc20TransactionsAll(address string) (txs []BlockscanErc20Txs, err error)
- func (s *Scanner) GetEvents(topic0 string, address string, startBlock int, endBlock any) (res BlockscanGetEventsReq, err error)
- func (s *Scanner) GetEventsAll(topic0 string, address string) (events []BlockscanEvents, err error)
- func (s *Scanner) GetGasPrice() (gasPrice int64, err error)
- func (s *Scanner) GetInternalTransactions(address string, startBlock int, endBlock any) (res BlockscanGetInternalTxsReq, err error)
- func (s *Scanner) GetInternalTransactionsAll(address string) (txs []BlockscanInternalTxs, err error)
- func (s *Scanner) GetNormalTransactions(address string, startBlock int, endBlock any) (res BlockscanGetNormalTxsReq, err error)
- func (s *Scanner) GetNormalTransactionsAll(address string) (txs []BlockscanNormalTxs, err error)
- func (s *Scanner) GetSourceCode(address string) (res BlockscanSourceCodeReq, err error)
- func (s *Scanner) IsVerifiedContract(address string) (isContract bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AbiStruct ¶
type AbiStruct []struct { Inputs []struct { InternalType string `json:"internalType"` Name string `json:"name"` Type string `json:"type"` } `json:"inputs"` StateMutability string `json:"stateMutability"` Type string `json:"type"` Anonymous bool `json:"anonymous"` Name string `json:"name"` Outputs []struct { InternalType string `json:"internalType"` Name string `json:"name"` Type string `json:"type"` } `json:"outputs"` }
type BlockscanErc20Txs ¶
type BlockscanErc20Txs struct { BlockNumber string `json:"blockNumber"` TimeStamp string `json:"timeStamp"` Hash string `json:"hash"` Nonce string `json:"nonce"` BlockHash string `json:"blockHash"` From string `json:"from"` ContractAddress string `json:"contractAddress"` To string `json:"to"` Value string `json:"value"` TokenName string `json:"tokenName"` TokenSymbol string `json:"tokenSymbol"` TokenDecimal string `json:"tokenDecimal"` TransactionIndex string `json:"transactionIndex"` Gas string `json:"gas"` GasPrice string `json:"gasPrice"` GasUsed string `json:"gasUsed"` CumulativeGasUsed string `json:"cumulativeGasUsed"` Input string `json:"input"` Confirmations string `json:"confirmations"` }
type BlockscanEvents ¶
type BlockscanEvents struct { Address string `json:"address"` Topics []string `json:"topics"` Data string `json:"data"` BlockNumber string `json:"blockNumber"` TimeStamp string `json:"timeStamp"` GasPrice string `json:"gasPrice"` GasUsed string `json:"gasUsed"` LogIndex string `json:"logIndex"` TransactionHash string `json:"transactionHash"` TransactionIndex string `json:"transactionIndex"` }
type BlockscanGasPriceReq ¶
type BlockscanGetBalanceReq ¶
type BlockscanGetBalancesReq ¶
type BlockscanGetErc20TxsReq ¶
type BlockscanGetErc20TxsReq struct { Status string `json:"status"` Message string `json:"message"` Result []BlockscanErc20Txs `json:"result"` }
type BlockscanGetEventsReq ¶
type BlockscanGetEventsReq struct { Status string `json:"status"` Message string `json:"message"` Result []BlockscanEvents `json:"result"` }
type BlockscanGetInternalTxsReq ¶
type BlockscanGetInternalTxsReq struct { Status string `json:"status"` Message string `json:"message"` Result []BlockscanInternalTxs `json:"result"` }
type BlockscanGetNormalTxsReq ¶
type BlockscanGetNormalTxsReq struct { Status string `json:"status"` Message string `json:"message"` Result []BlockscanNormalTxs `json:"result"` }
type BlockscanInternalTxs ¶
type BlockscanInternalTxs struct { BlockNumber string `json:"blockNumber"` TimeStamp string `json:"timeStamp"` Hash string `json:"hash"` From string `json:"from"` To string `json:"to"` Value string `json:"value"` ContractAddress string `json:"contractAddress"` Input string `json:"input"` Type string `json:"type"` Gas string `json:"gas"` GasUsed string `json:"gasUsed"` TraceID string `json:"traceId"` IsError string `json:"isError"` ErrCode string `json:"errCode"` }
type BlockscanNormalTxs ¶
type BlockscanNormalTxs struct { BlockNumber string `json:"blockNumber"` TimeStamp string `json:"timeStamp"` Hash string `json:"hash"` Nonce string `json:"nonce"` BlockHash string `json:"blockHash"` TransactionIndex string `json:"transactionIndex"` From string `json:"from"` To string `json:"to"` Value string `json:"value"` Gas string `json:"gas"` GasPrice string `json:"gasPrice"` IsError string `json:"isError"` TxreceiptStatus string `json:"txreceipt_status"` Input string `json:"input"` ContractAddress string `json:"contractAddress"` CumulativeGasUsed string `json:"cumulativeGasUsed"` GasUsed string `json:"gasUsed"` Confirmations string `json:"confirmations"` }
type BlockscanSourceCodeReq ¶
type BlockscanSourceCodeReq struct { Status string `json:"status"` Message string `json:"message"` Result []struct { SourceCode string `json:"SourceCode"` Abi string `json:"ABI"` ContractName string `json:"ContractName"` CompilerVersion string `json:"CompilerVersion"` OptimizationUsed string `json:"OptimizationUsed"` Runs string `json:"Runs"` ConstructorArguments string `json:"ConstructorArguments"` EVMVersion string `json:"EVMVersion"` Library string `json:"Library"` LicenseType string `json:"LicenseType"` Proxy string `json:"Proxy"` Implementation string `json:"Implementation"` SwarmSource string `json:"SwarmSource"` } `json:"result"` }
type Scanner ¶ added in v0.2.0
func (*Scanner) GetBalance ¶ added in v0.2.0
Get balance of a single address.
func (*Scanner) GetBalances ¶ added in v0.2.0
func (s *Scanner) GetBalances(addresses []string) (res BlockscanGetBalancesReq, err error)
Get balances of up to 20 addresses in one call.
func (*Scanner) GetBlockNumberByTimestamp ¶ added in v0.2.0
Use timestamp to get block number.
func (*Scanner) GetContractAbi ¶ added in v0.2.0
Get the contract's abi(if it is a verified contract)
func (*Scanner) GetContractName ¶ added in v0.2.0
Get the contract's name by its source code.
func (*Scanner) GetErc20Transactions ¶ added in v0.2.0
func (s *Scanner) GetErc20Transactions(address string, startBlock int, endBlock any) (res BlockscanGetErc20TxsReq, err error)
Get up to 10000 erc20 txs of an address.
func (*Scanner) GetErc20TransactionsAll ¶ added in v0.2.0
func (s *Scanner) GetErc20TransactionsAll(address string) (txs []BlockscanErc20Txs, err error)
Get all the erc20 txs of an address.
func (*Scanner) GetEvents ¶ added in v0.2.0
func (s *Scanner) GetEvents(topic0 string, address string, startBlock int, endBlock any) (res BlockscanGetEventsReq, err error)
Get up to 1000 events of an address.
func (*Scanner) GetEventsAll ¶ added in v0.2.0
func (s *Scanner) GetEventsAll(topic0 string, address string) (events []BlockscanEvents, err error)
Get all the events of an address.
func (*Scanner) GetGasPrice ¶ added in v0.2.0
Get gas price.
func (*Scanner) GetInternalTransactions ¶ added in v0.2.0
func (s *Scanner) GetInternalTransactions(address string, startBlock int, endBlock any) (res BlockscanGetInternalTxsReq, err error)
Get up to 10000 internal txs of an address.
func (*Scanner) GetInternalTransactionsAll ¶ added in v0.2.0
func (s *Scanner) GetInternalTransactionsAll(address string) (txs []BlockscanInternalTxs, err error)
Get all the internal txs of an address.
func (*Scanner) GetNormalTransactions ¶ added in v0.2.0
func (s *Scanner) GetNormalTransactions(address string, startBlock int, endBlock any) (res BlockscanGetNormalTxsReq, err error)
Get up to 10000 txs of an address.
func (*Scanner) GetNormalTransactionsAll ¶ added in v0.2.0
func (s *Scanner) GetNormalTransactionsAll(address string) (txs []BlockscanNormalTxs, err error)
Get all the txs of an address.
func (*Scanner) GetSourceCode ¶ added in v0.2.0
func (s *Scanner) GetSourceCode(address string) (res BlockscanSourceCodeReq, err error)
Get the source code of a contract.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.