1.0.0 • Published 5 years ago

kapitalize-ex v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

Kapitalize

Kapitalize is an industrious Bitcoin client for node.

npm install kapitalize

Example

var kapitalize = require('kapitalize-ex')()

kapitalize.auth('Macintyre, John', 'mypassword')

kapitalize.getNewAddress(function(err, address) {
    kapitalize.validateAddress(address, console.log)
})

Chaining

Pretty much everything in Kapitalize is chainable.

var kapitalize = require('kapitalize-ex')()

kapitalize
.auth('Macintyre', 'mypassword')
.set('host', '127.0.0.1')
.set({
    port:8332
})
.getNewAddress()
.getBalance()

Methods

The Bitcoin API is supported as direct methods. Use either camelcase or lowercase.

kapitalize.getNewAddress(function(err, address) {
    this.validateaddress(address, function(err, info) {

    })
})

.exec(command string, ...arguments..., callback function)

Executes the given command with optional arguments. Function callback defaults to console.log. All of the API commands are supported in lowercase or camelcase. Or uppercase. Anycase!

kapitalize.exec('getNewAddress')

kapitalize.exec('getbalance', function(err, balance) {

})

.set(key string, object, value optional)

Accepts either key & value strings or an Object containing settings, returns this for chainability.

kapitalize.set('host', '127.0.0.1')

.get(key string)

Returns the specified option's value

kapitalize.get('user')

.auth(user string, pass string)

Generates authorization header, returns this for chainability

Commands

All Bitcoin API commands are supported, in lowercase or camelcase form.

Generation is limited to genproclimit processors, -1 is unlimited.

Options

You may pass options to the initialization function or to the set method.

var kapitalize = require('kapitalize-ex')({
    user:'user'
})

kapitalize.set('pass', 'somn')
kapitalize.set({port:8331})

Available options and default values:

  • host localhost
  • port 8332
  • user
  • pass