Code Monkey home page Code Monkey logo

blockstarter-ripple's Introduction

Blockstarter Ripple

This is library helps to integrate blockstarter with Ripple

Install

npm i blockstarter-ripple

Available functions

  • generateUniqueRippleAddress
  • getTransactions
  • createTransactionsSendAllFundTo
  • getCurrentRippleToUSDRate
  • pushTransaction

Usage

Ripple Address

Creating a unique Ripple Address

var br = require('blockstarter-ripple');
var newAddress = br.generateUniqueRippleAddress('your seed');
console.log(newAddress);

List transactions

A list of all incoming transactions for the address

var br = require('blockstarter-ripple');
var newAddress = br.getTransactions('ripple address', function(err, transactions){
  if (err != null) {
    throw err;
  }
  console.log(transactions);
});

Сreate a transaction

Сreate a transaction to transfer funds from one address to another

var br = require('blockstarter-ripple');
var newAddress = br.createTransactionsSendAllFundTo('your secret', 'address from', 'address to', 'amount', function(err, res){
  if (err != null) {
    throw err;
  }
  console.log(res);
});

Exchange rate

The course is considered for the 3 exchanges EXMO, POLONIEX, KRAKEN

var br = require('blockstarter-ripple');
var newAddress = br.getCurrentRippleToUSDRate(function(err, rates){
  if (err != null) {
    throw err;
  }
  console.log(rates);
});

Example retrun value

{ exmo:
   { buy_price: '0.56500283',
     sell_price: '0.56500565',
     last_trade: '0.565',
     high: '0.61411',
     low: '0.56491737',
     avg: '0.59404117',
     vol: '1318654.76139709',
     vol_curr: '745039.94018936',
     updated: 1522309401 },
  poloniex:
   { id: 127,
     last: '0.54000001',
     lowestAsk: '0.54314082',
     highestBid: '0.54000003',
     percentChange: '-0.06347552',
     baseVolume: '1353601.41228686',
     quoteVolume: '2394419.26895776',
     isFrozen: '0',
     high24hr: '0.58799997',
     low24hr: '0.54000010' },
  kraken:
   { a: [ '0.54118000', '33', '33.000' ],
     b: [ '0.54032000', '2664', '2664.000' ],
     c: [ '0.54120000', '15.19519520' ],
     v: [ '3783555.63449743', '6447316.87099599' ],
     p: [ '0.55409794', '0.56209874' ],
     t: [ 1657, 3473 ],
     l: [ '0.53920000', '0.53920000' ],
     h: [ '0.57400000', '0.58788000' ],
     o: '0.57239000' } }

Send transaction

Sending a transaction for execution

var br = require('blockstarter-ripple');
var newAddress = br.pushTransaction('tx_blob', function(err, res){
  if (err != null) {
    throw err;
  }
  console.log(res);
});

blockstarter-ripple's People

Contributors

strngr avatar

Watchers

 avatar  avatar  avatar  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.