How to use the bitauth.decrypt function in bitauth

To help you get started, we’ve selected a few bitauth examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bitpay / node-bitpay-client / examples / create-bill.js View on Github external
var fs         = require('fs');
var HOME       = process.env['HOME'];
var bitauth    = require('bitauth');
var bitpay     = require('../index');
var encPrivkey = fs.readFileSync(HOME + '/.bitpay/api.key').toString();
var privkey    = bitauth.decrypt('', encPrivkey); // decrypt with your key pass
var client     = bitpay.createClient(privkey);

client.on('error', function(err) {
    console.log(err);
});

client.on('ready', function() {

  var payload = {
    items: [
      { price: 10, quantity: 1, description: 'thing' }
    ],
    name: 'Bill Merchant',
    address1: '1234 Fake St',
    city: 'Atlanta',
    state: 'GA',
github bitpay / node-bitpay-client / examples / streaming-response.js View on Github external
var fs         = require('fs');
var HOME       = process.env['HOME'];
var bitauth    = require('bitauth');
var bitpay     = require('../index');
var encPrivkey = fs.readFileSync(HOME + '/.bitpay/api.key').toString();
var privkey    = bitauth.decrypt('', encPrivkey); // decrypt with your key pass
var client     = bitpay.createClient(privkey);

client.on('error', function(err) {
  console.log(err);
});

client.on('ready', function() {

  var today      = new Date().getTime();
  var oneWeekAgo = new Date(today - 1000 * 60 * 60 * 24 * 7).getTime();

  client.get('invoices', {
    dateStart: oneWeekAgo,
    dateEnd: today
  }).pipe(process.stdout);
github bitpay / node-bitpay-client / examples / get-payouts.js View on Github external
var fs         = require('fs');
var HOME       = process.env['HOME'];
var bitauth    = require('bitauth');
var bitpay     = require('../index');
var encPrivkey = fs.readFileSync(HOME + '/.bitpay/api.key').toString();
var privkey    = bitauth.decrypt('', encPrivkey); // decrypt with your key pass
var client     = bitpay.createClient(privkey);

client.on('error', function(err) {
    console.log(err);
});

client.on('ready', function() {

  client.as('payroll').get('payouts', { status: 'new' }, function(err, request) {
    console.log(err || request);
  });

});
github bitpay / node-bitpay-client / examples / get-ledgers.js View on Github external
var fs         = require('fs');
var HOME       = process.env['HOME'];
var bitauth    = require('bitauth');
var bitpay     = require('../index');
var encPrivkey = fs.readFileSync(HOME + '/.bitpay/api.key').toString();
var privkey    = bitauth.decrypt('', encPrivkey); // decrypt with your key pass
var client     = bitpay.createClient(privkey);

client.on('error', function(err) {
    console.log(err);
});

client.on('ready', function() {

  var today      = new Date().getTime();
  var oneWeekAgo = new Date(today - 1000 * 60 * 60 * 24 * 7).getTime();

  client.get('ledgers', function(err, data) {
    console.log(err || data);
  });

});
github bitpay / node-bitpay-client / examples / get-invoices.js View on Github external
var fs         = require('fs');
var HOME       = process.env['HOME'];
var bitauth    = require('bitauth');
var bitpay     = require('../index');
var encPrivkey = fs.readFileSync(HOME + '/.bitpay/api.key').toString();
var privkey    = bitauth.decrypt('', encPrivkey); // decrypt with your key pass
var client     = bitpay.createClient(privkey);

client.on('error', function(err) {
    console.log(err);
});

client.on('ready', function() {

  var today      = new Date().getTime();
  var oneWeekAgo = new Date(today - 1000 * 60 * 60 * 24 * 7).getTime();

  client.get('invoices', {
    dateStart: oneWeekAgo,
    dateEnd: today
  }, function(err, data) {
    console.log(err || data)
github bitpay / node-bitpay-client / test / Currencies.js View on Github external
var assert     = require('assert');
var fs         = require('fs');
var BitPay     = require('../lib/rest-client');

var HOME       = process.env['HOME'];
var config     = require('../config');
var bitauth    = require('bitauth');
var encPrivkey = fs.readFileSync(HOME + '/.bitpay/api.key').toString();
var privkey    = bitauth.decrypt(config.keyPassword, encPrivkey);

var client     = new BitPay( privkey , {
  sticky: true
});

describe('Currency API', function() {

  var bitpay = client.as('public');

  describe('get currencies', function() {
    it('should provide a list of currencies', function(done) {
      client.get('currencies', done );
    });
  });

});
github bitpay / node-bitpay-client / test / Invoices.js View on Github external
var assert     = require('assert');
var fs         = require('fs');
var BitPay     = require('../lib/rest-client');

var HOME       = process.env['HOME'];
var config     = require('../config');
var bitauth    = require('bitauth');
var encPrivkey = fs.readFileSync(HOME + '/.bitpay/api.key').toString();
var privkey    = bitauth.decrypt(config.keyPassword, encPrivkey);

var client     = new BitPay( privkey , {
  sticky: true
});

describe('Invoice API', function() {

  var bitpay = client.as('merchant');

  describe('get invoices', function() {
    it('should provide a list of invoices', function(done) {
      client.get('invoices', done );
    });
  });

  describe('create invoice', function() {
github bitpay / node-bitpay-client / examples / get-payout-request.js View on Github external
var fs         = require('fs');
var async      = require('async');
var bitauth    = require('bitauth');
var HOME       = process.env['HOME'];
var BitPay     = require('../lib/rest-client');
var encPrivkey = fs.readFileSync(HOME + '/.bitpay/api.key').toString();
var config     = require('../config');
var privkey    = bitauth.decrypt(config.keyPassword, encPrivkey);
var client     = new BitPay(privkey);

if (process.argv.length < 3) {
  console.log('usage: get-payout-request.js [payoutId]');
  return;
}

client.on('error', function(err) {
    console.log(err);
});

client.on('ready', function() {

  client.as('payroll').get('payouts/' + process.argv[2], { status: 'new' }, function(err, requests) {
    console.log(err || requests);
  });
github bitpay / node-bitpay-client / examples / resend-invoice-ipn.js View on Github external
var fs         = require('fs');
var bitauth    = require('bitauth');
var HOME       = process.env['HOME'];
var BitPay     = require('../lib/rest-client');
var encPrivkey = fs.readFileSync(HOME + '/.bitpay/api.key').toString();
var config     = require('../config');
var privkey    = bitauth.decrypt(config.keyPassword, encPrivkey);
var client     = new BitPay(privkey);

if (process.argv.length < 3) {
  console.log("Usage: get-invoice-by-id.js [invoiceID]");
  return;
}

client.on('error', function(err) {
    console.log(err);
});

client.on('ready', function() {

  client.get('invoices/' + process.argv[2], function(err, invoice) {
    invoice.post('notifications', function(err, msg) {
      console.log(err || msg);
github bitpay / node-bitpay-client / examples / get-orphan-status.js View on Github external
var fs         = require('fs');
var bitauth    = require('bitauth');
var HOME       = process.env['HOME'];
var BitPay     = require('../lib/rest-client');
var encPrivkey = fs.readFileSync(HOME + '/.bitpay/api.key').toString();
var config     = require('../config');
var privkey    = bitauth.decrypt(config.keyPassword, encPrivkey);
var client     = new BitPay(privkey);

if (process.argv.length < 3) {
  console.log("Usage: get-payout-request.js [invoiceID]");
  return;
}

client.on('error', function(err) {
    console.log(err);
});

client.on('ready', function() {
  client.get('invoices/' + process.argv[2], function(err, invoice) {
    if(err) console.log(err);
    invoice.get('orphans', function(err, txs) {
      console.log(err || txs)

bitauth

Passwordless authentication using Bitcoin cryptography

MIT
Latest version published 4 years ago

Package Health Score

43 / 100
Full package analysis

Popular bitauth functions