Add Account#lines.

This commit is contained in:
Stefan Thomas
2013-08-08 18:43:16 -07:00
parent 7c5e9bae2a
commit e49838437e

View File

@@ -127,6 +127,35 @@ Account.prototype.entry = function (callback)
return this;
};
/**
* Retrieve this account's Ripple trust lines.
*
* To keep up-to-date with changes to the AccountRoot entry, subscribe to the
* "lines" event. (Not yet implemented.)
*
* @param {function (err, lines)} callback Called with the result
*/
Account.prototype.lines = function (callback)
{
var self = this;
self._remote.request_account_lines(this._account_id)
.on('success', function (e) {
self._lines = e.lines;
self.emit('lines', self._lines);
if ("function" === typeof callback) {
callback(null, e);
}
})
.on('error', function (e) {
callback(e);
})
.request();
return this;
};
/**
* Notify object of a relevant transaction.
*