api.entities.DefaultPortfolio - PolymeshAssociation/polymesh-sdk GitHub Wiki
@polymeshassociation/polymesh-sdk / api/entities/DefaultPortfolio
Defined in: api/entities/DefaultPortfolio.ts:10
Represents the default Portfolio for an Identity
owner:
Identity
Defined in: api/entities/Portfolio/index.ts:94
Identity of the Portfolio's owner
uuid:
string
Defined in: api/entities/Entity.ts:46
exists():
Promise<boolean>
Defined in: api/entities/DefaultPortfolio.ts:21
Determine whether this Portfolio exists on chain
Promise<boolean>
getAssetBalances(
args?):Promise<PortfolioBalance[]>
Defined in: api/entities/Portfolio/index.ts:296
Retrieve the balances of all fungible assets in this Portfolio
| Parameter | Type | Description |
|---|---|---|
args? |
{ assets: (string | FungibleAsset)[]; } |
- |
args.assets? |
(string | FungibleAsset)[] |
array of FungibleAssets (or tickers) for which to fetch balances (optional, all balances are retrieved if not passed) |
Promise<PortfolioBalance[]>
passing args.assets reads only those Assets' storage keys. Omitting it scans every
Asset the Portfolio holds, which is unbounded
free excludes tokens an Asset agent has frozen, as well as locked tokens. See
PortfolioBalance
getCollections(
args?):Promise<PortfolioCollection[]>
Defined in: api/entities/Portfolio/index.ts:447
Retrieve the NFTs held in this portfolio
| Parameter | Type | Description |
|---|---|---|
args? |
{ collections: (string | NftCollection)[]; } |
- |
args.collections? |
(string | NftCollection)[] |
array of NftCollection (or tickers) for which to fetch holdings (optional, all holdings are retrieved if not passed) |
Promise<PortfolioCollection[]>
passing args.collections reads only those collections. Omitting it scans every NFT the
Portfolio holds, which is unbounded
getCustodian():
Promise<Identity>
Defined in: api/entities/Portfolio/index.ts:563
Retrieve the custodian Identity of this Portfolio
Promise<Identity>
if no custodian is set, the owner Identity is returned
getTransactionHistory(
filters?):Promise<HistoricSettlement[]>
Defined in: api/entities/Portfolio/index.ts:605
Retrieve a list of transactions where this portfolio was involved. Can be filtered using parameters
| Parameter | Type | Description |
|---|---|---|
filters |
{ account?: string; assetId?: string; ticker?: string; } |
- |
filters.account? |
string |
Account involved in the settlement |
filters.assetId? |
string |
- |
filters.ticker? |
string |
ticker involved in the transaction |
Promise<HistoricSettlement[]>
uses the middlewareV2
Portfolio.getTransactionHistory
isAssetPreApproved(
asset):Promise<boolean>
Defined in: api/entities/Portfolio/index.ts:172
Returns whether or not this Portfolio has pre-approved a particular asset
| Parameter | Type |
|---|---|
asset |
string | BaseAsset
|
Promise<boolean>
isCustodiedBy(
args?):Promise<boolean>
Defined in: api/entities/Portfolio/index.ts:158
Return whether an Identity is the Portfolio custodian
| Parameter | Type | Description |
|---|---|---|
args? |
{ identity: string | Identity; } |
- |
args.identity? |
string | Identity
|
optional, defaults to the signing Identity |
Promise<boolean>
isEqual(
entity):boolean
Defined in: api/entities/Entity.ts:61
Determine whether this Entity is the same as another one
| Parameter | Type |
|---|---|
entity |
Entity<unknown, unknown> |
boolean
isOwnedBy(
args?):Promise<boolean>
Defined in: api/entities/Portfolio/index.ts:145
Return whether an Identity is the Portfolio owner
| Parameter | Type | Description |
|---|---|---|
args? |
{ identity: string | Identity; } |
- |
args.identity? |
string | Identity
|
defaults to the signing Identity |
Promise<boolean>
moveFunds(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Portfolio/index.ts:538
Moves funds from this Portfolio to another one owned by the same Identity
| Parameter | Type |
|---|---|
args |
MoveFundsParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
required role:
- Portfolio Custodian
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
preApproveAsset(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Portfolio/index.ts:551
Pre-approves receiving an asset for this Portfolio. Receiving this asset in a settlement will not require manual affirmation
| Parameter | Type |
|---|---|
args |
{ asset: string | BaseAsset; } |
args.asset |
string | BaseAsset
|
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
this method is of type ProcedureMethod, which means you can call preApproveAsset.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
preApprovedAssets(
paginationOpts?):Promise<ResultSet<Asset>>
Defined in: api/entities/Portfolio/index.ts:197
Returns a list of all assets this Portfolio has pre-approved. These assets will not require affirmation when being received in settlements
| Parameter | Type |
|---|---|
paginationOpts? |
PaginationOptions |
quitCustody(
opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Portfolio/index.ts:546
Returns the custody of the portfolio to the portfolio owner unilaterally
| Parameter | Type |
|---|---|
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
required role:
- Portfolio Custodian
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
removeAssetPreApproval(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Portfolio/index.ts:556
Removes pre-approval of an asset for this Portfolio
| Parameter | Type |
|---|---|
args |
{ asset: string | BaseAsset; } |
args.asset |
string | BaseAsset
|
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
this method is of type ProcedureMethod, which means you can call removeAssetPreApproval.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Portfolio.removeAssetPreApproval
toHuman():
HumanReadable
Defined in: api/entities/Portfolio/index.ts:680
Return the Portfolio ID and owner DID
staticgenerateUuid<Identifiers>(identifiers):string
Defined in: api/entities/Entity.ts:14
Generate the Entity's UUID from its identifying properties
| Type Parameter |
|---|
Identifiers |
| Parameter | Type | Description |
|---|---|---|
identifiers |
Identifiers |
- |
string
staticunserialize<Identifiers>(serialized):Identifiers
Defined in: api/entities/Entity.ts:23
Unserialize a UUID into its Unique Identifiers
| Type Parameter |
|---|
Identifiers |
| Parameter | Type | Description |
|---|---|---|
serialized |
string |
UUID to unserialize |
Identifiers
Defined in: api/entities/DefaultPortfolio.ts:3
did:
string
Defined in: api/entities/DefaultPortfolio.ts:4