Transaction API

The Transaction API allows you to send transactions to the Mainsail blockchain network, as well as query the transaction pool on the node.


GET/configuration

Get the pool configuration

This endpoint retrieves the pool configuration settings.

Request

GET
/configuration
curl https://testnet.mainsailhq.com/tx/api/configuration

Response

{
    "data": {
        "core": {
            "version": "0.0.1-evm.13",
            "height": 171455,
            "transactionPool": {
                "maxTransactionAge": 2700,
                "maxTransactionBytes": 9000,
                "maxTransactionsInPool": 15000,
                "maxTransactionsPerRequest": 40,
                "maxTransactionsPerSender": 150
            }
        }
    }
}

POST/transactions

Create transaction

This endpoint allows you to broadcast a transaction to the blockchain. Transactions must be correctly signed and serialized before being sent to this endpoint. You can use SDKs provided by the platform to create and sign transactions in a standardized manner.

Query Parameters

  • Name
    transactions
    Type
    array
    Description

    An array containing one or more serialized transactions to broadcast.

Request

POST
/transactions
curl -X POST https://testnet.mainsailhq.com/tx/api/transactions \
  -H "Content-Type: application/json" \
  -d '{
    "transactions": ["<serialized_transaction>"]
  }'

Response

{
    "data": {
        "accept": [0],
        "broadcast": [0],
        "excess": [],
        "invalid": []
    }
}

GET/transactions/unconfirmed

List All Unconfirmed Transactions

This endpoint retrieves a paginated list of all unconfirmed transactions on the node.

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.

Request

GET
/transactions/unconfirmed
curl https://testnet.mainsailhq.com/tx/api/transactions/unconfirmed

Response

{
    "results": [
        {
            "network": 30,
            "nonce": "27",
            "gasPrice": 5000000000,
            "gas": 21000,
            "to": "0xA5cc0BfEB09742C5e4C610f2EBaaB82Eb142Ca10",
            "value": "100000000000000",
            "data": "",
            "v": 27,
            "r": "c5f604b1950df7c8eb7676c89a93a057363a92458d9793ec0c62db69c76e7dd0",
            "s": "667b483a0d6d34df0712db68137d4da82893139527a0a747aff194712f5b6e8d",
            "senderPublicKey": "022a40ea35d53eedf0341ffa17574fca844d69665ce35f224e9a6b1385575044fd",
            "from": "0xA5cc0BfEB09742C5e4C610f2EBaaB82Eb142Ca10",
            "hash": "5b001b2555e780be703b17a87df71684780a50224a8f8bc82157d494cd7204ca"
        }
    ],
    "totalCount": 1
}

GET/transactions/unconfirmed/{id}

Retrieve an Unconfirmed Transaction

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

Query Parameters

  • Name
    id
    Type
    string
    Description

    The identifier of the unconfirmed transaction to be retrieved.

Request

GET
/transactions/unconfirmed/{id}
curl https://testnet.mainsailhq.com/tx/api/transactions/unconfirmed/{id}

Response

{
    "data":{
        "network": 30,
        "nonce": "27",
        "gasPrice": 5000000000,
        "gas": 21000,
        "to": "0xA5cc0BfEB09742C5e4C610f2EBaaB82Eb142Ca10",
        "value": "100000000000000",
        "data": "",
        "v": 27,
        "r": "c5f604b1950df7c8eb7676c89a93a057363a92458d9793ec0c62db69c76e7dd0",
        "s": "667b483a0d6d34df0712db68137d4da82893139527a0a747aff194712f5b6e8d",
        "senderPublicKey": "022a40ea35d53eedf0341ffa17574fca844d69665ce35f224e9a6b1385575044fd",
        "from": "0xA5cc0BfEB09742C5e4C610f2EBaaB82Eb142Ca10",
        "hash": "5b001b2555e780be703b17a87df71684780a50224a8f8bc82157d494cd7204ca"
    }
}