simulate transaction - Movement

Simulates a transaction without committing it and returns its predicted effects, gas usage, and success status. The signature is not verified (a zero signature is used), so it is ideal for gas estimation.

Endpoint

httpPOST /v1/transactions/simulate

Query Parameters

ParameterTypeDescription
estimate_gas_unit_pricestringLet the node estimate the gas unit price (true/false)
estimate_max_gas_amountstringLet the node estimate the max gas (true/false)

Example

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

curl -X POST "${MOVEMENT_REST}v1/transactions/simulate?estimate_gas_unit_price=true" \
  -H "Content-Type: application/json" \
  -d '{"sender": "0xabc...", "sequence_number": "42", "max_gas_amount": "2000", "gas_unit_price": "100", "expiration_timestamp_secs": "1736772600", "payload": {"type": "entry_function_payload", "function": "0x1::coin::transfer", "type_arguments": ["0x1::aptos_coin::AptosCoin"], "arguments": ["0xdef...", "1000000000"]}, "signature": {"type": "ed25519_signature", "public_key": "0x...", "signature": "0x00"}}'

Response

json[
    {
        "version": "0",
        "hash": "0x0",
        "success": true,
        "vm_status": "Executed successfully",
        "gas_used": "7",
        "gas_unit_price": "100"
    }
]

Response Fields

FieldTypeDescription
successbooleanWhether the transaction would succeed
gas_usedstringPredicted gas usage
vm_statusstringPredicted VM status

Use Cases

  • Gas Estimation: Size gas before signing
  • Validation: Catch failures before broadcasting

Error Handling

ErrorMessageDescription
400 / Bad requestBad requestA path, query, or body parameter was invalid
404 / Not foundNot foundThe account, block, transaction, or resource does not exist
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect