oracle-d-api

Easy access to the Oracle-D API

Usage no npm install needed!

<script type="module">
  import oracleDApi from 'https://cdn.skypack.dev/oracle-d-api';
</script>

README

Oracle-D API

If you want to use the Oracle-D API please apply for an API key at: https://api.oracle-d.com/v1

Licence

This package is licenced under CC BY-ND 4.0

Installation

npm i oracle-d-api --save

Usage

const OracleD = require("oracle-d-api");

let api = new OracleD.AccountAPI.API({api_key: "MY_SECRET_API_KEY"});

// request a new account

let newAccount = new OracleD.AccountAPI.Account({username:"mynewusername",email:"user.email@provider.com"});

api.requestAccount(newAccount).then(account => {
    console.log(account);
}).catch(e => {
     console.log(e)
});

let account = new OracleD.AccountAPI.Account({_id: "accountID"});

// get the accounts' status

api.getAccountStatus(account.data).then(account => {
    console.log(account)
}).catch(e => {
    console.log(e)
});

// get all requested accounts
api.getAccountList().then(data => {
    console.log(data)
});

// get information about my api key
api.getDappStatus().then(data => {
    console.log(data)
});

//The following methods do not require an api_key

// get a list of dapps which have access to the api

api.getDappStatus().then(data => {
    console.log(data)
});

// get a list of accounts created by a dapp

api.getDappAccountList(id).then(data => {
    console.log(data)
});