# Account

Represents an account in the Polymesh blockchain. Accounts can hold POLYX, control Identities and vote on proposals (among other things)

## Hierarchy

* [Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/entity)‹UniqueIdentifiers, string›

  ↳ **Account**

## Index

### Properties

* [address](#address)
* [authorizations](#authorizations)
* [context](#protected-context)
* [key](#key)
* [uuid](#uuid)

### Methods

* [exists](#exists)
* [getBalance](#getbalance)
* [getIdentity](#getidentity)
* [getPermissions](#getpermissions)
* [getSubsidy](#getsubsidy)
* [getTransactionHistory](#gettransactionhistory)
* [hasPermissions](#haspermissions)
* [isEqual](#isequal)
* [isFrozen](#isfrozen)
* [leaveIdentity](#leaveidentity)
* [toJson](#tojson)
* [generateUuid](#static-generateuuid)
* [unserialize](#static-unserialize)

## Properties

### address

• **address**: *string*

*Defined in* [*src/api/entities/Account.ts:64*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L64)

Polymesh-specific address of the account. Serves as an identifier

### authorizations

• **authorizations**: [*Authorizations*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/authorizations)*‹*[*Account*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/account)*›*

*Defined in* [*src/api/entities/Account.ts:72*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L72)

### `Protected` context

• **context**: [*Context*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/context)

*Inherited from* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/entity)*.*[*context*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/entity#protected-context)

*Defined in* [*src/api/entities/Entity.ts:48*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Entity.ts#L48)

### key

• **key**: *string*

*Defined in* [*src/api/entities/Account.ts:69*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L69)

public key of the account. This is a hex representation of the address that is transversal to any Substrate chain

### uuid

• **uuid**: *string*

*Inherited from* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/entity)*.*[*uuid*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/entity#uuid)

*Defined in* [*src/api/entities/Entity.ts:46*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Entity.ts#L46)

## Methods

### exists

▸ **exists**(): *Promise‹boolean›*

*Overrides* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/entity)*.*[*exists*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/entity#abstract-exists)

*Defined in* [*src/api/entities/Account.ts:444*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L444)

Determine whether this Account exists on chain

**Returns:** *Promise‹boolean›*

### getBalance

▸ **getBalance**(): *Promise‹*[*AccountBalance*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/globals#accountbalance)*›*

*Defined in* [*src/api/entities/Account.ts:109*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L109)

Get the free/locked POLYX balance of the account

**`note`** can be subscribed to

**Returns:** *Promise‹*[*AccountBalance*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/globals#accountbalance)*›*

▸ **getBalance**(`callback`: [SubCallback](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/globals#subcallback)‹[AccountBalance](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/globals#accountbalance)›): *Promise‹*[*UnsubCallback*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/globals#unsubcallback)*›*

*Defined in* [*src/api/entities/Account.ts:110*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L110)

**Parameters:**

| Name       | Type                                                                                                                                                                                                                         |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `callback` | [SubCallback](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/globals#subcallback)‹[AccountBalance](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/globals#accountbalance)› |

**Returns:** *Promise‹*[*UnsubCallback*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/globals#unsubcallback)*›*

### getIdentity

▸ **getIdentity**(): *Promise‹*[*Identity*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/identity) *| null›*

*Defined in* [*src/api/entities/Account.ts:152*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L152)

Retrieve the Identity associated to this Account (null if there is none)

**Returns:** *Promise‹*[*Identity*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/identity) *| null›*

### getPermissions

▸ **getPermissions**(): *Promise‹Permissions›*

*Defined in* [*src/api/entities/Account.ts:290*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L290)

Retrieve the Permissions this Signer has as a Signing Key for its corresponding Identity

**Returns:** *Promise‹Permissions›*

### getSubsidy

▸ **getSubsidy**(): *Promise‹Omit‹*[*Subsidy*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/subsidy)*, "beneficiary"› | null›*

*Defined in* [*src/api/entities/Account.ts:131*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L131)

Get the subsidized balance of this Account and the subsidizer Account. If this Account isn't being subsidized, return null

**`note`** can be subscribed to

**Returns:** *Promise‹Omit‹*[*Subsidy*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/subsidy)*, "beneficiary"› | null›*

▸ **getSubsidy**(`callback`: [SubCallback](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/globals#subcallback)‹Omit‹[Subsidy](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/subsidy), "beneficiary"› | null›): *Promise‹*[*UnsubCallback*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/globals#unsubcallback)*›*

*Defined in* [*src/api/entities/Account.ts:132*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L132)

**Parameters:**

| Name       | Type                                                                                                                                                                                                                                           |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `callback` | [SubCallback](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/globals#subcallback)‹Omit‹[Subsidy](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/subsidy), "beneficiary"› \| null› |

**Returns:** *Promise‹*[*UnsubCallback*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/globals#unsubcallback)*›*

### getTransactionHistory

▸ **getTransactionHistory**(`filters`: object): *Promise‹*[*ResultSet*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/resultset)*‹*[*ExtrinsicData*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/extrinsicdata)*››*

*Defined in* [*src/api/entities/Account.ts:184*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L184)

Retrieve a list of transactions signed by this account. Can be filtered using parameters

**`note`** uses the middleware

**Parameters:**

▪`Default value` **filters**: *object*= {}

| Name           | Type                       | Description                                   |
| -------------- | -------------------------- | --------------------------------------------- |
| `blockNumber?` | BigNumber                  | -                                             |
| `orderBy?`     | TransactionOrderByInput    | -                                             |
| `size?`        | undefined \| number        | page size                                     |
| `start?`       | undefined \| number        | page offset                                   |
| `success?`     | undefined \| false \| true | whether the transaction was successful or not |
| `tag?`         | TxTag                      | tag associated with the transaction           |

**Returns:** *Promise‹*[*ResultSet*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/resultset)*‹*[*ExtrinsicData*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/extrinsicdata)*››*

### hasPermissions

▸ **hasPermissions**(`permissions`: [SimplePermissions](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/simplepermissions)): *Promise‹boolean›*

*Defined in* [*src/api/entities/Account.ts:318*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L318)

Check if this Account possesses certain Permissions for its corresponding Identity

**Parameters:**

| Name          | Type                                                                                                                      |
| ------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `permissions` | [SimplePermissions](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/simplepermissions) |

**Returns:** *Promise‹boolean›*

### isEqual

▸ **isEqual**(`entity`: [Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/entity)‹unknown, unknown›): *boolean*

*Inherited from* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/entity)*.*[*isEqual*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/entity#isequal)

*Defined in* [*src/api/entities/Entity.ts:61*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Entity.ts#L61)

Determine whether this Entity is the same as another one

**Parameters:**

| Name     | Type                                                                                                               |
| -------- | ------------------------------------------------------------------------------------------------------------------ |
| `entity` | [Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/entity)‹unknown, unknown› |

**Returns:** *boolean*

### isFrozen

▸ **isFrozen**(): *Promise‹boolean›*

*Defined in* [*src/api/entities/Account.ts:269*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L269)

Check whether this Account is frozen. If frozen, it cannot perform any action until the primary key of the Identity unfreezes all secondary keys

**Returns:** *Promise‹boolean›*

### leaveIdentity

▸ **leaveIdentity**(`args`: void, `opts?`: [ProcedureOpts](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/procedureopts)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/transactionqueue)*‹void››*

*Defined in* [*src/api/entities/Account.ts:100*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L100)

Leave the Account's Identity. This operation can only be done if the Account is a secondary key for the Identity

**`note`** this method is of type [ProcedureMethod](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/proceduremethod), which means you can call `leaveIdentity.checkAuthorization` on it to see whether the Current Account has the required permissions to run it

**Parameters:**

| Name    | Type                                                                                                              |
| ------- | ----------------------------------------------------------------------------------------------------------------- |
| `args`  | void                                                                                                              |
| `opts?` | [ProcedureOpts](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/procedureopts) |

**Returns:** *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/transactionqueue)*‹void››*

### toJson

▸ **toJson**(): *string*

*Overrides* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/entity)*.*[*toJson*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/entity#abstract-tojson)

*Defined in* [*src/api/entities/Account.ts:451*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Account.ts#L451)

Return the Account's address

**Returns:** *string*

### `Static` generateUuid

▸ **generateUuid**‹**Identifiers**›(`identifiers`: Identifiers): *string*

*Inherited from* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/entity)*.*[*generateUuid*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/entity#static-generateuuid)

*Defined in* [*src/api/entities/Entity.ts:14*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Entity.ts#L14)

Generate the Entity's UUID from its identifying properties

**Type parameters:**

▪ **Identifiers**

**Parameters:**

| Name          | Type        | Description |
| ------------- | ----------- | ----------- |
| `identifiers` | Identifiers |             |

**Returns:** *string*

### `Static` unserialize

▸ **unserialize**‹**Identifiers**›(`serialized`: string): *Identifiers*

*Inherited from* [*Entity*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/entity)*.*[*unserialize*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/entity#static-unserialize)

*Defined in* [*src/api/entities/Entity.ts:23*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Entity.ts#L23)

Unserialize a UUID into its Unique Identifiers

**Type parameters:**

▪ **Identifiers**

**Parameters:**

| Name         | Type   | Description         |
| ------------ | ------ | ------------------- |
| `serialized` | string | UUID to unserialize |

**Returns:** *Identifiers*
