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
blockHash- 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
data- Type
- string
- Description
The arbitrary data attached to the transaction, often used for smart contract interactions or additional metadata.
- Name
from- Type
- string
- Description
The address of the transaction sender.
- Name
gas- Type
- string
- Description
The maximum amount of gas that the transaction is allowed to consume.
- Name
gasPrice- Type
- string
- Description
The price per unit of gas that the sender is willing to pay for the transaction.
- Name
hash- Type
- string
- Description
Unique identifier for the transaction.
- Name
nonce- Type
- string
- Description
A unique number to ensure the transaction can only be processed once.
- Name
senderPublicKey- Type
- string
- Description
The public key of the transaction sender.
- Name
signature- Type
- string
- Description
The cryptographic signature of the transaction.
- Name
to- Type
- string
- Description
The recipient's address for the transaction.
- Name
value- Type
- string
- Description
The amount of cryptocurrency transferred in the transaction.
- Name
receipt- Type
- object
- Description
The receipt of the transaction, containing detailed information about the transaction's execution such as gas details and status.
- Name
timestamp- Type
- string
- Description
The timestamp when the transaction was created.
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
curl https://testnet.mainsailhq.com/api/transactions?limit=100&page=1
Response
{
"meta": {
"totalCountIsEstimate": false,
"count": 100,
"first": "/transactions?fullReceipt=false&includeTokens=false&orderBy=timestamp%3Adesc&orderBy=transactionIndex%3Adesc&limit=100&page=1",
"last": "/transactions?fullReceipt=false&includeTokens=false&orderBy=timestamp%3Adesc&orderBy=transactionIndex%3Adesc&limit=100&page=302",
"next": "/transactions?fullReceipt=false&includeTokens=false&orderBy=timestamp%3Adesc&orderBy=transactionIndex%3Adesc&limit=100&page=2",
"pageCount": 302,
"previous": null,
"self": "/transactions?fullReceipt=false&includeTokens=false&orderBy=timestamp%3Adesc&orderBy=transactionIndex%3Adesc&limit=100&page=1",
"totalCount": 30149
},
"data": [
{
"blockHash": "9be7fe8c68671ee71803af87ac111c645a64d6cd95302273c568585c9dc12691",
"confirmations": 7749,
"data": "0xebed6dab",
"from": "0x18Bbea3b900BAb625C0A865043cC9D6d3F901B13",
"gas": "200000",
"gasPrice": "5000000000",
"hash": "620948bac5d245a7fab0fde0466e33e5140eeffd9e1a1978e9e8138a42f3c287",
"nonce": "1223",
"senderPublicKey": "03fcc590bc21691700d56afc31f04f307a2fd2bf573444ae36b5388e19efa66942",
"signature": "ef80ebb04cdbfc4aee22a7c11f25e900944a3bb18a9a14fce0f0a33dcd0a1c47735dce714586b1e199c9b64adc57c229f6f8a5791c6f24a39a8b1ad98be5198c01",
"to": "0x2c1DE3b4Dbb4aDebEbB5dcECAe825bE2a9fc6eb6",
"value": "0",
"receipt": {
"cumulativeGasUsed": 4372105,
"gasRefunded": 8007,
"gasUsed": 32032,
"status": 1
},
"timestamp": "1776334237095"
},
...
]
}
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.
Query Parameters
- Name
fullReceipt- Type
- boolean
- Description
Whether to include the full receipt in the response.
- Name
includeTokens- Type
- boolean
- Description
Whether to include token details in the response (only relevant for transactions that involve ERC20 tokens).
Request
curl https://testnet.mainsailhq.com/api/transactions/ef61b92da0416f44aa7fdb17abca7fe005eb7197c448e85010778da135a298b9
Response
{
"data": {
"blockHash": "9be7fe8c68671ee71803af87ac111c645a64d6cd95302273c568585c9dc12691",
"confirmations": 7743,
"data": "",
"from": "0xBD6A24E605161B2564435090DFcF6D0B37b9C6D7",
"gas": "21000",
"gasPrice": "5000000000",
"hash": "ef61b92da0416f44aa7fdb17abca7fe005eb7197c448e85010778da135a298b9",
"nonce": "406",
"senderPublicKey": "035c12998aa980a1e52f7ec0aecf47a5132ecc7d7b1545e07695ca019bfb4ae904",
"signature": "a311a5578c7473a672d002eb43bdb02dcc5ccb4b21b3105276023bb4cec1482c795d35749d8631ca239248626dfb5481d6d881e327737c06cd7eb57c2c9de55501",
"to": "0x678eDf303Ce72326162f5A9c9F83e7e5951bf1A3",
"value": "430000000000000000",
"receipt": {
"cumulativeGasUsed": 2690439,
"gasRefunded": 0,
"gasUsed": 21000,
"status": 1
},
"timestamp": "1776334237095"
}
}