Abstract Class: Portfolio
Defined in: src/api/entities/Portfolio/index.ts:57
Represents a base Portfolio for a specific Identity in the Polymesh blockchain
Extends
Extended by
Properties
owner
owner:
Identity
Defined in: src/api/entities/Portfolio/index.ts:71
Identity of the Portfolio's owner
uuid
uuid:
string
Defined in: src/api/entities/Entity.ts:46
Inherited from
Methods
exists()
abstractexists():Promise<boolean>
Defined in: src/api/entities/Entity.ts:68
Determine whether this Entity exists on chain
Returns
Promise<boolean>
Inherited from
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
| Parameter | Type | Description |
|---|---|---|
| { | ‐ |
| ( | array of FungibleAssets (or tickers) for which to fetch balances (optional, all balances are retrieved if not passed) |
Returns
Promise<PortfolioBalance[]>
getCollections()
getCollections(
args?:object):Promise<PortfolioCollection[]>
Defined in: src/api/entities/Portfolio/index.ts:212
Retrieve the NFTs held in this portfolio
Parameters
| Parameter | Type | Description |
|---|---|---|
| { | ‐ |
| ( | array of NftCollection (or tickers) for which to fetch holdings (optional, all holdings are retrieved if not passed) |
Returns
Promise<PortfolioCollection[]>
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
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
| Parameter | Type | Description |
|---|---|---|
| { | ‐ |
|
| Account involved in the settlement |
|
| ‐ |
|
| ticker involved in the transaction |
Returns
Promise<HistoricSettlement[]>
Note
uses the middlewareV2
isCustodiedBy()
isCustodiedBy(
args?:object):Promise<boolean>
Defined in: src/api/entities/Portfolio/index.ts:117
Return whether an Identity is the Portfolio custodian
Parameters
| Parameter | Type | Description |
|---|---|---|
| { | ‐ |
|
| optional, defaults to the signing Identity |
Returns
Promise<boolean>
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
| Parameter | Type |
|---|---|
|
|
Returns
boolean
Inherited from
isOwnedBy()
isOwnedBy(
args?:object):Promise<boolean>
Defined in: src/api/entities/Portfolio/index.ts:104
Return whether an Identity is the Portfolio owner
Parameters
| Parameter | Type | Description |
|---|---|---|
| { | ‐ |
|
| defaults to the signing Identity |
Returns
Promise<boolean>
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
| Parameter | Type |
|---|---|
| |
|
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
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
| Parameter | Type |
|---|---|
|
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
toHuman()
toHuman():
HumanReadable
Defined in: src/api/entities/Portfolio/index.ts:450
Return the Portfolio ID and owner DID
Returns
Overrides
generateUuid()
staticgenerateUuid<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 |
|---|
|
Parameters
| Parameter | Type | Description |
|---|---|---|
|
|
Returns
string
Inherited from
unserialize()
staticunserialize<Identifiers>(serialized:string):Identifiers
Defined in: src/api/entities/Entity.ts:23
Unserialize a UUID into its Unique Identifiers
Type Parameters
| Type Parameter |
|---|
|
Parameters
| Parameter | Type | Description |
|---|---|---|
|
| UUID to unserialize |
Returns
Identifiers