# getLatestTxs

## Description

The `getLatestTxs` function is an asynchronous function used to retrieve the latest transactions from the blockchain explorer.&#x20;

It returns the result containing the retrieved latest transactions.

## Parameters

| Parameter | Data Type | Description                                    |
| --------- | --------- | ---------------------------------------------- |
| `count`   | number    | The number of latest transactions to retrieve. |

## Response

| Field    | Data Type | Description                                                           |
| -------- | --------- | --------------------------------------------------------------------- |
| `code`   | number    | The response code indicating the success or failure of the operation. |
| `result` | object\[] | An array of the latest transactions.                                  |

## Example Request and Response

### Prerequisites&#x20;

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```sh
npm install @nest25/explorer-lib
OR
yarn add @nest25/explorer-lib
```

### Request

Here is an example of how to make a `getLatestTxs` request using the Volary SDK:

{% code overflow="wrap" %}

```javascript
const {Explorer} = require("@nest25/explorer-lib")
const explorer = new Explorer('', 'testnet');


async function main (){
    const response = await explorer.getLatestTxs();
  console.log("latest txs on vlry bc --> ", response.result.length);
}

main()
```

{% endcode %}

### Response

{% code overflow="wrap" %}

```sh
latest txs on vlry --> bc 10
```

{% endcode %}

## Use Cases

* **Retrieving latest transactions:** By invoking this function with the appropriate count parameter, you can retrieve the specified number of latest transactions from the blockchain explorer.
* **Sending HTTP request:** The function sends an HTTP request to the blockchain explorer's API to fetch the latest transactions.
* **Specifying the count:** The function includes the count parameter in the request payload to specify the number of latest transactions to retrieve.
