Class: Portfolio
api/entities/Portfolio.Portfolio
Represents a base Portfolio for a specific Identity in the Polymesh blockchain
Hierarchy
-
Entity
<UniqueIdentifiers
,HumanReadable
>↳
Portfolio
Properties
owner
• owner: Identity
Identity of the Portfolio's owner
Defined in
api/entities/Portfolio/index.ts:77
uuid
• uuid: string
Inherited from
Defined in
Methods
exists
▸ Abstract
exists(): Promise
<boolean
>
Determine whether this Entity exists on chain
Returns
Promise
<boolean
>
Inherited from
Defined in
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
[]>
Defined in
api/entities/Portfolio/index.ts:143
getCollections
▸ getCollections(args?
): Promise
<PortfolioCollection
[]>
Retrieve the NFTs held in this portfolio
Parameters
Name | Type |
---|---|
args? | Object |
args.collections | (string | NftCollection )[] |
Returns
Promise
<PortfolioCollection
[]>
Defined in
api/entities/Portfolio/index.ts:222
getCustodian
▸ getCustodian(): Promise
<Identity
>
Retrieve the custodian Identity of this Portfolio
Returns
Promise
<Identity
>
Note
if no custodian is set, the owner Identity is returned
Defined in
api/entities/Portfolio/index.ts:370
getTransactionHistory
▸ getTransactionHistory(filters?
): Promise
<HistoricSettlement
[]>
Retrieve a list of transactions where this portfolio was involved. Can be filtered using parameters
Parameters
Name | Type | Description |
---|---|---|
filters | Object | - |
filters.account? | string | Account involved in the settlement |
filters.assetId? | string | - |
filters.ticker? | string | Deprecated in favour of assetId |
Returns
Promise
<HistoricSettlement
[]>
Note
uses the middlewareV2
Defined in
api/entities/Portfolio/index.ts:412
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:127
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
Defined in
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:114
moveFunds
▸ moveFunds(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Moves funds from this Portfolio to another one owned by the same Identity
Parameters
Name | Type |
---|---|
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
Defined in
api/entities/Portfolio/index.ts:348
quitCustody
▸ quitCustody(opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Returns the custody of the portfolio to the portfolio owner unilaterally