Documentation
¶
Index ¶
- func BigToHex(bigInt big.Int) string
- func Eth1() *big.Int
- func Eth1Int64() int64
- func HexToBigInt(hex string) *big.Int
- func Int64ToHex(i int64) string
- func IntToHex(i int) string
- func LocalSigning(addrHex string, privHex string, plainMessage string) ([]byte, error)
- func ParseBigInt(value string) (*big.Int, string, error)
- func ParseHexToInt(value string) (int64, error)
- func ParseInt(value string) (int64, error)
- func ResolveNetworkId(id string) string
- func ResolveNetworkId2(id string) string
- func TextAndHash(data []byte) ([]byte, string)
- type Block
- type ConnectionMode
- type EthRPC
- func (rpc *EthRPC) ChainId() (string, error)
- func (rpc *EthRPC) ContractCall(contract string, methodName string, params string, block string, gas string, ...) (string, error)
- func (rpc *EthRPC) DbGetHex(dbname string, key string) (string, error)
- func (rpc *EthRPC) DbGetString(dbname string, key string) (string, error)
- func (rpc *EthRPC) DbPutHex(dbname string, key string, value string) (bool, error)
- func (rpc *EthRPC) DbPutString(dbname string, key string, value string) (bool, error)
- func (rpc *EthRPC) DeployContract(fromAddress string, bytecode string, gas string, gasPrice string) (json.RawMessage, error)
- func (rpc *EthRPC) Erc20Allowance(contract string, tokenOwner string, spender string) (json.RawMessage, error)
- func (rpc *EthRPC) Erc20BalanceOf(contract string, tokenOwner string) (json.RawMessage, error)
- func (rpc *EthRPC) Erc20Decimals(contract string) (string, error)
- func (rpc *EthRPC) Erc20Name(contract string) (string, error)
- func (rpc *EthRPC) Erc20Summary(contract string) (map[string]string, error)
- func (rpc *EthRPC) Erc20Symbol(contract string) (string, error)
- func (rpc *EthRPC) Erc20TotalSupply(contract string) (string, error)
- func (rpc *EthRPC) Erc20Transfer(contract string, address string, amount int) (json.RawMessage, error)
- func (rpc *EthRPC) EthAccounts() ([]string, error)
- func (rpc *EthRPC) EthBlockNumber() (int64, error)
- func (rpc *EthRPC) EthCall(transaction TransactionData, tag string) (string, error)
- func (rpc *EthRPC) EthCoinbase() (string, error)
- func (rpc *EthRPC) EthCompileLLL(code string) ([]string, error)
- func (rpc *EthRPC) EthCompileSerpent(code string) ([]string, error)
- func (rpc *EthRPC) EthCompileSolidity(code string) ([]string, error)
- func (rpc *EthRPC) EthEstimateGas(transaction TransactionData) (int64, error)
- func (rpc *EthRPC) EthGasPrice() (int64, error)
- func (rpc *EthRPC) EthGetBalance(address string, block string) (*big.Int, string, error)
- func (rpc *EthRPC) EthGetBlockByHash(hash string, withTransactions bool) (*Block, error)
- func (rpc *EthRPC) EthGetBlockByNumber(number int, withTransactions bool) (*Block, error)
- func (rpc *EthRPC) EthGetBlockTransactionCountByHash(hash string) (int64, error)
- func (rpc *EthRPC) EthGetBlockTransactionCountByNumber(blockNumber string) (int64, error)
- func (rpc *EthRPC) EthGetCode(address string, block string) (string, error)
- func (rpc *EthRPC) EthGetCompilers() ([]string, error)
- func (rpc *EthRPC) EthGetFilterChanges(filterID string) ([]Log, error)
- func (rpc *EthRPC) EthGetFilterLogs(filterID string) ([]Log, error)
- func (rpc *EthRPC) EthGetLogs(filter FilterParams) ([]Log, error)
- func (rpc *EthRPC) EthGetPendingTransactions(hash string) (*TransactionReceipt, error)
- func (rpc *EthRPC) EthGetProof(address string, keys []string, blocktime string) (bool, error)
- func (rpc *EthRPC) EthGetStorageAt(data string, key string, block string) (string, error)
- func (rpc *EthRPC) EthGetTransactionByBlockHashAndIndex(blockHash string, transactionIndex int) (*Transaction, error)
- func (rpc *EthRPC) EthGetTransactionByBlockNumberAndIndex(blockNumber, transactionIndex int) (*Transaction, error)
- func (rpc *EthRPC) EthGetTransactionByHash(hash string) (*Transaction, error)
- func (rpc *EthRPC) EthGetTransactionCount(address string, block string) (int64, error)
- func (rpc *EthRPC) EthGetTransactionReceipt(hash string) (*TransactionReceipt, error)
- func (rpc *EthRPC) EthGetUncleByBlockHashAndIndex(hash string, uncleIndex int) (*TransactionReceipt, error)
- func (rpc *EthRPC) EthGetUncleByBlockNumberAndIndex(blockNumber string, uncleIndex int) (*TransactionReceipt, error)
- func (rpc *EthRPC) EthGetUncleCountByBlockHash(hash string) (int64, error)
- func (rpc *EthRPC) EthGetUncleCountByBlockNumber(number int) (int64, error)
- func (rpc *EthRPC) EthGetWork() ([]string, error)
- func (rpc *EthRPC) EthHashRate() (int64, error)
- func (rpc *EthRPC) EthMethodNoParams(methodName string) (interface{}, error)
- func (rpc *EthRPC) EthMining() (bool, error)
- func (rpc *EthRPC) EthNetVersion() (string, error)
- func (rpc *EthRPC) EthNewBlockFilter() (string, error)
- func (rpc *EthRPC) EthNewFilter(filter FilterParams) (string, error)
- func (rpc *EthRPC) EthNewPendingTransactionFilter() (string, error)
- func (rpc *EthRPC) EthNodeInfo() (string, error)
- func (rpc *EthRPC) EthProtocolVersion() (string, error)
- func (rpc *EthRPC) EthSendRawTransaction(data string) (string, error)
- func (rpc *EthRPC) EthSendTransaction(transaction TransactionData) (string, error)
- func (rpc *EthRPC) EthSendTransactionPtr(transaction *TransactionData) (string, error)
- func (rpc *EthRPC) EthSign(address, data string) (string, error)
- func (rpc *EthRPC) EthSubmitHashrate(hashrate string, clientid string) (bool, error)
- func (rpc *EthRPC) EthSubmitWork(nonce, header, digest string) (bool, error)
- func (rpc *EthRPC) EthSyncing() (*Syncing, error)
- func (rpc *EthRPC) EthUninstallFilter(filterID string) (bool, error)
- func (rpc *EthRPC) GraphQL(graphQLendpointURI string, qlQuery []byte) ([]byte, stack.Error)
- func (rpc *EthRPC) IsGanache() (bool, error)
- func (rpc *EthRPC) IsSmartContractAddress(addr string) (bool, error)
- func (rpc *EthRPC) NetListening() (bool, error)
- func (rpc *EthRPC) NetPeerCount() (int, error)
- func (rpc *EthRPC) NetVersion() (string, error)
- func (rpc *EthRPC) NetworkId() (*big.Int, error)
- func (rpc *EthRPC) PendingNonceAt(address string) (uint64, error)
- func (rpc *EthRPC) Proxy(requestContent []byte) ([]byte, stack.Error)
- func (rpc *EthRPC) RawCall(method string, params string) (json.RawMessage, error)
- func (rpc *EthRPC) ShhAddToGroup(identityKey string) (bool, error)
- func (rpc *EthRPC) ShhGetFilterChanges() (string, error)
- func (rpc *EthRPC) ShhNewFilter() (string, error)
- func (rpc *EthRPC) ShhNewGroup() (string, error)
- func (rpc *EthRPC) ShhNewIdentity() (string, error)
- func (rpc *EthRPC) ShhPost(data model.WhisperParams) (string, error)
- func (rpc *EthRPC) ShhUninstallFilter() (bool, error)
- func (rpc *EthRPC) ShhVersion() (string, error)
- func (rpc *EthRPC) SshGetMessages(filterId string) ([]model.FilterChanges, error)
- func (rpc *EthRPC) SshHasIdentity(identityKey string) (bool, error)
- func (rpc *EthRPC) SuggestGasPrice() (*big.Int, error)
- func (rpc *EthRPC) URL() string
- func (rpc *EthRPC) Web3ClientVersion() (string, error)
- func (rpc *EthRPC) Web3Sha3(data []byte) (string, error)
- type FilterParams
- type Log
- type NodeSignRequest
- type ParamsCallback
- type Syncing
- type Transaction
- type TransactionData
- type TransactionReceipt
- type Web3Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HexToBigInt ¶
func Int64ToHex ¶
Int64ToHex convert int64 to hexadecimal representation
func LocalSigning ¶
func ParseBigInt ¶
ParseBigInt parse hex string value to big.Int
func ParseHexToInt ¶
ParseBigInt parse hex string value to big.Int
func ResolveNetworkId ¶
func TextAndHash ¶
TextAndHash is a helper function that calculates a hash for the given message that can be safely used to calculate a signature from.
The hash is calulcated as
keccak256("\x19Ethereum Signed Message:\n"${message length}${message}).
This gives context to the signed message and prevents signing of transactions.
Types ¶
type Block ¶
type Block struct { Number int Hash string ParentHash string Nonce string Sha3Uncles string LogsBloom string TransactionsRoot string StateRoot string Miner string Difficulty big.Int TotalDifficulty big.Int ExtraData string Size int GasLimit int GasUsed int Timestamp int Uncles []string Transactions []Transaction }
Block - block object
type EthRPC ¶
type EthRPC struct { // debug flag Debug bool // contains filtered or unexported fields }
EthRPC - Ethereum rpc client
func NewDefaultRPC ¶
New create new rpc client with given url
func NewDefaultRPCPtr ¶
New create new rpc client with given url
func (*EthRPC) ContractCall ¶
func (rpc *EthRPC) ContractCall(contract string, methodName string, params string, block string, gas string, gasprice string) (string, error)
post ethereum network contract with no parameters
func (*EthRPC) DbGetHex ¶
db_getHex Returns binary data from the local database. Note this function is deprecated and will be removed in the future. Parameters
String - Database name. String - Key name.
Example Parameters
params: [
"testDB", "myKey",
]
Returns ¶
DATA - The previously stored data.
func (*EthRPC) DbGetString ¶
db_getString Returns string from the local database. Note this function is deprecated and will be removed in the future. Parameters String - Database name. String - Key name. Example Parameters
params: [
"testDB", "myKey",
] Returns
String - The previously stored string.
func (*EthRPC) DbPutHex ¶
db_putHex Stores binary data in the local database. Note this function is deprecated and will be removed in the future. Parameters
String - Database name. String - Key name. DATA - The data to store.
Example Parameters ¶
params: [
"testDB", "myKey", "0x68656c6c6f20776f726c64"
]
Returns ¶
Boolean - returns true if the value was stored, otherwise false.
func (*EthRPC) DbPutString ¶
db_putString Stores a string in the local database. Note this function is deprecated and will be removed in the future. Parameters
String - Database name. String - Key name. String - String to store.
Example Parameters ¶
params: [
"testDB", "myKey", "myString"
]
Returns ¶
Boolean - returns true if the value was stored, otherwise false.
func (*EthRPC) DeployContract ¶
func (rpc *EthRPC) DeployContract(fromAddress string, bytecode string, gas string, gasPrice string) (json.RawMessage, error)
curl localhost:8545 -X POST --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from": "0x8aff0a12f3e8d55cc718d36f84e002c335df2f4a", "data": "606060405260728060106000396000f360606040526000357c0100000000000000000000000000000000000000000000000000000000900480636ffa1caa146037576035565b005b604b60048080359060200190919050506061565b6040518082815260200191505060405180910390f35b6000816002029050606d565b91905056"}],"id":1}
func (*EthRPC) Erc20Allowance ¶
func (*EthRPC) Erc20BalanceOf ¶
func (*EthRPC) Erc20Summary ¶
func (*EthRPC) Erc20TotalSupply ¶
func (*EthRPC) Erc20Transfer ¶
func (*EthRPC) EthAccounts ¶
EthAccounts returns a list of addresses owned by client.
func (*EthRPC) EthBlockNumber ¶
EthBlockNumber returns the number of most recent block.
func (*EthRPC) EthCall ¶
func (rpc *EthRPC) EthCall(transaction TransactionData, tag string) (string, error)
EthCall executes a new message post immediately without creating a transaction on the block chain.
func (*EthRPC) EthCoinbase ¶
EthCoinbase returns the client coinbase address
func (*EthRPC) EthCompileLLL ¶
eth_compileLLL @deprecated Returns compiled LLL code.
DATA - The compiled source code.
func (*EthRPC) EthCompileSerpent ¶
eth_compileSerpent @deprecated Returns compiled Serpent code.
DATA - The compiled source code.
func (*EthRPC) EthCompileSolidity ¶
eth_compileSolidity @deprecated Returns compiled solidity code.
DATA - The compiled source code.
func (*EthRPC) EthEstimateGas ¶
func (rpc *EthRPC) EthEstimateGas(transaction TransactionData) (int64, error)
EthEstimateGas makes a post 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 (*EthRPC) EthGasPrice ¶
EthGasPrice returns the current price per gas in wei.
func (*EthRPC) EthGetBalance ¶
EthGetBalance returns the balance of the account of given address in wei.
func (*EthRPC) EthGetBlockByHash ¶
EthGetBlockByHash returns information about a block by hash.
func (*EthRPC) EthGetBlockByNumber ¶
EthGetBlockByNumber returns information about a block by block number.
func (*EthRPC) EthGetBlockTransactionCountByHash ¶
EthGetBlockTransactionCountByHash returns the number of transactions in a block from a block matching the given block hash.
func (*EthRPC) EthGetBlockTransactionCountByNumber ¶
EthGetBlockTransactionCountByNumber returns the number of transactions in a block from a block matching the given block
func (*EthRPC) EthGetCode ¶
EthGetCode returns code at a given address.
func (*EthRPC) EthGetCompilers ¶
EthGetCompilers returns a list of available compilers in the client. @deprecated returns Array - Array of available compilers.
func (*EthRPC) EthGetFilterChanges ¶
EthGetFilterChanges polling method for a filter, which returns an array of logs which occurred since last poll.
func (*EthRPC) EthGetFilterLogs ¶
EthGetFilterLogs returns an array of all logs matching filter with given id.
func (*EthRPC) EthGetLogs ¶
func (rpc *EthRPC) EthGetLogs(filter FilterParams) ([]Log, error)
EthGetLogs returns an array of all logs matching a given filter object.
func (*EthRPC) EthGetPendingTransactions ¶
func (rpc *EthRPC) EthGetPendingTransactions(hash string) (*TransactionReceipt, error)
TODO implement EthGetPendingTransactions returns the list of pending transactions
func (*EthRPC) EthGetProof ¶
Returns Object - A account object: balance: QUANTITY - the balance of the account. See eth_getBalance codeHash: DATA, 32 Bytes - hash of the code of the account. For a simple Account without code it will return "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" nonce: QUANTITY, - nonce of the account. See eth_getTransactionCount storageHash: DATA, 32 Bytes - SHA3 of the StorageRoot. All storage will deliver a MerkleProof starting with this rootHash. accountProof: ARRAY - Array of rlp-serialized MerkleTree-Nodes, starting with the stateRoot-Node, following the path of the SHA3 (address) as key. storageProof: ARRAY - Array of storage-entries as requested. Each entry is a object with these properties: key: QUANTITY - the requested storage key value: QUANTITY - the storage value proof: ARRAY - Array of rlp-serialized MerkleTree-Nodes, starting with the storageHash-Node, following the path of the SHA3 (key) as path.
func (*EthRPC) EthGetStorageAt ¶
EthGetStorageAt returns the value from a storage position at a given address.
func (*EthRPC) EthGetTransactionByBlockHashAndIndex ¶
func (rpc *EthRPC) EthGetTransactionByBlockHashAndIndex(blockHash string, transactionIndex int) (*Transaction, error)
EthGetTransactionByBlockHashAndIndex returns information about a transaction by block hash and transaction index position.
func (*EthRPC) EthGetTransactionByBlockNumberAndIndex ¶
func (rpc *EthRPC) EthGetTransactionByBlockNumberAndIndex(blockNumber, transactionIndex int) (*Transaction, error)
EthGetTransactionByBlockNumberAndIndex returns information about a transaction by block number and transaction index position.
func (*EthRPC) EthGetTransactionByHash ¶
func (rpc *EthRPC) EthGetTransactionByHash(hash string) (*Transaction, error)
EthGetTransactionByHash returns the information about a transaction requested by transaction hash.
func (*EthRPC) EthGetTransactionCount ¶
EthGetTransactionCount returns the number of transactions sent from an address.
func (*EthRPC) EthGetTransactionReceipt ¶
func (rpc *EthRPC) EthGetTransactionReceipt(hash string) (*TransactionReceipt, error)
EthGetTransactionReceipt returns the receipt of a transaction by transaction hash. Note That the receipt is not available for pending transactions.
func (*EthRPC) EthGetUncleByBlockHashAndIndex ¶
func (rpc *EthRPC) EthGetUncleByBlockHashAndIndex(hash string, uncleIndex int) (*TransactionReceipt, error)
eth_getUncleByBlockHashAndIndex Returns information about a uncle of a block by hash and uncle index position. params: [
'0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b', '0x0' // 0
] Note: An uncle doesn't contain individual transactions.
func (*EthRPC) EthGetUncleByBlockNumberAndIndex ¶
func (rpc *EthRPC) EthGetUncleByBlockNumberAndIndex(blockNumber string, uncleIndex int) (*TransactionReceipt, error)
eth_getUncleByBlockNumberAndIndex Returns information about a uncle of a block by number and uncle index position. params: [
'0x29c', // 668 '0x0' // 0
] Note: An uncle doesn't contain individual transactions.
func (*EthRPC) EthGetUncleCountByBlockHash ¶
EthGetUncleCountByBlockHash returns the number of uncles in a block from a block matching the given block hash.
func (*EthRPC) EthGetUncleCountByBlockNumber ¶
EthGetUncleCountByBlockNumber returns the number of uncles in a block from a block matching the given block number.
func (*EthRPC) EthGetWork ¶
eth_getWork Returns the hash of the current block, the seedHash, and the boundary condition to be met ("target"). EthGetWork returns an array of all logs matching a given filter object. Returns Array - Array with the following properties: DATA, 32 Bytes - current block header pow-hash DATA, 32 Bytes - the seed hash used for the DAG. DATA, 32 Bytes - the boundary condition ("target"), 2^256 / difficulty.
func (*EthRPC) EthHashRate ¶
EthHashRate returns the number of hashes per second that the node is mining with.
func (*EthRPC) EthMethodNoParams ¶
func (*EthRPC) EthNetVersion ¶
returns ethereum node information
func (*EthRPC) EthNewBlockFilter ¶
EthNewBlockFilter creates a filter in the node, to notify when a new block arrives. To check if the state has changed, post EthGetFilterChanges.
func (*EthRPC) EthNewFilter ¶
func (rpc *EthRPC) EthNewFilter(filter FilterParams) (string, error)
EthNewFilter creates a new filter object.
func (*EthRPC) EthNewPendingTransactionFilter ¶
EthNewPendingTransactionFilter creates a filter in the node, to notify when new pending transactions arrive. To check if the state has changed, post EthGetFilterChanges.
func (*EthRPC) EthNodeInfo ¶
returns ethereum node information
func (*EthRPC) EthProtocolVersion ¶
EthProtocolVersion returns the current ethereum protocol version.
func (*EthRPC) EthSendRawTransaction ¶
EthSendRawTransaction creates new message post transaction or a contract creation for signed transactions.
func (*EthRPC) EthSendTransaction ¶
func (rpc *EthRPC) EthSendTransaction(transaction TransactionData) (string, error)
EthSendTransaction creates new message post transaction or a contract creation, if the data field contains code.
func (*EthRPC) EthSendTransactionPtr ¶
func (rpc *EthRPC) EthSendTransactionPtr(transaction *TransactionData) (string, error)
EthSendTransaction creates new message post transaction or a contract creation, if the data field contains code.
func (*EthRPC) EthSign ¶
EthSign signs data with a given address. Calculates an Ethereum specific signature with: sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message)))
func (*EthRPC) EthSubmitHashrate ¶
eth_submitHashrate Used for submitting mining hashrate. Parameters
Hashrate, a hexadecimal string representation (32 bytes) of the hash rate ID, String - A random hexadecimal(32 bytes) ID identifying the client
params: [
"0x0000000000000000000000000000000000000000000000000000000000500000", "0x59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283c"
] returns Boolean - returns true if submitting went through succesfully and false otherwise.
func (*EthRPC) EthSubmitWork ¶
eth_submitWork EthSubmitWork Used for submitting a proof-of-work solution. DATA, 8 Bytes - The nonce found (64 bits) DATA, 32 Bytes - The header's pow-hash (256 bits) DATA, 32 Bytes - The mix digest (256 bits) params: [
"0x0000000000000001", "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000"
] Boolean - returns true if the provided solution is valid, otherwise false.
func (*EthRPC) EthSyncing ¶
EthSyncing returns an object with data about the sync status or false.
func (*EthRPC) EthUninstallFilter ¶
EthUninstallFilter uninstalls a filter with given id.
func (*EthRPC) GraphQL ¶
method that calls graph ql api of ethereum nodes (supported on geth +1.9.0)
func (*EthRPC) IsSmartContractAddress ¶
func (*EthRPC) NetListening ¶
NetListening returns true if client is actively listening for network connections.
func (*EthRPC) NetPeerCount ¶
NetPeerCount returns number of peers currently connected to the client.
func (*EthRPC) NetVersion ¶
NetVersion returns the current network protocol version.
func (*EthRPC) NetworkId ¶
NetworkID returns the network ID (also known as the chain ID) for this chain.
func (*EthRPC) PendingNonceAt ¶
PendingNonceAt returns the account nonce of the given account in the pending state. This is the nonce that should be used for the next transaction.
func (*EthRPC) ShhAddToGroup ¶
shh_addToGroup Adds a whisper identity to the group. Parameters
DATA, 60 Bytes - The identity address to add to a group.
Example Parameters params: [ "0x04f96a5e25610293e42a73908e93ccc8c4d4dc0edcfa9fa872f50cb214e08ebf61a03e245533f97284d442460f2998cd41858798ddfd4d661997d3940272b717b1" ] Returns
Boolean - returns true if the identity was successfully added to the group, otherwise false.
func (*EthRPC) ShhGetFilterChanges ¶
shh_getFilterChanges Polling method for whisper filters. Returns new messages since the last call of this method. Note calling the shh_getMessages method, will reset the buffer for this method, so that you won't receive duplicate messages. Parameters
QUANTITY - The filter id.
Example Parameters params: [ "0x7" // 7 ] Returns Array - Array of messages received since last poll:
hash: DATA, 32 Bytes (?) - The hash of the message. from: DATA, 60 Bytes - The sender of the message, if a sender was specified. to: DATA, 60 Bytes - The receiver of the message, if a receiver was specified. expiry: QUANTITY - Integer of the time in seconds when this message should expire (?). ttl: QUANTITY - Integer of the time the message should float in the system in seconds (?). sent: QUANTITY - Integer of the unix timestamp when the message was sent. topics: Array of DATA - Array of DATA topics the message contained. payload: DATA - The payload of the message. workProved: QUANTITY - Integer of the work this message required before it was send (?).
func (*EthRPC) ShhNewFilter ¶
shh_newFilter Creates filter to notify, when client receives whisper message matching the filter options. Parameters
Object - The filter options: to: DATA, 60 Bytes - (optional) Identity of the receiver. When present it will try to decrypt any incoming message if the client holds the private key to this identity. topics: Array of DATA - Array of DATA topics which the incoming message's topics should match. You can use the following combinations: [A, B] = A && B [A, [B, C]] = A && (B || C) [null, A, B] = ANYTHING && A && B null works as a wildcard
Example Parameters ¶
params: [{ "topics": ['0x12341234bf4b564f'], "to": "0x04f96a5e25610293e42a73908e93ccc8c4d4dc0edcfa9fa872f50cb214e08ebf61a03e245533f97284d442460f2998cd41858798ddfd4d661997d3940272b717b1" }]
Returns ¶
QUANTITY - The newly created filter. TODO develop
func (*EthRPC) ShhNewGroup ¶
shh_newGroup Creates a new group. Parameters: none Returns
DATA, 60 Bytes - the address of the new group.
func (*EthRPC) ShhNewIdentity ¶
shh_newIdentity Creates new whisper identity in the client. Parameters: none Returns
DATA, 60 Bytes - the address of the new identiy.
func (*EthRPC) ShhPost ¶
func (rpc *EthRPC) ShhPost(data model.WhisperParams) (string, error)
shh_post Sends a whisper message. Parameters
Object - The whisper post object: from: DATA, 60 Bytes - (optional) The identity of the sender. to: DATA, 60 Bytes - (optional) The identity of the receiver. When present whisper will encrypt the message so that only the receiver can decrypt it. topics: Array of DATA - Array of DATA topics, for the receiver to identify messages. payload: DATA - The payload of the message. priority: QUANTITY - The integer of the priority in a range from ... (?). ttl: QUANTITY - integer of the time to live in seconds.
Example Parameters ¶
params: [{ from: "0x04f96a5e25610293e42a73908e93ccc8c4d4dc0edcfa9fa872f50cb214e08ebf61a03e245533f97284d442460f2998cd41858798ddfd4d661997d3940272b717b1", to: "0x3e245533f97284d442460f2998cd41858798ddf04f96a5e25610293e42a73908e93ccc8c4d4dc0edcfa9fa872f50cb214e08ebf61a0d4d661997d3940272b717b1", topics: ["0x776869737065722d636861742d636c69656e74", "0x4d5a695276454c39425154466b61693532"], payload: "0x7b2274797065223a226d6", priority: "0x64", ttl: "0x64", }]
Returns ¶
Boolean - returns true if the message was send, otherwise false. TODO develop this option
func (*EthRPC) ShhUninstallFilter ¶
shh_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 shh_getFilterChanges for a period of time. Parameters
QUANTITY - The filter id.
Example Parameters params: [ "0x7" // 7 ] Returns Boolean - true if the filter was successfully uninstalled, otherwise false.
func (*EthRPC) ShhVersion ¶
shh_version Returns the current whisper protocol version. Parameters
none
Returns
String - The current whisper protocol version
func (*EthRPC) SshGetMessages ¶
func (rpc *EthRPC) SshGetMessages(filterId string) ([]model.FilterChanges, error)
shh_getMessages Get all messages matching a filter. Unlike shh_getFilterChanges this returns all messages. Parameters
QUANTITY - The filter id.
params: [
"0x7" // 7
] Returns: see shh_getFilterChanges
func (*EthRPC) SshHasIdentity ¶
shh_hasIdentity Checks if the client hold the private keys for a given identity. Parameters
DATA, 60 Bytes - The identity address to check.
Example Parameters params: [ "0x04f96a5e25610293e42a73908e93ccc8c4d4dc0edcfa9fa872f50cb214e08ebf61a03e245533f97284d442460f2998cd41858798ddfd4d661997d3940272b717b1" ] Returns Boolean - returns true if the client holds the privatekey for that identity, otherwise false.
func (*EthRPC) SuggestGasPrice ¶
SuggestGasPrice retrieves the currently suggested gas price to allow a timely execution of a transaction.
func (*EthRPC) Web3ClientVersion ¶
Web3ClientVersion returns the current client version.
type FilterParams ¶
type FilterParams struct { FromBlock string `json:"fromBlock,omitempty"` ToBlock string `json:"toBlock,omitempty"` Address []string `json:"address,omitempty"` Topics [][]string `json:"topics,omitempty"` }
FilterParams - Filter parameters object
func (FilterParams) String ¶
func (params FilterParams) String() string
type Log ¶
type Log struct { Removed bool LogIndex int TransactionIndex int TransactionHash string BlockNumber int BlockHash string Address string Data string Topics []string }
Log - log object
func (*Log) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type NodeSignRequest ¶
Note the address to sign with must be unlocked.
type ParamsCallback ¶
type ParamsCallback func() string
type Syncing ¶
type Syncing struct { IsSyncing bool StartingBlock int CurrentBlock int HighestBlock int PulledStates int KnownStates int }
Syncing - object with syncing data info
func (*Syncing) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type Transaction ¶
type Transaction struct { Hash string Nonce int BlockHash string BlockNumber *int TransactionIndex *int From string To string Value big.Int Gas int GasPrice big.Int Input string }
Transaction - transaction object
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
type TransactionData ¶
type TransactionData struct { From string `json:"from"` To string `json:"to"` GasStr string `json:"gas"` GasPriceStr string `json:"price"` ValueStr string `json:"value"` Data string `json:"data"` NonceStr string `json:"nonce"` // contains filtered or unexported fields }
TransactionData - input transaction object
func (TransactionData) MarshalJSON ¶
func (t TransactionData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Unmarshaler interface.
func (*TransactionData) SetValue ¶
func (t *TransactionData) SetValue(wei *big.Int)
func (TransactionData) Value ¶
func (t TransactionData) Value() *big.Int
type TransactionReceipt ¶
type TransactionReceipt struct { TransactionHash string TransactionIndex int BlockHash string BlockNumber int CumulativeGasUsed int GasUsed int ContractAddress string Logs []Log LogsBloom string Root string Status string }
TransactionReceipt - transaction receipt object
func (*TransactionReceipt) UnmarshalJSON ¶
func (t *TransactionReceipt) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
type Web3Resolver ¶
type Web3Resolver func() (interface{}, error)