module Web3::EthCalls

Public Instance Methods

eth_accounts() click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_accounts

# File eth_calls.rb, line 39
def eth_accounts()
response = do_request("eth_accounts")
response["result"]
end
eth_blockNumber() click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_blocknumber

# File eth_calls.rb, line 45
def eth_blockNumber()
response = do_request("eth_blockNumber")
to_decimal response["result"]
end
eth_call(trans_object,block="latest") click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_call

# File eth_calls.rb, line 147
def eth_call(trans_object,block="latest")
  response = do_request("eth_call",[trans_object, block])
  response["result"]
end
eth_coinbase() click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_coinbase

# File eth_calls.rb, line 15
def eth_coinbase()
response = do_request("eth_coinbase")
response["result"]
end
eth_compileLLL(code) click to toggle source

deprecated

See https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_compilelll
# File eth_calls.rb, line 215
def eth_compileLLL(code)
response = do_request("eth_compileLLL",[code])
response["result"]
end
eth_compileSerpent(code) click to toggle source

deprecated See github.com/ethereum/wiki/wiki/JSON-RPC#eth_compileserpent

# File eth_calls.rb, line 229
def eth_compileSerpent(code)
response = do_request("eth_compileSerpent",[code])
response["result"]
end
eth_compileSolidity(code) click to toggle source

deprecated See github.com/ethereum/wiki/wiki/JSON-RPC#eth_compilesolidity

# File eth_calls.rb, line 222
def eth_compileSolidity(code)
response = do_request("eth_compileSolidity",[code])
response["result"]
end
eth_estimateGas(trans_object) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_estimategas

# File eth_calls.rb, line 153
def eth_estimateGas(trans_object)
  response = do_request("eth_estimateGas",[trans_object])
  response["result"]
end
eth_gasPrice() click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_gasprice

# File eth_calls.rb, line 33
def eth_gasPrice()
response = do_request("eth_gasPrice")
to_decimal response["result"]
end
eth_getBalance(address, block = "latest") click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getbalance

# File eth_calls.rb, line 51
def eth_getBalance(address, block = "latest")
response = do_request("eth_getBalance",[address, block])
to_decimal response["result"]
end
eth_getBlockByHash(hash, full_transactions = true) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getblockbyhash

# File eth_calls.rb, line 159
def eth_getBlockByHash(hash, full_transactions = true)
response = do_request("eth_getBlockByHash",[hash, full_transactions])
response["result"]
end
eth_getBlockByNumber(number, full_transactions = true) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getblockbynumber

# File eth_calls.rb, line 165
def eth_getBlockByNumber(number, full_transactions = true)
response = do_request("eth_getBlockByNumber",[number, full_transactions])
response["result"]
end
eth_getBlockTransactionCountByHash(data) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getblocktransactioncountbyhash

# File eth_calls.rb, line 69
def eth_getBlockTransactionCountByHash(data)
response = do_request("eth_getBlockTransactionCountByHash",[data])
to_decimal response["result"]
end
eth_getBlockTransactionCountByNumber(block = "latest") click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getblocktransactioncountbynumber

# File eth_calls.rb, line 75
def eth_getBlockTransactionCountByNumber(block = "latest")
response = do_request("eth_getBlockTransactionCountByNumber",[block])
to_decimal response["result"]
end
eth_getCode(address, block = "latest") click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getcode

# File eth_calls.rb, line 93
def eth_getCode(address, block = "latest")
response = do_request("eth_getCode",[address, block])
response["result"]
end
eth_getCompilers() click to toggle source

deprecated See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getcompilers

# File eth_calls.rb, line 208
def eth_getCompilers()
response = do_request("eth_getCompilers")
response["result"]
end
eth_getFilterChanges(id) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getfilterchanges

# File eth_calls.rb, line 259
def eth_getFilterChanges(id)
response = do_request("eth_getFilterChanges",[id])
response["result"]
end
eth_getFilterLogs(id) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getfilterlogs

# File eth_calls.rb, line 265
def eth_getFilterLogs(id)
response = do_request("eth_getFilterLogs",[id])
response["result"]
end
eth_getLogs(filter_obj) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getlogs

# File eth_calls.rb, line 271
def eth_getLogs(filter_obj)
response = do_request("eth_getLogs",[filter_obj])
response["result"]
end
eth_getStorageAt(storage_address, position, block = "latest") click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getstorageat

# File eth_calls.rb, line 57
def eth_getStorageAt(storage_address, position, block = "latest")
response = do_request("eth_getStorageAt",[storage_address, to_hex(position), block])
response["result"]
end
eth_getTransactionByBlockHashAndIndex(hash, index) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactionbyblockhashandindex

# File eth_calls.rb, line 177
def eth_getTransactionByBlockHashAndIndex(hash, index)
response = do_request("eth_getTransactionByBlockHashAndIndex",[hash, index])
response["result"]
end
eth_getTransactionByBlockNumberAndIndex(number, index) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactionbyblocknumberandindex

# File eth_calls.rb, line 183
def eth_getTransactionByBlockNumberAndIndex(number, index)
response = do_request("eth_getTransactionByBlockNumberAndIndex",[number, index])
response["result"]
end
eth_getTransactionByHash(hash) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactionbyhash

# File eth_calls.rb, line 171
def eth_getTransactionByHash(hash)
response = do_request("eth_getTransactionByHash",[hash])
response["result"]
end
eth_getTransactionCount(address, block = "latest") click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactioncount

# File eth_calls.rb, line 63
def eth_getTransactionCount(address, block = "latest")
response = do_request("eth_getTransactionCount",[address, block])
to_decimal response["result"]
end
eth_getTransactionReceipt(hash) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactionreceipt

# File eth_calls.rb, line 189
def eth_getTransactionReceipt(hash)
response = do_request("eth_getTransactionReceipt",[hash])
response["result"]
end
eth_getUncleByBlockHashAndIndex(hash, index) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getunclebyblockhashandindex

# File eth_calls.rb, line 195
def eth_getUncleByBlockHashAndIndex(hash, index)
response = do_request("eth_getUncleByBlockHashAndIndex",[hash, index])
response["result"]
end
eth_getUncleByBlockNumberAndIndex(number, index) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getunclebyblocknumberandindex

# File eth_calls.rb, line 201
def eth_getUncleByBlockNumberAndIndex(number, index)
response = do_request("eth_getUncleByBlockNumberAndIndex",[number, index])
response["result"]
end
eth_getUncleCountByBlockHash(data) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getunclecountbyblockhash

# File eth_calls.rb, line 81
def eth_getUncleCountByBlockHash(data)
response = do_request("eth_getUncleCountByBlockHash",[data])
to_decimal response["result"]
end
eth_getUncleCountByBlockNumber(data) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getunclecountbyblocknumber

# File eth_calls.rb, line 87
def eth_getUncleCountByBlockNumber(data)
response = do_request("eth_getUncleCountByBlockNumber",[data])
to_decimal response["result"]
end
eth_getWork() click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_getwork

# File eth_calls.rb, line 277
def eth_getWork()
response = do_request("eth_getWork")
response["result"]
end
eth_hashrate() click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_hashrate

# File eth_calls.rb, line 27
def eth_hashrate()
response = do_request("eth_hashrate")
to_decimal response["result"]
end
eth_mining() click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_mining

# File eth_calls.rb, line 21
def eth_mining()
response = do_request("eth_mining")
response["result"]
end
eth_newBlockFilter() click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_newblockfilter

# File eth_calls.rb, line 241
def eth_newBlockFilter()
response = do_request("eth_newBlockFilter")
to_decimal response["result"]
end
eth_newFilter(fromBlock, toBlock, address, topics) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_newfilter

# File eth_calls.rb, line 235
def eth_newFilter(fromBlock, toBlock, address, topics)
response = do_request("$CODE",[fromBlock, toBlock, address, topics])
to_decimal response["result"]
end
eth_newPendingTransactionFilter() click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_newpendingtransactionfilter

# File eth_calls.rb, line 247
def eth_newPendingTransactionFilter()
response = do_request("eth_newPendingTransactionFilter")
to_decimal response["result"]
end
eth_pendingTransactions() click to toggle source

Returns pending transactions that belong to any of the users accounts See github.com/ethereum/go-ethereum/wiki/JavaScript-Console#ethpendingtransactions

# File eth_calls.rb, line 121
def eth_pendingTransactions()
  response = do_request("eth_pendingTransactions")
  response["result"]
end
eth_protocolVersion() click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_protocolversion

# File eth_calls.rb, line 4
def eth_protocolVersion()
raise NotImplementedError.new "JSON-RPC call to eth_protocolVersion is not currently supported"
end
eth_resend(pending_transaction, gasPrice=nil, gasLimit=nil) click to toggle source

Resends a transaction. These can ge retrieved from #eth_pendingTransactions(). gasPrice and gasLimit can be included together if the gas settings are being changed from their original settings in the pending_transaction object See github.com/ethereum/go-ethereum/wiki/JavaScript-Console#ethresend

# File eth_calls.rb, line 130
def eth_resend(pending_transaction, gasPrice=nil, gasLimit=nil)
  package = [pending_transaction]
  if gasPrice != nil
    package += [gasPrice, gasLimit]
  end
  response = do_request("eth_resend", package)
  response["result"]
end
eth_sendRawTransaction(data) click to toggle source

This sends a transaction that looks something like this: See github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendrawtransaction

# File eth_calls.rb, line 141
def eth_sendRawTransaction(data)
  response = do_request("eth_sendRawTransaction",[data])
  response["result"]
end
eth_sendTransaction(transaction_object) click to toggle source

Sends a transaction for posting to the ethereum network. The transaction_object that is sent should look something like this:

{"from"=> accounts[0],  "to" => accounts[1],  "value" => w3.ether_to_0xwei(0.001)}

Other 0x-fomatted attributes that can be included in the transaction_object are:

"data"                                  : formatted as hex
"gas", "gasPrice", "value", and "nonce" : formatted as "0x" + hex

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendtransaction

# File eth_calls.rb, line 114
def eth_sendTransaction(transaction_object)
  response = do_request("eth_sendTransaction",[transaction_object])
  response["result"]
end
eth_sign(address, data) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign

# File eth_calls.rb, line 99
def eth_sign(address, data)
response = do_request("eth_sign",[address, data])
response["result"]
end
eth_submitHashrate(hashrate, id) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_submithashrate

# File eth_calls.rb, line 289
def eth_submitHashrate(hashrate, id)
response = do_request("eth_submitHashrate",[hashrate, id])
response["result"]
end
eth_submitWork(nonce, powHash, mixDigest) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_submitwork

# File eth_calls.rb, line 283
def eth_submitWork(nonce, powHash, mixDigest)
response = do_request("eth_submitWork",[nonce, powHash, mixDigest])
response["result"]
end
eth_syncing() click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_syncing

# File eth_calls.rb, line 9
def eth_syncing()
response = do_request("eth_syncing")
response["result"]
end
eth_uninstallFilter(id) click to toggle source

See github.com/ethereum/wiki/wiki/JSON-RPC#eth_uninstallfilter

# File eth_calls.rb, line 253
def eth_uninstallFilter(id)
response = do_request("eth_uninstallFilter",[id])
response["result"]
end