# 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](https://docs.xverse.app/sats-connect/connecting-to-the-wallet/connect-to-xverse-wallet) and obtained [account read permissions.](https://docs.xverse.app/sats-connect/xverse-wallet-permissions)&#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](https://docs.xverse.app/sats-connect/xverse-wallet-permissions), 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).
