JSON-RPC Endpoints
Ethereum (eth_) Endpoints

Ethereum (eth_) endpoints in Frietor Chains

eth_chainId

Returns the currently configured chain id, a value used in replay-protected transaction signing as introduced by EIP-155.

Parameters

  • None

Returns

  • QUANTITY - big integer of the current chain id.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' https://rpc.saar.frietor.network

eth_syncing

Returns information about the sync status of the node

Parameters

  • None

Returns

  • Boolean (FALSE) - if the node isn't syncing (which means it has fully synced)

  • Object - an object with sync status data if the node is syncing _ startingBlock: QUANTITY - The block at which the import started (will only be reset, after the sync reached his head) _ currentBlock: QUANTITY - The current block, same as eth_blockNumber * highestBlock: QUANTITY - The estimated highest block

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' https://rpc.saar.frietor.network

eth_getBlockByNumber

Returns block information by number.

Parameters

  • QUANTITY|TAG - integer of a block number, or the string "latest"
  • 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:

  • number: QUANTITY - the block number.
  • hash: DATA, 32 Bytes - hash of the block.
  • parentHash: DATA, 32 Bytes - hash of the parent block.
  • nonce: DATA, 8 Bytes - hash of the generated proof-of-work.
  • sha3Uncles: DATA, 32 Bytes - SHA3 of the uncles data in the block.
  • logsBloom: DATA, 256 Bytes - the bloom filter for the logs of the block.
  • transactionsRoot: DATA, 32 Bytes - the root of the transaction trie of the block.
  • stateRoot: DATA, 32 Bytes - the root of the final state trie of the block.
  • receiptsRoot: DATA, 32 Bytes - the root of the receipts trie of the block.
  • miner: DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.
  • difficulty: QUANTITY - integer of the difficulty for this block.
  • totalDifficulty: QUANTITY - integer of the total difficulty of the chain until this block.
  • extraData: DATA - the “extra data” field of this block.
  • size: QUANTITY - integer the size of this block in bytes.
  • gasLimit: QUANTITY - the maximum gas allowed in this block.
  • gasUsed: QUANTITY - the total used gas by all transactions in this block.
  • timestamp: QUANTITY - the unix timestamp for when the block was collated.
  • transactions: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
  • uncles: Array - Array of uncle hashes.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1b4", true],"id":1}' https://rpc.saar.frietor.network

This example will return data for the block with number 436.

eth_getBlockByHash

Returns block information 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:

  • number: QUANTITY - the block number. null when its pending block.
  • hash: DATA, 32 Bytes - hash of the block. null when its pending block.
  • parentHash: DATA, 32 Bytes - hash of the parent block.
  • nonce: DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block.
  • sha3Uncles: DATA, 32 Bytes - SHA3 of the uncles data in the block.
  • logsBloom: DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block.
  • transactionsRoot: DATA, 32 Bytes - the root of the transaction trie of the block.
  • stateRoot: DATA, 32 Bytes - the root of the final state trie of the block.
  • receiptsRoot: DATA, 32 Bytes - the root of the receipts trie of the block.
  • miner: DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.
  • difficulty: QUANTITY - integer of the difficulty for this block.
  • totalDifficulty: QUANTITY - integer of the total difficulty of the chain until this block.
  • extraData: DATA - the “extra data” field of this block.
  • size: QUANTITY - integer the size of this block in bytes.
  • gasLimit: QUANTITY - the maximum gas allowed in this block.
  • gasUsed: QUANTITY - the total used gas by all transactions in this block.
  • timestamp: QUANTITY - the unix timestamp for when the block was collated.
  • transactions: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
  • uncles: Array - Array of uncle hashes.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0x6fd9e2a8e9b6d20c2c3d3b0e7e7d6b2057b1c9b2d0b9b6b9b6b9b6b9b6b9b6b9", true],"id":1}' https://rpc.saar.frietor.network

This example will return data for the block with hash 0x6fd9e2a8e9b6d20c2c3d3b0e7e7d6b2057b1c9b2d0b9b6b9b6b9b6b9b6b9b6b9.

eth_blockNumber

Returns the number of most recent block.

Parameters

  • None

Returns

  • QUANTITY - integer of the current block number the client is on.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' https://rpc.saar.frietor.network

eth_gasPrice

Returns the current price per gas in wei.

Parameters

  • None

Returns

  • QUANTITY - integer of the current gas price in wei.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":1}' https://rpc.saar.frietor.network

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

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"],"id":1}' https://rpc.saar.frietor.network

This example will return the current balance for the given address : 0x407d73d8a49eeb85d32cf465507dd71d507100c1

eth_sendRawTransaction

Creates new message call transaction or a contract creation, if the data field contains code.

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

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xf904808000831cfde080"],"id":1}' https://rpc.saar.frietor.network

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:

  • hash: DATA, 32 Bytes - hash of the transaction.
  • nonce: QUANTITY - the number of transactions made by the sender prior to this one.
  • blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. null when its pending.
  • blockNumber: QUANTITY - block number where this transaction was in. null when its pending.
  • transactionIndex: QUANTITY - integer of the transactions index position in the block. null when its pending.
  • from: DATA, 20 Bytes - address of the sender.
  • to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction.
  • value: QUANTITY - value transferred in Wei.
  • gasPrice: QUANTITY - gas price provided by the sender in Wei.
  • gas: QUANTITY - gas provided by the sender.
  • input: DATA - the data send along with the transaction.
  • v: QUANTITY - ECDSA recovery id
  • r: DATA, 32 Bytes - ECDSA signature r
  • s: DATA, 32 Bytes - ECDSA signature s

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x3f7b...", "latest"],"id":1}' https://rpc.saar.frietor.network

This example will return the information about the transaction with hash 0x3f7b...

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:

  • transactionHash: DATA, 32 Bytes - hash of the transaction.
  • transactionIndex: QUANTITY - integer of the transactions index position in the block.
  • blockHash: DATA, 32 Bytes - hash of the block where this transaction was in.
  • blockNumber: QUANTITY - block number where this transaction was in.
  • from: DATA, 20 Bytes - address of the sender.
  • to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction.
  • cumulativeGasUsed: QUANTITY - The total amount of gas used when this transaction was executed in the block.
  • gasUsed: QUANTITY - The amount of gas used by this specific transaction alone.
  • contractAddress: DATA, 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null.
  • logs: Array - Array of log objects, which this transaction generated.
  • logsBloom: DATA, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs.
  • status: QUANTITY either 1 (success) or 0 (failure)
  • root: DATA 32 bytes of post-transaction stateroot (pre Byzantium)
  • cumulativeGasUsed: QUANTITY The total amount of gas used when this transaction was executed in the block.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0xb90b...", "latest"],"id":1}' https://rpc.saar.frietor.network

This example will return the information about the transaction receipt with hash 0xb90b...

eth_getTransactionCount

Returns the number of transactions sent from an address.

Parameters

  • DATA, 20 Bytes - address.

Returns

  • QUANTITY - integer of the number of transactions send from this address.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"],"id":1}' https://rpc.saar.frietor.network

This example will return the number of transactions sent from the address 0x407d73d8a49eeb85d32cf465507dd71d507100c1.

eth_getBlockTransactionCountByNumber

Returns the number of transactions in a block from a block matching the given block number.

Parameters

  • QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in the default block parameter.

Returns

  • QUANTITY - integer of the number of transactions in this block.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNumber","params":["0x10d4f"],"id":1}' https://rpc.saar.frietor.network

This example will return the number of transactions in block 433.

eth_getLogs

Returns an array of all logs matching a given filter object.

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. Topics are order-dependent. Each topic can also be an array of DATA with "or" options.
  • blockhash: DATA, 32 Bytes - (optional) With the addition of EIP-234 (Geth >= v1.8.13 or Parity >= v2.1.0), blockHash is a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash as a filter option does not retrieve the associated block.

Returns

Array - Array of log objects, or an empty array if nothing has changed since last poll:

  • removed: TAG - true when the log was removed, due to a chain reorganization. false if its a valid log.
  • logIndex: QUANTITY - integer of the log index position in the block. null when its pending log.
  • transactionIndex: QUANTITY - integer of the transactions index position log was created from. null when its pending log.
  • transactionHash: DATA, 32 Bytes - hash of the transactions this log was created from. null when its pending log.
  • blockHash: DATA, 32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log.
  • blockNumber: QUANTITY - the block number where this log was in. null when its pending. null when its pending log.
  • address: DATA, 20 Bytes - address from which this log originated.
  • data: DATA - contains one or more 32 Bytes non-indexed arguments of the log.
  • topics: Array of DATA - Array of 0 to 4 32 Bytes DATA of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.)

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x1234567890123456789012345678901234567891", "topics": ["0x12341234"]}],"id":1}' https://rpc.saar.frietor.network

This example will return all logs matching the filter criteria, from block 1 to block 2 and filtered by an address and topics.

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

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getCode","params":["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"],"id":1}' https://rpc.saar.frietor.network

This example will return the code at address 0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b.

eth_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. For details see Ethereum Contract ABI in the Solidity documentation
  • nonce: QUANTITY - (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.
  • QUANTITY|TAG - integer block number, or the string "latest", "earliest" or "pending", see the default block parameter

Returns

  • DATA - the return value of executed contract.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x2f015e6b1a7a9b6c3d6dd3a0d2e0b6d9a5b2e0b6","data":"0x70a08231000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"},"latest"],"id":1}' https://rpc.saar.frietor.network

This example will return the data at position 0x0 of the storage of address 0x2f015e6b1a7a9b6c3d6dd3a0d2e0b6d9a5b2e0b6.

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", see the default block parameter

Returns

  • DATA - the value at this storage position.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getStorageAt","params":["0x2f015e6b1a7a9b6c3d6dd3a0d2e0b6d9a5b2e0b6", "0x0", "latest"],"id":1}' https://rpc.saar.frietor.network

This example will return the value at position 0x0 of the storage of address 0x2f015e6b1a7a9b6c3d6dd3a0d2e0b6d9a5b2e0b6.

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 - 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. For details see Ethereum Contract ABI in the Solidity documentations
  • QUANTITY|TAG - integer block number, or the string "latest", "earliest" or "pending", see the default block parameter

Returns

  • QUANTITY - the amount of gas used.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_estimateGas","params":[{"from":"0x2f015e6b1a7a9b6c3d6dd3a0d2e0b6d9a5b2e0b6","to":"0x2f015e6b1a7a9b6c3d6dd3a0d2e0b6d9a5b2e0b6","data":"0x70a08231000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"},"latest"],"id":1}' https://rpc.saar.frietor.network

This example will return the amount of gas used for the hypothetical call of eth_call/eth_sendTransaction.

eth_newFilter

Creates a filter object, based on filter options, to notify when the state changes (logs). To check if the state has changed, call eth_getFilterChanges.

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. Topics are order-dependent. Each topic can also be an array of DATA with "or" options.

Returns

  • QUANTITY - A filter id.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newFilter","params":[{"topics":["0x12341234"]}],"id":73}' https://rpc.saar.frietor.network

This example will return a filter id for the given filter options, which should be used to call eth_getFilterChanges.

eth_newBlockFilter

Creates a filter in the node, to notify when a new block arrives. To check if the state has changed, call eth_getFilterChanges.

Parameters

  • None

Returns

  • QUANTITY - A filter id.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newBlockFilter","params":[],"id":73}' https://rpc.saar.frietor.network

eth_getFilterLogs

Returns an array of all logs matching filter with given id.

Parameters

  • QUANTITY - The filter id.

Returns

Array - Array of log objects, or an empty array if nothing has changed since last poll.

  • removed: TAG - true when the log was removed, due to a chain reorganization. false if its a valid log.
  • logIndex: QUANTITY - integer of the log index position in the block. null when its pending log.
  • transactionIndex: QUANTITY - integer of the transactions index position log was created from. null when its pending log.
  • transactionHash: DATA, 32 Bytes - hash of the transactions this log was created from. null when its pending log.
  • blockHash: DATA, 32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log.
  • blockNumber: QUANTITY - the block number where this log was in. null when its pending. null when its pending log.
  • address: DATA, 20 Bytes - address from which this log originated.
  • data: DATA - contains one or more 32 Bytes non-indexed arguments of the log.
  • topics: Array of DATA - Array of 0 to 4 32 Bytes DATA of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.)

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getFilterLogs","params":["0x16"],"id":73}' https://rpc.saar.frietor.network

This example will return the logs matching filter with id 0x16.

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.

  • removed: TAG - true when the log was removed, due to a chain reorganization. false if its a valid log.
  • logIndex: QUANTITY - integer of the log index position in the block. null when its pending log.
  • transactionIndex: QUANTITY - integer of the transactions index position log was created from. null when its pending log.
  • transactionHash: DATA, 32 Bytes - hash of the transactions this log was created from. null when its pending log.
  • blockHash: DATA, 32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log.
  • blockNumber: QUANTITY - the block number where this log was in. null when its pending. null when its pending log.
  • address: DATA, 20 Bytes - address from which this log originated.
  • data: DATA - contains one or more 32 Bytes non-indexed arguments of the log.
  • topics: Array of DATA - Array of 0 to 4 32 Bytes DATA of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.)

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getFilterChanges","params":["0x16"],"id":73}' https://rpc.saar.frietor.network

This example will return the logs matching filter with id 0x16 which occurred since last poll.

eth_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 eth_getFilterChanges for a period of time.

Parameters

  • QUANTITY - The filter id.

Returns

  • Boolean - true if the filter was successfully uninstalled, otherwise false.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_uninstallFilter","params":["0xb"],"id":73}' https://rpc.saar.frietor.network

This example will return the boolean true if the filter with id 0xb was successfully uninstalled, otherwise false.

eth_unsubscribe

Subscriptions are cancelled with a regular RPC call with eth_unsubscribe as a method and the subscription id as the first parameter. It returns a bool indicating if the subscription was cancelled successfully.

Parameters

  • QUANTITY - The subscription id.

Returns

  • Boolean - true if the subscription was successfully cancelled, otherwise false.

Example

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_unsubscribe","params":["0xb"],"id":73}' https://rpc.saar.frietor.network

This example will return the boolean true if the subscription with id 0xb was successfully cancelled, otherwise false.