api.entities.Asset.NonFungible.NftCollection - PolymeshAssociation/polymesh-sdk GitHub Wiki

@polymeshassociation/polymesh-sdk / api/entities/Asset/NonFungible/NftCollection

api/entities/Asset/NonFungible/NftCollection

Classes

NftCollection

Defined in: api/entities/Asset/NonFungible/NftCollection.ts:74

Class used to manage NFT functionality

Extends

Properties

assetHolders

assetHolders: AssetHolders

Defined in: api/entities/Asset/NonFungible/NftCollection.ts:75

compliance

compliance: Compliance

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

Inherited from

BaseAsset.compliance

documents

documents: Documents

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

Inherited from

BaseAsset.documents

id

id: string

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

Unique ID of the Asset in UUID format

Inherited from

BaseAsset.id

metadata

metadata: Metadata

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

Inherited from

BaseAsset.metadata

permissions

permissions: Permissions

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

Inherited from

BaseAsset.permissions

settlements

settlements: NonFungibleSettlements

Defined in: api/entities/Asset/NonFungible/NftCollection.ts:76

uuid

uuid: string

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

Inherited from

BaseAsset.uuid

Accessors

rawId
Get Signature

get rawId(): string

Defined in: 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, 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

Parameters
Parameter Type
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

batchIssue()

batchIssue(args, opts?): Promise<GenericPolymeshTransaction<Nft[], Nft[]>>

Defined in: api/entities/Asset/NonFungible/NftCollection.ts:89

Issues mulitple NFTs for the collection

Parameters
Parameter Type
args BatchIssueNftParams
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<Nft[], Nft[]>>

Note

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.

Note

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()

collectionKeys(): Promise<CollectionKey[]>

Defined in: api/entities/Asset/NonFungible/NftCollection.ts:202

Retrieve the metadata that defines the NFT collection. Every issue call for this collection must provide a value for each element returned

Returns

Promise<CollectionKey[]>

Note

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()

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

Defined in: api/entities/Asset/NonFungible/NftCollection.ts:94

Force a transfer from the origin portfolio to one of the caller's portfolios

Parameters
Parameter Type
args NftControllerTransferParams
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: api/entities/Asset/NonFungible/NftCollection.ts:291

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: 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): Promise<UnsubCallback>

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

Retrieve the Asset's funding round

Parameters
Parameter Type Description
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: api/entities/Asset/NonFungible/NftCollection.ts:143

Retrieve the NftCollection's data

Returns

Promise<AssetDetails>

Promise that resolves to the NftCollection details

Overrides

BaseAsset.details

Call Signature

details(callback): Promise<UnsubCallback>

Defined in: api/entities/Asset/NonFungible/NftCollection.ts:153

Retrieve the NftCollection's data

Parameters
Parameter Type Description
callback SubCallback<AssetDetails> Callback function that receives NftCollection 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

Overrides

BaseAsset.details

exists()

exists(): Promise<boolean>

Defined in: api/entities/Asset/NonFungible/NftCollection.ts:314

Determine whether this NftCollection exists on chain

Returns

Promise<boolean>

Overrides

BaseAsset.exists

freeze()

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

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

Freeze transfers of the Asset

Parameters
Parameter Type
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

getCollectionId()

getCollectionId(): Promise<BigNumber>

Defined in: api/entities/Asset/NonFungible/NftCollection.ts:333

Returns the collection's on chain numeric ID. Used primarily to access NFT specific storage values

Returns

Promise<BigNumber>

getIdentifiers()
Call Signature

getIdentifiers(): Promise<SecurityIdentifier[]>

Defined in: 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?): Promise<UnsubCallback>

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

Retrieve the Asset's identifiers list

Parameters
Parameter Type Description
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): Promise<BigNumber>

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

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

Parameters
Parameter Type Description
fundingRound string name of the funding round to query
Returns

Promise<BigNumber>

Inherited from

BaseAsset.getIssuedInFundingRound

getNft()

getNft(args): Promise<Nft>

Defined in: api/entities/Asset/NonFungible/NftCollection.ts:267

Get an NFT belonging to this collection

Parameters
Parameter Type
args { id: BigNumber; }
args.id BigNumber
Returns

Promise<Nft>

Throws

if the given NFT does not exist

getRequiredMediators()

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

Returns

Promise<Identity[]>

Inherited from

BaseAsset.getRequiredMediators

getTransactionHistory()

getTransactionHistory(opts): Promise<ResultSet<HistoricNftTransaction>>

Defined in: api/entities/Asset/NonFungible/NftCollection.ts:360

Retrieve this Collection's transaction history

Parameters
Parameter Type
opts { size?: BigNumber; start?: BigNumber; }
opts.size? BigNumber
opts.start? BigNumber
Returns

Promise<ResultSet<HistoricNftTransaction>>

Note

uses the middlewareV2

getVenueFilteringDetails()

getVenueFilteringDetails(): Promise<VenueFilteringDetails>

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

Get venue filtering details

Returns

Promise<VenueFilteringDetails>

Inherited from

BaseAsset.getVenueFilteringDetails

investorCount()

investorCount(): Promise<BigNumber>

Defined in: api/entities/Asset/NonFungible/NftCollection.ts:245

Retrieve the amount of unique investors that hold this Nft

Returns

Promise<BigNumber>

isEqual()

isEqual(entity): boolean

Defined in: api/entities/Entity.ts:61

Determine whether this Entity is the same as another one

Parameters
Parameter Type
entity Entity<unknown, unknown>
Returns

boolean

Inherited from

BaseAsset.isEqual

isFrozen()
Call Signature

isFrozen(): Promise<boolean>

Defined in: 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): Promise<UnsubCallback>

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

Check whether transfers are frozen for the Asset

Parameters
Parameter Type Description
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

issue()

issue(args, opts?): Promise<GenericPolymeshTransaction<Nft[], Nft>>

Defined in: api/entities/Asset/NonFungible/NftCollection.ts:82

Issues a new NFT for the collection

Parameters
Parameter Type
args IssueNftParams
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<Nft[], Nft>>

Note

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.

Note

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()

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

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

Link ticker to the asset

Parameters
Parameter Type
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, opts?): Promise<GenericPolymeshTransaction<Asset, Asset>>

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

Modify some properties of the Asset

Parameters
Parameter Type
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

removeRequiredMediators()

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

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

Remove required mediators

Parameters
Parameter Type
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, 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

Parameters
Parameter Type
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: api/entities/Asset/Base/BaseAsset.ts:594

Return the BaseAsset's ID

Returns

string

Inherited from

BaseAsset.toHuman

transferOwnership()

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

Parameters
Parameter Type
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 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

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?): Promise<GenericPolymeshTransaction<void, void>>

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

Unfreeze transfers of the Asset

Parameters
Parameter Type
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?): Promise<GenericPolymeshTransaction<void, void>>

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

Unlink ticker from the Asset

Parameters
Parameter Type
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): string

Defined in: api/entities/Entity.ts:14

Generate the Entity's UUID from its identifying properties

Type Parameters
Type Parameter
Identifiers
Parameters
Parameter Type Description
identifiers Identifiers -
Returns

string

Inherited from

BaseAsset.generateUuid

unserialize()

static unserialize<Identifiers>(serialized): Identifiers

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

Unserialize a UUID into its Unique Identifiers

Type Parameters
Type Parameter
Identifiers
Parameters
Parameter Type Description
serialized string UUID to unserialize
Returns

Identifiers

Inherited from

BaseAsset.unserialize

⚠️ **GitHub.com Fallback** ⚠️