forked from onrik/ethrpc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
interface.go
50 lines (47 loc) · 2.04 KB
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package ethrpc
import (
"math/big"
)
type EthereumAPI interface {
Web3ClientVersion() (string, error)
Web3Sha3(data []byte) (string, error)
NetVersion() (string, error)
NetListening() (bool, error)
NetPeerCount() (int, error)
EthProtocolVersion() (string, error)
EthSyncing() (*Syncing, error)
EthCoinbase() (string, error)
EthMining() (bool, error)
EthHashrate() (int, error)
EthGasPrice() (big.Int, error)
EthAccounts() ([]string, error)
EthBlockNumber() (int, error)
EthGetBalance(address, block string) (big.Int, error)
EthGetStorageAt(data string, position int, tag string) (string, error)
EthGetTransactionCount(address, block string) (int, error)
EthGetBlockTransactionCountByHash(hash string) (int, error)
EthGetBlockTransactionCountByNumber(number int) (int, error)
EthGetUncleCountByBlockHash(hash string) (int, error)
EthGetUncleCountByBlockNumber(number int) (int, error)
EthGetCode(address, block string) (string, error)
EthSign(address, data string) (string, error)
EthSendTransaction(transaction T) (string, error)
EthSendRawTransaction(data string) (string, error)
EthCall(transaction T, tag string) (string, error)
EthEstimateGas(transaction T) (int, error)
EthGetBlockByHash(hash string, withTransactions bool) (*Block, error)
EthGetBlockByNumber(number int, withTransactions bool) (*Block, error)
EthGetTransactionByHash(hash string) (*Transaction, error)
EthGetTransactionByBlockHashAndIndex(blockHash string, transactionIndex int) (*Transaction, error)
EthGetTransactionByBlockNumberAndIndex(blockNumber, transactionIndex int) (*Transaction, error)
EthGetTransactionReceipt(hash string) (*TransactionReceipt, error)
EthGetCompilers() ([]string, error)
EthNewFilter(params FilterParams) (string, error)
EthNewBlockFilter() (string, error)
EthNewPendingTransactionFilter() (string, error)
EthUninstallFilter(filterID string) (bool, error)
EthGetFilterChanges(filterID string) ([]Log, error)
EthGetFilterLogs(filterID string) ([]Log, error)
EthGetLogs(params FilterParams) ([]Log, error)
}
var _ EthereumAPI = (*EthRPC)(nil)