## Get user address

One of the first basic tasks for any dapp is to get the address of the account which the user would like to utilize with a dApp. In order to do this, we can use the method `ethAccounts` and `ethRequestAccounts`. This method will prompt the user, letting them know that your dApp is requesting that they provide an address from their O3 wallet. The user can then select any account from their wallet at the time of the request, and confirm that they would like to provide it to your dApp.

![](/images/tutorials/getAccount/getAccountTrayWindow.png)

Assuming that you have already included the [eth-dapi](https://github.com/O3Labs/eth-dapi) JS package into your application, you can call the method `ethAccounts` and `ethRequestAccounts`, as follows:

```
ethDapi.getAccount()
.then((account: Account) => {
  const {
    address,
    label,
  } = account;

  console.log('Account address: ' + address);
  console.log('Account label: ' + label);
})
.catch(({type: string, description: string, data: any}) => {
  switch(type) {
    case NO_PROVIDER:
      console.log('No provider available.');
      break;
    case CONNECTION_DENIED:
      console.log('The user rejected the request to connect with your dApp');
      break;
  }
});
```

This method, like all methods on the dAPI return a JS Promise object. This promise will resolve or reject, based on whether the user has approve or denied your request.

In the case that the request to `ethAccounts` and `ethRequestAccounts`, resolves the Promise, you will be returned an object with the parameters `address`. The `address` is the ETH address for the account which the user would like to interact with your dApp.

For example, in the O3 Ontology staking dApp, we display the label for the users account along side the shortened ETH address.

![](/images/tutorials/getAccount/getAccountOntStake.png)

From here, the dApp can use this address to query additional information from the dAPI that are relevant to that specific user, or simply have an address for which assets will be sent.
