@aneopsy/linniajs

Library for interacting with Linnia smart contracts

Stats

StarsIssuesVersionUpdatedCreatedSize
@aneopsy/linniajs
1.3.144 years ago4 years agoMinified + gzip package size for @aneopsy/linniajs in KB

Readme

build status dependency status [npm downloads] code style: prettier

LinniaJS

Library for interacting with Linnia smart contracts

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Installing

What things you need to install the software and how to install them

npm i @aneopsy/linniajs

Running the tests

A step by step series of examples that tell you have to get a development env running

Say what the step will be

npm run test

Or you can run an example:

npm run example

End with an example of getting some data out of the system or using it for a little demo

Running the lint tests

You can run the automated lint tests:

npm run pretest

Basic usage

Explain what these tests test and why

const Web3 = require("web3");
const LinniaJS = require("@aneopsy/linniajs");

const Linnia = new LinniaJS(new Web3.providers.HttpProvider(
  "https://rinkeby.infura.io"
));

// Get if is provider
Linnia.LinniaRolesContract.isProvider("0x1EA9034E15e3bec0467cEADC7dbC64A8ACf726A3")
  .call()
  .then(result => {
    if (result) {
      console.log("is provider");
    } else {
      console.log("is not provider");
    }
  });

Class & Methods

LinniaJs

Objects

  • LinniaRolesContract
  • LinniaPermissionsContract
  • LinniaRecordsContract

Methods

  • getWeb3()

LinniaRolesContract

Methods

Internal
  • getAddress()
  • getInstance()
  • getWeb3()
Call
  • isPatient(userAddress)
  • isProvider(userAddress)
  • provenance(userAddress)
Send
  • registerPatient()
  • registerProvider(userAddress)
  • removeProvider(userAddress)

LinniaPermissionsContract

Internal

  • getAddress()
  • getInstance()
  • getWeb3()
Call
  • isPatient(userAddress)
  • isProvider(userAddress)
  • provenance(userAddress)
Send
  • registerPatient()
  • registerProvider(userAddress)
  • removeProvider(userAddress)

LinniaRecordsContract

Internal

  • getAddress()
  • getInstance()
  • getWeb3()
Call
  • isPatient(userAddress)
  • isProvider(userAddress)
  • provenance(userAddress)
Send
  • registerPatient()
  • registerProvider(userAddress)
  • removeProvider(userAddress)

Deployment

Authors

  • Paul THEIS - Initial work - AneoPsy

License

This project is licensed under the MIT License.

Acknowledgments

  • Hat tip to anyone who's code was used
  • Inspiration
  • etc

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.