mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-21 04:35:49 +00:00
Add transaction.invoiceID setter
This commit is contained in:
@@ -268,6 +268,14 @@ Transaction.prototype.destinationTag = function(tag) {
|
||||
return this;
|
||||
};
|
||||
|
||||
Transaction.prototype.invoiceID = function(id) {
|
||||
if (typeof id === 'string') {
|
||||
while (id.length < 64) id += '0';
|
||||
this.tx_json.InvoiceID = id;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
Transaction._pathRewrite = function(path) {
|
||||
return path.map(function(node) {
|
||||
var newNode = { };
|
||||
@@ -630,20 +638,22 @@ Transaction.prototype.submit = function(callback) {
|
||||
|
||||
this.callback = typeof callback === 'function' ? callback : function(){};
|
||||
|
||||
function submission_error(error, message) {
|
||||
function submissionError(error, message) {
|
||||
if (!(error instanceof RippleError)) {
|
||||
error = new RippleError(error, message);
|
||||
}
|
||||
self.callback(error);
|
||||
};
|
||||
|
||||
function submission_success(message) {
|
||||
this.once('error', submissionError);
|
||||
|
||||
function submissionSuccess(message) {
|
||||
self.callback(null, message);
|
||||
};
|
||||
|
||||
this.once('success', submissionSuccess);
|
||||
|
||||
this.on('error', function(){});
|
||||
this.once('error', submission_error);
|
||||
this.once('success', submission_success);
|
||||
|
||||
var account = this.tx_json.Account;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user