Create & Manage NFT
Methods related to NFTs management.
Reserve NFT
Your wallet must own at least 1
certificate
credit. The credit is spent once the NFT has been minted and claimed by another wallet.
Method:
creator.reserveSmartAssetId(smartAssetId?, overrideTransaction?:NonPayableOverrides)
Parameter | Mandatory | Type | Description |
---|---|---|---|
smartAssetId | ❌ | Number | If ID defined → Checked if ID is free. If ID undefined → Get a free ID. |
overrides | ❌ | gasPrice , gasLimit , maxFeePerGas , maxPriorityPerGas | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |
Response: promise
returns reserved smartAssetId
is returned.
Check if an NFT ID is available for reservation or creation
Method to check if the passed NFT ID is available.
Method:
creator.isSmartAssetIdAvailable(id)
Parameter | Mandatory | Type | Description |
---|---|---|---|
id | ✅ | String | NFT identification number to be checked. |
Response: promise returns boolean:
true
: ID available.false
: ID already linked to an NFT.
Get a random available ID
Smart Asset
Method:
creator.getAvailableSmartAssetId()
Response: promise
returns number
corresponding to the smarAssetId
.
All types
Method:
creator.getAvailableId(idType)
Parameter | Mandatory | Type | Description |
---|---|---|---|
idType | ✅ | smartAsset , message , event | Type of ID required. |
Response: promise
returns number
corresponding to the id
.
Create & Hydrate NFT
Create an NFT and store its content on the Arianee Privacy Gateway.
Method
creator.createAndStoreSmartAsset(data:hydrateTokenParameters, overrideTransaction?:NonPayableOverrides)
→ You have a registered & verified identity:
Parameter | Mandatory | Type | Description |
---|---|---|---|
smartAssetId | ❌ | Number | NFT identitication number. |
tokenAccess | ❌ | String | Wallet address generated through the passphrase. |
tokenRecoveryTimestamp | ❌ | Number | Period during which the NFT can be recovered by its issuer. Default value if empty: 5 years. |
sameRequestOwnershipPassphrase | ❌ | Boolean | true : Transferable NFTfalse : Non-transferable NFT |
content | ✅ | Object | Content mandatory if no uri and imprint . |
uri | ✅ | String | NFT uri. Mandatory with imprint if no content . |
imprint | ✅ | String | NFT imprint. Mandatory with uri if no content . |
overrides | ❌ | gasPrice , gasLimit , maxFeePerGas , maxPriorityPerGas | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |
→ You have not a registered & verified identity:
Parameter | Mandatory | Type | Description |
---|---|---|---|
uri | ✅ | String | NFT uri. |
Response:
promise
returnsLinkObject
. The NFT has been created, as well as NFTdeeplink
,smartAssetId
andpassphrase
.
Example:
{
deeplink:"https://test.arianee.net/440105186,v6lsj4vhg5dx", // except if address was provided instead of passphrase
smartAssetId:"440105186",
passphrase:"v6lsj4vhg5dx" // except if address was provided instead of passphrase
}
- An error may occur.
Error type | Description |
---|---|
UnavailableSmartAssetIdError | The NFT identification number is not available. |
InsufficientSmartAssetCreditsError | The core address does not have enough smart asset credits. |
NoIdentityError | The core address does not have an identity URI. |
ArianeePrivacyGatewayError | An error occurred while interacting with the Arianee Privacy Gateway. |
Create NFT without content storing
Create an NFT without storing the content on the Arianee Privacy Gateway.
Method for test purposes.
creator.createSmartAsset(smartAssetId, overrideTransaction?:NonPayableOverrides)
Parameter | Mandatory | Type | Description |
---|---|---|---|
smartAssetId | ❌ | Number | NFT identitication number. |
tokenAccess | ❌ | String | Wallet address generated through the passphrase. |
tokenRecoveryTimestamp | ❌ | Number | Period during which the NFT can be recovered by its issuer. Default value if empty: 5 years. |
sameRequestOwnershipPassphrase | ❌ | Boolean | true : Transferable NFTfalse : Non-transferable NFT |
content | ✅ | Object | Content mandatory if no uri and imprint . |
uri | ✅ | String | NFT uri. Mandatory with imprint if no content . |
overrides | ❌ | gasPrice , gasLimit , maxFeePerGas , maxPriorityPerGas | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |
Response:
promise
returnsLinkObject
. The NFT has been created, as well as NFTdeeplink
,smartAssetId
andpassphrase
.
Example:
{
deeplink:"https://test.arianee.net/440105186,v6lsj4vhg5dx",
smartAssetId:"440105186",
passphrase:"v6lsj4vhg5dx"
}
- An error may occur.
Error type | Description |
---|---|
UnavailableSmartAssetIdError | The NFT identification number is not available. |
InsufficientSmartAssetCreditsError | The core address does not have enough smart asset credits. |
Recover NFT
The NFT issuer can recover a distributed NFT, in other words, the issuer gets back the ownership of the NFT.
- The wallet must be the NFT issuer.
- The
tokenRecoveryTimestamp
must not be outdated.
Method:
creator.recoverSmartAsset(id, overrideTransaction?:NonPayableOverrides)
Parameter | Mandatory | Type | Description |
---|---|---|---|
id | ✅ | Number | ID of the NFT to recover. |
overrides | ❌ | gasPrice , gasLimit , maxFeePerGas , maxPriorityPerGas | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |
Response: The receipt of the transaction is returned.
Destroy NFT
The destroy process transfers the given NFT ID to the wallet address
0x000000000000000000000000000000000000dead
.
Method:
creator.destroySmartAsset(id, overrideTransaction?:NonPayableOverrides)
Parameter | Mandatory | Type | Description |
---|---|---|---|
id | ✅ | String | ID of the NFT to destroy. |
overrides | ❌ | gasPrice , gasLimit , maxFeePerGas , maxPriorityPerGas | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |
Response: The receipt of the transaction is returned.
Set token access
Method to set the token access,requestKey
orviewKey
, of a smart asset owned by the core wallet address.
Method:
creator.setTokenAccess(smartAssetId, tokenAccessType, tokenAccess?, overrrides?)
Parameter | Mandatory | Type | Description |
---|---|---|---|
smartAssetId | ✅ | Number | Arianee token ID of the NFT. |
tokenAccessType | ✅ | - 0 - viewKey - 1 - requestKey | Type of key. |
tokenAccess | ❌ | String | Wallet address generated through the passphrase. |
overrrides | ❌ | gasPrice , gasLimit , maxFeePerGas , maxPriorityPerGas | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |
Response:
- The token type has been set on the given
smartAssetId
. - An error may occur.
Error type | Description |
---|---|
NotOwnerOf | The core wallet address is not the owner of the NFT. |
Set request key
Method to set the requestKey
of a smart asset owned by the core wallet address.
Method:
creator.setRequestKey(smartAssetId, tokenAccess?, overrrides?)
Parameter | Mandatory | Type | Description |
---|---|---|---|
smartAssetId | ✅ | Number | Arianee token ID of the NFT. |
tokenAccess | ❌ | String | Wallet address generated through the passphrase. |
overrrides | ❌ | gasPrice , gasLimit , maxFeePerGas , maxPriorityPerGas | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |
Response:
- The
requestKey
is set on the givensmartAssetId
. - An error may occur.
Error type | Description |
---|---|
NotOwnerOf | The core wallet address is not the owner of the NFT. |
Update token URI
Method:
creator.updateTokenURI(smartAssetId, uri, overrides)
Parameter | Mandatory | Type | Description |
---|---|---|---|
smartAssetId | ✅ | Number | Arianee token ID of the NFT. |
uri | ✅ | String | NFT uri. |
overrrides | ❌ | gasPrice , gasLimit , maxFeePerGas , maxPriorityPerGas | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |
Response:
- The token URI is updated.
- An error may occur.
Error type | Description |
---|---|
NotIssuerError | The wallet core address is not the issuer of the smart asset. |
InvalidURIError | The uri is not valid. |
Update NFT
Update the content of an NFT in the Arianee Privacy Gateway and update its imprint on chain. Returns the imprint of the new content.
The wallet core address requires an Identity URI.
Method:
creator.updateSmartAsset(smartAssetId, content, overrides)
Parameter | Mandatory | Type | Description |
---|---|---|---|
smartAssetId | ✅ | Number | Arianee token ID of the NFT. |
content | ✅ | Object | Content of the NFT. |
overrrides | ❌ | gasPrice , gasLimit , maxFeePerGas , maxPriorityPerGas | Allows you to override the gas/gasprice part to be able to move transactions through more quickly if needed. |
Response:
- The NFT has been updated.
- An error may occur.
Error type | Description |
---|---|
InsufficientUpdateCreditsError | The wallet core address does not have enough update credits. |
NoIdentityError | The wallet core address does not have an identity URI. |
ArianeePrivacyGatewayError | An error occurred while interacting with the Arianee Privacy Gateway. |
Fetch NFT owner
Retrieve the owner of a given NFT.
Method:
creator.getSmartAssetOwner(id)
Parameter | Mandatory | Type | Description |
---|---|---|---|
id | ✅ | Number | Arianee token ID of the NFT. |
Response: promise
returns string
corresponding to the the wallet owner.
Fetch NFT issuer
Retrieve the issuer of a given NFT.
Method:
creator.getSmartAssetIssuer(id: string)
Parameter | Mandatory | Type | Description |
---|---|---|---|
id | ✅ | Number | Arianee token ID of the NFT. |
Response: promise
returns string
corresponding to the NFT wallet issuer.
Updated about 1 year ago