Links

trace_call

Executes the given call and returns a number of possible traces for it.

Parameters

Params - a string array containing (required):
  • Object - Call options, same as eth_call.
    • from: Address - (optional) 20 Bytes - The address the transaction is send from.
    • to: Address - (optional when creating new contract) 20 Bytes - The address the transaction is directed to.
    • gas: Quantity - (optional) Integer formatted as a hex string 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 formatted as a hex string of the gas price used for each paid gas.
    • value: Quantity - (optional) Integer formatted as a hex string of the value sent with this transaction.
    • data: Data - (optional) 4 byte hash of the method signature followed by encoded parameters. For details see Ethereum Contract ABI.
  • Array - Type of trace, one or more of: "vmTrace", "trace", "stateDiff".
  • QUANTITY|TAG(hex string|string, optional) - integer block number in hex string format, or the string "earliest", "latest" or "pending", see the default block parameter

Returns

Array - Block traces.
  • trace(array). Array of the given transactions’ traces.
    • action(object). DATA - Transaction details.
      • callType(string). type of method, such as call or create.
      • from(hex string). DATA, 20 Bytes - address of the sender.
      • to(hex string). DATA, 20 Bytes - address of the receiver.
      • gas(hex string) . QUANTITY - the amount of gas used by transaction.
      • input(hex string). DATA - the data send along with the transaction.
      • value(hex string). QUANTITY - value transferred in Wei.
    • result(object). DATA - Transaction result.
      • gasUsed(hex string) . QUANTITY - the amount of gas used by transaction.
      • output(hex string). DATA - Return value of the contract call. Contains only the actual value sent by a RETURN operation. If a RETURN was not executed, the output is empty bytes.
    • subTraces(hex string). - Traces of contract calls made by the transaction.
    • traceAddress(Array). - Tree list address of where the call occurred, address of the parents, and order of the current sub call.
    • type(string). type of method, such as call or create.

Example

Request

curl
TypeScript
curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "trace_call",
"params": [
{
"from": "0xb603da66c08d3d316b3462614cdab768217147c5",
"to": "0x06bcc078233082021df764a1d5a35a423403d965",
"value": "0x0",
"data": "0xa67a6a45000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000"
},
["trace"]
],
"id": 1
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.ETH_MAINNET)
// Access BlockVision Enhanced API requests
bv.traceCall(
{
from: '0x407d73d8a49eeb85d32cf465507dd71d507100c1',
to: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b',
value: '0x186a0'
},
['trace'],
'latest'
).then(console.log)

Result

{
"jsonrpc": "2.0",
"id": 0,
"result": {
"trace": [
{
"action": {
"from": "0xb603da66c08d3d316b3462614cdab768217147c5",
"callType": "call",
"gas": "0x2fa9d78",
"input": "0xa67a6a45000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000",
"to": "0x06bcc078233082021df764a1d5a35a423403d965",
"value": "0x0"
},
"result": {
"gasUsed": "0x0",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [],
"type": "call"
"output": "0x",
"stateDiff": null
}
],
"vmTrace": null
}
}