Coder Social home page Coder Social logo

josetm / rouge.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from therougeproject/legacy-v0-rouge.js

0.0 1.0 0.0 2.58 MB

Javascript library for interacting with the Rouge protocol

License: GNU Affero General Public License v3.0

JavaScript 100.00%

rouge.js's Introduction

rouge.js

Node NPM David

Javascript library for interacting with the Rouge protocol

The Rouge protocol is an open-source blockchain voucher and note protocol built as a suite of smart contracts using a specific token — the Rouge token — on Ethereum compatible blockchains (tested on Ethereum and POA).

Rouge is for all types of usage of non-repudiable and unique usage digital vouchers (for example, e-tickets, e-coupons, cashback notes, etc).

Using the javascript rouge.js package you can easily add non-repudiable and unique usage digital vouchers without learning Solidity in the browser (ÐApps), a nodejs backend app or even a nativescript mobile app.

Installation

Install via npm

	npm i web3 rouge.js

or yarn

	yarn add web3 rouge.js

rouge.js depends on two modules (web3-eth and web3-utils) of the web3.js library.

Bundlers help

rouge.js is compiled as a collection of CommonJS modules & ES2015 modules for bundlers that support the module field in package.json (Rollup, Webpack 2).

CDN

If you don't use a package manager, you can access rouge.js via jsDelivr or unpkg, download the source, or point your package manager to the url.

The rouge.js package includes a precompiled and minified UMD build in the dist/folder. It can be used directly without a bundler and is thus compatible with many popular JavaScript module loaders and environments. You can drop a UMD build as a <script> tag on your page. The UMD builds make rouge.js available as a window.Rouge global variable.

Direct minified UMD url:

Usage

Using web3.js, creating a campaign can be as simple as these few lines:

import Web3 from 'web3'
import { RougeProtocol } from 'rouge.js'

const web3 = new Web3(<provider>)
const myAccount = web3.eth.accounts.privateKeyToAccount(<privateKey>)

const rouge = RougeProtocol(web3)
const campaign = rouge.as(myAccount).createCampaign()

Online full documentation.

Examples

See files in the examples folder.

Node

npm run example-node

Browser/UMD

Open the file examples/browser.html with your preferred browser.

Contributing

We are open to contributions, see CONTRIBUTING.md for more info.

Licensed under GNU AFFERO GENERAL PUBLIC LICENSE v3

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

rouge.js's People

Contributors

vdg avatar clbrge avatar dependabot[bot] avatar josetm avatar

Watchers

James Cloos 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.