api_entities_Portfolio.Portfolio

@polymeshassociation/polymesh-sdk / Modules / api/entities/Portfolio / Portfolio

Class: Portfolio

api/entities/Portfolio.Portfolio

Represents a base Portfolio for a specific Identity in the Polymesh blockchain

Hierarchy

Table of contents

Properties

Methods

Properties

owner

• owner: Identity

Identity of the Portfolio's owner

Defined in

api/entities/Portfolio/index.ts:75


uuid

• uuid: string

Inherited from

Entity.uuid

Defined in

api/entities/Entity.ts:46

Methods

exists

â–¸ Abstract exists(): Promise<boolean>

Determine whether this Entity exists on chain

Returns

Promise<boolean>

Inherited from

Entity.exists

Defined in

api/entities/Entity.ts:68


getAssetBalances

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

Retrieve the balances of all Assets in this Portfolio

Parameters

Name
Type
Description

args?

Object

-

args.assets

(string | Asset)[]

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

Returns

Promise<PortfolioBalance[]>

Defined in

api/entities/Portfolio/index.ts:141


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>

Defined in

api/entities/Portfolio/index.ts:271


getTransactionHistory

â–¸ getTransactionHistory(filters?): Promise<ResultSet<HistoricSettlement>>

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

note supports pagination

note uses the middleware

Parameters

Name
Type
Description

filters

Object

-

filters.account?

string

Account involved in the settlement

filters.size?

BigNumber

page size

filters.start?

BigNumber

page offset

filters.ticker?

string

ticker involved in the transaction

Returns

Promise<ResultSet<HistoricSettlement>>

Defined in

api/entities/Portfolio/index.ts:316


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>

Defined in

api/entities/Portfolio/index.ts:125


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

Entity.isEqual

Defined in

api/entities/Entity.ts:61


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>

Defined in

api/entities/Portfolio/index.ts:112


moveFunds

â–¸ moveFunds(args, opts?): Promise<TransactionQueue<void, void, unknown[][]>>

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

Returns

Promise<TransactionQueue<void, void, unknown[][]>>

Defined in

api/entities/Portfolio/index.ts:249


quitCustody

â–¸ quitCustody(opts?): Promise<TransactionQueue<void, void, unknown[][]>>

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

Returns

Promise<TransactionQueue<void, void, unknown[][]>>

Defined in

api/entities/Portfolio/index.ts:262


setCustodian

â–¸ setCustodian(args, opts?): Promise<TransactionQueue<AuthorizationRequest, AuthorizationRequest, unknown[][]>>

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

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

Returns

Promise<TransactionQueue<AuthorizationRequest, AuthorizationRequest, unknown[][]>>

Defined in

api/entities/Portfolio/index.ts:236


toHuman

â–¸ toHuman(): HumanReadable

Return the Portfolio ID and owner DID

Returns

HumanReadable

Overrides

Entity.toHuman

Defined in

api/entities/Portfolio/index.ts:413


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

Entity.generateUuid

Defined in

api/entities/Entity.ts:14


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

Entity.unserialize

Defined in

api/entities/Entity.ts:23

Last updated

Was this helpful?