# spark\_getAddress

Your application can request to connect to the user’s Spark wallet with the `spark_getAddress` method, which prompts them to share their Spark address.

Your app must have first [connected to the wallet](/sats-connect/connecting-to-the-wallet/connect-to-xverse-wallet.md) and obtained [account read permissions.](/sats-connect/xverse-wallet-permissions.md)&#x20;

No request parameters are required:

{% code fullWidth="false" %}

```typescript
import { request } from "sats-connect";

try {

  const response = await request("spark_getAddresses", {});

    if (response.status === "success") {
      alert("Success getting accounts. Check console for results.");
      console.log("Accounts:", response.result);
    } else {
      alert("Error getting accounts. Check console for details.");
      console.error(response);
    }
}
```

{% endcode %}

The method returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that resolves to return `GetAddressesResult`: an array of the user’s wallet `address` objects, defined as:

<table><thead><tr><th width="162">address field</th><th>Description</th></tr></thead><tbody><tr><td><code>address</code> </td><td>the user’s connected Spark wallet address</td></tr><tr><td><code>network</code></td><td><p>string - the network where the address is being used:</p><ul><li><code>mainnet</code> for Spark Mainnet</li><li><code>regtest</code> for Spark Regtest</li></ul></td></tr><tr><td><code>publicKey</code></td><td>A hex string representing the bytes of the public key of the Spark account</td></tr></tbody></table>

You can use these addresses to make further Stacks requests such as sending Spark Bitcoin or sending Spark BTKN.

If your app has not yet obtained [account read permissions](/sats-connect/xverse-wallet-permissions.md), the `spark_getAddresses`  will prompt the user with a *Connection Request* in their wallet. The prompt will display:

* your app logo, if it is specified in your app manifest
* the Spark wallet addresses that your app required

If the user declines the request or closes the pop-up, the promise will reject (throw when awaited).


---

# 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.xverse.app/sats-connect/spark-methods/spark_getaddress.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.
