Transactions

Get transactions

get

Retrieve on-chain committed transactions. The page size and start ledger version can be provided to get a specific sequence of transactions.

If the version has been pruned, then a 410 will be returned.

To retrieve a pending transaction, use /transactions/by_hash.

Query parameters
startstring · uint64Optional

A string containing a 64-bit unsigned integer.

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

Example: 32425224034
limitinteger · uint16Optional

Max number of transactions to retrieve.

If not provided, defaults to default page size

Responses
200Success
application/json
Responseone of[]

Enum of the different types of transactions in Aptos

get
GET /v1/transactions HTTP/1.1
Host: apt.nownodes.io
Accept: */*
[
  {
    "type": "pending_transaction",
    "hash": "text",
    "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": [
        "text"
      ],
      "arguments": []
    },
    "signature": {
      "type": "ed25519_signature",
      "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
      "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 "
    }
  }
]

Submit transaction

post

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. Make sure to use the application/x.aptos.signed_transaction+bcs Content-Type.

Body

A request to submit a transaction

This requires a transaction and a signature of it

senderstring · hexRequired

A hex encoded 32 byte Aptos account address.

This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x.

For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.

Example: 0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1
sequence_numberstring · uint64Required

A string containing a 64-bit unsigned integer.

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

Example: 32425224034
max_gas_amountstring · uint64Required

A string containing a 64-bit unsigned integer.

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

Example: 32425224034
gas_unit_pricestring · uint64Required

A string containing a 64-bit unsigned integer.

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

Example: 32425224034
expiration_timestamp_secsstring · uint64Required

A string containing a 64-bit unsigned integer.

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

Example: 32425224034
payloadone ofRequired

An enum of the possible transaction payloads

all ofOptional
and
or
all ofOptional
and
or
all ofOptional
or
all ofOptional
and
signatureone ofRequired

An enum representing the different transaction signatures available

all ofOptional
and
or
all ofOptional
and
or
all ofOptional
and
or
all ofOptional
and
or
all ofOptional
and
one ofOptional

Account signature scheme

The account signature scheme allows you to have two types of accounts:

  1. A single Ed25519 key account, one private key
  2. A k-of-n multi-Ed25519 key account, multiple private keys, such that k-of-n must sign a transaction.
  3. A single Secp256k1Ecdsa key account, one private key
all ofOptional
and
or
all ofOptional
and
or
all ofOptional
and
or
all ofOptional
and
Responses
202Success
post
POST /v1/transactions HTTP/1.1
Host: apt.nownodes.io
Content-Type: application/json
Accept: */*
Content-Length: 546

{
  "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": [
      "text"
    ],
    "arguments": []
  },
  "signature": {
    "type": "ed25519_signature",
    "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
    "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 "
  }
}
{
  "hash": "text",
  "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": [
      "text"
    ],
    "arguments": []
  },
  "signature": {
    "type": "ed25519_signature",
    "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
    "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 "
  }
}

Last updated