Skip to content

api.entities.Asset.Asset

VictorVicente edited this page Sep 16, 2022 · 37 revisions

Class: Asset

api/entities/Asset.Asset

Class used to manage all Asset functionality

Hierarchy

Table of contents

Properties

Methods

Properties

assetHolders

assetHolders: AssetHolders

Defined in

api/entities/Asset/index.ts:112


checkpoints

checkpoints: Checkpoints

Defined in

api/entities/Asset/index.ts:117


compliance

compliance: Compliance

Defined in

api/entities/Asset/index.ts:114


corporateActions

corporateActions: CorporateActions

Defined in

api/entities/Asset/index.ts:118


did

did: string

Identity ID of the Asset (used for Claims)

Defined in

api/entities/Asset/index.ts:102


documents

documents: Documents

Defined in

api/entities/Asset/index.ts:110


issuance

issuance: Issuance

Defined in

api/entities/Asset/index.ts:113


offerings

offerings: Offerings

Defined in

api/entities/Asset/index.ts:116


permissions

permissions: Permissions

Defined in

api/entities/Asset/index.ts:119


settlements

settlements: Settlements

Defined in

api/entities/Asset/index.ts:111


ticker

ticker: string

ticker of the Asset

Defined in

api/entities/Asset/index.ts:107


transferRestrictions

transferRestrictions: TransferRestrictions

Defined in

api/entities/Asset/index.ts:115


uuid

uuid: string

Inherited from

Entity.uuid

Defined in

api/entities/Entity.ts:46

Methods

controllerTransfer

controllerTransfer(args, opts?): Promise<GenericPolymeshTransaction<void, void>>

Force a transfer from a given Portfolio to the caller’s default Portfolio

Note

this method is of type ProcedureMethod, which means you can call controllerTransfer.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

Parameters

Name Type
args ControllerTransferParams
opts? ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<void, void>>


createdAt

createdAt(): Promise<null | EventIdentifier>

Retrieve the identifier data (block number, date and event index) of the event that was emitted when the token was created

Note

uses the middleware

Note

there is a possibility that the data is not ready by the time it is requested. In that case, null is returned

Returns

Promise<null | EventIdentifier>


createdAtV2

createdAtV2(): Promise<null | EventIdentifier>

Retrieve the identifier data (block number, date and event index) of the event that was emitted when the token was created

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

Returns

Promise<null | EventIdentifier>


currentFundingRound

currentFundingRound(): Promise<null | string>

Retrieve the Asset's funding round

Note

can be subscribed to

Returns

Promise<null | string>

currentFundingRound(callback): Promise<UnsubCallback>

Parameters

Name Type
callback SubCallback<null | string>

Returns

Promise<UnsubCallback>


details

details(): Promise<AssetDetails>

Retrieve the Asset's data

Note

can be subscribed to

Returns

Promise<AssetDetails>

details(callback): Promise<UnsubCallback>

Parameters

Name Type
callback SubCallback<AssetDetails>

Returns

Promise<UnsubCallback>


exists

exists(): Promise<boolean>

Determine whether this Asset exists on chain

Returns

Promise<boolean>

Overrides

Entity.exists


freeze

freeze(opts?): Promise<GenericPolymeshTransaction<Asset, Asset>>

Freeze transfers of the Asset

Note

this method is of type NoArgsProcedureMethod, which means you can call freeze.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

Parameters

Name Type
opts? ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<Asset, Asset>>


getIdentifiers

getIdentifiers(): Promise<SecurityIdentifier[]>

Retrieve the Asset's identifiers list

Note

can be subscribed to

Returns

Promise<SecurityIdentifier[]>

getIdentifiers(callback?): Promise<UnsubCallback>

Parameters

Name Type
callback? SubCallback<SecurityIdentifier[]>

Returns

Promise<UnsubCallback>


getOperationHistory

getOperationHistory(): Promise<HistoricAgentOperation[]>

Retrieve this Asset's Operation History

Note

Operations are grouped by the agent Identity who performed them

Note

uses the middleware

Returns

Promise<HistoricAgentOperation[]>


getOperationHistoryV2

getOperationHistoryV2(): Promise<HistoricAgentOperation[]>

Retrieve this Asset's Operation History

Note

Operations are grouped by the agent Identity who performed them

Note

uses the middlewareV2

Returns

Promise<HistoricAgentOperation[]>


investorCount

investorCount(): Promise<BigNumber>

Retrieve the amount of unique investors that hold this Asset

Note

this takes into account the Scope ID of Investor Uniqueness Claims. If an investor holds balances of this Asset in two or more different Identities, but they all have Investor Uniqueness Claims with the same Scope ID, then they will only be counted once for the purposes of this result

Returns

Promise<BigNumber>


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

Entity.isEqual


isFrozen

isFrozen(): Promise<boolean>

Check whether transfers are frozen for the Asset

Note

can be subscribed to

Returns

Promise<boolean>

isFrozen(callback): Promise<UnsubCallback>

Parameters

Name Type
callback SubCallback<boolean>

Returns

Promise<UnsubCallback>


modify

modify(args, opts?): Promise<GenericPolymeshTransaction<Asset, Asset>>

Modify some properties of the Asset

Throws

if the passed values result in no changes being made to the Asset

Note

this method is of type ProcedureMethod, which means you can call modify.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

Parameters

Name Type
args ModifyAssetParams
opts? ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<Asset, Asset>>


modifyPrimaryIssuanceAgent

modifyPrimaryIssuanceAgent(args, opts?): Promise<GenericPolymeshTransaction<void, void>>

Assign a new primary issuance agent for the Asset

Note

this will create an Authorization Request which has to be accepted by the target Identity. 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

Deprecated

in favor of inviteAgent

Note

this method is of type ProcedureMethod, which means you can call modifyPrimaryIssuanceAgent.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

Parameters

Name Type
args ModifyPrimaryIssuanceAgentParams
opts? ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<void, void>>


redeem

redeem(args, opts?): Promise<GenericPolymeshTransaction<void, void>>

Redeem (burn) an amount of this Asset's tokens

Note

tokens are removed from the caller's Default Portfolio

Note

this method is of type ProcedureMethod, which means you can call redeem.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

Parameters

Name Type
args RedeemTokensParams
opts? ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<void, void>>


removePrimaryIssuanceAgent

removePrimaryIssuanceAgent(opts?): Promise<GenericPolymeshTransaction<void, void>>

Remove the primary issuance agent of the Asset

Note

if primary issuance agent is not set, Asset owner would be used by default

Deprecated

Note

this method is of type NoArgsProcedureMethod, which means you can call removePrimaryIssuanceAgent.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

Parameters

Name Type
opts? ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<void, void>>


toHuman

toHuman(): string

Return the Asset's ticker

Returns

string

Overrides

Entity.toHuman


transferOwnership

transferOwnership(args, opts?): Promise<GenericPolymeshTransaction<AuthorizationRequest, AuthorizationRequest>>

Transfer ownership of the Asset to another Identity. This generates an authorization request that must be accepted by the recipient

Note

this will create Authorization Request which has to be accepted by the target Identity. 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

this method is of type ProcedureMethod, which means you can call transferOwnership.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

Parameters

Name Type
args TransferAssetOwnershipParams
opts? ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<AuthorizationRequest, AuthorizationRequest>>


unfreeze

unfreeze(opts?): Promise<GenericPolymeshTransaction<Asset, Asset>>

Unfreeze transfers of the Asset

Note

this method is of type NoArgsProcedureMethod, which means you can call unfreeze.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

Parameters

Name Type
opts? ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<Asset, Asset>>


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

Entity.generateUuid


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

Inherited from

Entity.unserialize

Clone this wiki locally