Class: NftCollection
api/entities/Asset/NonFungible/NftCollection.NftCollection
Class used to manage NFT functionality
Hierarchy
-
↳
NftCollection
Properties
assetHolders
• assetHolders: AssetHolders
Defined in
api/entities/Asset/NonFungible/NftCollection.ts:62
compliance
• compliance: Compliance
Inherited from
Defined in
api/entities/Asset/Base/BaseAsset.ts:71
documents
• documents: Documents
Inherited from
Defined in
api/entities/Asset/Base/BaseAsset.ts:72
id
• id: string
Unique ID of the Asset in UUID format
Inherited from
Defined in
api/entities/Asset/Base/BaseAsset.ts:79
metadata
• metadata: Metadata
Inherited from
Defined in
api/entities/Asset/Base/BaseAsset.ts:73
permissions
• permissions: Permissions
Inherited from
Defined in
api/entities/Asset/Base/BaseAsset.ts:74
settlements
• settlements: NonFungibleSettlements
Defined in
api/entities/Asset/NonFungible/NftCollection.ts:63
uuid
• uuid: string
Inherited from
Defined in
Accessors
rawId
• get
rawId(): string
Unique ID of the Asset in hex format
Returns
string
Note
Although UUID format is the usual representation of asset IDs, generic polkadot/substrate tools usually expect it in hex format
Inherited from
BaseAsset.rawId
Defined in
api/entities/Asset/Base/BaseAsset.ts:86
Methods
addRequiredMediators
▸ addRequiredMediators(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Add required mediators. Mediators must approve any trades involving the asset
Parameters
Name | 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
Defined in
api/entities/Asset/Base/BaseAsset.ts:241
collectionKeys
▸ collectionKeys(): Promise
<CollectionKey
[]>
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
Defined in
api/entities/Asset/NonFungible/NftCollection.ts:172
controllerTransfer
▸ controllerTransfer(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Force a transfer from the origin portfolio to one of the caller's portfolios
Parameters
Name | 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
Defined in
api/entities/Asset/NonFungible/NftCollection.ts:82
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
Returns
Promise
<null
| EventIdentifier
>
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
Defined in
api/entities/Asset/NonFungible/NftCollection.ts:261
currentFundingRound
▸ currentFundingRound(): Promise
<null
| string
>
Retrieve the Asset's funding round
Returns
Promise
<null
| string
>
Note
can be subscribed to, if connected to node using a web socket
Inherited from
Defined in
api/entities/Asset/Base/BaseAsset.ts:518
▸ currentFundingRound(callback
): Promise
<UnsubCallback
>
Parameters
Name | Type |
---|---|
callback | SubCallback <null | string > |
Returns
Promise
<UnsubCallback
>
Inherited from
Defined in
api/entities/Asset/Base/BaseAsset.ts:519
details
▸ details(): Promise
<AssetDetails
>
Retrieve the NftCollection's data
Returns
Promise
<AssetDetails
>
Note
can be subscribed to, if connected to node using a web socket
Overrides
Defined in
api/entities/Asset/NonFungible/NftCollection.ts:122
▸ details(callback
): Promise
<UnsubCallback
>
Parameters
Name | Type |
---|---|
callback | SubCallback <AssetDetails > |
Returns
Promise
<UnsubCallback
>
Overrides
Defined in
api/entities/Asset/NonFungible/NftCollection.ts:123
exists
▸ exists(): Promise
<boolean
>
Determine whether this NftCollection exists on chain
Returns
Promise
<boolean
>
Overrides
BaseAsset.exists
Defined in
api/entities/Asset/NonFungible/NftCollection.ts:284
freeze
▸ freeze(opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Freeze transfers of the Asset
Parameters
Name | 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
Defined in
api/entities/Asset/Base/BaseAsset.ts:221
getCollectionId
▸ getCollectionId(): Promise
<BigNumber
>
Returns the collection's on chain numeric ID. Used primarily to access NFT specific storage values
Returns
Promise
<BigNumber
>
Defined in
api/entities/Asset/NonFungible/NftCollection.ts:303
getIdentifiers
▸ getIdentifiers(): Promise
<SecurityIdentifier
[]>
Retrieve the Asset's identifiers list
Returns
Promise
<SecurityIdentifier
[]>
Note
can be subscribed to, if connected to node using a web socket
Inherited from
Defined in
api/entities/Asset/Base/BaseAsset.ts:287
▸ getIdentifiers(callback?
): Promise
<UnsubCallback
>
Parameters
Name | Type |
---|---|
callback? | SubCallback <SecurityIdentifier []> |
Returns
Promise
<UnsubCallback
>
Inherited from
Defined in
api/entities/Asset/Base/BaseAsset.ts:288
getNft
▸ getNft(args
): Promise
<Nft
>
Get an NFT belonging to this collection
Parameters
Name | Type |
---|---|
args | Object |
args.id | BigNumber |
Returns
Promise
<Nft
>
Throws
if the given NFT does not exist
Defined in
api/entities/Asset/NonFungible/NftCollection.ts:237
getRequiredMediators
▸ getRequiredMediators(): Promise
<Identity
[]>
Get required Asset mediators. These Identities must approve any Instruction involving the asset
Returns
Promise
<Identity
[]>
Inherited from
BaseAsset.getRequiredMediators
Defined in
api/entities/Asset/Base/BaseAsset.ts:463
getTransactionHistory
▸ getTransactionHistory(opts
): Promise
<ResultSet
<HistoricNftTransaction
>>
Retrieve this Collection's transaction history
Parameters
Name | Type |
---|---|
opts | Object |
opts.size? | BigNumber |
opts.start? | BigNumber |
Returns
Promise
<ResultSet
<HistoricNftTransaction
>>
Note
uses the middlewareV2
Defined in
api/entities/Asset/NonFungible/NftCollection.ts:330
getVenueFilteringDetails
▸ getVenueFilteringDetails(): Promise
<VenueFilteringDetails
>
Get venue filtering details
Returns
Promise
<VenueFilteringDetails
>
Inherited from
BaseAsset.getVenueFilteringDetails
Defined in
api/entities/Asset/Base/BaseAsset.ts:483
investorCount
▸ investorCount(): Promise
<BigNumber
>
Retrieve the amount of unique investors that hold this Nft
Returns
Promise
<BigNumber
>
Defined in
api/entities/Asset/NonFungible/NftCollection.ts:215
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
Defined in
isFrozen
▸ isFrozen(): Promise
<boolean
>
Check whether transfers are frozen for the Asset
Returns
Promise
<boolean
>
Note
can be subscribed to, if connected to node using a web socket
Inherited from
Defined in
api/entities/Asset/Base/BaseAsset.ts:326
▸ isFrozen(callback
): Promise
<UnsubCallback
>
Parameters
Name | Type |
---|---|
callback | SubCallback <boolean > |
Returns
Promise
<UnsubCallback
>
Inherited from
Defined in
api/entities/Asset/Base/BaseAsset.ts:327
issue
▸ issue(args
, opts?
): Promise
<GenericPolymeshTransaction
<Nft
, Nft
>>
Issues a new NFT for the collection
Parameters
Name | 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
Defined in
api/entities/Asset/NonFungible/NftCollection.ts:72
linkTicker
▸ linkTicker(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Link ticker to the asset
Parameters
Name | 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
Defined in
api/entities/Asset/Base/BaseAsset.ts:264
modify
▸ modify(args
, opts?
): Promise
<GenericPolymeshTransaction
<Asset
, Asset
>>
Modify some properties of the Asset
Parameters
Name | 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
Defined in
api/entities/Asset/Base/BaseAsset.ts:135
removeRequiredMediators
▸ removeRequiredMediators(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Remove required mediators
Parameters
Name | 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
Defined in
api/entities/Asset/Base/BaseAsset.ts:251
setVenueFiltering
▸ setVenueFiltering(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Enable/disable venue filtering for this Asset and/or set allowed/disallowed venues
Parameters
Name | 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
Defined in
api/entities/Asset/Base/BaseAsset.ts:111
toHuman
▸ toHuman(): string
Return the BaseAsset's ID
Returns
string
Inherited from
Defined in
api/entities/Asset/Base/BaseAsset.ts:575
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
Parameters
Name | Type |
---|---|
args | TransferAssetOwnershipParams |
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<AuthorizationRequest
, AuthorizationRequest
>>
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
Defined in
api/entities/Asset/Base/BaseAsset.ts:101
unfreeze
▸ unfreeze(opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Unfreeze transfers of the Asset
Parameters
Name | 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
Defined in
api/entities/Asset/Base/BaseAsset.ts:231
unlinkTicker
▸ unlinkTicker(opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Unlink ticker from the Asset
Parameters
Name | 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
Defined in
api/entities/Asset/Base/BaseAsset.ts:278
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
Defined in
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