v6

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2022-08-07178779.8 KB
Transactions

Submit transaction

This endpoint accepts transaction submissions in two formats.

To submit a transaction as JSON, you must submit a SubmitTransactionRequest. To build this request, do the following:

  1. Encode the transaction as BCS. If you are using a language that has native BCS support, make sure of that library. If not, you may take advantage of /transactions/encode_submission. When using this endpoint, make sure you trust the node you're talking to, as it is possible they could manipulate your request.
  2. Sign the encoded transaction and use it to create a TransactionSignature.
  3. Submit the request. Make sure to use the "application/json" Content-Type.

To submit a transaction as BCS, you must submit a SignedTransaction encoded as BCS. See SignedTransaction in types/src/transaction/mod.rs.

post/transactions

Request body

senderstring hex required

Hex encoded 32 byte Aptos account address

sequence_numberstring uint64 required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatability with languages such as JavaScript that do not parse u64s in JSON natively.

max_gas_amountstring uint64 required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatability with languages such as JavaScript that do not parse u64s in JSON natively.

gas_unit_pricestring uint64 required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatability with languages such as JavaScript that do not parse u64s in JSON natively.

expiration_timestamp_secsstring uint64 required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatability with languages such as JavaScript that do not parse u64s in JSON natively.

Example request

{
  "sequence_number": "32425224034",
  "max_gas_amount": "32425224034",
  "gas_unit_price": "32425224034",
  "expiration_timestamp_secs": "32425224034",
  "payload": {
    "type": "script_function_payload"
  },
  "signature": {
    "type": "ed_25519_signature"
  }
}

Response

hashstring required
senderstring hex required

Hex encoded 32 byte Aptos account address

sequence_numberstring uint64 required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatability with languages such as JavaScript that do not parse u64s in JSON natively.

max_gas_amountstring uint64 required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatability with languages such as JavaScript that do not parse u64s in JSON natively.

gas_unit_pricestring uint64 required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatability with languages such as JavaScript that do not parse u64s in JSON natively.

expiration_timestamp_secsstring uint64 required

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatability with languages such as JavaScript that do not parse u64s in JSON natively.

Example response

{
  "sequence_number": "32425224034",
  "max_gas_amount": "32425224034",
  "gas_unit_price": "32425224034",
  "expiration_timestamp_secs": "32425224034",
  "payload": {
    "type": "script_function_payload"
  },
  "signature": {
    "type": "ed_25519_signature"
  }
}