# Portfolio

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

## Hierarchy

* [Entity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/entity)‹UniqueIdentifiers, [HumanReadable](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/humanreadable.md)›

  ↳ **Portfolio**

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

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

## Index

### Properties

* [\_id](#protected-optional-_id)
* [context](#protected-context)
* [owner](#owner)
* [uuid](#uuid)

### Methods

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

## Properties

### `Protected` `Optional` \_id

• **\_id**? : *BigNumber*

*Defined in* [*src/api/entities/Portfolio/index.ts:83*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Portfolio/index.ts#L83)

internal Portfolio identifier (unused for default Portfolio)

***

### `Protected` context

• **context**: *Context*

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

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

***

### owner

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

*Defined in* [*src/api/entities/Portfolio/index.ts:78*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Portfolio/index.ts#L78)

Identity of the Portfolio's owner

***

### uuid

• **uuid**: *string*

*Inherited from* [*CheckpointSchedule*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule)*.*[*uuid*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/checkpointschedule#uuid)

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

## Methods

### `Abstract` exists

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

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

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

Determine whether this Entity exists on chain

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

***

### getAssetBalances

▸ **getAssetBalances**(`args?`: undefined | object): *Promise‹*[*PortfolioBalance*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/portfoliobalance.md)*\[]›*

*Defined in* [*src/api/entities/Portfolio/index.ts:144*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Portfolio/index.ts#L144)

Retrieve the balances of all Assets in this Portfolio

**Parameters:**

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

**Returns:** *Promise‹*[*PortfolioBalance*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/portfoliobalance.md)*\[]›*

***

### getCustodian

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

*Defined in* [*src/api/entities/Portfolio/index.ts:274*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Portfolio/index.ts#L274)

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-beta/classes/identity)*›*

***

### getTransactionHistory

▸ **getTransactionHistory**(`filters`: object): *Promise‹*[*ResultSet*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/resultset.md)*‹*[*HistoricSettlement*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/historicsettlement.md)*››*

*Defined in* [*src/api/entities/Portfolio/index.ts:319*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Portfolio/index.ts#L319)

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

**`note`** supports pagination

**`note`** uses the middleware

**Parameters:**

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

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

**Returns:** *Promise‹*[*ResultSet*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/resultset.md)*‹*[*HistoricSettlement*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/historicsettlement.md)*››*

***

### getTransactionHistoryV2

▸ **getTransactionHistoryV2**(`filters`: object): *Promise‹*[*HistoricSettlement*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/historicsettlement.md)*\[]›*

*Defined in* [*src/api/entities/Portfolio/index.ts:421*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Portfolio/index.ts#L421)

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

**`note`** uses the middlewareV2

**Parameters:**

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

| Name       | Type                | Description                        |
| ---------- | ------------------- | ---------------------------------- |
| `account?` | undefined \| string | Account involved in the settlement |
| `ticker?`  | undefined \| string | ticker involved in the transaction |

**Returns:** *Promise‹*[*HistoricSettlement*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/historicsettlement.md)*\[]›*

***

### isCustodiedBy

▸ **isCustodiedBy**(`args?`: undefined | object): *Promise‹boolean›*

*Defined in* [*src/api/entities/Portfolio/index.ts:128*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Portfolio/index.ts#L128)

Return whether an Identity is the Portfolio custodian

**Parameters:**

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

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

***

### isEqual

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

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

*Defined in* [*src/api/entities/Entity.ts:61*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/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-beta/classes/entity)‹unknown, unknown› |

**Returns:** *boolean*

***

### isOwnedBy

▸ **isOwnedBy**(`args?`: undefined | object): *Promise‹boolean›*

*Defined in* [*src/api/entities/Portfolio/index.ts:115*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Portfolio/index.ts#L115)

Return whether an Identity is the Portfolio owner

**Parameters:**

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

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

***

### moveFunds

▸ **moveFunds**(`args`: [MoveFundsParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/movefundsparams.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/api/entities/Portfolio/index.ts:252*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Portfolio/index.ts#L252)

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://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md), which means you can call [moveFunds.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`  | [MoveFundsParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/movefundsparams.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››*

***

### quitCustody

▸ **quitCustody**(`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/api/entities/Portfolio/index.ts:265*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Portfolio/index.ts#L265)

Returns the custody of the portfolio to the portfolio owner unilaterally

**`note`** required role:

* Portfolio Custodian

**`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 [quitCustody.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››*

***

### setCustodian

▸ **setCustodian**(`args`: [SetCustodianParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/setcustodianparams.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/api/entities/Portfolio/index.ts:239*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Portfolio/index.ts#L239)

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-beta/classes/authorizationrequest) which has to be accepted by the `targetIdentity`. 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`** required role:

* Portfolio Custodian

**`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 [setCustodian.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`  | [SetCustodianParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/setcustodianparams.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)*››*

***

### toHuman

▸ **toHuman**(): [*HumanReadable*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/humanreadable.md)

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

*Defined in* [*src/api/entities/Portfolio/index.ts:540*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Portfolio/index.ts#L540)

Return the Portfolio ID and owner DID

**Returns:** [*HumanReadable*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/humanreadable.md)

***

### `Static` generateUuid

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

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

*Defined in* [*src/api/entities/Entity.ts:14*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/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* [*CheckpointSchedule*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/checkpointschedule)*.*[*unserialize*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/checkpointschedule#static-unserialize)

*Defined in* [*src/api/entities/Entity.ts:23*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/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*
