Available Methods
Here is the complete list of JSON-RPC methods available in the Winnie API:Chain Methods
eth_blockNumber
Returns the number of the most recent block. Parameters:- None
QUANTITY- integer of the current block number the client is on
eth_chainId
Returns the chain ID of the current network. Parameters:- None
QUANTITY- integer of the current chain ID
eth_syncing
Returns an object with data about the sync status or false. Parameters:- None
Object|Boolean- An object with sync status data or false
State Methods
eth_getBalance
Returns the balance of the account of given address. Parameters:DATA, 20 Bytes - address to check for balanceQUANTITY|TAG- integer block number, or the string “latest”, “earliest” or “pending”
QUANTITY- integer of the current balance in wei
eth_getStorageAt
Returns the value from a storage position at a given address. Parameters:DATA, 20 Bytes - address of the storageQUANTITY- integer of the position in the storageQUANTITY|TAG- integer block number, or the string “latest”, “earliest” or “pending”
DATA- the value at this storage position
eth_getTransactionCount
Returns the number of transactions sent from an address. Parameters:DATA, 20 Bytes - addressQUANTITY|TAG- integer block number, or the string “latest”, “earliest” or “pending”
QUANTITY- integer of the number of transactions send from this address
eth_getCode
Returns code at a given address. Parameters:DATA, 20 Bytes - addressQUANTITY|TAG- integer block number, or the string “latest”, “earliest” or “pending”
DATA- the code from the given address
Block Methods
eth_getBlockByHash
Returns information about a block by hash. Parameters:DATA, 32 Bytes - Hash of a blockBoolean- If true it returns the full transaction objects, if false only the hashes of the transactions
Object- A block object, or null when no block was found
eth_getBlockByNumber
Returns information about a block by block number. Parameters:QUANTITY|TAG- integer of a block number, or the string “latest”, “earliest” or “pending”Boolean- If true it returns the full transaction objects, if false only the hashes of the transactions
Object- A block object, or null when no block was found
Transaction Methods
eth_getTransactionByHash
Returns the information about a transaction requested by transaction hash. Parameters:DATA, 32 Bytes - hash of a transaction
Object- A transaction object, or null when no transaction was found
eth_getTransactionByBlockHashAndIndex
Returns information about a transaction by block hash and transaction index position. Parameters:DATA, 32 Bytes - hash of a blockQUANTITY- integer of the transaction index position
Object- A transaction object, or null when no transaction was found
eth_getTransactionReceipt
Returns the receipt of a transaction by transaction hash. Parameters:DATA, 32 Bytes - hash of a transaction
Object- A transaction receipt object, or null when no receipt was found
Account Methods
eth_accounts
Returns a list of addresses owned by client. Parameters:- None
Array of DATA, 20 Bytes - addresses owned by the client
eth_sign
Signs data with a given address. Parameters:DATA, 20 Bytes - addressDATA- message to sign
DATA- signature
Gas Methods
eth_gasPrice
Returns the current price per gas in wei. Parameters:- None
QUANTITY- integer of the current gas price in wei
eth_estimateGas
Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. Parameters:Object- The transaction call objectfrom: DATA, 20 Bytes - (optional) The address the transaction is sent fromto: DATA, 20 Bytes - (optional) The address the transaction is directed togas: QUANTITY - (optional) Integer of the gas provided for the transaction executiongasPrice: QUANTITY - (optional) Integer of the gasPrice used for each paid gasvalue: QUANTITY - (optional) Integer of the value sent with this transactiondata: DATA - (optional) Hash of the method signature and encoded parameters
QUANTITY- the amount of gas used
Transaction Methods
eth_sendTransaction
Creates new message call transaction or a contract creation. Parameters:Object- The transaction objectfrom: DATA, 20 Bytes - The address the transaction is sent fromto: DATA, 20 Bytes - (optional) The address the transaction is directed togas: QUANTITY - (optional) Integer of the gas provided for the transaction executiongasPrice: QUANTITY - (optional) Integer of the gasPrice used for each paid gasvalue: QUANTITY - (optional) Integer of the value sent with this transactiondata: DATA - (optional) Hash of the method signature and encoded parametersnonce: QUANTITY - (optional) Integer of a nonce
DATA, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available
eth_sendRawTransaction
Creates new message call transaction or a contract creation for signed transactions. Parameters:DATA- The signed transaction data
DATA, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available
Filter Methods
eth_newFilter
Creates a filter object, based on filter options, to notify when the state changes. Parameters:Object- The filter optionsfromBlock: QUANTITY|TAG - (optional, default: “latest”) Integer block number, or “latest” for the last mined block or “pending”, “earliest” for not yet mined transactionstoBlock: QUANTITY|TAG - (optional, default: “latest”) Integer block number, or “latest” for the last mined block or “pending”, “earliest” for not yet mined transactionsaddress: DATA|Array, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originatetopics: Array of DATA, - (optional) Array of 32 Bytes DATA topics
QUANTITY- A filter id
eth_getFilterChanges
Polling method for a filter, which returns an array of logs which occurred since last poll. Parameters:QUANTITY- the filter id
Array- Array of log objects, or an empty array if nothing has changed since last poll
eth_getFilterLogs
Returns an array of all logs matching filter with given id. Parameters:QUANTITY- the filter id
Array- Array of log objects
eth_getLogs
Returns an array of all logs matching a given filter object. Parameters:Object- The filter options (same as eth_newFilter)
Array- Array of log objects
eth_uninstallFilter
Uninstalls a filter with given id. Parameters:QUANTITY- the filter id
Boolean- true if the filter was successfully uninstalled, otherwise false