Dynamically enable wallet api cmds based on settings
-Added a 'heavies' object to the api_cmds setting and moved all heavy api calls inside to allow for better separation of api calls
This commit is contained in:
+8
-8
@@ -389,7 +389,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
get_maxmoney: function(cb) {
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.getmaxmoney);
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.heavies.getmaxmoney);
|
||||
|
||||
if (!(cmd.method == '' && cmd.parameters.length == 0)) {
|
||||
if (settings.use_rpc) {
|
||||
@@ -417,7 +417,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
get_maxvote: function(cb) {
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.getmaxvote);
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.heavies.getmaxvote);
|
||||
|
||||
if (!(cmd.method == '' && cmd.parameters.length == 0)) {
|
||||
if (settings.use_rpc) {
|
||||
@@ -445,7 +445,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
get_vote: function(cb) {
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.getvote);
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.heavies.getvote);
|
||||
|
||||
if (!(cmd.method == '' && cmd.parameters.length == 0)) {
|
||||
if (settings.use_rpc) {
|
||||
@@ -473,7 +473,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
get_phase: function(cb) {
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.getphase);
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.heavies.getphase);
|
||||
|
||||
if (!(cmd.method == '' && cmd.parameters.length == 0)) {
|
||||
if (settings.use_rpc) {
|
||||
@@ -501,7 +501,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
get_reward: function(cb) {
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.getreward);
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.heavies.getreward);
|
||||
|
||||
if (!(cmd.method == '' && cmd.parameters.length == 0)) {
|
||||
if (settings.use_rpc) {
|
||||
@@ -529,7 +529,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
get_estnext: function(cb) {
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.getnextrewardestimate);
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.heavies.getnextrewardestimate);
|
||||
|
||||
if (!(cmd.method == '' && cmd.parameters.length == 0)) {
|
||||
if (settings.use_rpc) {
|
||||
@@ -557,7 +557,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
get_nextin: function(cb) {
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.getnextrewardwhenstr);
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.heavies.getnextrewardwhenstr);
|
||||
|
||||
if (!(cmd.method == '' && cmd.parameters.length == 0)) {
|
||||
if (settings.use_rpc) {
|
||||
@@ -642,7 +642,7 @@ module.exports = {
|
||||
get_supply: function(cb) {
|
||||
if (settings.supply == 'HEAVY') {
|
||||
// attempt to get the supply from the getsupply or similar api cmd that returns the current money supply as a single positive decimal value
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.getsupply);
|
||||
var cmd = prepareRpcCommand(settings.api_cmds.heavies.getsupply);
|
||||
|
||||
if (!(cmd.method == '' && cmd.parameters.length == 0)) {
|
||||
if (settings.use_rpc) {
|
||||
|
||||
Reference in New Issue
Block a user