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