Skip to main content
Version: 31.0.x

Class: FungibleAsset

Defined in: src/api/entities/Asset/Fungible/index.ts:55

Class used to manage all Fungible Asset functionality

Extends​

Properties​

assetHolders​

assetHolders: AssetHolders

Defined in: src/api/entities/Asset/Fungible/index.ts:57


checkpoints​

checkpoints: Checkpoints

Defined in: src/api/entities/Asset/Fungible/index.ts:61


compliance​

compliance: Compliance

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:71

Inherited from​

BaseAsset.compliance


corporateActions​

corporateActions: CorporateActions

Defined in: src/api/entities/Asset/Fungible/index.ts:62


documents​

documents: Documents

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:72

Inherited from​

BaseAsset.documents


id​

id: string

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:79

Unique ID of the Asset in UUID format

Inherited from​

BaseAsset.id


issuance​

issuance: Issuance

Defined in: src/api/entities/Asset/Fungible/index.ts:58


metadata​

metadata: Metadata

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:73

Inherited from​

BaseAsset.metadata


offerings​

offerings: Offerings

Defined in: src/api/entities/Asset/Fungible/index.ts:60


permissions​

permissions: Permissions

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:74

Inherited from​

BaseAsset.permissions


settlements​

settlements: FungibleSettlements

Defined in: src/api/entities/Asset/Fungible/index.ts:56


transferRestrictions​

transferRestrictions: TransferRestrictions

Defined in: src/api/entities/Asset/Fungible/index.ts:59


uuid​

uuid: string

Defined in: src/api/entities/Entity.ts:46

Inherited from​

BaseAsset.uuid

Accessors​

rawId​

Get Signature​

get rawId(): string

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:86

Unique ID of the Asset in hex format

Note​

Although UUID format is the usual representation of asset IDs, generic polkadot/substrate tools usually expect it in hex format

Returns​

string

Inherited from​

BaseAsset.rawId

Methods​

addRequiredMediators()​

addRequiredMediators(args: AssetMediatorParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:218

Add required mediators. Mediators must approve any trades involving the asset

Parameters​

ParameterType

args

AssetMediatorParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Note​

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

Inherited from​

BaseAsset.addRequiredMediators


approveAllowance()​

approveAllowance(args: ApproveAllowanceParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/Asset/Fungible/index.ts:300

Approve spender account allowance for transferring this Asset

Parameters​

ParameterType

args

ApproveAllowanceParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Note​

Replaces any existing allowance for this if an allowance already exists for spender account for this Asset. Setting amount to 0 revokes the allowance.

On every spend transaction, the spender account's allowance will be decremented by the amount transferred.

Note​

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


controllerTransfer()​

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

Defined in: src/api/entities/Asset/Fungible/index.ts:153

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

Parameters​

ParameterType

args

ControllerTransferParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

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


createdAt()​

createdAt(): Promise<EventIdentifier | null>

Defined in: src/api/entities/Asset/Fungible/index.ts:99

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

Returns​

Promise<EventIdentifier | null>

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


currentFundingRound()​

Call Signature​

currentFundingRound(): Promise<string | null>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:505

Retrieve the Asset's funding round

Returns​

Promise<string | null>

Promise that resolves to the current funding round name or null if not set

Inherited from​

BaseAsset.currentFundingRound

Call Signature​

currentFundingRound(callback: SubCallback<string | null>): Promise<UnsubCallback>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:515

Retrieve the Asset's funding round

Parameters​
ParameterTypeDescription

callback

SubCallback<string | null>

Callback function that receives funding round updates

Returns​

Promise<UnsubCallback>

Promise that resolves to an unsubscribe function

Note​

can be subscribed to, if connected to node using a web socket

Inherited from​

BaseAsset.currentFundingRound


details()​

Call Signature​

details(): Promise<AssetDetails>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:338

Retrieve the Asset's data

Returns​

Promise<AssetDetails>

Promise that resolves to the Asset details

Inherited from​

BaseAsset.details

Call Signature​

details(callback: SubCallback<AssetDetails>): Promise<UnsubCallback>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:348

Retrieve the Asset's data

Parameters​
ParameterTypeDescription

callback

SubCallback<AssetDetails>

Callback function that receives Asset details updates

Returns​

Promise<UnsubCallback>

Promise that resolves to an unsubscribe function

Note​

can be subscribed to, if connected to node using a web socket

Inherited from​

BaseAsset.details


exists()​

exists(): Promise<boolean>

Defined in: src/api/entities/Asset/Fungible/index.ts:273

Determine whether this FungibleAsset exists on chain

Returns​

Promise<boolean>

Overrides​

BaseAsset.exists


freeze()​

freeze(opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:208

Freeze transfers of the Asset

Parameters​

ParameterType

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

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

Inherited from​

BaseAsset.freeze


getAllowance()​

getAllowance(args: object): Promise<BigNumber>

Defined in: src/api/entities/Asset/Fungible/index.ts:305

Retrieve the amount of allowance for a spender account as approved by owner

Parameters​

ParameterType

args

{ owner: AccountLike; spender: AccountLike; }

args.owner

AccountLike

args.spender

AccountLike

Returns​

Promise<BigNumber>


getIdentifiers()​

Call Signature​

getIdentifiers(): Promise<SecurityIdentifier[]>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:247

Retrieve the Asset's identifiers list

Returns​

Promise<SecurityIdentifier[]>

Promise that resolves to the list of security identifiers

Inherited from​

BaseAsset.getIdentifiers

Call Signature​

getIdentifiers(callback?: SubCallback<SecurityIdentifier[]>): Promise<UnsubCallback>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:257

Retrieve the Asset's identifiers list

Parameters​
ParameterTypeDescription

callback?

SubCallback<SecurityIdentifier[]>

Callback function that receives identifier updates

Returns​

Promise<UnsubCallback>

Promise that resolves to an unsubscribe function

Note​

can be subscribed to, if connected to node using a web socket

Inherited from​

BaseAsset.getIdentifiers


getIssuedInFundingRound()​

getIssuedInFundingRound(fundingRound: string): Promise<BigNumber>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:551

Retrieve the total amount of the Asset issued in the given funding round

Parameters​

ParameterTypeDescription

fundingRound

string

name of the funding round to query

Returns​

Promise<BigNumber>

Inherited from​

BaseAsset.getIssuedInFundingRound


getOperationHistory()​

getOperationHistory(): Promise<HistoricAgentOperation[]>

Defined in: src/api/entities/Asset/Fungible/index.ts:162

Retrieve this Asset's Operation History

Returns​

Promise<HistoricAgentOperation[]>

Note​

Operations are grouped by the agent Identity who performed them

Note​

uses the middlewareV2


getRequiredMediators()​

getRequiredMediators(): Promise<Identity[]>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:450

Get required Asset mediators. These Identities must approve any Instruction involving the asset

Returns​

Promise<Identity[]>

Inherited from​

BaseAsset.getRequiredMediators


getTransactionHistory()​

getTransactionHistory(opts: object): Promise<ResultSet<HistoricAssetTransaction>>

Defined in: src/api/entities/Asset/Fungible/index.ts:193

Retrieve this Asset's transaction History

Parameters​

ParameterType

opts

{ size?: BigNumber; start?: BigNumber; }

opts.size?

BigNumber

opts.start?

BigNumber

Returns​

Promise<ResultSet<HistoricAssetTransaction>>

Note​

uses the middlewareV2


getVenueFilteringDetails()​

getVenueFilteringDetails(): Promise<VenueFilteringDetails>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:470

Get venue filtering details

Returns​

Promise<VenueFilteringDetails>

Inherited from​

BaseAsset.getVenueFilteringDetails


investorCount()​

investorCount(): Promise<BigNumber>

Defined in: src/api/entities/Asset/Fungible/index.ts:127

Retrieve the amount of unique investors that hold this Asset

Returns​

Promise<BigNumber>


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​

ParameterType

entity

Entity<unknown, unknown>

Returns​

boolean

Inherited from​

BaseAsset.isEqual


isFrozen()​

Call Signature​

isFrozen(): Promise<boolean>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:295

Check whether transfers are frozen for the Asset

Returns​

Promise<boolean>

Promise that resolves to true if transfers are frozen, false otherwise

Inherited from​

BaseAsset.isFrozen

Call Signature​

isFrozen(callback: SubCallback<boolean>): Promise<UnsubCallback>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:305

Check whether transfers are frozen for the Asset

Parameters​
ParameterTypeDescription

callback

SubCallback<boolean>

Callback function that receives frozen status updates

Returns​

Promise<UnsubCallback>

Promise that resolves to an unsubscribe function

Note​

can be subscribed to, if connected to node using a web socket

Inherited from​

BaseAsset.isFrozen


linkTicker()​

linkTicker(args: LinkTickerToAssetParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:231

Link ticker to the asset

Parameters​

ParameterType

args

LinkTickerToAssetParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Note​

if ticker is already reserved, then required role:

  • Ticker Owner

Note​

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

Inherited from​

BaseAsset.linkTicker


modify()​

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

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:127

Modify some properties of the Asset

Parameters​

ParameterType

args

ModifyAssetParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<Asset, Asset>>

Throws​

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

Throws​

if the passed assetType is not a known asset type or a custom type that has not been created on the chain

Throws​

if trying to modify an NftCollection's assetType

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

Inherited from​

BaseAsset.modify


redeem()​

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

Defined in: src/api/entities/Asset/Fungible/index.ts:122

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

Parameters​

ParameterType

args

RedeemTokensParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

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


removeRequiredMediators()​

removeRequiredMediators(args: AssetMediatorParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:223

Remove required mediators

Parameters​

ParameterType

args

AssetMediatorParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Note​

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

Inherited from​

BaseAsset.removeRequiredMediators


setVenueFiltering()​

setVenueFiltering(args: SetVenueFilteringParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:108

Enable/disable venue filtering for this Asset and/or set allowed/disallowed venues

Parameters​

ParameterType

args

SetVenueFilteringParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Note​

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

Inherited from​

BaseAsset.setVenueFiltering


toHuman()​

toHuman(): string

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:594

Return the BaseAsset's ID

Returns​

string

Inherited from​

BaseAsset.toHuman


transferOwnership()​

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

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:103

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

Parameters​

ParameterType

args

TransferAssetOwnershipParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<AuthorizationRequest, AuthorizationRequest>>

Note​

the signing Identity must be an agent of this Asset holding asset.acceptAssetOwnershipTransfer permission — granted by TxGroup.AdvancedAssetManagement or PermissionGroupType.Full. The chain checks this when the target accepts, against the Identity that created the Authorization Request, so an offer sent without it can never be accepted

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

Inherited from​

BaseAsset.transferOwnership


unfreeze()​

unfreeze(opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:213

Unfreeze transfers of the Asset

Parameters​

ParameterType

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

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

Inherited from​

BaseAsset.unfreeze


unlinkTicker()​

unlinkTicker(opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/Asset/Base/BaseAsset.ts:240

Unlink ticker from the Asset

Parameters​

ParameterType

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Note​

Only the ticker owner is allowed to unlink the Asset

Throws​

if there is no ticker to unlink

Note​

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

Inherited from​

BaseAsset.unlinkTicker


generateUuid()​

static generateUuid<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

Identifiers

Parameters​

ParameterTypeDescription

identifiers

Identifiers

‐

Returns​

string

Inherited from​

BaseAsset.generateUuid


unserialize()​

static unserialize<Identifiers>(serialized: string): Identifiers

Defined in: src/api/entities/Entity.ts:23

Unserialize a UUID into its Unique Identifiers

Type Parameters​

Type Parameter

Identifiers

Parameters​

ParameterTypeDescription

serialized

string

UUID to unserialize

Returns​

Identifiers

Inherited from​

BaseAsset.unserialize