# generateAccount

## Description

The `generateWallet` function utilizes the Solana Keypair library to generate a new public and private key pair. It conveniently returns an object that includes the generated public and private keys represented as strings.

## Parameter

This function does not take any parameters

## Response

| Property     | Type   | Description                                  |
| ------------ | ------ | -------------------------------------------- |
| `publicKey`  | string | The generated public key in Base58 encoding  |
| `privateKey` | string | The generated private key in Base58 encoding |

## Example Request and Response

### Prerequisites

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

&#x20;

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

<br>

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

### Request

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

```javascript
// import Nest SDK
import { Solana } from '@nest25/solana-lib';

// create a new instance of the SDK
const Sol = new Solana();

async function main() {
  // generate a new wallet
  let wallet = await Sol.generateAccount();
  console.log(wallet);
}

main();
```

### Response

```sh
 {
        wallet: {
          publicKey: 'J3k6z8xgH8YiDxw18oxnjYQubBfcyTTQjPieHYvxP3e2',
          privateKey: '97pdpveR9T9KFFpmiBy5EpL1Te6vV6nKHNXAgfVMV8nd7y2V7EfqcfyzmRWJ5utLEkA2ThCWWxqmTw94Hv3nt34'
        }
}
```

## Use Cases

* **Decentralized Applications (DApps):** Developers building decentralized applications on the Solana blockchain can utilize this function to generate new public and private key pairs for their users.
* **Crypto Wallets:** Crypto wallets can leverage the `generateWallet` function to generate new key pairs for users who wish to create a new wallet.
* **Cryptocurrency Exchanges:** Cryptocurrency exchanges can integrate the `generateWallet` function to generate new key pairs for users who want to create a new account on their platform.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.volary.io/sdks-guide/blockchain-sdks/solana-sdk/generateaccount.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
