Class: Portfolios
api/entities/Identity/Portfolios.Portfolios
Handles all Portfolio-related functionality on the Identity side
Hierarchy
-
Namespace
<Identity
>↳
Portfolios
Methods
delete
▸ delete(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Delete a Portfolio
Parameters
Name | Type | Description |
---|---|---|
args | Object | - |
args.portfolio | BigNumber | NumberedPortfolio | Portfolio instance or portfolio ID to delete |
opts? | ProcedureOpts | - |
Returns
Promise
<GenericPolymeshTransaction
<void
, void
>>
Note
The calling Identity must be the custodian of the Portfolio
Note
this method is of type ProcedureMethod, which means you can call delete.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/entities/Identity/Portfolios.ts:231
getCustodiedPortfolios
▸ getCustodiedPortfolios(paginationOpts?
): Promise
<ResultSet
<DefaultPortfolio
| NumberedPortfolio
>>
Retrieve all Portfolios currently custodied by this Identity
These include portfolios owned by another Identity but with this one as custodian.
To fetch portfolios actually owned by this Identity, use getPortfolios
.
Parameters
Name | Type | Description |
---|---|---|
paginationOpts? | PaginationOptions | Optional pagination options |
Returns
Promise
<ResultSet
<DefaultPortfolio
| NumberedPortfolio
>>
A ResultSet of portfolios (Default or Numbered) and pagination metadata
Note
supports pagination
Defined in
api/entities/Identity/Portfolios.ts:97
getPortfolio
▸ getPortfolio(): Promise
<DefaultPortfolio
>
Retrieve the Default Portfolio owned by this Identity
Returns
Promise
<DefaultPortfolio
>
The Default Portfolio
Defined in
api/entities/Identity/Portfolios.ts:144
▸ getPortfolio(args
): Promise
<NumberedPortfolio
>
Retrieve a Numbered Portfolio owned by this Identity
Parameters
Name | Type | Description |
---|---|---|
args | Object | - |
args.portfolioId | BigNumber | The ID of the Numbered Portfolio to retrieve |
Returns
Promise
<NumberedPortfolio
>
The requested Numbered Portfolio
Throws
If the specified Numbered Portfolio does not exist
Defined in
api/entities/Identity/Portfolios.ts:154
getPortfolioByName
▸ getPortfolioByName(args
): Promise
<NumberedPortfolio
>
Retrieve a Numbered Portfolio by name
Parameters
Name | Type | Description |
---|---|---|
args | Object | - |
args.name | string | Name of the Portfolio to fetch |
Returns
Promise
<NumberedPortfolio
>
The Portfolio with the given name
Throws
If no Portfolio exists with the specified name
Defined in
api/entities/Identity/Portfolios.ts:192
getPortfolios
▸ getPortfolios(): Promise
<[DefaultPortfolio
, ...NumberedPortfolio[]]>
Retrieve all Portfolios owned by this Identity
Returns
Promise
<[DefaultPortfolio
, ...NumberedPortfolio[]]>
An array where the first item is always the Default Portfolio, followed by any Numbered Portfolios owned by this Identity
Defined in
api/entities/Identity/Portfolios.ts:63
getTransactionHistory
▸ getTransactionHistory(filters?
): Promise
<HistoricSettlement
[]>
Retrieve historical transaction activity involving portfolios of this Identity
This includes transfers and settlements that involved any portfolio owned by this Identity.
Parameters
Name | Type | Description |
---|---|---|
filters | Object | - |
filters.account? | string | Account address involved in the settlement |
filters.assetId? | string | Asset ID to filter by (overrides ticker if both provided) |
filters.ticker? | string | Asset ticker to filter by |
Returns
Promise
<HistoricSettlement
[]>
An array of historical settlements related to this Identity