Skip to main content
POST
https://api.uniblock.dev
/
uni
/
v1
/
json-rpc
curl --request POST \
  --url https://api.uniblock.dev/uni/v1/json-rpc?chainId=1 \
  --header 'content-type: application/json' \
  --data '{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "ots_hasCode",
    "params": [
      "0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95",
      "latest"
    ]
  }'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": false
}

Parameters

chainId
string
default:"1"
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:"ots_hasCode"
required
JSON-RPC method name.
params
object
required
The parameters for the method ots_hasCode: [address, defaultBlock].Positional parameters for ots_hasCode:
  • params[0]: The address.
  • params[1]: Block identifier. Can be an integer block number or a string tag: “latest”, “earliest”, or “pending”.

Returns

result
boolean
boolean indicating if the address contains a bytecode or not.
curl --request POST \
  --url https://api.uniblock.dev/uni/v1/json-rpc?chainId=1 \
  --header 'content-type: application/json' \
  --data '{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "ots_hasCode",
    "params": [
      "0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95",
      "latest"
    ]
  }'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": false
}