var Ripple = require('ripple-lib')
var request = require('request')
var nconf = require('../config/nconf.js');

var client = new RippleSimpleClient({
  apiUrl: nconf.get('RIPPLE_REST_API')
});

// Proposed!!
/*
client.listener.on('payment:inbound', function(payment) {
  // create a new ripple transaction
});

client.listener.on('payment:outbound', function(payment) {
  // update an existing ripple transaction
});

client.listener.start();

*/

var Listener = require('../lib/listener.js');
var nconf = require('../config/nconf.js');

var listener = new Listener();

listener.onPayment = function(payment) {
  
  // do what you want with the payment here
  console.log(payment);

};

listener.start(nconf.get('last_payment_hash'));


Monitor incoming payments in worker.