Socket
Socket
Sign inDemoInstall

bitcoin-unocoin-client

Package Overview
Dependencies
5
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bitcoin-unocoin-client

Buy and sell Bitcoin using Unocoin API.


Version published
Weekly downloads
11
increased by120%
Maintainers
1
Install size
10.0 MB
Created
Weekly downloads
 

Readme

Source

Bitcoin Unocoin Javascript Client Build Status Coverage Status

This is used by My-Wallet-V3.

Install

npm install bitcoin-unocoin-client --save

Usage

Three things are needed:

  1. delegate object (see example) with functions that provide the following:
  • save() -> e.g. function () { return JSON.stringify(this._unocoin); }
  • email() -> String : the users email address
  • isEmailVerified() -> Boolean : whether the users email is verified
  • getToken() -> stringify : JSON web token {email: 'me@example.com'}
  • monitorAddress(address, callback) : callback(amount) if btc received
  • checkAddress(address) : look for existing transaction at address
  • getReceiveAddress(trade) : return the trades receive address
  • reserveReceiveAddress()
  • releaseReceiveAddress()
  • serializeExtraFields(obj, trade) : e.g. obj.account_index = ...
  • deserializeExtraFields(obj, trade)
  1. Unocoin partner identifier
var object = {user: 1, offline_token: 'token'};
var unocoin = new Unocoin(object, delegate);
unocoin.partnerId = ...;
unocoin.delegate.save.bind(unocoin.delegate)();
delegate.trades = unocoin.trades
// "{"user":1,"offline_token":"token"}"

To see a demo switch to Node 7.2 or higher and run:

nvm use 7.2
node demo.js

Development

Modifying bitcoin-exchange-client

To use a local version of bitcoin-exchange-client, create a symlink:

cd ..
rm -rf bitcoin-unocoin-client/node_modules/bitcoin-exchange-client
ln -s ../../bitcoin-exchange-client bitcoin-unocoin-client/node_modules/bitcoin-exchange-client

Testing inside my-wallet-v3

To use a local version of this repo inside my-wallet-v3, create a symlink:

cd ..
rm -rf My-Wallet-V3/node_modules/bitcoin-unocoin-client
ln -s ../../bitcoin-unocoin-client My-Wallet-V3/node_modules/bitcoin-unocoin-client

Note that Grunt won't detect these changes.

Release

Change version in package.json.

git commit -a -m "v0.1.0"
git push
git tag -s v0.1.0
git push --tags
make changelog

Add the relevant sections of Changelog.md to the tag on Github and mark it as pre-release.

npm publish

Keywords

FAQs

Last updated on 21 Nov 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc