Class: NumberedPortfolio
api/entities/NumberedPortfolio.NumberedPortfolio
Represents a numbered (non-default) Portfolio for an Identity
Hierarchy
-
↳
NumberedPortfolio
Properties
id
• id: BigNumber
Portfolio identifier number
Defined in
api/entities/NumberedPortfolio.ts:46
owner
• owner: Identity
The Identity that owns this Portfolio
Inherited from
Defined in
api/entities/Portfolio/index.ts:69
uuid
• uuid: string
Inherited from
Defined in
Methods
createdAt
▸ createdAt(): Promise
<null
| EventIdentifier
>
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
Defined in
api/entities/NumberedPortfolio.ts:113
exists
▸ exists(): Promise
<boolean
>
Return whether this Portfolio exists
Returns
Promise
<boolean
>
Overrides
Defined in
api/entities/NumberedPortfolio.ts:139
getAssetBalances
▸ getAssetBalances(args?
): Promise
<PortfolioBalance
[]>
Retrieve the balances of all fungible assets held in this Portfolio
Parameters
Name | Type | Description |
---|---|---|
args? | Object | - |
args.assets | (string | FungibleAsset )[] | Optional array of tickers or FungibleAsset instances to filter the results by. If not provided, all balances are returned |
Returns
Promise
<PortfolioBalance
[]>
An array of PortfolioBalance
objects representing total, locked, and free amounts for each asset
Inherited from
Defined in
api/entities/Portfolio/index.ts:133
getCollections
▸ getCollections(args?
): Promise
<PortfolioCollection
[]>
Retrieve all NFT holdings in this Portfolio
Parameters
Name | Type | Description |
---|---|---|
args? | Object | - |
args.collections | (string | NftCollection )[] | Optional array of tickers, asset IDs, or NftCollection instances to filter by. If not provided, returns all holdings |
Returns
Promise
<PortfolioCollection
[]>
An array of PortfolioCollection
objects, including held, locked, and free NFTs per collection
Inherited from
Defined in
api/entities/Portfolio/index.ts:214
getCustodian
▸ getCustodian(): Promise
<Identity
>
Retrieve the current custodian of this Portfolio's identity
Returns
Promise
<Identity
>
Note
If no custodian is explicitly assigned, the Portfolio owner is returned
Inherited from
Defined in
api/entities/Portfolio/index.ts:345
getName
▸ getName(): Promise
<string
>
Return the Portfolio name
Returns
Promise
<string
>
Defined in
api/entities/NumberedPortfolio.ts:84
getTransactionHistory
▸ getTransactionHistory(filters?
): Promise
<HistoricSettlement
[]>
Retrieve the transaction history of this Portfolio, optionally filtered by account, ticker, or assetId
Parameters
Name | Type | Description |
---|---|---|
filters | Object | - |
filters.account? | string | (optional) Account address to filter transactions by |
filters.assetId? | string | (optional) Asset ID to filter by. Overrides ticker if both are present |
filters.ticker? | string | (optional) Asset ticker involved in the transaction |
Returns
Promise
<HistoricSettlement
[]>
Note
Uses the middlewareV2 GraphQL API
Inherited from
Portfolio.getTransactionHistory
Defined in
api/entities/Portfolio/index.ts:388
isCustodiedBy
▸ isCustodiedBy(args?
): Promise
<boolean
>
Check whether a given Identity is the custodian of this Portfolio
Parameters
Name | Type | Description |
---|---|---|
args? | Object | - |
args.identity | string | Identity | Identity or DID string to compare. Defaults to the signing Identity |
Returns
Promise
<boolean
>
Inherited from
Defined in
api/entities/Portfolio/index.ts:115
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
>
Check whether a given Identity is the owner of this Portfolio
Parameters
Name | Type | Description |
---|---|---|
args? | Object | - |
args.identity | string | Identity | Identity or DID string to compare. Defaults to the signing Identity |
Returns
Promise
<boolean
>
Inherited from
Defined in
api/entities/Portfolio/index.ts:102
modifyName
▸ modifyName(args
, opts?
): Promise
<GenericPolymeshTransaction
<NumberedPortfolio
, NumberedPortfolio
>>
Rename portfolio
Parameters
Name | Type |
---|---|
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
Defined in
api/entities/NumberedPortfolio.ts:77
moveFunds
▸ moveFunds(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Move funds from this Portfolio to another Portfolio 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
Inherited from
Defined in
api/entities/Portfolio/index.ts:323
quitCustody
▸ quitCustody(opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Unilaterally return custody of the Portfolio to its owner
Parameters
Name | Type |
---|---|
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
Defined in
api/entities/Portfolio/index.ts:336
setCustodian
▸ setCustodian(args
, opts?
): Promise
<GenericPolymeshTransaction
<AuthorizationRequest
, AuthorizationRequest
>>
Send an invitation to an Identity to assign it as custodian for this Numbered Portfolio
Parameters
Name | Type |
---|---|
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
Defined in
api/entities/NumberedPortfolio.ts:171
toHuman
▸ toHuman(): HumanReadable
Convert this Portfolio's identifiers to a human-readable format
Returns
An object containing the owner DID and (if applicable) the Portfolio ID as strings
Inherited from
Defined in
api/entities/Portfolio/index.ts:465
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
Defined in
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