Skip to main content
Version: 31.0.x

Class: Portfolios

Defined in: src/api/entities/Identity/Portfolios.ts:35

Handles all Portfolio related functionality on the Identity side

Extends​

Methods​

delete()​

delete(args: object, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/Identity/Portfolios.ts:224

Delete a Portfolio by ID

Parameters​

ParameterTypeDescription

args

{ portfolio: BigNumber | NumberedPortfolio; }

‐

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


getCustodiedPortfolios()​

getCustodiedPortfolios(paginationOpts?: PaginationOptions): Promise<ResultSet<DefaultPortfolio | NumberedPortfolio>>

Defined in: src/api/entities/Identity/Portfolios.ts:96

Retrieve all Portfolios custodied by this Identity. This only includes portfolios owned by a different Identity but custodied by this one. To fetch Portfolios owned by this Identity, use getPortfolios

Parameters​

ParameterTypeDescription

paginationOpts?

PaginationOptions

Optional pagination options

Returns​

Promise<ResultSet<DefaultPortfolio | NumberedPortfolio>>

A ResultSet of portfolios (Default or Numbered) and pagination metadata

Note​

supports pagination


getPortfolio()​

Call Signature​

getPortfolio(): Promise<DefaultPortfolio>

Defined in: src/api/entities/Identity/Portfolios.ts:143

Retrieve the Default Portfolio for this Identity

Returns​

Promise<DefaultPortfolio>

Promise that resolves to the Default Portfolio

Call Signature​

getPortfolio(args: object): Promise<NumberedPortfolio>

Defined in: src/api/entities/Identity/Portfolios.ts:151

Retrieve a Numbered Portfolio by its ID

Parameters​
ParameterTypeDescription

args

{ portfolioId: BigNumber; }

‐

args.portfolioId

BigNumber

ID of the Portfolio to retrieve

Returns​

Promise<NumberedPortfolio>

Promise that resolves to the requested Numbered Portfolio


getPortfolioByName()​

getPortfolioByName(args: object): Promise<NumberedPortfolio>

Defined in: src/api/entities/Identity/Portfolios.ts:188

Retrieve a Numbered Portfolio by its name

Parameters​

ParameterTypeDescription

args

{ name: string; }

‐

args.name

string

Name of the Portfolio to fetch

Returns​

Promise<NumberedPortfolio>

Promise that resolves to the Portfolio with the given name

Throws​

if no Portfolio exists with the given name


getPortfolios()​

getPortfolios(): Promise<[DefaultPortfolio, ...NumberedPortfolio[]]>

Defined in: src/api/entities/Identity/Portfolios.ts:62

Retrieve all the 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


getTransactionHistory()​

getTransactionHistory(filters?: object): Promise<HistoricSettlement[]>

Defined in: src/api/entities/Identity/Portfolios.ts:236

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

Parameters​

ParameterTypeDescription

filters

{ account?: string; assetId?: string; ticker?: string; }

‐

filters.account?

string

Account involved in the settlement

filters.assetId?

string

Asset ID to filter by (overrides ticker if both provided)

filters.ticker?

string

ticker involved in the transaction

Returns​

Promise<HistoricSettlement[]>

Promise that resolves to an array of historical settlements

Note​

uses the middlewareV2