GithubHelp home page GithubHelp logo

godugome / block_io-nodejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blockio/block_io-nodejs

1.0 1.0 0.0 120 KB

Block.io API wrapper for node.js

Home Page: https://block.io

License: MIT License

JavaScript 100.00%

block_io-nodejs's Introduction

BlockIo

This nodejs module is the official reference client for the Block.io payments API. To use this, you will need the Dogecoin, Bitcoin, or Litecoin API key(s) from Block.io. Go ahead, sign up :)

Installation

Install the package using npm:

$ npm install block_io

For Nodejs < 5.10.0, please use:

$ npm install [email protected]

Usage

It's super easy to get started. In your node shell, do:

var BlockIo = require('block_io');

// 'SECRET_PIN' and 'VERSION' are optional
var block_io = new BlockIo('API_KEY', 'SECRET_PIN', 'VERSION');

// print the account balance
block_io.get_balance(console.log);

// print all addresses on this account
block_io.get_my_addresses(console.log);

// print the response of a withdrawal request
// 'SECRET_PIN' is only required if you did not specify it at 
// class initialization time.
block_io.withdraw(
  { 
    pin: 'SECRET_PIN', 
    from_labels: 'label1,label2', 
    to_label: 'label3', 
    amount: '50.0' 
  }, console.log);

For more information, see Node.js API Docs. This client provides a mapping for all methods listed on the Block.io API site.

Contributing

  1. Fork it ( https://github.com/BlockIo/block_io-nodejs/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Testing

We use vows for unit tests. To run the tests you need to specify BLOCK_IO_API_KEY and BLOCK_IO_PIN environment variables. The BLOCK_IO_VERSION environment variable is optional and currently defaults to 2.

DO NOT USE PRODUCTION CREDENTIALS FOR UNIT TESTING!

Test syntax:

BLOCK_IO_API_KEY="API_KEY" BLOCK_IO_PIN="SECRET_PIN" npm test

block_io-nodejs's People

Contributors

patricklodder avatar doersf avatar ppitonak avatar godugome avatar

Stargazers

 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.