Skip to main content

Parameters

chainId
string
default:"200901"
required
Unique identifier for a blockchain network.
id
number
default:1
required
Request identifier used to match responses.
jsonrpc
string
default:"2.0"
required
JSON-RPC version.
method
string
default:"eth_getCode"
required
JSON-RPC method name.
params
object
required
Parameters for eth_getCode: [address, defaultBlock].Positional parameters for eth_getCode:
  • params[0]: The address.
  • params[1]: Block identifier. Can be an integer block number or a string tag: “latest”, “earliest”, or “pending”.

Returns

result
string
The code from the given address. Example: “0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f35b600060078202905091905056”.
curl --request POST \
  --url https://api.uniblock.dev/uni/v1/json-rpc?chainId=200901 \
  --header 'content-type: application/json' \
  --data '{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "eth_getCode",
    "params": [
      "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
      "0x2"
    ]
  }'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f35b600060078202905091905056"
}