# AccountManagement

Handles functionality related to Account Management

## Hierarchy

* **AccountManagement**

## Index

### Methods

* [freezeSecondaryAccounts](#freezesecondaryaccounts)
* [getAccount](#getaccount)
* [getAccountBalance](#getaccountbalance)
* [getSigningAccount](#getsigningaccount)
* [getSigningAccounts](#getsigningaccounts)
* [inviteAccount](#inviteaccount)
* [leaveIdentity](#leaveidentity)
* [modifyPermissions](#modifypermissions)
* [removeSecondaryAccounts](#removesecondaryaccounts)
* [revokePermissions](#revokepermissions)
* [subsidizeAccount](#subsidizeaccount)
* [unfreezeSecondaryAccounts](#unfreezesecondaryaccounts)

## Methods

### freezeSecondaryAccounts

▸ **freezeSecondaryAccounts**(`opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹void››*

*Defined in* [*src/AccountManagement.ts:167*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/AccountManagement.ts#L167)

Freeze all of the secondary Accounts in the signing Identity. This means revoking their permission to perform any operation on the blockchain and freezing their funds until the Accounts are unfrozen via [unfreezeSecondaryAccounts](#unfreezesecondaryaccounts)

**`note`** this method is of type [NoArgsProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md), which means you can call [freezeSecondaryAccounts.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                             |
| ------- | ---------------------------------------------------------------------------------------------------------------- |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md) |

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

***

### getAccount

▸ **getAccount**(`args`: object): [*Account*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/account)

*Defined in* [*src/AccountManagement.ts:248*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/AccountManagement.ts#L248)

Return an Account instance from an address

**Parameters:**

▪ **args**: *object*

| Name      | Type   |
| --------- | ------ |
| `address` | string |

**Returns:** [*Account*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/account)

***

### getAccountBalance

▸ **getAccountBalance**(`args?`: undefined | object): *Promise‹*[*AccountBalance*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/globals#accountbalance)*›*

*Defined in* [*src/AccountManagement.ts:202*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/AccountManagement.ts#L202)

Get the free/locked POLYX balance of an Account

**`note`** can be subscribed to

**Parameters:**

| Name    | Type                |
| ------- | ------------------- |
| `args?` | undefined \| object |

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

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

*Defined in* [*src/AccountManagement.ts:203*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/AccountManagement.ts#L203)

**Parameters:**

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

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

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

*Defined in* [*src/AccountManagement.ts:204*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/AccountManagement.ts#L204)

**Parameters:**

▪ **args**: *object*

| Name      | Type                                                                                                          |
| --------- | ------------------------------------------------------------------------------------------------------------- |
| `account` | string \| [Account](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/account) |

▪ **callback**: [*SubCallback*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/globals#subcallback)*‹*[*AccountBalance*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/globals#accountbalance)*›*

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

***

### getSigningAccount

▸ **getSigningAccount**(): [*Account*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/account) *| null*

*Defined in* [*src/AccountManagement.ts:257*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/AccountManagement.ts#L257)

Return the signing Account, or null if no signing Account has been set

**Returns:** [*Account*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/account) *| null*

***

### getSigningAccounts

▸ **getSigningAccounts**(): *Promise‹*[*Account*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/account)*\[]›*

*Defined in* [*src/AccountManagement.ts:270*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/AccountManagement.ts#L270)

Return a list that contains all the signing Accounts associated to the SDK instance's Signing Manager

**`throws`** — if there is no Signing Manager attached to the SDK

**Returns:** *Promise‹*[*Account*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/account)*\[]›*

***

### inviteAccount

▸ **inviteAccount**(`args`: [InviteAccountParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/inviteaccountparams.md), `opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹*[*AuthorizationRequest*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/authorizationrequest)*››*

*Defined in* [*src/AccountManagement.ts:157*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/AccountManagement.ts#L157)

Send an invitation to an Account to join the signing Identity as a secondary Account

**`note`** this will create an [Authorization Request](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/authorizationrequest) which has to be accepted by the `targetAccount`. An [Account](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/enums/signertype.md#account) or [Identity](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/enums/roletype.md#identity) can fetch its pending Authorization Requests by calling [authorizations.getReceived](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/authorizations#getreceived). Also, an Account or Identity can directly fetch the details of an Authorization Request by calling [authorizations.getOne](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/authorizations#getone)

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md), which means you can call [inviteAccount.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                                         |
| ------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `args`  | [InviteAccountParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/inviteaccountparams.md) |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)             |

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

***

### leaveIdentity

▸ **leaveIdentity**(`opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹void››*

*Defined in* [*src/AccountManagement.ts:109*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/AccountManagement.ts#L109)

Disassociate the signing Account from its Identity. This operation can only be done if the signing Account is a secondary Account

**`note`** this method is of type [NoArgsProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md), which means you can call [leaveIdentity.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                             |
| ------- | ---------------------------------------------------------------------------------------------------------------- |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md) |

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

***

### modifyPermissions

▸ **modifyPermissions**(`args`: [ModifySignerPermissionsParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/modifysignerpermissionsparams.md), `opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹void››*

*Defined in* [*src/AccountManagement.ts:143*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/AccountManagement.ts#L143)

Modify all permissions of a list of secondary Accounts associated with the signing Identity

**`throws`** if the signing Account is not the primary Account of the Identity whose secondary Account permissions are being modified

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md), which means you can call [modifyPermissions.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                                                             |
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `args`  | [ModifySignerPermissionsParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/modifysignerpermissionsparams.md) |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)                                 |

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

***

### removeSecondaryAccounts

▸ **removeSecondaryAccounts**(`args`: [RemoveSecondaryAccountsParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/removesecondaryaccountsparams.md), `opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹void››*

*Defined in* [*src/AccountManagement.ts:119*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/AccountManagement.ts#L119)

Remove a list of secondary Accounts associated with the signing Identity

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md), which means you can call [removeSecondaryAccounts.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                                                             |
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `args`  | [RemoveSecondaryAccountsParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/removesecondaryaccountsparams.md) |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)                                 |

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

***

### revokePermissions

▸ **revokePermissions**(`args`: object, `opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹void››*

*Defined in* [*src/AccountManagement.ts:131*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/AccountManagement.ts#L131)

Revoke all permissions of a list of secondary Accounts associated with the signing Identity

**`throws`** if the signing Account is not the primary Account of the Identity whose secondary Account permissions are being revoked

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md), which means you can call [revokePermissions.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

▪ **args**: *object*

| Name                | Type                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------------------------ |
| `secondaryAccounts` | [Account](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/account)\[] |

▪`Optional` **opts**: [*ProcedureOpts*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)

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

***

### subsidizeAccount

▸ **subsidizeAccount**(`args`: [SubsidizeAccountParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/subsidizeaccountparams.md), `opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹*[*AuthorizationRequest*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/authorizationrequest)*››*

*Defined in* [*src/AccountManagement.ts:191*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/AccountManagement.ts#L191)

Send an Authorization Request to an Account to subsidize its transaction fees

**`note`** this will create an [Authorization Request](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/authorizationrequest) which has to be accepted by the `beneficiary` Account. An [Account](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/enums/signertype.md#account) or [Identity](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/enums/roletype.md#identity) can fetch its pending Authorization Requests by calling [authorizations.getReceived](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/authorizations#getreceived). Also, an Account or Identity can directly fetch the details of an Authorization Request by calling [authorizations.getOne](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/authorizations#getone)

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md), which means you can call [subsidizeAccount.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                                               |
| ------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `args`  | [SubsidizeAccountParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/subsidizeaccountparams.md) |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)                   |

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

***

### unfreezeSecondaryAccounts

▸ **unfreezeSecondaryAccounts**(`opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue)*‹void››*

*Defined in* [*src/AccountManagement.ts:177*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/AccountManagement.ts#L177)

Unfreeze all of the secondary Accounts in the signing Identity. This will restore their permissions as they were before being frozen

**`note`** this method is of type [NoArgsProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md), which means you can call [unfreezeSecondaryAccounts.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/noargsproceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                             |
| ------- | ---------------------------------------------------------------------------------------------------------------- |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md) |

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