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

Hierarchy

Index

Properties

Methods

Properties

Protected Optional _id

_id? : BigNumber
internal Portfolio identifier (unused for default Portfolio)

Protected context

context: Context
Inherited from CheckpointSchedule.context

owner

owner: Identity
Identity of the Portfolio's owner

uuid

uuid: string
Inherited from CheckpointSchedule.uuid

Methods

Abstract exists

exists(): Promise‹boolean›
Inherited from Entity.exists
Determine whether this Entity exists on chain
Returns: Promise‹boolean›

getAssetBalances

getAssetBalances(args?: undefined | object): Promise‹PortfolioBalance[]›
Retrieve the balances of all Assets in this Portfolio
Parameters:
Name
Type
args?
undefined | object
Returns: Promise‹PortfolioBalance[]›

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

getTransactionHistory

getTransactionHistory(filters: object): Promise‹ResultSetHistoricSettlement››
Retrieve a list of transactions where this portfolio was involved. Can be filtered using parameters
note supports pagination
note uses the middleware
Parameters:
Default value filters: object= {}
Name
Type
Description
account?
undefined | string
Account involved in the settlement
size?
BigNumber
page size
start?
BigNumber
page offset
ticker?
undefined | string
ticker involved in the transaction
Returns: Promise‹ResultSetHistoricSettlement››

isCustodiedBy

isCustodiedBy(args?: undefined | object): Promise‹boolean›
Return whether an Identity is the Portfolio custodian
Parameters:
Name
Type
args?
undefined | object
Returns: Promise‹boolean›

isEqual

isEqual(entity: Entity‹unknown, unknown›): boolean
Inherited from CheckpointSchedule.isEqual
Determine whether this Entity is the same as another one
Parameters:
Name
Type
entity
Entity‹unknown, unknown›
Returns: boolean

isOwnedBy

isOwnedBy(args?: undefined | object): Promise‹boolean›
Return whether an Identity is the Portfolio owner
Parameters:
Name
Type
args?
undefined | object
Returns: Promise‹boolean›

moveFunds

moveFunds(args: MoveFundsParams, opts?: ProcedureOpts): Promise‹TransactionQueue‹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
opts?
Returns: Promise‹TransactionQueue‹void››

quitCustody

quitCustody(opts?: ProcedureOpts): Promise‹TransactionQueue‹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?
Returns: Promise‹TransactionQueue‹void››

setCustodian

setCustodian(args: SetCustodianParams, opts?: ProcedureOpts): Promise‹TransactionQueueAuthorizationRequest››
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
opts?
Returns: Promise‹TransactionQueueAuthorizationRequest››

toJson

toJson(): HumanReadable
Overrides Entity.toJson
Return the Portfolio ID and owner DID
Returns: HumanReadable

Static generateUuid

generateUuidIdentifiers›(identifiers: Identifiers): string
Generate the Entity's UUID from its identifying properties
Type parameters:
Identifiers
Parameters:
Name
Type
Description
identifiers
Identifiers
Returns: string

Static unserialize

unserializeIdentifiers›(serialized: string): Identifiers
Unserialize a UUID into its Unique Identifiers
Type parameters:
Identifiers
Parameters:
Name
Type
Description
serialized
string
UUID to unserialize
Returns: Identifiers