Documentation
¶
Index ¶
- func EtherStrToWei(value string) (vInEther *big.Int, ok bool)
- func GetABI(address string, chain string) (abi string, err error)
- func GetOptimisation(address string, chain string) (optimisation bool, err error)
- func GetSWARM(address string, chain string) (swarm string, err error)
- func GetSourceCode(address string, chain string) (code string, err error)
- func GetVersion(address string, chain string) (version string, err error)
- type API
- func (a *API) AccountTransactions(action string, by string, val string, start string, end string, sort string) (tr TxListRec)
- func (a *API) EstimateGas(to string, value string) (res IntRec)
- func (a *API) EthCall(to string, data string) (res StringRec)
- func (a *API) GasPrice() (res IntRec)
- func (a *API) GetCode(address string) (res StringRec)
- func (a *API) GetLogs(fromBlock string, toBlock string, address string, topics []string, ...) (ev EventRec)
- func (a *API) InternalTransactionsByAddress(addr string) (tr TxListRec)
- func (a *API) TransactionsByAddress(addr string) (tr TxListRec)
- func (a *API) TransactionsByAddressFromTo(addr string, from string, to string) (tr TxListRec)
- type EvListItem
- type EventRec
- type IntRec
- type StringRec
- type TxListItem
- type TxListRec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EtherStrToWei ¶
EtherStrToWei converts 1.0 to 1000000000000000000000
0.1 to 100000000000000000000
func GetOptimisation ¶
GetOptimisation - find out if the code was optimised
func GetSourceCode ¶
GetSourceCode returns the code section
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API - the Etherscan API toolkit
func NewEtherscanAPI ¶
NewEtherscanAPI - create an api object with the correct key
func (*API) AccountTransactions ¶
func (a *API) AccountTransactions(action string, by string, val string, start string, end string, sort string) (tr TxListRec)
Really need to improve the way we call this.
func (*API) EstimateGas ¶
EstimateGas - run Tx locally and return amount of gas required
func (*API) GetLogs ¶
func (a *API) GetLogs(fromBlock string, toBlock string, address string, topics []string, operands []string) (ev EventRec)
GetLogs - scour event logs from start to stop
func (*API) InternalTransactionsByAddress ¶
func (*API) TransactionsByAddress ¶
TransactionsByAddress : Get a list of 'Normal' Transactions By Address [Optional Parameters] startblock: starting blockNo to retrieve results, endblock: ending blockNo to retrieve results ([BETA] Returned 'isError' values: 0=No Error, 1=Got Error) (Returns up to a maximum of the last 10000 transactions only) http://api.etherscan.io/api?module=account&action=txlist&address=0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae&startblock=0&endblock=99999999&sort=asc&apikey=YourApiKeyToken (To get paginated results use page=<page number> and offset=<max records to return>) https://api.etherscan.io/api?module=account&action=txlist&address=0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae&startblock=0&endblock=99999999&page=1&offset=10&sort=asc&apikey=YourApiKeyToken
type EvListItem ¶
type EvListItem struct {
Address string
Topics []string
Data string
BlockNumber string
TimeStamp string
GasPrice string
GasUsed string
LogIndex string
TransactionHash string
TransactionIndex string
}
EvListItem - returned by an EventList
type EventRec ¶
type EventRec struct {
Status string
Message string
Result []EvListItem
}
EventRec -
type TxListItem ¶
type TxListItem 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"`
Gas string `json:"gas"`
IsError string `json:"isError"`
GasUsed string `json:"gasUsed"`
CumulativeGasUsed string `json:"cumulativeGasUsed"`
ContractAddress string `json:"contractAddress"`
Input string `json:"input"`
}
type TxListRec ¶
type TxListRec struct {
Status string
Message string
Result []TxListItem
}
TxListRec - result from Transaction Calls
Status - OK / NOTOK Message - error if Status NOTOK Result - TxListItem