Manage NFT
Methods related to NFTs data collection.
Retrieve owned NFTs for a user
Retrieve the NFTs owned by a user in the wallet associated.
Method
wallet.smartAsset.getOwned(onlyFromBrands?, i18nStrategy?:useLanguages)
Input | Mandatory | Type | Description |
---|---|---|---|
language | ❌ | en-US , fr-FR ... | Language(s) returned in order of preference. |
onlyFromBrands | ❌ | String | Allows to return NFTs owned by the user and issued by the brand(s) only. |
Result: promise
returns an array
with the NFT's information.
ArianeeProductCertificateI18N
: NFT Schema.BlockchainEvent[]
: Gathering of transaction events of the token recorded on the blockchain.Event[]
: Event Schema.
[
{
data: {
certificateId: '58824256',
content: ArianeeProductCertificateI18N,
rawContent: ArianeeProductCertificateI18N,
blockchainEvents: BlockchainEvent[],
imprint: '0xce917f8d652187e7bf162b2c05d4b5439cef04142795eb6e5d2283b6193b8e88',
isAuthentic: true,
isRequestable: false,
issuer: '0x90d181a3e977E8CcD7822B711Bb3A83E79beaEFF',
owner: '0xa9bc90d24d0b8495043ab5857455444630028caf',
protocol: { name: "testnet"; chainId: 77 }
},
arianeeEvents: Event[]
}
]
Retrieve NFT from ID
Retrieve a specific NFT.
Method
wallet.smartAsset.get(protocol, {id: nftId, passphrase?: passphrase}, i18nStrategy?:useLanguages)
Input | Mandatory | Type | Description |
---|---|---|---|
nftId | ✅ | Number | Identification number of the NFT. |
passphrase | ❌ | String | A passphrase of the NFT. Param optional is you are the owner of the NFT. |
protocol | ✅ | mainnet or testnet | Blockchain network of the NFT ID. |
language | ❌ | en-US , fr-FR ... | Language(s) returned in order of preference. |
Result: promise
returns an object
with the NFT information.
ArianeeProductCertificateI18N
: NFT Schema.BlockchainEvent[]
: Gathering of transaction events of the token recorded on the blockchain.Event[]
: Event Schema.
{
data: {
certificateId: '58824256',
content: ArianeeProductCertificateI18N,
rawContent: ArianeeProductCertificateI18N,
blockchainEvents: BlockchainEvent[],
imprint: '0xce917f8d652187e7bf162b2c05d4b5439cef04142795eb6e5d2283b6193b8e88',
isAuthentic: true,
isRequestable: false,
issuer: '0x90d181a3e977E8CcD7822B711Bb3A83E79beaEFF',
owner: '0xa9bc90d24d0b8495043ab5857455444630028caf',
protocol: { name: "testnet"; chainId: 77 }
},
arianeeEvents: Event[]
}
Retrieve NFT from the link
Retrieve the content and data from the deeplink of a specific NFT.
Method
wallet.smartAsset.getFromLink(link, resolveFinalNft?, i18nStrategy?)
Input | Mandatory | Type | Description |
---|---|---|---|
link | ✅ | String | Deeplink of the NFT → https://arian.ee/tokenId,passphrase |
resolveFinalNft | ✅ | Boolean | - true : try to add the Arianee Access Token in the request.- false : get the landing NFT. |
language | ❌ | en-US , fr-FR ... | Language(s) returned in order of preference. |
Result: promise
returns an object
with the NFT information.
ArianeeProductCertificateI18N
: NFT Schema.BlockchainEvent[]
: Gathering of transaction events of the token recorded on the blockchain.Event[]
: Event Schema.
{
data: {
certificateId: '58824256',
content: ArianeeProductCertificateI18N,
rawContent: ArianeeProductCertificateI18N,
blockchainEvents: BlockchainEvent[],
imprint: '0xce917f8d652187e7bf162b2c05d4b5439cef04142795eb6e5d2283b6193b8e88',
isAuthentic: true,
isRequestable: false,
issuer: '0x90d181a3e977E8CcD7822B711Bb3A83E79beaEFF',
owner: '0xa9bc90d24d0b8495043ab5857455444630028caf',
protocol: { name: "testnet"; chainId: 77 }
},
arianeeEvents: Event[]
}
Create ownership request link
Method:
wallet.smartAsset.createProofLink(network, tokenId, passphrase?)
Parameter | Mandatory | Type | Description |
---|---|---|---|
network | ✅ | String | Network of the NFT. |
tokenId | ✅ | Number | Arianee token ID of the NFT. |
passphrase | ✅ | String | Token request passphrase. This param is optional if you are the NFT owner. |
Example:
const wallet = new Wallet({ chainType: 'mainnet' });
const nft = await wallet.smartAsset.getOwned();
const proofLink = await nft[0].createProofLink();
Response: The ownership link is returned.
Claim NFT
wallet.smartAsset.claim(network, tokenId, passphrase, receiver?)
Parameter | Mandatory | Type | Description |
---|---|---|---|
network | ✅ | String | Network of the NFT. |
tokenId | ✅ | Number | Arianee token ID of the NFT. |
passphrase | ✅ | String | Token request passphrase. This param is optional if you are the NFT owner. |
receiver | ❌ | String | Recipient wallet of the NFT. |
Example:
const wallet = new Wallet({ chainType: 'mainnet' });
const nft = await wallet.smartAsset.getFromLink("https://test.arian.ee/762482926,bnj9vdx3kbhj");
await nft.claim();
Response: The transaction request is sent to the blockchain.
Transfer NFT
Transfer an NFT from the owner's wallet to another.
Method
wallet.smartAsset.transfer(receiver: string)
Input | Mandatory | Type | Description |
---|---|---|---|
receiver | ✅ | String | The wallet address of the receiver. |
Result: promise
returns the transaction receipt.
Updated 11 months ago