GetCode
Get the code at a specific address.
String
- The address to get the code from.
String
- Block to query for information. Usually latest
, which specifies the most recent block.
Function
- (optional) Optional callback, returns an error object as first parameter and the result as second.
String
- The data at given address address
.
Sample Curl Request
Sample Curl Response
hmy_getStorageAt
Returns the value from a storage position at a given address.
Parameters
DATA
, 20 Bytes - address of the storage.
QUANTITY
- integer of the position in the storage.
QUANTITY|TAG
- integer block number, or the string "latest"
, "earliest"
or "pending"
Returns
DATA
- the value at this storage position.
Example
Calculating the correct position depends on the storage to retrieve. Consider the following contract deployed at 0x295a70b2de5e3953354a6a8344e616ed314d7251
by address 0x391694e7e0b0cce554cb130d723a9d27458f9298
.
Retrieving the value of pos0 is straight forward:
hmy_estimateGas
Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain.
Parameters
See hmy_call parameters, expect that all properties are optional. If no gas limit is specified geth uses the block gas limit from the pending block as an upper bound. As a result the returned estimate might not be enough to executed the call/transaction when the amount of gas is higher than the pending block gas limit.
Returns
QUANTITY
- the amount of gas used.
Example
hmy_call
Executes a new message call immediately without creating a transaction on the block chain.
Parameters
Object
- The transaction call object
from
: DATA
, 20 Bytes - (optional) The address the transaction is sent from.
to
: DATA
, 20 Bytes - The address the transaction is directed to.
gas
: QUANTITY
- (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.
gasPrice
: QUANTITY
- (optional) Integer of the gasPrice used for each paid gas
value
: QUANTITY
- (optional) Integer of the value sent with this transaction
data
: DATA
- (optional) Hash of the method signature and encoded parameters.
QUANTITY|TAG
- integer block number, or the string "latest"
, "earliest"
or "pending"
Returns
DATA
- the return value of executed contract.
Example