From a6e8e5d976aa56602f1df3c166e63e599b94fce0 Mon Sep 17 00:00:00 2001 From: Jaydeep Date: Fri, 12 Jul 2019 17:41:27 +0530 Subject: [PATCH] addded support for pivx based blockchain --- lib/api.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/api.js b/lib/api.js index 7ab339a..7401056 100644 --- a/lib/api.js +++ b/lib/api.js @@ -28,9 +28,12 @@ module.exports = function(){ } var command = []; - + //this is an case for pivx + if(/^getpivx/.test(method)){ + command = specialPivxCase(method); + } //this is pretty dirty but it is working for now - if(method == 'sendmany' || + else if(method == 'sendmany' || method == 'getmasternodecount' || method == 'getmasternodecountonline' || method == 'getmasternodelist' || @@ -134,6 +137,22 @@ module.exports = function(){ }]; } + function specialPivxCase(method_name){ + var params = []; + if(method_name == 'getpivxmasternodecount'){ + method_name = 'getmasternodecount'; + } + + if(method_name == 'getpivxmasternodelist'){ + method_name = 'listmasternodes'; + } + + return [{ + method: method_name, + params: params + }]; + } + return app; };