OSDN Git Service

add the confirmation params
authorZhiting Lin <zlin035@uottawa.ca>
Thu, 21 Feb 2019 02:59:31 +0000 (10:59 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Thu, 21 Feb 2019 02:59:31 +0000 (10:59 +0800)
src/sdk/transaction.js

index 1915f2f..ec7a999 100644 (file)
@@ -113,17 +113,20 @@ transactionSDK.prototype.buildPayment = function(guid, to, asset, amount, from,
  * @param {Number} fee transaction fee amount
  * @returns {Promise}
  */
-transactionSDK.prototype.buildTransaction = function(guid, inputs, outputs, fee ) {
+transactionSDK.prototype.buildTransaction = function(guid, inputs, outputs, fee, confirmations ) {
     let net = this.bytom.net;
     let retPromise = new Promise((resolve, reject) => {
         let pm = {
             guid,
             inputs,
-            outputs
+            outputs,
         };
         if (fee) {
             pm.fee = fee;
         }
+        if (confirmations) {
+            pm.confirmations = confirmations;
+        }
         this.http.request('merchant/build-transaction', pm, net).then(resp => {
             if (resp.status !== 200 || resp.data.code !== 200) {
                 reject(handleApiError(resp));