OSDN Git Service

update the api return format and addup the error handle.
[bytom/bytom-electron.git] / src / sdk / api / transactions.js
index 2a351fb..3106e61 100644 (file)
@@ -127,6 +127,11 @@ const transactionsAPI = (client) => {
             .then(resp => new shared.BatchResponse(resp)),
       cb
     ),
+
+    estimateGas: (template, cb) => shared.tryCallback(
+      client.request('/estimate-transaction-gas', {'transactionTemplate': template}).then(resp => checkForError(resp)),
+      cb
+    )
   }
 }