Executes a new message call immediately without creating a transaction on the block chain. It returns data or an error object of JSON RPC if error occurs.


Supported on Klaytn (mainnet) only.



callObjectObjectThe transaction call object. See the next table for the object's properties.
blockNumberOrHashQUANTITY | TAG | HASHInteger or hexadecimal block number, or the string "earliest", "latest" or "pending", or block hash.

NOTE: In versions earlier than Klaytn v1.7.0, only integer block number, the string "earliest" and "latest" are available.

callObject has the following properties:

from20-byte DATA(optional) The address the transaction is sent from.
to20-byte DATA(optional when testing the deployment of a new contract) The address the transaction is directed to.
gasQUANTITY(optional) Integer of the gas provided for the transaction execution. klay_call consumes zero gas, but this parameter may be needed by some executions.
gasPriceQUANTITY(optional) Integer of the gasPrice used for each paid gas.
valueQUANTITY(optional) Integer of the value sent with this transaction.
inputDATA(optional) Hash of the method signature and encoded parameters. It replaces data field, but 'data` field is still supported for backward compatibility.


DATAThe return value of executed contract.

If you deployed a contract, use klay_getTransactionReceipt to get the contract address.


It returns an error object of JSON RPC if anything goes wrong.
For example, an error object with a message "evm: execution reverted" will be generated if a message call is terminated with REVERT opcode.

API Endpoint

The format of a Klaytn API endpoint is

Here is an example:


// Request
curl https://open-platform.nodereal.io/{{apiKey}}/klaytn/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc": "2.0", "method": "klay_call", "params": [{"from": "0x3f71029af4e252b25b9ab999f77182f0cd3bc085", "to": "0x87ac99835e67168d4f9a40580f8f5c33550ba88b", "gas": "0x100000", "gasPrice": "0x5d21dba00", "value": "0x0", "input": "0x8ada066e"}, "latest"], "id": 1}' 

// Result