curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_getCode",
"id": 1,
"params": [
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"latest"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}TRON API method that returns the contract code at a given address. This method provides Ethereum-compatible interface for TRON blockchain.
curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_getCode",
"id": 1,
"params": [
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"latest"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}jsonrpc — the JSON-RPC protocol version (always “2.0”)method — the method name (always “eth_getCode”)params — array containing method parameters
address — the contract address to retrieve code fromblockParameter — the block number in hexadecimal format or “latest”, “earliest”, “pending”id — request identifier (number or string)jsonrpc — the JSON-RPC protocol version (“2.0”)id — the request identifier that matches the requestresult — the contract bytecode as a hex string (returns “0x” for non-contract addresses)jsonrpc eth_getCode method is used for:
Was this page helpful?