transactions

Get transactions

Retrieve on-chain committed transactions:

curl --request GET \
  --url https://devnet.m1.movementlabs.xyz/transactions \
  --header 'Accept: application/json, application/x-bcs'

or simply:

curl https://devnet.m1.movementlabs.xyz/transactions

Submit transaction

Submit a transaction and signature:

curl --request POST \
  --url https://devnet.m1.movementlabs.xyz/transactions \
  --header 'Accept: application/json, application/x-bcs' \
  --header 'Content-Type: application/json' \
  --data '{
  "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
  "sequence_number": "32425224034",
  "max_gas_amount": "32425224034",
  "gas_unit_price": "32425224034",
  "expiration_timestamp_secs": "32425224034",
  "payload": {
    "type": "entry_function_payload",
    "function": "0x1::aptos_coin::transfer",
    "type_arguments": [
      "string"
    ],
    "arguments": [
      null
    ]
  },
  "signature": {
    "type": "ed25519_signature",
    "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
    "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 "
  }
}'

Get transaction by hash

Look up a transaction by its hash. This is the same hash that is returned by the API when submitting a transaction (see PendingTransaction).

When given a transaction hash, the server first looks for the transaction in storage (on-chain, committed). If no on-chain transaction is found, it looks the transaction up by hash in the mempool (pending, not yet committed).

curl --request GET \
  --url https://aptos.devnet.m1.movementlabs.xyz/transactions/wait_by_hash/txn_hash \
  --header 'Accept: application/json, application/x-bcs'

or:

curl https://aptos.devnet.m1.movementlabs.xyz/transactions/by_hash/txn_hash

Get transaction by version

Retrieves a transaction by a given version

curl --request GET \
  --url https://aptos.devnet.m1.movementalbs.xyz/transactions/by_version/txn_version \
  --header 'Accept: application/json, application/x-bcs'

Get account transactions

Retrieves on-chain committed transactions from an account. If the start version is too far in the past

If no start version is given, it will start at version 0.

curl --request GET \
  --url https://aptos.devnet.m1.movementlabs.xyz/accounts/address/transactions \
  --header 'Accept: application/json, application/x-bcs'

Simulate transaction

The output of the transaction will have the exact transaction outputs and events that running an actual signed transaction would have. However, it will not have the associated state hashes, as they are not updated in storage. This can be used to estimate the maximum gas units for a submitted transaction.

You must submit a SignedTransaction encoded as BCS hex.

curl --request POST \
  --url https://aptos.devnet.m1.movementlabs.xyz/transactions/simulate \
  --header 'Accept: application/json, application/x-bcs' \
  --header 'Content-Type: application/json' \
  --data '{
  "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
  "sequence_number": "32425224034",
  "max_gas_amount": "32425224034",
  "gas_unit_price": "32425224034",
  "expiration_timestamp_secs": "32425224034",
  "payload": {
    "type": "entry_function_payload",
    "function": "0x1::aptos_coin::transfer",
    "type_arguments": [
      "string"
    ],
    "arguments": [
      null
    ]
  },
  "signature": {
    "type": "ed25519_signature",
    "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
    "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 "
  }
}'

Estimate gas price

Gives an estimate of the gas unit price required to get a transaction on chain in a reasonable amount of time. The gas unit price is the amount that each transaction commits to pay for each unit of gas consumed in executing the transaction. The estimate is based on recent history: it gives the minimum gas that would have been required to get into recent blocks, for blocks that were full. (When blocks are not full, the estimate will match the minimum gas unit price.)

The estimation is given in three values: de-prioritized (low), regular, and prioritized (aggressive). Using a more aggressive value increases the likelihood that the transaction will make it into the next block; more aggressive values are computed with a larger history and higher percentile statistics

curl --request GET \
  --url https://aptos.devnet.m1.movementlabs.xyz/estimate_gas_price \
  --header 'Accept: application/json, application/x-bcs'

Last updated