/cosmos/tx/v1beta1/simulate - Akash

Simulates a signed transaction and returns the gas it would use and the resulting events, without broadcasting.

Endpoint

POST /cosmos/tx/v1beta1/simulate

Example

bashexport AKASH_REST=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

curl --location --request POST "${AKASH_REST}cosmos/tx/v1beta1/simulate" \
--header 'Content-Type: application/json' \
--data-raw '{
    "tx_bytes": "Cr0BC...",
    "tx": null
}'

Response

json{
    "gas_info": {
        "gas_wanted": "200000",
        "gas_used": "118000"
    },
    "result": {
        "events": []
    }
}

Response Fields

FieldTypeDescription
gas_infoobjectGas wanted/used from simulation
resultobjectSimulated execution result and events

Use Cases

  • Fee Estimation: Estimate gas before signing

Error Handling

ErrorMessageDescription
400 / Bad requestBad requestA parameter was invalid
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect