api.entities.Asset.Fungible - PolymeshAssociation/polymesh-sdk GitHub Wiki
@polymeshassociation/polymesh-sdk / api/entities/Asset/Fungible
Defined in: api/entities/Asset/Fungible/index.ts:55
Class used to manage all Fungible Asset functionality
assetHolders:
AssetHolders
Defined in: api/entities/Asset/Fungible/index.ts:57
checkpoints:
Checkpoints
Defined in: api/entities/Asset/Fungible/index.ts:61
compliance:
Compliance
Defined in: api/entities/Asset/Base/BaseAsset.ts:71
corporateActions:
CorporateActions
Defined in: api/entities/Asset/Fungible/index.ts:62
documents:
Documents
Defined in: api/entities/Asset/Base/BaseAsset.ts:72
id:
string
Defined in: api/entities/Asset/Base/BaseAsset.ts:79
Unique ID of the Asset in UUID format
issuance:
Issuance
Defined in: api/entities/Asset/Fungible/index.ts:58
metadata:
Metadata
Defined in: api/entities/Asset/Base/BaseAsset.ts:73
offerings:
Offerings
Defined in: api/entities/Asset/Fungible/index.ts:60
permissions:
Permissions
Defined in: api/entities/Asset/Base/BaseAsset.ts:74
settlements:
FungibleSettlements
Defined in: api/entities/Asset/Fungible/index.ts:56
transferRestrictions:
TransferRestrictions
Defined in: api/entities/Asset/Fungible/index.ts:59
uuid:
string
Defined in: api/entities/Entity.ts:46
get rawId():
string
Defined in: api/entities/Asset/Base/BaseAsset.ts:86
Unique ID of the Asset in hex format
Although UUID format is the usual representation of asset IDs, generic polkadot/substrate tools usually expect it in hex format
string
addRequiredMediators(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:218
Add required mediators. Mediators must approve any trades involving the asset
| Parameter | Type |
|---|---|
args |
AssetMediatorParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
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
BaseAsset.addRequiredMediators
approveAllowance(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Fungible/index.ts:300
Approve spender account allowance for transferring this Asset
| Parameter | Type |
|---|---|
args |
ApproveAllowanceParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
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.
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(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Fungible/index.ts:153
Force a transfer from a given Portfolio to the caller’s default Portfolio
| Parameter | Type |
|---|---|
args |
ControllerTransferParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
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():
Promise<EventIdentifier|null>
Defined in: 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
Promise<EventIdentifier | null>
uses the middlewareV2
there is a possibility that the data is not ready by the time it is requested. In that case, null is returned
currentFundingRound():
Promise<string|null>
Defined in: api/entities/Asset/Base/BaseAsset.ts:505
Retrieve the Asset's funding round
Promise<string | null>
Promise that resolves to the current funding round name or null if not set
currentFundingRound(
callback):Promise<UnsubCallback>
Defined in: api/entities/Asset/Base/BaseAsset.ts:515
Retrieve the Asset's funding round
| Parameter | Type | Description |
|---|---|---|
callback |
SubCallback<string | null> |
Callback function that receives funding round updates |
Promise<UnsubCallback>
Promise that resolves to an unsubscribe function
can be subscribed to, if connected to node using a web socket
details():
Promise<AssetDetails>
Defined in: api/entities/Asset/Base/BaseAsset.ts:338
Retrieve the Asset's data
Promise<AssetDetails>
Promise that resolves to the Asset details
details(
callback):Promise<UnsubCallback>
Defined in: api/entities/Asset/Base/BaseAsset.ts:348
Retrieve the Asset's data
| Parameter | Type | Description |
|---|---|---|
callback |
SubCallback<AssetDetails> |
Callback function that receives Asset details updates |
Promise<UnsubCallback>
Promise that resolves to an unsubscribe function
can be subscribed to, if connected to node using a web socket
exists():
Promise<boolean>
Defined in: api/entities/Asset/Fungible/index.ts:273
Determine whether this FungibleAsset exists on chain
Promise<boolean>
BaseAsset.exists
freeze(
opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:208
Freeze transfers of the Asset
| Parameter | Type |
|---|---|
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
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
getAllowance(
args):Promise<BigNumber>
Defined in: api/entities/Asset/Fungible/index.ts:305
Retrieve the amount of allowance for a spender account as approved by owner
| Parameter | Type |
|---|---|
args |
{ owner: AccountLike; spender: AccountLike; } |
args.owner |
AccountLike |
args.spender |
AccountLike |
Promise<BigNumber>
getIdentifiers():
Promise<SecurityIdentifier[]>
Defined in: api/entities/Asset/Base/BaseAsset.ts:247
Retrieve the Asset's identifiers list
Promise<SecurityIdentifier[]>
Promise that resolves to the list of security identifiers
getIdentifiers(
callback?):Promise<UnsubCallback>
Defined in: api/entities/Asset/Base/BaseAsset.ts:257
Retrieve the Asset's identifiers list
| Parameter | Type | Description |
|---|---|---|
callback? |
SubCallback<SecurityIdentifier[]> |
Callback function that receives identifier updates |
Promise<UnsubCallback>
Promise that resolves to an unsubscribe function
can be subscribed to, if connected to node using a web socket
getIssuedInFundingRound(
fundingRound):Promise<BigNumber>
Defined in: api/entities/Asset/Base/BaseAsset.ts:551
Retrieve the total amount of the Asset issued in the given funding round
| Parameter | Type | Description |
|---|---|---|
fundingRound |
string |
name of the funding round to query |
Promise<BigNumber>
BaseAsset.getIssuedInFundingRound
getOperationHistory():
Promise<HistoricAgentOperation[]>
Defined in: api/entities/Asset/Fungible/index.ts:162
Retrieve this Asset's Operation History
Promise<HistoricAgentOperation[]>
Operations are grouped by the agent Identity who performed them
uses the middlewareV2
getRequiredMediators():
Promise<Identity[]>
Defined in: api/entities/Asset/Base/BaseAsset.ts:450
Get required Asset mediators. These Identities must approve any Instruction involving the asset
Promise<Identity[]>
BaseAsset.getRequiredMediators
getTransactionHistory(
opts):Promise<ResultSet<HistoricAssetTransaction>>
Defined in: api/entities/Asset/Fungible/index.ts:193
Retrieve this Asset's transaction History
| Parameter | Type |
|---|---|
opts |
{ size?: BigNumber; start?: BigNumber; } |
opts.size? |
BigNumber |
opts.start? |
BigNumber |
Promise<ResultSet<HistoricAssetTransaction>>
uses the middlewareV2
getVenueFilteringDetails():
Promise<VenueFilteringDetails>
Defined in: api/entities/Asset/Base/BaseAsset.ts:470
Get venue filtering details
Promise<VenueFilteringDetails>
BaseAsset.getVenueFilteringDetails
investorCount():
Promise<BigNumber>
Defined in: api/entities/Asset/Fungible/index.ts:127
Retrieve the amount of unique investors that hold this Asset
Promise<BigNumber>
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
isFrozen():
Promise<boolean>
Defined in: api/entities/Asset/Base/BaseAsset.ts:295
Check whether transfers are frozen for the Asset
Promise<boolean>
Promise that resolves to true if transfers are frozen, false otherwise
isFrozen(
callback):Promise<UnsubCallback>
Defined in: api/entities/Asset/Base/BaseAsset.ts:305
Check whether transfers are frozen for the Asset
| Parameter | Type | Description |
|---|---|---|
callback |
SubCallback<boolean> |
Callback function that receives frozen status updates |
Promise<UnsubCallback>
Promise that resolves to an unsubscribe function
can be subscribed to, if connected to node using a web socket
linkTicker(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:231
Link ticker to the asset
| Parameter | Type |
|---|---|
args |
LinkTickerToAssetParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
if ticker is already reserved, then required role:
- Ticker Owner
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
modify(
args,opts?):Promise<GenericPolymeshTransaction<Asset,Asset>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:127
Modify some properties of the Asset
| Parameter | Type |
|---|---|
args |
ModifyAssetParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<Asset, Asset>>
if the passed values result in no changes being made to the Asset
if the passed assetType is not a known asset type or a custom type that has not been created on the chain
if trying to modify an NftCollection's assetType
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
redeem(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Fungible/index.ts:122
Redeem (burn) an amount of this Asset's tokens
| Parameter | Type |
|---|---|
args |
RedeemTokensParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
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(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:223
Remove required mediators
| Parameter | Type |
|---|---|
args |
AssetMediatorParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
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
BaseAsset.removeRequiredMediators
setVenueFiltering(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:108
Enable/disable venue filtering for this Asset and/or set allowed/disallowed venues
| Parameter | Type |
|---|---|
args |
SetVenueFilteringParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
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
toHuman():
string
Defined in: api/entities/Asset/Base/BaseAsset.ts:594
Return the BaseAsset's ID
string
transferOwnership(
args,opts?):Promise<GenericPolymeshTransaction<AuthorizationRequest,AuthorizationRequest>>
Defined in: 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
| Parameter | Type |
|---|---|
args |
TransferAssetOwnershipParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<AuthorizationRequest, AuthorizationRequest>>
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
this will create Authorization Request which has to be accepted by the target Identity.
An api/entities/Account!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
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
unfreeze(
opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:213
Unfreeze transfers of the Asset
| Parameter | Type |
|---|---|
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
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
unlinkTicker(
opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:240
Unlink ticker from the Asset
| Parameter | Type |
|---|---|
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
Only the ticker owner is allowed to unlink the Asset
if there is no ticker to unlink
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
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