Build Wallet
Before you begin
As a brand, let's say you want to build your own multi-chains compliant wallet on multiple chains.
Requirement: Arianee Access Token or Wallet Connect
Methods
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:
import { Wallet } from '@arianee/wallet';
(async () => {
const wallet = new Wallet({ chainType: 'testnet', auth: { mnemonic: '' } });
const nft = await wallet.smartAsset.getFromLink('');
await nft.claim();
})();
Response: The transaction request is sent to the blockchain.
Retrieve NFT(s)
Retrieve NFTs owned by a wallet and the content associated with these tokens.
Method
wallet.smartAsset.getOwned(onlyFromBrands?:string[], i18nStrategy?:{useLanguages?: string[]})
Input | Mandatory | Type | Description |
---|---|---|---|
language | ❌ | en-US , fr-FR ... | Language(s) returned in order of preference. |
chainType | ✅ | testnet or mainnet | Blockchain network of the NFT ID. |
brands | ❌ | String | Allows to return NFTs owned by the user and issued by the brand(s) only. |
Result: promise
returns an array
with the NFTs 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[]
}
]
Generate proof of ownership
Method
wallet.smartAsset.createProofLink(network, tokenId, passphrase?)
Parameter | Type | Mandatory | 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();
Result: The proof of ownership link is returned.
Retrieve dMessages
Retrieve the data and content of dMessages for a given chain type and NFTs owned by a wallet.
Method
wallet.message.getReceived(i18nStrategy?:{useLanguages?: string[]})
Input | Mandatory | Type | Description |
---|---|---|---|
language | ❌ | en-US , fr-FR ... | Language(s) returned in order of preference. |
Result: promise
returns an array
with messages information.
[{
data: {
id: '238153639',
certificateId: '86429342',
content: ArianeeMessageI18N,
rawContent: ArianeeMessageI18N,
imprint: 'TODO',
isRead: true,
protocol: { name: "testnet"; chainId: 77 }
receiver: '0xa9bc90d24d0b8495043ab5857455444630028caf',
sender: '0xb908b66915ecd1ec31e669adc9c71bdce44ec601',
timestamp: 1682609160
}
}]
For more information about Arianee SDK, dig deeper into the documentation.
Updated about 1 year ago