Skip to main content

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
Returns:
  • QUANTITY - integer of the current block number the client is on
Example:

eth_chainId

Returns the chain ID of the current network. Parameters:
  • None
Returns:
  • QUANTITY - integer of the current chain ID
Example:

eth_syncing

Returns an object with data about the sync status or false. Parameters:
  • None
Returns:
  • Object|Boolean - An object with sync status data or false
Example:

State Methods

eth_getBalance

Returns the balance of the account of given address. Parameters:
  • DATA, 20 Bytes - address to check for balance
  • QUANTITY|TAG - integer block number, or the string “latest”, “earliest” or “pending”
Returns:
  • QUANTITY - integer of the current balance in wei
Example:

eth_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:

eth_getTransactionCount

Returns the number of transactions sent from an address. Parameters:
  • DATA, 20 Bytes - address
  • QUANTITY|TAG - integer block number, or the string “latest”, “earliest” or “pending”
Returns:
  • QUANTITY - integer of the number of transactions send from this address
Example:

eth_getCode

Returns code at a given address. Parameters:
  • DATA, 20 Bytes - address
  • QUANTITY|TAG - integer block number, or the string “latest”, “earliest” or “pending”
Returns:
  • DATA - the code from the given address
Example:

Block Methods

eth_getBlockByHash

Returns information about a block by hash. Parameters:
  • DATA, 32 Bytes - Hash of a block
  • Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions
Returns:
  • Object - A block object, or null when no block was found
Example:

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
Returns:
  • Object - A block object, or null when no block was found
Example:

Transaction Methods

eth_getTransactionByHash

Returns the information about a transaction requested by transaction hash. Parameters:
  • DATA, 32 Bytes - hash of a transaction
Returns:
  • Object - A transaction object, or null when no transaction was found
Example:

eth_getTransactionByBlockHashAndIndex

Returns information about a transaction by block hash and transaction index position. Parameters:
  • DATA, 32 Bytes - hash of a block
  • QUANTITY - integer of the transaction index position
Returns:
  • Object - A transaction object, or null when no transaction was found
Example:

eth_getTransactionReceipt

Returns the receipt of a transaction by transaction hash. Parameters:
  • DATA, 32 Bytes - hash of a transaction
Returns:
  • Object - A transaction receipt object, or null when no receipt was found
Example:

Account Methods

eth_accounts

Returns a list of addresses owned by client. Parameters:
  • None
Returns:
  • Array of DATA, 20 Bytes - addresses owned by the client
Example:

eth_sign

Signs data with a given address. Parameters:
  • DATA, 20 Bytes - address
  • DATA - message to sign
Returns:
  • DATA - signature
Example:

Gas Methods

eth_gasPrice

Returns the current price per gas in wei. Parameters:
  • None
Returns:
  • QUANTITY - integer of the current gas price in wei
Example:

eth_estimateGas

Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. Parameters:
  • Object - The transaction call object
    • from: DATA, 20 Bytes - (optional) The address the transaction is sent from
    • to: DATA, 20 Bytes - (optional) The address the transaction is directed to
    • gas: QUANTITY - (optional) Integer of the gas provided for the transaction execution
    • 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
Returns:
  • QUANTITY - the amount of gas used
Example:

Transaction Methods

eth_sendTransaction

Creates new message call transaction or a contract creation. Parameters:
  • Object - The transaction object
    • from: DATA, 20 Bytes - The address the transaction is sent from
    • to: DATA, 20 Bytes - (optional) The address the transaction is directed to
    • gas: QUANTITY - (optional) Integer of the gas provided for the transaction execution
    • 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
    • nonce: QUANTITY - (optional) Integer of a nonce
Returns:
  • DATA, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available
Example:

eth_sendRawTransaction

Creates new message call transaction or a contract creation for signed transactions. Parameters:
  • DATA - The signed transaction data
Returns:
  • DATA, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available
Example:

Filter Methods

eth_newFilter

Creates a filter object, based on filter options, to notify when the state changes. Parameters:
  • Object - The filter options
    • fromBlock: QUANTITY|TAG - (optional, default: “latest”) Integer block number, or “latest” for the last mined block or “pending”, “earliest” for not yet mined transactions
    • toBlock: QUANTITY|TAG - (optional, default: “latest”) Integer block number, or “latest” for the last mined block or “pending”, “earliest” for not yet mined transactions
    • address: DATA|Array, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate
    • topics: Array of DATA, - (optional) Array of 32 Bytes DATA topics
Returns:
  • QUANTITY - A filter id
Example:

eth_getFilterChanges

Polling method for a filter, which returns an array of logs which occurred since last poll. Parameters:
  • QUANTITY - the filter id
Returns:
  • Array - Array of log objects, or an empty array if nothing has changed since last poll
Example:

eth_getFilterLogs

Returns an array of all logs matching filter with given id. Parameters:
  • QUANTITY - the filter id
Returns:
  • Array - Array of log objects
Example:

eth_getLogs

Returns an array of all logs matching a given filter object. Parameters:
  • Object - The filter options (same as eth_newFilter)
Returns:
  • Array - Array of log objects
Example:

eth_uninstallFilter

Uninstalls a filter with given id. Parameters:
  • QUANTITY - the filter id
Returns:
  • Boolean - true if the filter was successfully uninstalled, otherwise false
Example: