Skip to content

api.entities.NumberedPortfolio.NumberedPortfolio

prashantasdeveloper edited this page Sep 11, 2024 · 65 revisions

Class: NumberedPortfolio

api/entities/NumberedPortfolio.NumberedPortfolio

Represents a numbered (non-default) Portfolio for an Identity

Hierarchy

Table of contents

Properties

Methods

Properties

id

id: BigNumber

Portfolio identifier number

Defined in

api/entities/NumberedPortfolio.ts:39


owner

owner: Identity

Identity of the Portfolio's owner

Inherited from

Portfolio.owner

Defined in

api/entities/Portfolio/index.ts:82


uuid

uuid: string

Inherited from

Portfolio.uuid

Defined in

api/entities/Entity.ts:46

Methods

createdAt

createdAt(): Promise<null | EventIdentifier>

Retrieve the identifier data (block number, date and event index) of the event that was emitted when this Portfolio was created

Note

uses the middlewareV2

Note

there is a possibility that the data is not ready by the time it is requested. In that case, null is returned

Returns

Promise<null | EventIdentifier>


exists

exists(): Promise<boolean>

Return whether this Portfolio exists

Returns

Promise<boolean>

Overrides

Portfolio.exists


getAssetBalances

getAssetBalances(args?): Promise<PortfolioBalance[]>

Retrieve the balances of all fungible assets in this Portfolio

Parameters

Name Type Description
args? Object -
args.assets (string | FungibleAsset)[] array of FungibleAssets (or tickers) for which to fetch balances (optional, all balances are retrieved if not passed)

Returns

Promise<PortfolioBalance[]>

Inherited from

Portfolio.getAssetBalances


getCollections

getCollections(args?): Promise<PortfolioCollection[]>

Retrieve the NFTs held in this portfolio

Parameters

Name Type
args? Object
args.collections (string | NftCollection)[]

Returns

Promise<PortfolioCollection[]>

Inherited from

Portfolio.getCollections


getCustodian

getCustodian(): Promise<Identity>

Retrieve the custodian Identity of this Portfolio

Note

if no custodian is set, the owner Identity is returned

Returns

Promise<Identity>

Inherited from

Portfolio.getCustodian


getName

getName(): Promise<string>

Return the Portfolio name

Returns

Promise<string>


getTransactionHistory

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

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

Note

uses the middlewareV2

Parameters

Name Type Description
filters Object -
filters.account? string Account involved in the settlement
filters.ticker? string ticker involved in the transaction

Returns

Promise<HistoricSettlement[]>

Inherited from

Portfolio.getTransactionHistory


isCustodiedBy

isCustodiedBy(args?): Promise<boolean>

Return whether an Identity is the Portfolio custodian

Parameters

Name Type Description
args? Object -
args.identity string | Identity optional, defaults to the signing Identity

Returns

Promise<boolean>

Inherited from

Portfolio.isCustodiedBy


isEqual

isEqual(entity): boolean

Determine whether this Entity is the same as another one

Parameters

Name Type
entity Entity<unknown, unknown>

Returns

boolean

Inherited from

Portfolio.isEqual


isOwnedBy

isOwnedBy(args?): Promise<boolean>

Return whether an Identity is the Portfolio owner

Parameters

Name Type Description
args? Object -
args.identity string | Identity defaults to the signing Identity

Returns

Promise<boolean>

Inherited from

Portfolio.isOwnedBy


modifyName

modifyName(args, opts?): Promise<GenericPolymeshTransaction<NumberedPortfolio, NumberedPortfolio>>

Rename portfolio

Note

Only the owner is allowed to rename the Portfolio.

Note

this method is of type ProcedureMethod, which means you can call modifyName.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

Parameters

Name Type
args RenamePortfolioParams
opts? ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<NumberedPortfolio, NumberedPortfolio>>


moveFunds

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

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, which means you can call moveFunds.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
opts? ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<void, void>>

Inherited from

Portfolio.moveFunds


quitCustody

quitCustody(opts?): Promise<GenericPolymeshTransaction<void, void>>

Returns the custody of the portfolio to the portfolio owner unilaterally

Note

required role:

  • Portfolio Custodian

Note

this method is of type NoArgsProcedureMethod, which means you can call quitCustody.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

Returns

Promise<GenericPolymeshTransaction<void, void>>

Inherited from

Portfolio.quitCustody


setCustodian

setCustodian(args, opts?): Promise<GenericPolymeshTransaction<AuthorizationRequest, AuthorizationRequest>>

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

Note

this will create an Authorization Request which has to be accepted by the targetIdentity. An Account or Identity can fetch its pending Authorization Requests by calling authorizations.getReceived. Also, an Account or Identity can directly fetch the details of an Authorization Request by calling authorizations.getOne

Note

required role:

  • Portfolio Custodian

Note

this method is of type ProcedureMethod, which means you can call setCustodian.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
opts? ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<AuthorizationRequest, AuthorizationRequest>>

Inherited from

Portfolio.setCustodian


toHuman

toHuman(): HumanReadable

Return the Portfolio ID and owner DID

Returns

HumanReadable

Inherited from

Portfolio.toHuman


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

Portfolio.generateUuid


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

Portfolio.unserialize

Clone this wiki locally