JSON-RPC methods
Scroll RPC
You can review the official Scroll RPC documentation HERE
Example RPC
curl https://api.chainup.net/scroll/mainnet/<YOUR_API_KEY> \
-X POST \
-H 'content-type: application/json' \
-H "CONSISTENT-HASH: true" \
---data '{"jsonrpc":"2.0","method":"getblock","params":[],"id":1}' const axios = require('axios');
//npm install axios if you don have the module installed`
let options = {
url: "https://api.chainup.net/scroll/mainnet/<YOUR_API_KEY>",
method: "post",
headers:
{
"content-type": "application/json"
},
body: JSON.stringify({"jsonrpc":"2.0","method":"getblock","params":[],"id":1})
};
axios(options)
.then(response => {
console.log('Post successful: response:', response.data);
})
.catch(error => {
console.error('An error has occurred:', error);
});Scroll Methods supported
web3_clientVersionβ returns the current client version.web3_sha3β returns Keccak-256 (not the standardized SHA3-256) of the given data.net_versionβ returns the current network ID.net_listeningβ returns true if client is actively listening for network connections.eth_syncingβ returns data on the sync status or false.eth_gasPriceβ returns the current price per gas in wei.eth_accountsβ returns a list of addresses owned by client.eth_blockNumberβ returns the number of most recent block.eth_getBalanceβ returns the balance of the account specified by address.eth_getStorageAtβ returns the value from a storage position at an address specified.eth_getTransactionCountβ returns the number of transactions sent from an address.eth_getBlockTransactionCountByHashβ returns the number of transactions in a block specified by block hash.eth_getBlockTransactionCountByNumberβ returns the number of transactions in the block specified by number.eth_getUncleCountByBlockHashβ returns the number of uncles in a block specified by block hash.eth_getUncleCountByBlockNumberβ returns the number of uncles in a block specified by block number.eth_getCodeβ returns code at an address specified.eth_sendRawTransactionβ creates a new message call transaction or a contract creation for signed transactions.eth_callβ executes a new message call immediately without creating a transaction on the blockchain.eth_estimateGasβ generates and returns an estimate of how much gas is necessary to allow the transaction to complete.eth_getBlockByHashβ returns information for the block specified by block hash.eth_getBlockByNumberβ returns information for the block specified by block number.eth_getTransactionByHashβ returns information on a transaction specified by transaction hash.eth_getTransactionByBlockHashAndIndexβ returns information on a transaction specified by block hash and transaction index position.eth_getTransactionByBlockNumberAndIndexβ returns information on a transaction by block number and transaction index position.eth_getTransactionReceiptβ returns the receipt of a transaction by transaction hash.eth_getUncleByBlockHashAndIndexβ returns information about an uncle of a block by hash and uncle index position.eth_getUncleByBlockNumberAndIndexβ returns information about an uncle of a block by number and uncle index position.eth_getLogsβ returns logs matching the parameters specified.
Last updated
Was this helpful?