Web3API
HomeAPI EndpointsContactTwitter
  • ​🚀 Welcome to Web3API
  • Introduction
    • ✨Getting Started
    • 📡 Choosing A Network
  • Developers
    • 🔌API Endpoints
      • eth_hashrate
      • eth_gasPrice
      • eth_blockNumber
      • eth_getBalance
      • eth_getStorageAt
      • eth_getTransactionCount
      • eth_getBlockTransactionCountByHash
      • eth_getBlockTransactionCountByNumber
      • eth_getCode
      • eth_sendRawTransaction
      • eth_call
      • eth_getBlockByHash
      • eth_getBlockByNumber
      • eth_getTransactionByHash
      • eth_getTransactionByBlockHashAndIndex
      • eth_getTransactionByBlockNumberAndIndex
      • eth_getTransactionReceipt
      • eth_getUncleByBlockHashAndIndex
      • eth_getUncleByBlockNumberAndIndex
      • eth_getUncleCountByBlockHash
      • eth_getUncleCountByBlockNumber
      • eth_estimateGas
      • eth_syncing
    • 😟API Errors and Troubleshooting
  • Tutorials
    • ⚡Adding a Custom RPC to Metamask
  • Dashboard
    • 🔑Forgot Password
  • Resources
    • ❓ FAQ
    • 🤝 Support
Powered by GitBook
On this page

Was this helpful?

  1. Developers
  2. API Endpoints

eth_call

Executes a new message call immediately without creating a transaction on the blockchain.

Example

curl https://bsc-<network>.web3api.com/v1/YOUR-API-KEY 
-X POST 
-H "Content-Type: application/json"  
-d "{\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\": [{\"from\": \"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\": \"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\": \"0x76c0\",\"gasPrice\": \"0x9184e72a000\",\"value\": \"0x9184e72a\",\"data\": \"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"}, \"latest\"],\"id\":1}" 
curl -X POST 'https://bsc-<network>.web3api.com/v1/YOUR-API-KEY' \
-H 'Content-Type: application/json' \
--data-raw '{"jsonrpc":"2.0","method":"eth_call","params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155","to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567","gas": "0x76c0","gasPrice": "0x9184e72a000","value": "0x9184e72a","data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"],"id":1}'
  1. BLOCK PARAMETER - An int block number in the form of hex, appended with 0x such as 0x6D7FE0, or pre-defined strings latest, earliest, pending.

  2. TRANSACTION CALL OBJECT - A transaction object to be broadcasted.

Web3API's Composer accepts int block numbers, which will be auto-converted to a hex representation before being sent to a node.

Within the transaction call object, the following information are required.

  1. from: 20 Bytes - address of the sender.

  2. to: 20 Bytes - address of the receiver.

  3. gas: Hex representation of an integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.

  4. gasPrice: Hex representation of an integer of the gasPrice used for each paid gas

  5. value: Hex representation of an integer of the value sent with this transaction

  6. data: Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI.

Result Fields

RETURN VALUE - the return value of the executed contract method.

Body

{
   "jsonrpc":"2.0",
   "id":1,
   "result": "0x"
}
Previouseth_sendRawTransactionNexteth_getBlockByHash

Last updated 3 years ago

Was this helpful?

🔌