api.entities.Identity.Portfolios - PolymeshAssociation/polymesh-sdk GitHub Wiki

@polymeshassociation/polymesh-sdk / api/entities/Identity/Portfolios

api/entities/Identity/Portfolios

Classes

Portfolios

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

Handles all Portfolio related functionality on the Identity side

Extends

Methods

delete()

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

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

Delete a Portfolio by ID

Parameters
Parameter Type Description
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?): Promise<ResultSet<DefaultPortfolio | NumberedPortfolio>>

Defined in: 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
Parameter 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

getPortfolio()
Call Signature

getPortfolio(): Promise<DefaultPortfolio>

Defined in: 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): Promise<NumberedPortfolio>

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

Retrieve a Numbered Portfolio by its ID

Parameters
Parameter Type Description
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): Promise<NumberedPortfolio>

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

Retrieve a Numbered Portfolio by its name

Parameters
Parameter Type Description
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: 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?): Promise<HistoricSettlement[]>

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

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

Parameters
Parameter Type Description
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