api.entities.Asset.NonFungible.NftCollection - PolymeshAssociation/polymesh-sdk GitHub Wiki
@polymeshassociation/polymesh-sdk / api/entities/Asset/NonFungible/NftCollection
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:90
Class used to manage NFT functionality
assetHolders:
AssetHolders
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:91
compliance:
Compliance
Defined in: api/entities/Asset/Base/BaseAsset.ts:73
documents:
Documents
Defined in: api/entities/Asset/Base/BaseAsset.ts:74
id:
string
Defined in: api/entities/Asset/Base/BaseAsset.ts:81
Unique ID of the Asset in UUID format
metadata:
Metadata
Defined in: api/entities/Asset/Base/BaseAsset.ts:75
permissions:
Permissions
Defined in: api/entities/Asset/Base/BaseAsset.ts:76
settlements:
NonFungibleSettlements
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:92
uuid:
string
Defined in: api/entities/Entity.ts:46
get evmAddress():
string
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:209
The address of the non-fungible precompile through which EVM contracts and Ethereum tooling can
call this collection, i.e. 0x<Asset ID>00090000, EIP-55 checksummed. The precompile
identifies an NFT by its id within the collection
every collection is exposed automatically, with nothing to deploy or register. Calls run the same checks as the equivalent extrinsic, so compliance and transfer restrictions still apply
string
get rawId():
string
Defined in: api/entities/Asset/Base/BaseAsset.ts:88
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:253
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
approveOperator(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:129
Approve an operator: an Account that may transfer any of the signing Account's NFTs in this
collection, with transferFunds, and approve other Accounts for them. The non-fungible
precompile's equivalent is setApprovalForAll
| Parameter | Type |
|---|---|
args |
NftOperatorParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
the approval covers every NFT the signing Account holds in the collection, including any it receives after approving. It is not used up by a transfer, and lasts until revokeOperator
requires Polymesh 8.1.1 or later, and throws NotSupported on an older chain
this method is of type ProcedureMethod, which means you can call approveOperator.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
batchIssue(
args,opts?):Promise<GenericPolymeshTransaction<Nft[],Nft[]>>
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:105
Issues mulitple NFTs for the collection
| Parameter | Type |
|---|---|
args |
BatchIssueNftParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<Nft[], Nft[]>>
Each NFT requires metadata for each value returned by collectionKeys. The SDK and chain only validate the presence of these fields. Additional validation may be needed to ensure each value complies with the specification.
this method is of type ProcedureMethod, which means you can call batchIssue.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
collectionKeys():
Promise<CollectionKey[]>
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:277
Retrieve the metadata that defines the NFT collection. Every issue call for this collection must provide a value for each element returned
Promise<CollectionKey[]>
Each NFT must have an entry for each value, it should comply with the spec. In other words, the SDK only validates the presence of metadata keys, additional validation should be used when issuing
controllerTransfer(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:117
Force a transfer from the origin Portfolio or Account, by default to the caller's default Portfolio
| Parameter | Type |
|---|---|
args |
NftControllerTransferParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
from Polymesh 8.1.1 destination can be any Account or Portfolio, such as the rightful
owner of seized NFTs. Before 8.1.1 it must be the signing Account or one of the signing
Identity's Portfolios
a destination the caller does not control must not require receiver affirmation for the collection, since a forced transfer cannot affirm on its behalf
the transfer ignores a holder freeze, so it can seize NFTs from a frozen holder
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/NonFungible/NftCollection.ts:366
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:540
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:550
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/NonFungible/NftCollection.ts:218
Retrieve the NftCollection's data
Promise<AssetDetails>
Promise that resolves to the NftCollection details
details(
callback):Promise<UnsubCallback>
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:228
Retrieve the NftCollection's data
| Parameter | Type | Description |
|---|---|---|
callback |
SubCallback<AssetDetails> |
Callback function that receives NftCollection 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/NonFungible/NftCollection.ts:389
Determine whether this NftCollection exists on chain
Promise<boolean>
BaseAsset.exists
freeze(
opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:222
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
freezeHolder(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:239
Freeze one holder of the Asset, an Account or a Portfolio, so that it cannot send any of it. Unlike freeze, every other holder can still transfer
| Parameter | Type |
|---|---|
args |
FreezeHolderParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
freezing applies to the holder given, not to its Identity. To stop an investor moving the Asset, freeze each Account and Portfolio that holds it
the holder can still receive the Asset, and a controller transfer can still take it from the holder, which is how an agent seizes from a frozen holder
requires Polymesh 8.1.1 or later, and throws NotSupported on an older chain
this method is of type ProcedureMethod, which means you can call freezeHolder.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
getCollectionId():
Promise<BigNumber>
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:449
Returns the collection's on chain numeric ID. Used primarily to access NFT specific storage values
Promise<BigNumber>
getIdentifiers():
Promise<SecurityIdentifier[]>
Defined in: api/entities/Asset/Base/BaseAsset.ts:282
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:292
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:586
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
getNft(
args):Promise<Nft>
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:342
Get an NFT belonging to this collection
| Parameter | Type |
|---|---|
args |
{ id: BigNumber; } |
args.id |
BigNumber |
Promise<Nft>
if the given NFT does not exist
getRequiredMediators():
Promise<Identity[]>
Defined in: api/entities/Asset/Base/BaseAsset.ts:485
Get required Asset mediators. These Identities must approve any Instruction involving the asset
Promise<Identity[]>
BaseAsset.getRequiredMediators
getTransactionHistory(
opts):Promise<ResultSet<HistoricNftTransaction>>
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:480
Retrieve this Collection's transaction history
| Parameter | Type |
|---|---|
opts |
MiddlewarePaginationOptions & object
|
Promise<ResultSet<HistoricNftTransaction>>
uses the middlewareV2
getVenueFilteringDetails():
Promise<VenueFilteringDetails>
Defined in: api/entities/Asset/Base/BaseAsset.ts:505
Get venue filtering details
Promise<VenueFilteringDetails>
BaseAsset.getVenueFilteringDetails
investorCount():
Promise<BigNumber>
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:320
Retrieve the amount of unique investors that hold this Nft
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:330
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:340
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
isOperatorApproved(
args):Promise<boolean>
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:414
Check whether an Account may transfer any of another Account's NFTs in this collection, as its
operator. The non-fungible precompile's equivalent is isApprovedForAll
| Parameter | Type | Description |
|---|---|---|
args |
{ operator: AccountLike; owner: AccountLike; } |
- |
args.operator |
AccountLike |
the Account that may have been approved |
args.owner |
AccountLike |
the Account holding the NFTs |
Promise<boolean>
always false before Polymesh 8.1.1, which has no NFT approvals
issue(
args,opts?):Promise<GenericPolymeshTransaction<Nft[],Nft>>
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:98
Issues a new NFT for the collection
| Parameter | Type |
|---|---|
args |
IssueNftParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<Nft[], Nft>>
Each NFT requires metadata for each value returned by collectionKeys. The SDK and chain only validate the presence of these fields. Additional validation may be needed to ensure each value complies with the specification.
this method is of type ProcedureMethod, which means you can call issue.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
linkTicker(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:266
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:129
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
removeRequiredMediators(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:258
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
revokeOperator(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/NonFungible/NftCollection.ts:136
Revoke an operator approved with approveOperator
| Parameter | Type |
|---|---|
args |
NftOperatorParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
requires Polymesh 8.1.1 or later, and throws NotSupported on an older chain
this method is of type ProcedureMethod, which means you can call revokeOperator.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
setVenueFiltering(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:110
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:629
Return the BaseAsset's ID
string
transferOwnership(
args,opts?):Promise<GenericPolymeshTransaction<AuthorizationRequest,AuthorizationRequest>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:105
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:227
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
unfreezeHolder(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/entities/Asset/Base/BaseAsset.ts:248
Unfreeze a holder of the Asset that was frozen with freezeHolder
| Parameter | Type |
|---|---|
args |
FreezeHolderParams |
opts? |
ProcedureOpts |
Promise<GenericPolymeshTransaction<void, void>>
leaves any frozen part of the holder's balance frozen. See unfreezeTokens
requires Polymesh 8.1.1 or later, and throws NotSupported on an older chain
this method is of type ProcedureMethod, which means you can call unfreezeHolder.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:275
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