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();

*/

@@ -1,18 +1,20 @@
 var 
-Ripple
+Listener
  = requi
@@ -21,53 +21,29 @@
 re('
-ripple-lib')%0Avar request = require('request
+../lib/listener.js
 ')
+;
 %0Avar
@@ -91,110 +91,36 @@
 var 
-c
 li
-ent
+stener
  = new 
-RippleSimpleClient(%7B%0A  apiUrl: nconf.get('RIPPLE_REST_API')%0A%7D);%0A%0A// Proposed!!%0A/*%0Aclient.
+Listener();%0A%0A
 list
@@ -130,27 +130,17 @@
 r.on
-('p
+P
 ayment
-:inbound',
+ =
  fun
@@ -162,180 +162,127 @@
 %7B%0A  
-// create a new ripple transaction%0A%7D);%0A%0Aclient.listener.on('payment:outbound', function(payment) %7B%0A  // update an existing ripple transaction%0A%7D);%0A%0Aclient.listener.start(
+%0A  // do what you want with the payment here%0A  console.log(payment);%0A%0A%7D;%0A%0Alistener.start(nconf.get('last_payment_hash')
 );%0A%0A
-*/%0A

Monitor incoming payments in worker.