> For the complete documentation index, see [llms.txt](https://docs.arweavekit.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arweavekit.com/wallets/get-wallet-address.md).

# Get Wallet Address

Fetching a wallet address

The `getWallet` function returns the wallet address for a given private key.

### Basic Syntax

The function is called as follows:

```javascript
import { getAddress } from 'arweavekit/wallet'

const address = await getAddress({params});
```

### Input Parameters

The following params are available for this function:

* `key: JWKInterface` : The private key for the wallet address to be fetched. The wallet key file can be loaded as follows:

```javascript
import { readFileSync } from 'fs';

const key = JSON.parse(readFileSync('wallet.json').toString());
```

{% hint style="danger" %}
Private keys must be kept secure at all times. Please ensure that the `wallet.json` file is not pushed to a version control (eg. GitHub).
{% endhint %}

{% hint style="info" %}
It is important to `JSON.parse` the read file as this returns the `key` in the correct format (`object`) for further use.
{% endhint %}

* `environment: 'local' | 'mainnet'` : The active environment on which the wallet is interacting with.

{% hint style="info" %}
An `arlocal` instance must be running on port <mark style="color:red;">`1984`</mark> for the function to work with the local environment. To create one, simply run `npx arlocal` in the command line. Learn more about `arlocal` [here](https://cookbook.arweave.dev/guides/testing/arlocal.html).
{% endhint %}

<details>

<summary>Example</summary>

```javascript
const walletAddress = await getAddress({
    key: { KEY_OBJECT },
    environment: 'local',
});
```

This returns the wallet address of the key entered as part of the parameters for the chosen environment.

</details>

### Returned Data

The function call returns the following data:

<pre class="language-bash"><code class="lang-bash"><strong>'WALLET_ADDRESS'
</strong></code></pre>

* `address: string` : The wallet address corresponding to the private key input is returned as type `string`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.arweavekit.com/wallets/get-wallet-address.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
