Browse Source

Fund value

etomic
jl777 7 years ago
parent
commit
f47199739a
  1. 3
      iguana/exchanges/LP_commands.c
  2. 4
      iguana/exchanges/fundvalue
  3. 2
      iguana/exchanges/install
  4. 5
      iguana/exchanges/mm.c
  5. 2
      iguana/exchanges/stats.c

3
iguana/exchanges/LP_commands.c

@ -136,6 +136,7 @@ setconfirms(coin, numconfirms, maxconfirms=6)\n\
trust(pubkey, trust) # positive to trust, 0 for normal, negative to blacklist\n\ trust(pubkey, trust) # positive to trust, 0 for normal, negative to blacklist\n\
balance(coin, address)\n\ balance(coin, address)\n\
balances(address)\n\ balances(address)\n\
fundvalue(address="", holdings=[])\n\
orderbook(base, rel, duration=3600)\n\ orderbook(base, rel, duration=3600)\n\
getprices()\n\ getprices()\n\
getprice(base, rel)\n\ getprice(base, rel)\n\
@ -625,6 +626,8 @@ instantdex_claim()\n\
retstr = clonestr("{\"error\":\"deprecated\"}"); retstr = clonestr("{\"error\":\"deprecated\"}");
else if ( strcmp(method,"balances") == 0 ) else if ( strcmp(method,"balances") == 0 )
return(jprint(LP_balances(jstr(argjson,"address")),1)); return(jprint(LP_balances(jstr(argjson,"address")),1));
else if ( strcmp(method,"fundvalue") == 0 )
return(jprint(LP_fundvalue(argjson),1));
else if ( strcmp(method,"getprice") == 0 ) else if ( strcmp(method,"getprice") == 0 )
{ {
double price; double price;

4
iguana/exchanges/fundvalue

@ -0,0 +1,4 @@
#!/bin/bash
source userpass
# this will only work for watchonly addresses that have been rescanned and with active coins
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"fundvalue\",\"address\":\"RRyyejME7LRTuvdziWsXkAbSW1fdiohGwK\"}"

2
iguana/exchanges/install

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
cp balances dynamictrust getcoin kickstart tradesarray claim deposit10 deposit1 invreset sendrawtransaction processfiles stop millis mnzservers bot_buy bot_list bot_statuslist bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts cp fundvalue balances dynamictrust getcoin kickstart tradesarray claim deposit10 deposit1 invreset sendrawtransaction processfiles stop millis mnzservers bot_buy bot_list bot_statuslist bot_pause bot_resume bot_sell bot_settings bot_status bot_stop guistats pubkeystats pendings coinswaps baserelswaps setpassphrase notarizations getrawtransaction parselog statsdisp m_js trust trusted setconfirms balance listunspent electrum snapshot_balance snapshot_loop secretaddresses dividends snapshot goals goal portfolio autoprice deletemessages getmessages debug buy sell bestfit orderbook client run_osx client_osx run coins disable enable myprice myprices getcoins getpeers getpeersIP getprices help inv setprice status ../dexscripts
cp coins.json .. cp coins.json ..
cd ../dexscripts cd ../dexscripts
#cp ../exchanges/passphrase ../exchanges/userpass . #cp ../exchanges/passphrase ../exchanges/userpass .

5
iguana/exchanges/mm.c

@ -921,7 +921,10 @@ int main(int argc, const char * argv[])
} }
if ( argc > 1 && (retjson= cJSON_Parse(argv[1])) != 0 ) if ( argc > 1 && (retjson= cJSON_Parse(argv[1])) != 0 )
{ {
DOCKERFLAG = (uint32_t)calc_ipbits(jstr(retjson,"docker")); if ( jint(retjson,"docker") == 1 )
DOCKERFLAG = 1;
else if ( jstr(retjson,"docker") != 0 )
DOCKERFLAG = (uint32_t)calc_ipbits(jstr(retjson,"docker"));
if ( (passphrase= jstr(retjson,"passphrase")) == 0 ) if ( (passphrase= jstr(retjson,"passphrase")) == 0 )
jaddstr(retjson,"passphrase","test"); jaddstr(retjson,"passphrase","test");
if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_main,(void *)retjson) != 0 ) if ( OS_thread_create(malloc(sizeof(pthread_t)),NULL,(void *)LP_main,(void *)retjson) != 0 )

2
iguana/exchanges/stats.c

@ -817,7 +817,7 @@ void stats_rpcloop(void *args)
} }
#endif*/ #endif*/
memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits)); memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits));
if ( DOCKERFLAG != 0 && ipbits == DOCKERFLAG ) if ( DOCKERFLAG != 0 && (DOCKERFLAG == 1 || ipbits == DOCKERFLAG) )
ipbits = localhostbits; ipbits = localhostbits;
if ( port == RPC_port && ipbits != localhostbits ) if ( port == RPC_port && ipbits != localhostbits )
{ {

Loading…
Cancel
Save