> For the complete documentation index, see [llms.txt](https://support.marscat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.marscat.io/development-guide/frontend-development/api-interface/api-interface-details/level-0/getaccount.md).

# getAccount

Used to get the account address under this MarsApp, ensuring unique user identity under each MarsApp. Different MarsApps will have different account addresses, reflecting the independent identity of users in each application.

{% hint style="info" %}

* `generateSignature` and `verifySignature` rely on the BTC address returned by default from `getAccount` for signing and verifying user identity.
* `encrypt` and `decrypt` rely on the ECC public key returned by `getAccount(type: 1)` for data encryption and decryption.
* The two key systems are respectively applicable to identity verification and data encryption scenarios, and developers can call as needed.
  {% endhint %}

## Request Parameters

| Parameter Name | Type   | Required | Description                                                                                                 |
| -------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------- |
| type           | String | No       | Request type. Defaults to returning BTC address; if `1` is passed, returns ECC public key (Base64 encoded). |

## Response Parameters

| Parameter Name | Type   | Description                             |
| -------------- | ------ | --------------------------------------- |
| result         | String | Returned account address or public key. |

## Call Example

{% code title="example.js" %}

```javascript
let payload = {
  type: "1"
};

const response = await relayx.getAccount(payload);
if (response.code === 200) {
  console.log("RelayApp account:", response.result);
}
```

{% endcode %}
