# getAccountFromSecretKey

## Description

The `getWalletFromSecretKey` takes a secret key as input and generates a public key and a private key. The generated keys can be used to interact with various blockchain networks.

## Parameter

| Parameter   | Type   | Description                             |
| ----------- | ------ | --------------------------------------- |
| `secretKey` | string | A string representation of a secret key |

## Response

| Property     | Type   | Description                               |
| ------------ | ------ | ----------------------------------------- |
| `publicKey`  | string | A string representation of a public key   |
| `privateKey` | string | A string representation of a private key. |

## Example Request and Response

### Prerequisites

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/solana-lib
OR
yarn add @nest25/solana-lib
```

### Request

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

<pre class="language-javascript"><code class="lang-javascript">// import Nest SDK
import { Solana } from '@nest25/solana-lib';

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

<strong>async function main() {
</strong>  // get the account from the secret key
  let wallet = Sol.getAccountFromSecretKey(your-secret-keyThe getWalletFromSecretKey function is a JavaScript function that takes a secret key as input and generates a public key and a private key. The generated keys can be used to interact with various blockchain networks.The getWalletFromSecretKey function is a JavaScript function that takes a secret key as input and generates a public key and a private key. The generated keys can be used to interact with various blockchain networks.The getWalletFromSecretKey function is a JavaScript function that takes a secret key as input and generates a public key and a private key. The generated keys can be used to interact with various blockchain networks.);
  console.log(wallet);
}

main();
</code></pre>

### Response

```sh
  {
        publicKey: '9jBxBwCHt6R5CgxhpjH43M6141JMCdjccjfWufnEB2r8',
        privateKey: '4DfysqXg2xiG3XnychN9gF1ffPs8omn1QQCzLJBsUJA6ZQwKCqVWF11YbZx29kmmHYDzs2GcA6S1D4QeuHiYRYjN'
}
```

## Use Cases

* **Crypto Wallets:** Crypto wallets can leverage this function to generate a secure public and private key pair for a user's account.
* **Decentralized Applications (DApps):** DApps can integrate the getAccountFromSecretKey function to generate a public and private key pair for users to interact with the application.
* **Blockchain Developers:** Blockchain developers can utilize the getAccountFromSecretKey function to generate a public and private key pair for testing and development purposes.


---

# 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/getaccountfromsecretkey.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.
