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/arianeejs@latest/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]);
Parameter | Type | Mandatory | Description |
---|---|---|---|
networkName | String | β | The network to use mainnet or testnet .Default : testnet |
arianeeCustomConfiguration | Object | β | Some options can be overriden. |
arianeeCustomConfiguration β walletReward | object\<{address:string> | β | Address of wallet to be rewarded. |
arianeeCustomConfiguration β brandDataHubReward | object\<{address:string> | β | Address of NFT Management Platform to be rewarded. |
arianeeCustomConfiguration β httpProvider | provider | β | Provider as defined by web3js. |
arianeeCustomConfiguration β transactionOptions | object\<gas:number, gasPrice:any> | β | Transaction options. |
arianeeCustomConfiguration β deeplink | String | β | Deeplink to be used by ArianeeJS to create deeplink. |
arianeeCustomConfiguration β protocolConfiguration | Object | β | Arianee protocol configuration. If not specified, the library will fetch the configuration depending on the networkName . |
arianeeCustomConfiguration β defaultArianeePrivacyGateway | String | β | 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);
Parameter | Type | Mandatory | Description |
---|---|---|---|
networkName | String | β | 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();
Updated over 1 year ago