GithubHelp home page GithubHelp logo

vitaliibronsky / deveryjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devery/deveryjs

1.0 1.0 0.0 6.91 MB

Build decentralized verification apps on the Devery Protocol using Javascript

License: MIT License

JavaScript 100.00%

deveryjs's Introduction

Devery.js

npm version Coverage Status Build Status

Javascript library for the Devery protocol.

You can check the full documentation with examples here ==> Devery.js documentation.

Installation:

the instalation process is quite simple you just need to install it from NPM or YARN.

  1. Installing devery.
    npm install --save @devery/devery

That's it now you can start using it inside your app.

Importing:

you can use require or import like syntax access devery classes

  1. require like syntax.
    const devery = require('@devery/devery');
    const DeveryRegistry = devery.DeveryRegistry;
    
    let deveryRegistryClient = new DeveryRegistry();

or alternatively you can use this.

  1. ES6 import sytax
    import {DeveryRegistry} from '@devery/devery';
    
    let deveryRegistryClient = new DeveryRegistry();

Simple usage example

  1. Checking if a product has been marked.

      //first you need to get a {@link DeveryRegistry} instance
      let deveryRegistryClient = new DeveryRegistry();
    
      //passing true as param will add the account as marker
      deveryRegistryClient.check("0x627306090abaB3A6e1400e9345bC60c78a8BEf57").then(item => {
           console.log('product brand',item.brandAccount);
           //other stuff
      })
    
      //or with the async syntax
    
      async function(){
               //passing false as param will remove the account as marker
               let item = await deveryRegistryClient.check("0x627306090abaB3A6e1400e9345bC60c78a8BEf57")
               console.log('product brand',item.brandAccount);
      }

Access to the ethereum network

Devery.js will try to automatically get the web3 object instance present in your context(page, app,etc). If this is not possible then it will fallback to a read only provider poiting to the main network. As the fallback does not contain a signer you will not be able to perform read operations.

Main Classes documentation.

  1. DeveryRegistry
  2. EveToken

deveryjs's People

Contributors

andrewrd avatar victorrseloy avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.