Skip to main content

Utilities Endpoint

List Supported Compiler Versions

List Supported Compiler Versions

GET

API_URL/api/contract/utils/compiler-versions

HEADERS

client_id   9b16ae5638534ae1961fb370f874b6cc*

client_secret   sk_9b16ae5638534ae1961fb370f874b6cc*

The returned values will be in the format of

Sample Result
{
"message": "Success",
"result": [
"0.8.28",
"0.8.27",
"0.8.26",
...
]
}

Encode ABI - Contract Deploy

Encode Contract Deployment Parameters

POST

API_URL/api/contract/utils/deploy-encode

HEADERS

client_id   9b16ae5638534ae1961fb370f874b6cc*

client_secret   sk_9b16ae5638534ae1961fb370f874b6cc*

Params

NameRequiredDescription
abiYesThe contract abi
bytecodeYesThe contract bytecode
paramsRequired if contract have deployment parametersKey-value array list of parameters required for the contract deployment
Sample Request Body (Custodial Wallet)
{
"abi": [
{
"name": "increment",
"type": "function",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
...
],
"bytecode": "0x60806040526000805560006001...",
"params": {
"fieldA": "Testing"
}
}

The returned values will be in the format of

Sample Result
{
"message": "Success",
"result": "encodedAbiString"
}

Encode ABI - Contract Execution

Encode Contract Execution Parameters

POST

API_URL/api/contract/utils/execute-encode

HEADERS

client_id   9b16ae5638534ae1961fb370f874b6cc*

client_secret   sk_9b16ae5638534ae1961fb370f874b6cc*

Params

NameRequiredDescription
abiYesThe contract abi
contract_addressYesThe contract address
method_nameYesThe contract method name to execute
paramsRequired if contract method require parametersKey-value array list of parameters required for the contract deployment
Sample Request Body
{
"abi": [
{
"name": "increment",
"type": "function",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
...
],
"contract_address": "0x9F7A94cEA78652479...",
"method_name": "increment",
"params": {
"fieldA": "Testing"
}
}

The returned values will be in the format of

Sample Result
{
"message": "Success",
"result": "encodedAbiString"
}

Estimate Gas

Estimate Gas for Transaction

POST

API_URL/api/contract/utils/estimate-gas

HEADERS

client_id   9b16ae5638534ae1961fb370f874b6cc*

client_secret   sk_9b16ae5638534ae1961fb370f874b6cc*

Params

NameRequiredDescription
fromAt least one of the listed fields is requiredThe sender address
toAt least one of the listed fields is requiredThe target/receiver address
valueAt least one of the listed fields is requiredAmount to transfer with the transaction
dataAt least one of the listed fields is requiredABI encoded transaction data
nonceNoNonce
Sample Request Body (Contract Execution)
{
"from": "0x9db65D81AB6c2B6E7Ca354864f9e5b4c6eE303C5",
"to": "0x9F7A94cEA7865247958aEbF34039AD78AF4b0C80",
"data": "0xd09de08a"
}

The returned values will be in the format of

Sample Result
{
"message": "Success",
"result": 47648
}