Transactions

Transactions are signed, serialized payloads that are batched together to form a block. The Transactions resource provides various endpoints to query, broadcast, and manage transactions on the blockchain.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the transaction.

  • Name
    amount
    Type
    string
    Description

    The amount of cryptocurrency transferred in the transaction.

  • Name
    asset
    Type
    object
    Description

    The additional assets or data associated with the transaction, such as usernames or custom fields.

  • Name
    blockId
    Type
    string
    Description

    The identifier of the block that includes this transaction.

  • Name
    confirmations
    Type
    integer
    Description

    The number of confirmations the transaction has received.

  • Name
    fee
    Type
    string
    Description

    The transaction fee paid to include this transaction in a block.

  • Name
    nonce
    Type
    string
    Description

    A unique number to ensure the transaction can only be processed once.

  • Name
    recipient
    Type
    string
    Description

    The recipient's address for the transaction.

  • Name
    senderPublicKey
    Type
    string
    Description

    The public key of the transaction sender.

  • Name
    signature
    Type
    string
    Description

    The cryptographic signature of the transaction.

  • Name
    signatures
    Type
    array
    Description

    An array of additional signatures for multi-signature transactions. Can be null if not applicable.

  • Name
    timestamp
    Type
    string
    Description

    The timestamp when the transaction was created.

  • Name
    type
    Type
    integer
    Description

    The type of transaction, which determines the action it performs.

  • Name
    typeGroup
    Type
    integer
    Description

    The group identifier of the transaction type, which helps classify different transaction types.

  • Name
    vendorField
    Type
    string
    Description

    Optional field for attaching additional data to the transaction. Can be null if not applicable.

  • Name
    version
    Type
    integer
    Description

    The version of the transaction.


GET/transactions

List All Transactions

This endpoint retrieves a list of all transactions on the blockchain. You can apply filters through query parameters to search for specific transactions based on various criteria such as sender, recipient, amount, and more.

Query Parameters

  • Name
    page
    Type
    integer
    Description

    The number of the page that will be returned.

  • Name
    limit
    Type
    integer
    Description

    The number of resources per page.

  • Name
    orderBy
    Type
    string
    Description

    The column by which the resources will be sorted.

  • Name
    address
    Type
    string
    Description

    The sender or recipient address of the transaction to be retrieved.

  • Name
    senderId
    Type
    string
    Description

    The sender address of the transaction to be retrieved.

  • Name
    senderPublicKey
    Type
    string
    Description

    The sender's public key of the transaction to be retrieved.

  • Name
    recipientId
    Type
    string
    Description

    The recipient address of the transaction to be retrieved.

  • Name
    id
    Type
    string
    Description

    The ID of the transaction to be retrieved.

  • Name
    version
    Type
    integer
    Description

    The version of the transaction to be retrieved.

  • Name
    blockId
    Type
    string
    Description

    The block ID of the transaction to be retrieved.

  • Name
    sequence
    Type
    integer
    Description

    The sequence of the transaction to be retrieved.

  • Name
    timestamp
    Type
    string
    Description

    The timestamp of the transaction to be retrieved.

  • Name
    nonce
    Type
    integer
    Description

    The nonce of the transaction to be retrieved.

  • Name
    type
    Type
    integer
    Description

    The type of transaction to be retrieved.

  • Name
    typeGroup
    Type
    integer
    Description

    The type group of the transaction to be retrieved.

  • Name
    vendorField
    Type
    string
    Description

    The vendor field of the transaction to be retrieved.

  • Name
    amount
    Type
    integer
    Description

    The amount of the transaction to be retrieved.

  • Name
    fee
    Type
    integer
    Description

    The fee of the transaction to be retrieved.

  • Name
    asset
    Type
    object
    Description

    The asset associated with the transaction.

  • Name
    fullReceipt
    Type
    boolean
    Description

    Whether to include the full receipt of the transaction.

Request

GET
/transactions
curl https://testnet.mainsailhq.com/api/transactions?limit=100&page=1

Response

{
  "meta": {
    "totalCountIsEstimate": true,
    "count": 1,
    "first": "/transactions?fullReceipt=true&limit=1&orderBy=timestamp%3Adesc&orderBy=transactionIndex%3Adesc&page=1",
    "last": "/transactions?fullReceipt=true&limit=1&orderBy=timestamp%3Adesc&orderBy=transactionIndex%3Adesc&page=159",
    "next": "/transactions?fullReceipt=true&limit=1&orderBy=timestamp%3Adesc&orderBy=transactionIndex%3Adesc&page=2",
    "pageCount": 159,
    "previous": null,
    "self": "/transactions?fullReceipt=true&limit=1&orderBy=timestamp%3Adesc&orderBy=transactionIndex%3Adesc&page=1",
    "totalCount": 159
  },
  "data": [
    {
      "blockHash": "ce87da1d99aaf777c5f64c50ec74beb91f0cde60172bf575224fbb06c3ac99f1",
      "confirmations": 5766,
      "data": "0x6dd7d8ea0000000000000000000000006277e639c276c7e18d83fe2632ae49216b418682",
      "from": "0x6277e639c276c7E18D83fE2632AE49216b418682",
      "gas": "200000",
      "gasPrice": "0",
      "hash": "c2798219915215d39f6e4e5381c8c574fdf55678d7d3a2165fe06866d04b697d",
      "nonce": "1",
      "senderPublicKey": "03cefbc61fb9c865b92e0bb5f534b9a159793e4594607d1ba2c56b392892d350f7",
      "signature": "78c3869ec9faf41efa94128dde36b76891883eae1142092921b8bf00bf67bf894f11398a62e42ea0a79cdd08a029b4a1120b7ba037f07266647041fe5f2d22120",
      "to": "0x535B3D7A252fa034Ed71F0C53ec0C6F784cB64E1",
      "value": "0",
      "timestamp": "1742274585321",
      "receipt": {
        "gasRefunded": 0,
        "gasUsed": 183633,
        "logs": [
          {
            "data": "0x0000000000000000000000006277e639c276c7e18d83fe2632ae49216b4186820000000000000000000000006277e639c276c7e18d83fe2632ae49216b418682",
            "topics": ["0xce0c7a2a940807f7dc2ce7a615c2532e915e6c0ac9a08bc4ed9d515a710a53e2"],
            "address": "0x535b3d7a252fa034ed71f0c53ec0c6f784cb64e1"
          }
        ],
        "output": "0x",
        "status": 1
      }
    }
  ]
}


GET/transactions/{id}

Retrieve a Transaction

This endpoint retrieves details of a specific transaction by its ID. The response includes all relevant information about the transaction, including its amount, sender, recipient, and other metadata.

Path Parameters

  • Name
    id
    Type
    string
    Description

    The identifier of the transaction to be retrieved.

Request

GET
/transactions/{id}
curl https://testnet.mainsailhq.com/api/transactions/9ae70c79288d69f457755b57525a06c945b42a1820370bac3daef6f3ec1a8477

Response

{
  "data": {
    "value": "100000000",
    "asset": null,
    "blockHash": "0c70756ee77fafc6c428a9ae62e79566cf681b31c3a48f6811cdcdff6e1ea3f2",
    "confirmations": 4755,
    "fee": "10000000",
    "hash": "9ae70c79288d69f457755b57525a06c945b42a1820370bac3daef6f3ec1a8477",
    "nonce": "21",
    "to": "0xDC0A21aF27FeB1b7e0f2e519288445c0510Cb23C",
    "senderPublicKey": "025f81956d5826bad7d30daed2b5c8c98e72046c1ec8323da336445476183fb7ca",
    "signature": "499c5a0c7ed2714f9d6f7f8cd75bf38be3a2ffb7cfb62a6fe337d1499b922a4892be296d960f5d244096489d3ab69a397664042e4191da25f7c9921de2d9e4da",
    "signatures": null,
    "timestamp": "1725449519419",
    "type": 0,
    "typeGroup": 1,
    "vendorField": null,
    "version": 1
  }
}