Skip to main content
Version: 29.0.x

Class: NumberedPortfolio

Defined in: src/api/entities/NumberedPortfolio.ts:31

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

Extends

Properties

id

id: BigNumber

Defined in: src/api/entities/NumberedPortfolio.ts:45

Portfolio identifier number


owner

owner: Identity

Defined in: src/api/entities/Portfolio/index.ts:71

Identity of the Portfolio's owner

Inherited from

Portfolio.owner


uuid

uuid: string

Defined in: src/api/entities/Entity.ts:46

Inherited from

Portfolio.uuid

Methods

createdAt()

createdAt(): Promise<null | EventIdentifier>

Defined in: src/api/entities/NumberedPortfolio.ts:107

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

Returns

Promise<null | EventIdentifier>

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


exists()

exists(): Promise<boolean>

Defined in: src/api/entities/NumberedPortfolio.ts:133

Return whether this Portfolio exists

Returns

Promise<boolean>

Overrides

Portfolio.exists


getAssetBalances()

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

Defined in: src/api/entities/Portfolio/index.ts:133

Retrieve the balances of all fungible assets in this Portfolio

Parameters

ParameterTypeDescription

args?

{ assets: (string | FungibleAsset)[]; }

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?: object): Promise<PortfolioCollection[]>

Defined in: src/api/entities/Portfolio/index.ts:212

Retrieve the NFTs held in this portfolio

Parameters

ParameterTypeDescription

args?

{ collections: (string | NftCollection)[]; }

args.collections?

(string | NftCollection)[]

array of NftCollection (or tickers) for which to fetch holdings (optional, all holdings are retrieved if not passed)

Returns

Promise<PortfolioCollection[]>

Inherited from

Portfolio.getCollections


getCustodian()

getCustodian(): Promise<Identity>

Defined in: src/api/entities/Portfolio/index.ts:333

Retrieve the custodian Identity of this Portfolio

Returns

Promise<Identity>

Note

if no custodian is set, the owner Identity is returned

Inherited from

Portfolio.getCustodian


getName()

getName(): Promise<string>

Defined in: src/api/entities/NumberedPortfolio.ts:78

Return the Portfolio name

Returns

Promise<string>


getTransactionHistory()

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

Defined in: src/api/entities/Portfolio/index.ts:375

Retrieve a list of transactions where this portfolio 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

filters.ticker?

string

ticker involved in the transaction

Returns

Promise<HistoricSettlement[]>

Note

uses the middlewareV2

Inherited from

Portfolio.getTransactionHistory


isCustodiedBy()

isCustodiedBy(args?: object): Promise<boolean>

Defined in: src/api/entities/Portfolio/index.ts:117

Return whether an Identity is the Portfolio custodian

Parameters

ParameterTypeDescription

args?

{ identity: string | Identity; }

args.identity?

string | Identity

optional, defaults to the signing Identity

Returns

Promise<boolean>

Inherited from

Portfolio.isCustodiedBy


isEqual()

isEqual(entity: Entity<unknown, unknown>): boolean

Defined in: src/api/entities/Entity.ts:61

Determine whether this Entity is the same as another one

Parameters

ParameterType

entity

Entity<unknown, unknown>

Returns

boolean

Inherited from

Portfolio.isEqual


isOwnedBy()

isOwnedBy(args?: object): Promise<boolean>

Defined in: src/api/entities/Portfolio/index.ts:104

Return whether an Identity is the Portfolio owner

Parameters

ParameterTypeDescription

args?

{ identity: string | Identity; }

args.identity?

string | Identity

defaults to the signing Identity

Returns

Promise<boolean>

Inherited from

Portfolio.isOwnedBy


modifyName()

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

Defined in: src/api/entities/NumberedPortfolio.ts:73

Rename portfolio

Parameters

ParameterType

args

RenamePortfolioParams

opts?

ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<NumberedPortfolio, NumberedPortfolio>>

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


moveFunds()

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

Defined in: src/api/entities/Portfolio/index.ts:318

Moves funds from this Portfolio to another one owned by the same Identity

Parameters

ParameterType

args

MoveFundsParams

opts?

ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<void, void>>

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

Inherited from

Portfolio.moveFunds


quitCustody()

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

Defined in: src/api/entities/Portfolio/index.ts:326

Returns the custody of the portfolio to the portfolio owner unilaterally

Parameters

ParameterType

opts?

ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<void, void>>

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

Inherited from

Portfolio.quitCustody


setCustodian()

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

Defined in: src/api/entities/NumberedPortfolio.ts:162

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

Parameters

ParameterType

args

SetCustodianParams

opts?

ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<AuthorizationRequest, AuthorizationRequest>>

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


toHuman()

toHuman(): HumanReadable

Defined in: src/api/entities/Portfolio/index.ts:450

Return the Portfolio ID and owner DID

Returns

HumanReadable

Inherited from

Portfolio.toHuman


generateUuid()

static generateUuid<Identifiers>(identifiers: Identifiers): string

Defined in: src/api/entities/Entity.ts:14

Generate the Entity's UUID from its identifying properties

Type Parameters

Type Parameter

Identifiers

Parameters

ParameterTypeDescription

identifiers

Identifiers

Returns

string

Inherited from

Portfolio.generateUuid


unserialize()

static unserialize<Identifiers>(serialized: string): Identifiers

Defined in: src/api/entities/Entity.ts:23

Unserialize a UUID into its Unique Identifiers

Type Parameters

Type Parameter

Identifiers

Parameters

ParameterTypeDescription

serialized

string

UUID to unserialize

Returns

Identifiers

Inherited from

Portfolio.unserialize