# api\_entities\_Portfolio.Portfolio

[@polymeshassociation/polymesh-sdk](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes) / [Modules](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/modules) / [api/entities/Portfolio](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/modules-1/api_entities_portfolio) / Portfolio

## Class: Portfolio

[api/entities/Portfolio](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/modules-1/api_entities_portfolio).Portfolio

Represents a base Portfolio for a specific Identity in the Polymesh blockchain

### Hierarchy

* [`Entity`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity)<[`UniqueIdentifiers`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/api_entities_portfolio.uniqueidentifiers), `HumanReadable`>

  ↳ **`Portfolio`**

  ↳↳ [`DefaultPortfolio`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_defaultportfolio.defaultportfolio)

  ↳↳ [`NumberedPortfolio`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_numberedportfolio.numberedportfolio)

### Table of contents

#### Properties

* [owner](#owner)
* [uuid](#uuid)

#### Methods

* [exists](#exists)
* [getAssetBalances](#getassetbalances)
* [getCustodian](#getcustodian)
* [getTransactionHistory](#gettransactionhistory)
* [isCustodiedBy](#iscustodiedby)
* [isEqual](#isequal)
* [isOwnedBy](#isownedby)
* [moveFunds](#movefunds)
* [quitCustody](#quitcustody)
* [setCustodian](#setcustodian)
* [toHuman](#tohuman)
* [generateUuid](#generateuuid)
* [unserialize](#unserialize)

### Properties

#### owner

• **owner**: [`Identity`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_identity.identity)

Identity of the Portfolio's owner

**Defined in**

[api/entities/Portfolio/index.ts:75](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Portfolio/index.ts#L75)

***

#### uuid

• **uuid**: `string`

**Inherited from**

[Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity).[uuid](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/api_entities_entity.entity#uuid)

**Defined in**

[api/entities/Entity.ts:46](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Entity.ts#L46)

### Methods

#### exists

▸ `Abstract` **exists**(): `Promise`<`boolean`>

Determine whether this Entity exists on chain

**Returns**

`Promise`<`boolean`>

**Inherited from**

[Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity).[exists](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/api_entities_entity.entity#exists)

**Defined in**

[api/entities/Entity.ts:68](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Entity.ts#L68)

***

#### getAssetBalances

▸ **getAssetBalances**(`args?`): `Promise`<[`PortfolioBalance`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/api_entities_portfolio_types.portfoliobalance)\[]>

Retrieve the balances of all Assets in this Portfolio

**Parameters**

| Name          | Type                                                                                                                                   | Description                                                                                                   |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `args?`       | `Object`                                                                                                                               | -                                                                                                             |
| `args.assets` | (`string` \| [`Asset`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_asset.asset))\[] | array of Assets (or tickers) for which to fetch balances (optional, all balances are retrieved if not passed) |

**Returns**

`Promise`<[`PortfolioBalance`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/api_entities_portfolio_types.portfoliobalance)\[]>

**Defined in**

[api/entities/Portfolio/index.ts:141](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Portfolio/index.ts#L141)

***

#### getCustodian

▸ **getCustodian**(): `Promise`<[`Identity`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_identity.identity)>

Retrieve the custodian Identity of this Portfolio

**`note`** if no custodian is set, the owner Identity is returned

**Returns**

`Promise`<[`Identity`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_identity.identity)>

**Defined in**

[api/entities/Portfolio/index.ts:271](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Portfolio/index.ts#L271)

***

#### getTransactionHistory

▸ **getTransactionHistory**(`filters?`): `Promise`<[`ResultSet`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.resultset)<[`HistoricSettlement`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/api_entities_portfolio_types.historicsettlement)>>

Retrieve a list of transactions where this portfolio was involved. Can be filtered using parameters

**`note`** supports pagination

**`note`** uses the middleware

**Parameters**

| Name               | Type        | Description                        |
| ------------------ | ----------- | ---------------------------------- |
| `filters`          | `Object`    | -                                  |
| `filters.account?` | `string`    | Account involved in the settlement |
| `filters.size?`    | `BigNumber` | page size                          |
| `filters.start?`   | `BigNumber` | page offset                        |
| `filters.ticker?`  | `string`    | ticker involved in the transaction |

**Returns**

`Promise`<[`ResultSet`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.resultset)<[`HistoricSettlement`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/api_entities_portfolio_types.historicsettlement)>>

**Defined in**

[api/entities/Portfolio/index.ts:316](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Portfolio/index.ts#L316)

***

#### isCustodiedBy

▸ **isCustodiedBy**(`args?`): `Promise`<`boolean`>

Return whether an Identity is the Portfolio custodian

**Parameters**

| Name            | Type                                                                                                                                       | Description                                |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------ |
| `args?`         | `Object`                                                                                                                                   | -                                          |
| `args.identity` | `string` \| [`Identity`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_identity.identity) | optional, defaults to the signing Identity |

**Returns**

`Promise`<`boolean`>

**Defined in**

[api/entities/Portfolio/index.ts:125](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Portfolio/index.ts#L125)

***

#### isEqual

▸ **isEqual**(`entity`): `boolean`

Determine whether this Entity is the same as another one

**Parameters**

| Name     | Type                                                                                                                                           |
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `entity` | [`Entity`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity)<`unknown`, `unknown`> |

**Returns**

`boolean`

**Inherited from**

[Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity).[isEqual](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/api_entities_entity.entity#isequal)

**Defined in**

[api/entities/Entity.ts:61](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Entity.ts#L61)

***

#### isOwnedBy

▸ **isOwnedBy**(`args?`): `Promise`<`boolean`>

Return whether an Identity is the Portfolio owner

**Parameters**

| Name            | Type                                                                                                                                       | Description                      |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- |
| `args?`         | `Object`                                                                                                                                   | -                                |
| `args.identity` | `string` \| [`Identity`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_identity.identity) | defaults to the signing Identity |

**Returns**

`Promise`<`boolean`>

**Defined in**

[api/entities/Portfolio/index.ts:112](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Portfolio/index.ts#L112)

***

#### moveFunds

▸ **moveFunds**(`args`, `opts?`): `Promise`<`TransactionQueue`<`void`, `void`, `unknown`\[]\[]>>

Moves funds from this Portfolio to another one owned by the same Identity

**`note`** required role:

* Portfolio Custodian

**`note`** this method is of type [ProcedureMethod](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.proceduremethod), which means you can call [moveFunds.checkAuthorization](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.proceduremethod#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters**

| Name    | Type                                                                                                                                               |
| ------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `args`  | [`MoveFundsParams`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/api_procedures_movefunds.movefundsparams) |
| `opts?` | [`ProcedureOpts`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.procedureopts)                        |

**Returns**

`Promise`<`TransactionQueue`<`void`, `void`, `unknown`\[]\[]>>

**Defined in**

[api/entities/Portfolio/index.ts:249](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Portfolio/index.ts#L249)

***

#### quitCustody

▸ **quitCustody**(`opts?`): `Promise`<`TransactionQueue`<`void`, `void`, `unknown`\[]\[]>>

Returns the custody of the portfolio to the portfolio owner unilaterally

**`note`** required role:

* Portfolio Custodian

**`note`** this method is of type [NoArgsProcedureMethod](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.noargsproceduremethod), which means you can call [quitCustody.checkAuthorization](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.noargsproceduremethod#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://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.procedureopts) |

**Returns**

`Promise`<`TransactionQueue`<`void`, `void`, `unknown`\[]\[]>>

**Defined in**

[api/entities/Portfolio/index.ts:262](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Portfolio/index.ts#L262)

***

#### setCustodian

▸ **setCustodian**(`args`, `opts?`): `Promise`<`TransactionQueue`<[`AuthorizationRequest`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_authorizationrequest.authorizationrequest), [`AuthorizationRequest`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_authorizationrequest.authorizationrequest), `unknown`\[]\[]>>

Send an invitation to an Identity to assign it as custodian for this Portfolio

**`note`** this will create an [Authorization Request](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_authorizationrequest.authorizationrequest) which has to be accepted by the `targetIdentity`. An [Account](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_account.account) or [Identity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_identity.identity) can fetch its pending Authorization Requests by calling [authorizations.getReceived](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/api_entities_common_namespaces_authorizations.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-alpha/api_entities_common_namespaces_authorizations.authorizations#getone)

**`note`** required role:

* Portfolio Custodian

**`note`** this method is of type [ProcedureMethod](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.proceduremethod), which means you can call [setCustodian.checkAuthorization](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.proceduremethod#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters**

| Name    | Type                                                                                                                                                        |
| ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `args`  | [`SetCustodianParams`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/api_procedures_setcustodian.setcustodianparams) |
| `opts?` | [`ProcedureOpts`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/interfaces/types.procedureopts)                                 |

**Returns**

`Promise`<`TransactionQueue`<[`AuthorizationRequest`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_authorizationrequest.authorizationrequest), [`AuthorizationRequest`](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_authorizationrequest.authorizationrequest), `unknown`\[]\[]>>

**Defined in**

[api/entities/Portfolio/index.ts:236](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Portfolio/index.ts#L236)

***

#### toHuman

▸ **toHuman**(): `HumanReadable`

Return the Portfolio ID and owner DID

**Returns**

`HumanReadable`

**Overrides**

[Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity).[toHuman](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/api_entities_entity.entity#tohuman)

**Defined in**

[api/entities/Portfolio/index.ts:413](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Portfolio/index.ts#L413)

***

#### generateUuid

▸ `Static` **generateUuid**<`Identifiers`>(`identifiers`): `string`

Generate the Entity's UUID from its identifying properties

**Type parameters**

| Name          |
| ------------- |
| `Identifiers` |

**Parameters**

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

**Returns**

`string`

**Inherited from**

[Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity).[generateUuid](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/api_entities_entity.entity#generateuuid)

**Defined in**

[api/entities/Entity.ts:14](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Entity.ts#L14)

***

#### unserialize

▸ `Static` **unserialize**<`Identifiers`>(`serialized`): `Identifiers`

Unserialize a UUID into its Unique Identifiers

**Type parameters**

| Name          |
| ------------- |
| `Identifiers` |

**Parameters**

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

**Returns**

`Identifiers`

**Inherited from**

[Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/classes/api_entities_entity.entity).[unserialize](https://developers.polymath.network/polymesh-sdk-api-reference/docs-alpha/api_entities_entity.entity#unserialize)

**Defined in**

[api/entities/Entity.ts:23](https://github.com/PolymathNetwork/polymesh-sdk/blob/31dfa0dc/src/api/entities/Entity.ts#L23)
