-
Notifications
You must be signed in to change notification settings - Fork 11
api.entities.Asset.NonFungible.NftCollection.NftCollection
api/entities/Asset/NonFungible/NftCollection.NftCollection
Class used to manage NFT functionality
-
↳
NftCollection
- collectionKeys
- createdAt
- details
- exists
- freeze
- getCollectionId
- getIdentifiers
- getNft
- investorCount
- isEqual
- isFrozen
- issue
- toHuman
- transferOwnership
- unfreeze
- generateUuid
- unserialize
• compliance: Compliance
api/entities/Asset/Base/BaseAsset.ts:54
• did: string
Identity ID of the Asset (used for Claims)
api/entities/Asset/Base/BaseAsset.ts:62
• documents: Documents
api/entities/Asset/Base/BaseAsset.ts:55
• metadata: Metadata
api/entities/Asset/Base/BaseAsset.ts:56
• permissions: Permissions
api/entities/Asset/Base/BaseAsset.ts:57
• settlements: NonFungibleSettlements
api/entities/Asset/NonFungible/NftCollection.ts:50
• ticker: string
ticker of the Asset
api/entities/Asset/Base/BaseAsset.ts:67
• uuid: string
▸ 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
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
Promise
<CollectionKey
[]>
▸ 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
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
Promise
<null
| EventIdentifier
>
▸ details(): Promise
<AssetDetails
>
Retrieve the NftCollection's data
Note
can be subscribed to
Promise
<AssetDetails
>
▸ details(callback
): Promise
<UnsubCallback
>
Name | Type |
---|---|
callback |
SubCallback <AssetDetails > |
Promise
<UnsubCallback
>
▸ exists(): Promise
<boolean
>
Determine whether this NftCollection exists on chain
Promise
<boolean
>
BaseAsset.exists
▸ freeze(opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Freeze transfers of the Asset
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
Name | Type |
---|---|
opts? |
ProcedureOpts |
Promise
<GenericPolymeshTransaction
<void
, void
>>
▸ getCollectionId(): Promise
<BigNumber
>
Returns the collection's on chain numeric ID. Used primarily to access NFT specific storage values
Promise
<BigNumber
>
▸ getIdentifiers(): Promise
<SecurityIdentifier
[]>
Retrieve the Asset's identifiers list
Note
can be subscribed to
Promise
<SecurityIdentifier
[]>
▸ getIdentifiers(callback?
): Promise
<UnsubCallback
>
Name | Type |
---|---|
callback? |
SubCallback <SecurityIdentifier []> |
Promise
<UnsubCallback
>
▸ getNft(args
): Promise
<Nft
>
Get an NFT belonging to this collection
Throws
if the given NFT does not exist
Name | Type |
---|---|
args |
Object |
args.id |
BigNumber |
Promise
<Nft
>
▸ investorCount(): Promise
<BigNumber
>
Retrieve the amount of unique investors that hold this Nft
Promise
<BigNumber
>
▸ isEqual(entity
): boolean
Determine whether this Entity is the same as another one
Name | Type |
---|---|
entity |
Entity <unknown , unknown > |
boolean
▸ isFrozen(): Promise
<boolean
>
Check whether transfers are frozen for the Asset
Note
can be subscribed to
Promise
<boolean
>
▸ isFrozen(callback
): Promise
<UnsubCallback
>
Name | Type |
---|---|
callback |
SubCallback <boolean > |
Promise
<UnsubCallback
>
▸ issue(args
, opts?
): Promise
<GenericPolymeshTransaction
<Nft
, Nft
>>
Issues a new NFT for the collection
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
Name | Type |
---|---|
args |
IssueNftParams |
opts? |
ProcedureOpts |
Promise
<GenericPolymeshTransaction
<Nft
, Nft
>>
▸ toHuman(): string
Return the NftCollection's ticker
string
▸ 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
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
Name | Type |
---|---|
args |
TransferAssetOwnershipParams |
opts? |
ProcedureOpts |
Promise
<GenericPolymeshTransaction
<AuthorizationRequest
, AuthorizationRequest
>>
▸ unfreeze(opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Unfreeze transfers of the Asset
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
Name | Type |
---|---|
opts? |
ProcedureOpts |
Promise
<GenericPolymeshTransaction
<void
, void
>>
▸ Static
generateUuid<Identifiers
>(identifiers
): string
Generate the Entity's UUID from its identifying properties
Name |
---|
Identifiers |
Name | Type |
---|---|
identifiers |
Identifiers |
string
▸ Static
unserialize<Identifiers
>(serialized
): Identifiers
Unserialize a UUID into its Unique Identifiers
Name |
---|
Identifiers |
Name | Type | Description |
---|---|---|
serialized |
string |
UUID to unserialize |
Identifiers
Entities
- Account
- Asset
- Authorization Request
- Checkpoint
- Checkpoint Schedule
- Corporate Action
- Corporate Action Base
- Corporate Ballot
- Custom Permission Group
- Default Portfolio
- Default Trusted Claim Issuer
- Dividend Distribution
- Entity
- Identity
- Instruction
- Known Permission Group
- Metadata Entry
- Multi Sig Proposal
- Numbered Portfolio
- Offering
- Permission Group
- Portfolio
- Subsidies
- Subsidy
- Ticker Reservation
- Venue
- Authorizations
- Types