_simulate

Simulates executing a transaction for estimating gas usage.

Parameters

Body

  • tx: OBJECT - The standard type used for broadcating transactions.
  • tx_bytes: STRING - The raw transaction.
curl https://cosmos-mainnet-archive.allthatnode.com:1317/cosmos/tx/v1beta1/simulate \
-H 'x-allthatnode-api-key: 8U3JLUhzIDg3GShvy9hkCCSYkLGc11kj' \
-H "Content-Type: application/json" \
--data '{
  "jsonrpc": "2.0",
  "id": 1,
  "tx": {
    "body": {
      "messages": [
        {
          "type_url": "string",
          "value": "string"
        }
      ],
      "memo": "string",
      "timeout_height": "string",
      "extension_options": [
        {
          "type_url": "string",
          "value": "string"
        }
      ],
      "non_critical_extension_options": [
        {
          "type_url": "string",
          "value": "string"
        }
      ]
    },
    "auth_info": {
      "signer_infos": [
        {
          "public_key": {
            "type_url": "string",
            "value": "string"
          },
          "mode_info": {
            "single": {
              "mode": "SIGN_MODE_UNSPECIFIED"
            },
            "multi": {
              "bitarray": {
                "extra_bits_stored": 0,
                "elems": "string"
              },
              "mode_infos": [
                null
              ]
            }
          },
          "sequence": "string"
        }
      ],
      "fee": {
        "amount": [
          {
            "denom": "string",
            "amount": "string"
          }
        ],
        "gas_limit": "string",
        "payer": "string",
        "granter": "string"
      }
    },
    "signatures": [
      "string"
    ]
  },
  "tx_bytes": "string"
}'

Returns

  • OBJECT - The simulation result.
{
  "gas_info": {
    "gas_wanted": "string",
    "gas_used": "string"
  },
  "result": {
    "data": "string",
    "log": "string",
    "events": [
      {
        "type": "string",
        "attributes": [
          {
            "key": "string",
            "value": "string",
            "index": true
          }
        ]
      }
    ]
  }
}

Try Yourself

Language
Click Try It! to start a request and see the response here!