Simulate

Simulate simulates executing a transaction for estimating gas usage.

POST//rest.origin.uptick.network/cosmos/tx/v1beta1/simulate
Body
txcosmos.tx.v1beta1.Tx (object)

Tx is the standard type used for broadcasting transactions.

tx_bytesstring (byte)

tx_bytes is the raw transaction.

Since: cosmos-sdk 0.43

Response

A successful response.

Body
gas_infoobject

gas_info is the information about gas used in the simulation.

resultobject

result is the result of the simulation.

Request
const response = await fetch('//rest.origin.uptick.network/cosmos/tx/v1beta1/simulate', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "gas_info": {
    "gas_wanted": "text",
    "gas_used": "text"
  },
  "result": {
    "data": "Ynl0ZXM=",
    "log": "text",
    "events": [
      {
        "type": "text",
        "attributes": [
          {
            "key": "text",
            "value": "text",
            "index": false
          }
        ]
      }
    ],
    "msg_responses": [
      {
        "type_url": "text",
        "value": "Ynl0ZXM="
      }
    ]
  }
}

Last updated