Documentation ¶
Index ¶
- Variables
- type Chain3
- func (chain3 *Chain3) CurrentProvider() provider.Provider
- func (chain3 *Chain3) CurrentRequestManager() *RequestManager
- func (chain3 *Chain3) FromASCII(textString string, padding int) string
- func (chain3 *Chain3) FromDecimal(value interface{}) string
- func (chain3 *Chain3) FromSha(number string, unit string) string
- func (chain3 *Chain3) IsAddress(address string) bool
- func (chain3 *Chain3) IsConnected() bool
- func (chain3 *Chain3) Reset(keepSyncing bool)
- func (chain3 *Chain3) SetProvider(provider provider.Provider)
- func (chain3 *Chain3) Sha3(data string, options interface{}) string
- func (chain3 *Chain3) ToASCII(hexString string) string
- func (chain3 *Chain3) ToBigNumber(value interface{}) (result *big.Rat)
- func (chain3 *Chain3) ToDecimal(value interface{}) string
- func (chain3 *Chain3) ToHex(value interface{}) string
- func (chain3 *Chain3) ToSha(number interface{}, unit string) string
- type Filter
- type FilterOption
- type FilterType
- type JSONBlock
- type JSONLog
- type JSONTransaction
- type JSONTransactionReceipt
- type Mc
- type MoacAPI
- func (mc *MoacAPI) Accounts() (addrs []common.Address, err error)
- func (mc *MoacAPI) BlockNumber() (result *big.Int, err error)
- func (mc *MoacAPI) Call(tx *common.TransactionRequest, quantity string) ([]byte, error)
- func (mc *MoacAPI) Coinbase() (addr common.Address, err error)
- func (mc *MoacAPI) EstimateGas(tx *common.TransactionRequest, quantity string) (result *big.Int, err error)
- func (mc *MoacAPI) GasPrice() (result *big.Int, err error)
- func (mc *MoacAPI) GetBalance(address common.Address, quantity string) (result *big.Int, err error)
- func (mc *MoacAPI) GetBlockByHash(hash common.Hash, full bool) (*common.Block, error)
- func (mc *MoacAPI) GetBlockByNumber(quantity string, full bool) (*common.Block, error)
- func (mc *MoacAPI) GetBlockTransactionCountByHash(hash common.Hash) (result *big.Int, err error)
- func (mc *MoacAPI) GetBlockTransactionCountByNumber(quantity string) (result *big.Int, err error)
- func (mc *MoacAPI) GetCode(address common.Address, quantity string) ([]byte, error)
- func (mc *MoacAPI) GetCompilers() (result []string, err error)
- func (mc *MoacAPI) GetFilterChanges(filter Filter) (result []interface{}, err error)
- func (mc *MoacAPI) GetFilterLogs(filter Filter) (result []interface{}, err error)
- func (mc *MoacAPI) GetLogs(filter Filter) (result []interface{}, err error)
- func (mc *MoacAPI) GetStorageAt(address common.Address, position uint64, quantity string) (uint64, error)
- func (mc *MoacAPI) GetTransactionByBlockHashAndIndex(hash common.Hash, index uint64) (*common.Transaction, error)
- func (mc *MoacAPI) GetTransactionByBlockNumberAndIndex(quantity string, index uint64) (*common.Transaction, error)
- func (mc *MoacAPI) GetTransactionByHash(hash common.Hash) (*common.Transaction, error)
- func (mc *MoacAPI) GetTransactionCount(address common.Address, quantity string) (result *big.Int, err error)
- func (mc *MoacAPI) GetTransactionReceipt(hash common.Hash) (*common.TransactionReceipt, error)
- func (mc *MoacAPI) GetUncleByBlockHashAndIndex(hash common.Hash, index uint64) (*common.Block, error)
- func (mc *MoacAPI) GetUncleByBlockNumberAndIndex(quantity string, index uint64) (*common.Block, error)
- func (mc *MoacAPI) GetUncleCountByBlockHash(hash common.Hash) (result *big.Int, err error)
- func (mc *MoacAPI) GetUncleCountByBlockNumber(quantity string) (result *big.Int, err error)
- func (mc *MoacAPI) GetWork() (header, seed, boundary common.Hash, err error)
- func (mc *MoacAPI) HashRate() (uint64, error)
- func (mc *MoacAPI) Mining() (bool, error)
- func (mc *MoacAPI) NewBlockFilter() (Filter, error)
- func (mc *MoacAPI) NewFilter(option *FilterOption) (Filter, error)
- func (mc *MoacAPI) NewPendingTransactionFilter() (Filter, error)
- func (mc *MoacAPI) ProtocolVersion() (string, error)
- func (mc *MoacAPI) SendRawTransaction(tx []byte) (hash common.Hash, err error)
- func (mc *MoacAPI) SendTransaction(tx *common.TransactionRequest) (hash common.Hash, err error)
- func (mc *MoacAPI) Sign(address common.Address, data []byte) ([]byte, error)
- func (mc *MoacAPI) SubmitWork(nonce uint64, header, mixDigest common.Hash) (bool, error)
- func (mc *MoacAPI) Syncing() (common.SyncStatus, error)
- func (mc *MoacAPI) UninstallFilter(filter Filter) (bool, error)
- type Net
- type NetAPI
- type RequestManager
- type WatchChannel
Constants ¶
This section is empty.
Variables ¶
var (
ErrChannelClosed = errors.New("Channel is closed")
)
Functions ¶
This section is empty.
Types ¶
type Chain3 ¶
Chain3 Standard interface See https://github.com/ethereum/wiki/wiki/JavaScript-API#web3js-api-reference
func (*Chain3) CurrentProvider ¶
CurrentProvider returns the current provider.
func (*Chain3) CurrentRequestManager ¶
func (chain3 *Chain3) CurrentRequestManager() *RequestManager
func (*Chain3) FromDecimal ¶
FromDecimal converts value to it"s hex representation.
func (*Chain3) FromSha ¶
FromWei takes a number of wei and converts it to any other ether unit.
Possible units are:
SI Short SI Full Effigy Other
- kwei femtoether babbage - mwei picoether lovelace - gwei nanoether shannon nano - -- microether szabo micro - -- microether szabo micro - -- milliether finney milli - ether -- -- - kether -- grand - mether - gether - tether
func (*Chain3) IsConnected ¶
IsConnected checks if a connection to a node exists.
func (*Chain3) Reset ¶
Reset state of chain3. Resets everything except manager. Uninstalls all filters. Stops polling. If keepSyncing is true, it will uninstall all filters, but will keep the chain3.mc.IsSyncing() polls.
func (*Chain3) SetProvider ¶
SetProvider sets provider.
func (*Chain3) ToBigNumber ¶
ToBigNumber takes an input and transforms it into an *big.Rat.
func (*Chain3) ToSha ¶
ToWei takes a number of a unit and converts it to wei.
Possible units are:
SI Short SI Full Effigy Other
- kwei femtoether babbage - mwei picoether lovelace - gwei nanoether shannon nano - -- microether szabo micro - -- microether szabo micro - -- milliether finney milli - ether -- -- - kether -- grand - mether - gether - tether
type FilterOption ¶
type FilterOption struct { FromBlock string `json:"fromBlock,omitempty"` ToBlock string `json:"toBlock,omitempty"` Address interface{} `json:"address,omitempty"` Topics []common.Data `json:"topics,omitempty"` }
FilterOption ...
func (*FilterOption) String ¶
func (opt *FilterOption) String() string
type FilterType ¶
type FilterType int
const ( TypeNormal FilterType = iota TypeBlockFilter TypeTransactionFilter )
type JSONBlock ¶
type JSONBlock struct { Difficulty json.Number `json:"difficulty"` ExtraData string `json:"extraData"` GasLimit json.Number `json:"gasLimit"` GasUsed json.Number `json:"gasUsed"` Hash string `json:"hash"` LogsBloom string `json:"logsBloom"` Miner string `json:"miner"` MixHash string `json:"mixHash"` Nonce string `json:"nonce"` Number json.Number `json:"number"` ParentHash string `json:"parentHash"` ReceiptsRoot string `json:"receiptsRoot"` Sha3Uncles string `json:"sha3Uncles"` Size json.Number `json:"size"` StateRoot string `json:"stateRoot"` Timestamp json.Number `json:"timestamp"` TotalDifficulty json.Number `json:"totalDifficulty"` Transactions []string `json:"transactions"` TransactionsRoot string `json:"transactionsRoot"` Uncles []string `json:"uncles"` }
type JSONLog ¶
type JSONLog struct { TxData string `json:"TxData"` Address string `json:"address"` BlockHash string `json:"blockHash"` BlockNumber json.Number `json:"blockNumber"` LogIndex json.Number `json:"logIndex"` Removed bool `json:"removed"` Topics []string `json:"topics"` TransactionHash string `json:"transactionHash"` TransactionIndex json.Number `json:"transactionIndex"` }
type JSONTransaction ¶
type JSONTransaction struct { BlockHash string `json:"blockHash"` BlockNumber json.Number `json:"blockNumber"` From string `json:"from"` Gas json.Number `json:"gas"` GasPrice json.Number `json:"gasprice"` Hash string `json:"hash"` Input string `json:"input"` Nonce json.Number `json:"nonce"` R string `json:"r"` S string `json:"s"` ShardingFlag string `json:"shardingFlag"` SysCnt string `json:"syscnt"` To string `json:"to"` TransactionIndex json.Number `json:"transactionIndex"` V string `json:"v"` Value json.Number `json:"value"` }
func (*JSONTransaction) ToTransaction ¶
func (t *JSONTransaction) ToTransaction() (tx *common.Transaction)
type JSONTransactionReceipt ¶
type JSONTransactionReceipt struct { BlockHash string `json:"blockHash"` BlockNumber json.Number `json:"blockNumber"` ContractAddress string `json:"contractAddress"` CumulativeGasUsed json.Number `json:"cumulativeGasUsed"` From string `json:"from"` GasUsed json.Number `json:"gasUsed"` Logs []JSONLog `json:"logs"` LogsBloom string `json:"logsBloom"` Root string `json:"root"` To string `json:"to"` TransactionHash string `json:"transactionHash"` TransactionIndex json.Number `json:"transactionIndex"` }
func (*JSONTransactionReceipt) ToTransactionReceipt ¶
func (r *JSONTransactionReceipt) ToTransactionReceipt() (receipt *common.TransactionReceipt)
type Mc ¶
type Mc interface { ProtocolVersion() (string, error) Syncing() (common.SyncStatus, error) Coinbase() (common.Address, error) Mining() (bool, error) HashRate() (uint64, error) GasPrice() (*big.Int, error) Accounts() ([]common.Address, error) BlockNumber() (*big.Int, error) GetBalance(address common.Address, quantity string) (*big.Int, error) GetStorageAt(address common.Address, position uint64, quantity string) (uint64, error) GetTransactionCount(address common.Address, quantity string) (*big.Int, error) GetBlockTransactionCountByHash(hash common.Hash) (*big.Int, error) GetBlockTransactionCountByNumber(quantity string) (*big.Int, error) GetUncleCountByBlockHash(hash common.Hash) (*big.Int, error) GetUncleCountByBlockNumber(quantity string) (*big.Int, error) GetCode(address common.Address, quantity string) ([]byte, error) Sign(address common.Address, data []byte) ([]byte, error) SendTransaction(tx *common.TransactionRequest) (common.Hash, error) SendRawTransaction(tx []byte) (common.Hash, error) Call(tx *common.TransactionRequest, quantity string) ([]byte, error) EstimateGas(tx *common.TransactionRequest, quantity string) (*big.Int, error) GetBlockByHash(hash common.Hash, full bool) (*common.Block, error) GetBlockByNumber(quantity string, full bool) (*common.Block, error) GetTransactionByHash(hash common.Hash) (*common.Transaction, error) GetTransactionByBlockHashAndIndex(hash common.Hash, index uint64) (*common.Transaction, error) GetTransactionByBlockNumberAndIndex(quantity string, index uint64) (*common.Transaction, error) GetTransactionReceipt(hash common.Hash) (*common.TransactionReceipt, error) GetUncleByBlockHashAndIndex(hash common.Hash, index uint64) (*common.Block, error) GetUncleByBlockNumberAndIndex(quantity string, index uint64) (*common.Block, error) GetCompilers() ([]string, error) // GompileLLL // CompileSolidity // CompileSerpent NewFilter(option *FilterOption) (Filter, error) NewBlockFilter() (Filter, error) NewPendingTransactionFilter() (Filter, error) UninstallFilter(filter Filter) (bool, error) GetFilterChanges(filter Filter) ([]interface{}, error) GetFilterLogs(filter Filter) ([]interface{}, error) GetLogs(filter Filter) ([]interface{}, error) GetWork() (common.Hash, common.Hash, common.Hash, error) SubmitWork(nonce uint64, header common.Hash, mixDigest common.Hash) (bool, error) }
Mc ...
type MoacAPI ¶
type MoacAPI struct {
// contains filtered or unexported fields
}
MoacAPI ...
func (*MoacAPI) BlockNumber ¶
BlockNumber returns the number of most recent block.
func (*MoacAPI) Call ¶
Call executes a new message call immediately without creating a transaction on the block chain.
func (*MoacAPI) EstimateGas ¶
func (mc *MoacAPI) EstimateGas(tx *common.TransactionRequest, quantity string) (result *big.Int, err error)
EstimateGas makes a call or transaction, which won't be added to the blockchain and returns the used gas, which can be used for estimating the used gas.
func (*MoacAPI) GetBalance ¶
GetBalance returns the balance of the account of given address.
func (*MoacAPI) GetBlockByHash ¶
GetBlockByHash returns information about a block by hash.
func (*MoacAPI) GetBlockByNumber ¶
GetBlockByNumber returns information about a block by block number.
func (*MoacAPI) GetBlockTransactionCountByHash ¶
GetBlockTransactionCountByHash returns the number of transactions in a block from a block matching the given block hash.
func (*MoacAPI) GetBlockTransactionCountByNumber ¶
GetBlockTransactionCountByNumber returns the number of transactions in a block from a block matching the given block number.
func (*MoacAPI) GetCompilers ¶
GetCompilers returns a list of available compilers in the client.
func (*MoacAPI) GetFilterChanges ¶
GetFilterChanges polling mmcod for a filter, which returns an array of logs which occurred since last poll.
func (*MoacAPI) GetFilterLogs ¶
GetFilterLogs returns an array of all logs matching filter with given id.
func (*MoacAPI) GetStorageAt ¶
func (mc *MoacAPI) GetStorageAt(address common.Address, position uint64, quantity string) (uint64, error)
GetStorageAt returns the value from a storage position at a given address.
func (*MoacAPI) GetTransactionByBlockHashAndIndex ¶
func (mc *MoacAPI) GetTransactionByBlockHashAndIndex(hash common.Hash, index uint64) (*common.Transaction, error)
GetTransactionByBlockHashAndIndex returns information about a transaction by block hash and transaction index position.
func (*MoacAPI) GetTransactionByBlockNumberAndIndex ¶
func (mc *MoacAPI) GetTransactionByBlockNumberAndIndex(quantity string, index uint64) (*common.Transaction, error)
GetTransactionByBlockNumberAndIndex returns information about a transaction by block number and transaction index position.
func (*MoacAPI) GetTransactionByHash ¶
GetTransactionByHash returns the information about a transaction requested by transaction hash.
func (*MoacAPI) GetTransactionCount ¶
func (mc *MoacAPI) GetTransactionCount(address common.Address, quantity string) (result *big.Int, err error)
GetTransactionCount returns the number of transactions sent from an address.
func (*MoacAPI) GetTransactionReceipt ¶
GetTransactionReceipt Returns the receipt of a transaction by transaction hash.
func (*MoacAPI) GetUncleByBlockHashAndIndex ¶
func (mc *MoacAPI) GetUncleByBlockHashAndIndex(hash common.Hash, index uint64) (*common.Block, error)
GetUncleByBlockHashAndIndex returns information about a uncle of a block by hash and uncle index position.
func (*MoacAPI) GetUncleByBlockNumberAndIndex ¶
func (mc *MoacAPI) GetUncleByBlockNumberAndIndex(quantity string, index uint64) (*common.Block, error)
GetUncleByBlockNumberAndIndex returns information about a uncle of a block by number and uncle index position.
func (*MoacAPI) GetUncleCountByBlockHash ¶
GetUncleCountByBlockHash returns the number of uncles in a block from a block matching the given block hash.
func (*MoacAPI) GetUncleCountByBlockNumber ¶
GetUncleCountByBlockNumber returns the number of uncles in a block from a block matching the given block number.
func (*MoacAPI) GetWork ¶
GetWork returns the hash of the current block, the seedHash, and the boundary condition to be met ("target").
func (*MoacAPI) HashRate ¶
HashRate returns the number of hashes per second that the node is mining with.
func (*MoacAPI) NewBlockFilter ¶
NewBlockFilter creates a filter in the node, to notify when a new block arrives. To check if the state has changed, call mc_getFilterChanges.
func (*MoacAPI) NewFilter ¶
func (mc *MoacAPI) NewFilter(option *FilterOption) (Filter, error)
NewFilter creates a filter object, based on filter options, to notify when the state changes (logs). To check if the state has changed, call mc_getFilterChanges.
func (*MoacAPI) NewPendingTransactionFilter ¶
NewPendingTransactionFilter creates a filter in the node, to notify when new pending transactions arrive. To check if the state has changed, call mc_getFilterChanges.
func (*MoacAPI) ProtocolVersion ¶
ProtocolVersion returns the current ethereum protocol version.
func (*MoacAPI) SendRawTransaction ¶
SendRawTransaction creates new message call transaction or a contract creation for signed transactions.
func (*MoacAPI) SendTransaction ¶
SendTransaction creates new message call transaction or a contract creation, if the data field contains code.
func (*MoacAPI) SubmitWork ¶
SubmitWork is used for submitting a proof-of-work solution.
func (*MoacAPI) Syncing ¶
func (mc *MoacAPI) Syncing() (common.SyncStatus, error)
Syncing returns true with an object with data about the sync status or false with nil.
func (*MoacAPI) UninstallFilter ¶
UninstallFilter uninstalls a filter with given id. Should always be called when watch is no longer needed. Additonally Filters timeout when they aren't requested with mc_getFilterChanges for a period of time.
type Net ¶
type Net interface { Version() (string, error) PeerCount() (uint64, error) Listening() (bool, error) }
Net ...
type NetAPI ¶
type NetAPI struct {
// contains filtered or unexported fields
}
NetAPI ...
func (*NetAPI) Listening ¶
Listening returns true if client is actively listening for network connections.
type RequestManager ¶
type RequestManager struct {
// contains filtered or unexported fields
}
requestManager is responsible for passing messages to providers
func NewRequestManager ¶
func NewRequestManager(provider provider.Provider) *RequestManager
func (*RequestManager) NewRequest ¶
func (rm *RequestManager) NewRequest(method string) rpc.Request
type WatchChannel ¶
type WatchChannel interface { Next() (interface{}, error) Close() }
WatchChannel ...