v2

latestOpenAPI 3.0.3Apache 2.0raw.githubusercontent.com2022-07-19176455.9 KB
transactions

Simulate transaction

**Submit transaction for simulation result using JSON **

  • Create a SignedTransaction with zero-padded signature
  • Submit the user transaction request with the zero-padded siganture.
  • The request header "Content-Type" must set to "application/json".
post/transactions/simulate

Request body

senderstring address required

Hex-encoded 16 bytes Aptos account address.

Prefixed with 0x and leading zeros are trimmed.

See doc for more details.

sequence_numberstring uint64 required

Unsigned int64 type value

max_gas_amountstring uint64 required

Unsigned int64 type value

gas_unit_pricestring uint64 required

Unsigned int64 type value

gas_currency_codestring
expiration_timestamp_secsstring uint64 required

Timestamp in seconds, e.g. transaction expiration timestamp.

Example request

{
  "sender": "0xdd",
  "sequence_number": "32425224034",
  "max_gas_amount": "32425224034",
  "gas_unit_price": "32425224034",
  "gas_currency_code": "XDX",
  "expiration_timestamp_secs": "1635447454",
  "payload": {
    "type": "script_function_payload",
    "function": "0x1::payment_scripts::peer_to_peer_with_metadata",
    "type_arguments": [
      "0x1::xdx::XDX"
    ],
    "arguments": [
      "0x1668f6be25668c1a17cd8caf6b8d2f25",
      "2021000000",
      "0x",
      "0x"
    ]
  },
  "signature": {
    "type": "ed25519_signature",
    "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1",
    "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1"
  }
}

Response

Transaction simulation completed.