NFT
Methods related to NFTs management.
Create NFT
Fees
This method performs a blockchain transaction. It costs 1 credit and Gas.
Method
ArianeeWallets.methods.createCertificate(data)
Parameter | Type | Mandatory | Description |
---|---|---|---|
data | Object | β | NFT creation data object integrating the elements below. |
data β uri | String | β | NFT uri. |
data β content | Object | β | NFT content object - Json Schema. |
data β hash | String | β | NFT imprint, either content or hash need to be provided. |
data β certificateId | Number | β | Arianee token ID. When empty, the ID is randomly generated. |
data β passphrase | String | β | NFT access passphrase. |
data β recoveryTimestamp | Number | β | Timestamp until issuer can recover NFT ownership. Default value: 90 days from creation date. |
data β sameRequestOwnershipPassphrase | Boolean | β | Defines if a passphrase is required. Default value: true |
Output
promise
returns object
: The receipt of the blockchain transaction and keys.
certificateId
- Arianee token ID of the NFT created.passphrase
- NFT access passphrase.
Example
// fetch certificate content
var certificate = await fetch("https://cert.arianee.org/cert/sampleCert.json");
var content = await certificate.json();
// Create a certificate based on a self hosted json
await wallet.methods.createCertificate({
uri: "https://cert.arianee.org/cert/sampleCert.json",
content:content})
.then((i) => {
console.log("Arianee ID:"+i.certificateId);
console.log("Passphrase:"+i.passphrase);
})
.catch(i => console.log("Creating certificate : error ", JSON.stringify(i)));
Create NFT and store content
Fees
This method performs a blockchain transaction. It costs 1 credit and Gas.
Method
ArianeeWallets.methods.createAndStoreCertificate(data)
Parameter | Type | Mandatory | Description |
---|---|---|---|
data | Object | β | NFT creation data object integrating the elements below. |
data β uri | String | β | NFT uri. |
data β content | Object | β | NFT content object - Json Schema. |
data β hash | String | β | NFT imprint, either content or hash need to be provided. |
data β certificateId | Number | β | Arianee token ID. When empty, the ID is randomly generated. |
data β passphrase | String | β | NFT access passphrase. |
data β recoveryTimestamp | Number | β | Timestamp until issuer can recover NFT ownership. Default value: 90 days from creation date. |
data β sameRequestOwnershipPassphrase | Boolean | β | Defines if a passphrase is required. Default value: true |
url | String | β | URL of RPC Server. Usually, it is the url of issuer's RPC Server. |
Output
promise
returns object
: The receipt of the blockchain transaction and keys.
certificateId
- Arianee token ID of the NFT created.passphrase
- NFT access passphrase.
Example
// fetch certificate content
var certificate = await fetch("https://cert.arianee.org/cert/sampleCert.json");
var content = await certificate.json();
// Create a certificate based on a self hosted json
await wallet.methods.createCertificate({
uri: "https://cert.arianee.org/cert/sampleCert.json",
content:content})
.then((i) => {
console.log("Arianee ID:"+i.certificateId);
console.log("Passphrase:"+i.passphrase);
})
.catch(i => console.log("Creating certificate : error ", JSON.stringify(i)));
Store NFT content
Method
ArianeeWallets.methods.storeContentInRPCServer(certificateId, content, RPCURL)
Parameter | Type | Mandatory | Description |
---|---|---|---|
certificateId | Number | β | Arianee token ID of the NFT. |
data | Object | β | Content of the NFT. |
url | String | β | URL of RPC Server. Usually, it is the url of issuer's RPC Server. |
Output
promise
returns object
.
Example
// fetch certificate content
var certificate = await fetch("https://cert.arianee.org/cert/sampleCert.json");
var content = await certificate.json();
// Store content of a Arianee certificate
await wallet.methods.storeContentInRPCServer(
1234,
content,
'https://arianee.cleverapps.io/testnet/rpc'
)
Request NFT ownership
Fees
This method performs a blockchain transaction. It costs 1 credit and Gas.
Method
ArianeeWallets.methods.requestCertificateOwnership(certificateId, passphrase)
Parameter | Type | Mandatory | Description |
---|---|---|---|
certificateId | Number | β | Arianee token ID of the NFT. |
passphrase | String | β | Token request passphrase. |
Output
promise
returns object
: The receipt of the blockchain transaction.
Example
// Request certificate ownership
await wallet.methods.requestCertificateOwnership(3703454,'j2ukmnj6weyz')
.then(i => console.log("success"))
.catch(i => console.log("fail"));
Reserve an NFT ID
Fees
This method performs a blockchain transaction. It costs 1 credit and Gas.
Gas fees are debited after the NFT is hydrated.
Method
ArianeeWallets.methods.reserveCertificateId(smartAsset.tokenId, receiver);
Parameter | Type | Mandatory | Description |
---|---|---|---|
smartAsset β tokenId | Number | β | Specific token ID to reserve. |
receiver | String | β | Recipient of the NFT. |
Output: promise
returns object
: The receipt of the blockchain transaction.
Read NFT content & metadata
Method
ArianeeWallets.methods.getCertificateFromLink(link)
Parameter | Type | Mandatory | Description |
---|---|---|---|
link | String | β | Arianee link (requestOwnership, proof, ...). |
Output
promise
returns object
: the NFT content.
Example
// Fetch a certificate
await wallet.methods.getCertificateFromLink('https://test.arian.ee/3703454,j2ukmnj6weyz')
.then((data)=> console.log(data));
> { content:
{ data:
{ '$schema': 'https://cert.arianee.org/version1/ArianeeAsset.json',
name: 'Arianee',
v: '0.1',
serialnumber: [Array],
brand: 'Arianee',
model: 'Token goody',
description:
'Here is the digital passport of your Arianee token goody, giving you a glimpse of an augmented ownership experience. This Smart-Asset has a unique ID. It is transferable and enables future groundbreaking features. \n Connect with the arianee team to learn more.',
type: 'SmartAsset',
picture:
'https://www.arianee.org/wp-content/uploads/2019/02/Screen-Shot-2019-02-27-at-12.12.53-PM.png',
pictures: [Array],
socialmedia: [Object],
externalContents: [Array],
jsonSurcharger: 'url' },
isAuthentic: true },
issuer:
{ identity: { data: undefined, isAuthentic: false, isApproved: false },
isIdentityAuthentic: false,
isIdentityVerified: false },
isTransferable: true,
owner:
{ publicKey: '0x29059AA0a8D7eE82d5251410d9231d5077339B65',
isOwner: false },
events:
CertificateEventsSummary { transfer: [ [Object], [Object] ], arianeeEvents: [] } }
Create link for ownership request
Fees
This method performs a Blockchain transaction. It costs 1 credit and Gas.
Method
ArianeeWallets.methods.createRequestOwnershipLink(certificateId [, passphrase])
Parameter | Type | Mandatory | Description |
---|---|---|---|
certificateId | Number | β | Arianee token ID of the NFT. |
passphrase | String | β | Token request passphrase. |
Output
promise
returns object
: The receipt of the blockchain transaction. The ownership link
is displayed.
Example
await wallet.methods.createRequestTransferOwnershipLink(3703454)
.then((data)=> console.log(data));
> { certificateId: 3703454,
passphrase: 'evo8mrqmuo42',
link: 'https://test.arian.ee/3703454,evo8mrqmuo42' }
Read NFTs owned by a wallet
Method
wallet.methods.getMyCertificates()
Parameter | Type | Mandatory | Description |
---|---|---|---|
query | Object | β | Default : all blocks are fetched. |
query β isRequestable | Boolean | β | NFT is transferable with provided passphrase. |
query β content | Boolean | β | NFT content object - Json Schema. |
query β issuer | Object | β | Issuer information. |
query β owner | Boolean | β | Owner information. |
query β events | Boolean | β | Transfer events list. |
query β arianeeEvents | Boolean | β | Arianee events list. |
query β advanced | Object | β | Token recovery timestamp. |
query β getMessageSenders | Object | β | List of validated senders |
url | String | β | Verify the list of owned NFT in the blockchain. |
Output
promise
returns array
: an array with Arianee NFT objects.
Test if an NFT is claimable
Method
ArianeeWallets.methods.isCertificateOwnershipRequestable(certificateId, passphrase)
Parameter | Type | Mandatory | Description |
---|---|---|---|
certificateId | Number | β | Arianee token ID of the NFT. |
passphrase | String | β | Token request passphrase. |
Output
promise
returns ExtendedBoolean
:
isTrue
- true if the NFT is claimable.code
- returns code.message
- returns message.
Example
await wallet.methods.isCertificateOwnershipRequestable(3703454,'evo8mrqmuo42')
.then((data)=> console.log(data))
> {isTrue: true, code: 'certicate.requestable', message: 'certificate is requestable'}
Create a proof of ownership link
Fees
This method performs a blockchain transaction. It costs 1 credit and Gas.
Method
ArianeeWallets.methods.createCertificateProofLink(certificateId [, passphrase])
Parameter | Type | Mandatory | Description |
---|---|---|---|
certificateId | Number | β | Arianee token ID of the NFT. |
passphrase | String | β | Token request passphrase. |
Output
promise
returns object
: A link object containing certificateId
, passphrase
, and method proof
and final link
.
Example
await wallet.methods.createCertificateProofLink(3703454)
.then((data)=> console.log(data));
> { method: 'proof',
certificateId: 3703454,
passphrase: 's4cx5wnr8bol',
link: 'https://test.arian.ee/proof/3703454,s4cx5wnr8bol' }
Test a proof
Method
ArianeeWallets.methods.isCertificateProofValid(certificateId, passphrase)
Parameter | Type | Mandatory | Description |
---|---|---|---|
certificateId | Number | β | Arianee token ID of the NFT. |
passphrase | String | β | Token proof passphrase. |
Output
promise
returns ExtendedBoolean
:
isTrue
- true if proof is valid.code
- returns code.message
- returns message.
Example
await wallet.methods.isCertificateProofValid(3703454,'j2ukmnjd6weyz')
.then((data)=> console.log(data))
> {isTrue:true, code:'proof.token.valid', message: 'proof is valid'}
Create action proof link
An action proof link is a typed link in an NFT external content. It can be used to authenticate anonymously a user on a specified link using an Arianee proof. A user needs to be the owner of the specified NFT.
Fees
This method performs a blockchain transaction. It costs 1 credit and Gas.
Method
ArianeeWallets.methods.createActionProofLink(url, certificateId [, passphrase])
Parameter | Type | Mandatory | Description |
---|---|---|---|
link | String | β | A URL. This URL should implement test proof. |
certificateId | Number | β | Arianee token ID of the NFT. |
passphrase | String | β | Token proof passphrase. |
Output
promise
returns string
: A URL with the proof append to the URL.
Example
wallet.methods.createActionProofLink('https://myurl.com/mywebpage.html',3703454,'j2ukmnjd6weyz')
> https://myurl.com/mywebpage.html?proofLink=https://arian.ee/3703454,j2ukmnjd6weyz
Create Arianee Access token
Method
An Arianee Access Token is an Ethereum Web Token (or JWT using Ethereum algorithm signature). It is very close to a Arianee Proof but it does not require a blockchain transaction. It can be used to anonymously authenticate a user. A user needs to be the owner of the specified NFT to create a valid Arianee Access Token.
ArianeeWallets.methods.createCertificateArianeeAccessToken(certificateId)
Parameter | Type | Mandatory | Description |
---|---|---|---|
certificateId | Number | β | Arianee token ID of the NFT. |
Output
string
- An Ethereum Web Token.
Example
wallet.methods.createCertificateArianeeAccessToken(3703454)
> eyJ0eXAiOiJKV1QiLCJhbGciOiJFVEgifQ==.eyJpc3MiOiIweDQ5NjdmOTZBOTUyMDk2Q2IxODAyRDM3NWNCNzAzMTRmODcyOUE5NzciLCJzY29wZSI6ImFsbCIsImV4cCI6MTU5NTkxMzMyNDk1OSwiaWF0IjoxNTk1OTEzMDI0OTYwLCJjaGFpbiI6InRlc3RuZXQiLCJzdWIiOiJjZXJ0aWZpY2F0ZSIsInN1YklkIjozNzAzNDU0fQ==.0x1a13a3f9f47b31212bfca68b67e17053c9a95d68d356bb540c7f7af77682699316a34fdb44c07a744e8584a41a5beea5b86ba92d97a4ab03ec5598f50a3f81f21c
Decode Arianee Access token
Method
ArianeeWallets.methods.decodeArianeeAccessToken(ArianeeAccessToken)
Parameter | Type | Mandatory | Description |
---|---|---|---|
ArianeeAccessToken | Number | β | An Arianee access token. |
Output
Object
- Decoded Arianee Access Token.
Example
wallet.methods.decodeArianeeAccessToken(eyJ0eXAiOiJKV1QiLCJhbGciOiJFVEgifQ==.eyJpc3MiOiIweDQ5NjdmOTZBOTUyMDk2Q2IxODAyRDM3NWNCNzAzMTRmODcyOUE5NzciLCJzY29wZSI6ImFsbCIsImV4cCI6MTU5NTkxMzMyNDk1OSwiaWF0IjoxNTk1OTEzMDI0OTYwLCJjaGFpbiI6InRlc3RuZXQiLCJzdWIiOiJjZXJ0aWZpY2F0ZSIsInN1YklkIjozNzAzNDU0fQ==.0x1a13a3f9f47b31212bfca68b67e17053c9a95d68d356bb540c7f7af77682699316a34fdb44c07a744e8584a41a5beea5b86ba92d97a4ab03ec5598f50a3f81f21c)
>
{ header: { typ: 'JWT', alg: 'ETH' },
payload:
{ iss: '0x4967f96A952096Cb1802D375cB70314f8729A977',
scope: 'all',
exp: 1595913439007,
iat: 1595913139007,
chain: 'testnet',
sub: 'certificate',
subId: 3703454 },
signature:
'0x9d889236b78f92f9b32367415a99e055726b17c9605b335de63bbeb64c0fbc442ec24e83bf929afc620a801ad6a50d7d82280df2ac070ad845757b597d20d1ea1b' }
Create Action Arianee Access token link
An action Arianee Access Token link is a typed link in an NFT external content.
It can be used to anonymously authenticate a user on a specified link using an Arianee Access Token. It does not require a blockchain transaction.
Method
ArianeeWallets.methods.createActionArianeeAccessTokenLink(url, certificateId)
Parameter | Type | Mandatory | Description |
---|---|---|---|
link | String | β | URL. |
certificateId | Number | β | Arianee token ID of the NFT. |
Output
string
- URL added with Arianee Access Token.
Example
const b=wallet.methods.createActionArianeeAccessTokenLink('http://www.authentificate-me.com',3703454);
>
Check if URL is authentic
Check if a URL is an authenticated URL by either a proof or an Arianee access token.
Method
ArianeeWallets.methods.isAuthURL(url)
Parameter | Type | Mandatory | Description |
---|---|---|---|
link | URL | β | URL with proof or Arianee Access Token. Pass the full URL with query parameters. |
Output
promise
returns ExtendedBoolean
:
isTrue
- true if proof is valid.code
- returns code.message
- returns message.timestamp
- returns URL auth creation timestamp.certificateId
- returns the Arianee token ID of the NFT.
Example
wallet.methods.isAuthURL('https://www.authentificate-me.com/us-fr/my-account/login/?arianee=1&arianeeAccessToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJFVEgifQ%3D%3D.eyJpc3MiOiIweDA5MTg4ZEMxNzA2NDMyNmVBMmYwRjgwZkIzNUNjRTAxQkEzNTRDOTMiLCJzY29wZSI6ImFsbCIsImV4cCI6MTYwMTI3NTEzOTEzNCwiaWF0IjoxNjAxMjc0ODM5MTM1LCJjaGFpbiI6InRlc3RuZXQiLCJzdWIiOiJjZXJ0aWZpY2F0ZSIsInN1YklkIjo3MTk0NTMzMX0%3D.0x97d9f7f1b440ec5ddc6d1029c59e395c8052f096ccdc7a5c59d2f29f8dc1acd01335b6ec78c9b277b1cf50139f6909418de36b36441e29e4490e0f847c32af341b')
>
{ isTrue: true,
code: 'proof.token.valid',
message: 'proof is valid',
timestamp: 1601274961946,
certificateId: 71945331 }
Update NFT
Fees
This method performs a blockchain transaction. It costs 1 credit and Gas.
ArianeeWallets.methods.updateCertificate(data)
Parameter | Type | Mandatory | Description |
---|---|---|---|
data | Object | β | NFT creation data object. |
data β certificateId | Number | β | Arianee token ID of the NFT. |
data β content | Object | β | NFT content object - Json Schema. |
data β imprint | String | β | NFT imprint, either content or hash to be provided. |
Output
promise
returns object
: The receipt of the blockchain transaction.
Example
// fetch certificate content
var certificate = await fetch("https://cert.arianee.org/cert/sampleCert.json");
var content = await certificate.json();
// Create a certificate based on a self hosted json
await wallet.methods.updateCertificate({
certificateId: 1234567,
content:content})
.then((i) => {
...
})
.catch(i => console.log("Updating certificate : error ", JSON.stringify(i)));
Update NFT and store content in RPC server
Fees
This method performs a blockchain transaction. It costs 1 credit and Gas.
Method
ArianeeWallets.methods.updateAndStoreCertificate(data)
Parameter | Type | Mandatory | Description |
---|---|---|---|
data | Object | β | NFT creation data object. |
data β certificateId | Number | β | Arianee token ID of the NFT. |
data β content | Object | β | NFT content object - Json Schema. |
data β imprint | String | β | NFT imprint, either content or hash to be provided. |
url | String | β | URL of RPC server. Usually, it is the url of issuer's RPC Server. |
Output
promise
returns object
: The receipt of the blockchain transaction.
Example
// fetch certificate content
var certificate = await fetch("https://cert.arianee.org/cert/sampleCert.json");
var content = await certificate.json();
// Create a certificate based on a self hosted json
await wallet.methods.updateCertificate({
certificateId: 1234567,
content:content},
'https://arianee.cleverapps.io/testnet/rpc'
)
.then((i) => {
...
})
.catch(i => console.log("Updating certificate : error ", JSON.stringify(i)));
Store updated NFT content
Method
ArianeeWallets.methods.storeUpdateContentInRPCServer(certificateId, content, RPCURL)
Parameter | Type | Mandatory | Description |
---|---|---|---|
certificateId | Number | β | Arianee token ID of the NFT. |
data | Object | β | NFT content. |
url | String | β | URL of RPC server. Usually, it is the url of issuer's RPC Server. |
Output
promise
returns object
.
Example
// fetch certificate content
var certificate = await fetch("https://cert.arianee.org/cert/sampleCert.json");
var content = await certificate.json();
// Store content of a Arianee certificate
await wallet.methods.storeUpdateContentInRPCServer(
1234,
content,
'https://arianee.cleverapps.io/testnet/rpc'
)
Get ownership information
Method
ArianeeWallets.methods.ownerOf(certificateId)
Parameter | Type | Mandatory | Description |
---|---|---|---|
certificateId | Number | β | Arianee token ID of the NFT. |
Output
promise
returns object
:
address
- NFT owner address.hasOwner
- NFT has an owner.isOwner
- Current wallet if the owner.
// Get ownership info of a Arianee certificate
await wallet.methods.ownerOf(
1234
)
>
{
address: '0xbEa4D632da6aBE9b85780dC0A43bF6C2777C466E', // certificate owner address
hasOwner: true, // this certificate has an owner
isOwner: true // current wallet is the owner
}
Transfer NFT
Method
ArianeeWallets.methods.transfer(certificateId, publicAddress)
Parameter | Type | Mandatory | Description |
---|---|---|---|
certificateId | Number | β | Arianee token ID of the NFT. |
publicAddress | String | β | Public wallet address of the recipient. |
Output
promise
returns object
: Receipt of the transaction.
Example
try {
transfer = await wallet.methods.transfer(certificateId, '0x5BC8da7dE68c1af47D329B14ADdBf1d7547A1747');
}
catch(e) {
console.log('error',e)
}
console.log(transfer);
>
{
address: '0xAF561f54CDd4A2cAD2aa5aD70f87358c2399626b',
hasOwner: true,
isOwner: true
}
{
receipt: {
blockHash: '0x3385b04da2e85d8dcef310246431fad06db3295caaba68070e8fc9d8a1330e04',
blockNumber: 20992104,
contractAddress: null,
cumulativeGasUsed: 119452,
from: '0xaf561f54cdd4a2cad2aa5ad70f87358c2399626b',
gasUsed: 75692,
logs: [ [Object], [Object] ],
logsBloom: '0x00000000000000080000000000000000000000008000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000010001000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000010000020000000000020000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000001000000000000000002000002000000000000000000000000000000100000000000000000000000000040000000000000000000000000000000000004020010000200000000000000',
status: true,
to: '0x512c1fcf401133680f373a386f3f752b98070bc5',
transactionHash: '0xeb070b58361500e316c1867d0205a01536c4035382391359bb19d56df340259b',
transactionIndex: 1
}
}
//In case of error (transfer initiated by non-owner)
Error: This wallet is not the owner of 904554486
receipt: {
blockHash: '0x3385b04da2e85d8dcef310246431fad06db3295caaba68070e8fc9d8a1330e04',
blockNumber: 20992104,
contractAddress: null,
cumulativeGasUsed: 119452,
from: '0xaf561f54cdd4a2cad2aa5ad70f87358c2399626b',
gasUsed: 75692,
logs: [ [Object], [Object] ],
logsBloom: '0x00000000000000080000000000000000000000008000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000010001000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000010000020000000000020000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000001000000000000000002000002000000000000000000000000000000100000000000000000000000000040000000000000000000000000000000000004020010000200000000000000',
status: true,
to: '0x512c1fcf401133680f373a386f3f752b98070bc5',
transactionHash: '0xeb070b58361500e316c1867d0205a01536c4035382391359bb19d56df340259b',
transactionIndex: 1
}
}
Recover an NFT
Method
ArianeeWallets.methods.recoverCertificate(certificateId)
Parameter | Type | Mandatory | Description |
---|---|---|---|
certificateId | Number | β | Arianee token ID of the NFT. |
Output
promise
returns object
: Receipt of the transaction.
Destroy an NFT
Make sure to be the owner to destroy an NFT. If you are not, recover the NFT.
Method
ArianeeWallets.methods.destroyCertificate(certificateId)
Parameter | Type | Mandatory | Description |
---|---|---|---|
certificateId | Number | β | Arianee token ID of the NFT. |
Output
promise
returns object
: Receipt of the transaction.
Updated over 1 year ago