ArianeeJS Library

ArianeeJS is the first official SDK to interact with the Arianee protocol.

Introduction

ArianeeJS works on NodeJs and browser.

If you want to play straight away with the library, a demo is available directly within your browser.

Ressources

ArianeeJS npm: https://www.npmjs.com/package/@arianee/arianeejs

ArianeeJS Library repo: https://github.com/Arianee/arianeeJS

πŸ”§

To report a bug, report an issue in the Github repo. Provide as much detail as possible.

Install

Use the certification module as a NPM package in your application.

$ npm i --save @arianee/arianeejs 

Import the package inside your app.

import { Arianee } from '@arianee/arianeejs'

Optional - If you wish to use it directly in your browser with javascript, you can include:

<script src="https://unpkg.com/@arianee/[email protected]/browser/bundle.js">
</script> 

Demo

This code is for demonstration purpose, so we can use @latest bundle. In real world, you should always add SRI (sub-resource integrity) as recommended by W3C: https://www.w3.org/TR/SRI/

<script src="https://unpkg.com/@arianee/[email protected]/browser/bundle.js" 
integrity="sha384-Ay7oXTEIhZSeW8AFjocYolR96Vl14omuBh2PcTiCuO5tkU1B6NOGqHzZwwVT3XC+" 
crossorigin="anonymous"></script>

Initialize

Instantiate ArianeeJS.

new Arianee();
Arianee.init([networkName], [arianeeCustomConfiguration]);
ParameterTypeMandatoryDescription
networkNameString❌The network to use mainnet or testnet.
Default : testnet
arianeeCustomConfigurationObject❌Some options can be overriden.
arianeeCustomConfiguration β†’ walletRewardobject\<{address:string>❌Address of wallet to be rewarded.
arianeeCustomConfiguration β†’ brandDataHubRewardobject\<{address:string>❌Address of NFT Management Platform to be rewarded.
arianeeCustomConfiguration β†’ httpProviderprovider❌Provider as defined by web3js.
arianeeCustomConfiguration β†’ transactionOptionsobject\<gas:number, gasPrice:any>❌Transaction options.
arianeeCustomConfiguration β†’ deeplinkString❌Deeplink to be used by ArianeeJS to create deeplink.
arianeeCustomConfiguration β†’ protocolConfigurationObject❌Arianee protocol configuration. If not specified, the library will fetch the configuration depending on the networkName.
arianeeCustomConfiguration β†’ defaultArianeePrivacyGatewayString❌Default Arianee Privacy Gateway URL where will be stored NFT content.

Result: promise returns object- ArianeeWalletBuilder object. The Arianee instance with the choosen network.

πŸ“Œ

Initialization is asynchronous. You need to use await or a promise.

Example:

const arianeeLib = new Arianee();
const arianee = await arianeeLib.init("testnet");

Set default Query

Instantiate ArianeeJS.

new Arianee();
Arianee.setDefaultQuery(ConsolidatedCertificateRequest);
ParameterTypeMandatoryDescription
networkNameString❌The network to use mainnet or testnet.
Default : testnet

Result: Arianee returns object - Arianee object. The Arianee instance.

Example:

const arianee = new Arianee()
    .setDefaultQuery({content:true})
    .init();