|
|
@ -109,7 +109,6 @@ myprice(base, rel)\n\ |
|
|
|
enable(coin)\n\ |
|
|
|
disable(coin)\n\ |
|
|
|
notarizations(coin)\n\ |
|
|
|
parselog()\n\ |
|
|
|
statsdisp(starttime=0, endtime=0, gui="", pubkey="", base="", rel="")\n\ |
|
|
|
tradesarray(base, rel, starttime=<now>-timescale*1024, endtime=<now>, timescale=60) -> [timestamp, high, low, open, close, relvolume, basevolume, aveprice, numtrades]\n\ |
|
|
|
pricearray(base, rel, starttime=0, endtime=0, timescale=60) -> [timestamp, avebid, aveask, highbid, lowask]\n\ |
|
|
@ -269,12 +268,6 @@ zeroconf_claim(address, expiration=0)\n\ |
|
|
|
{ |
|
|
|
return(LP_portfolio()); |
|
|
|
} |
|
|
|
else if ( strcmp(method,"parselog") == 0 ) |
|
|
|
{ |
|
|
|
bits256 zero; |
|
|
|
memset(zero.bytes,0,sizeof(zero)); |
|
|
|
return(jprint(LP_statslog_disp(2000000000,2000000000,"",zero,0,0),1)); |
|
|
|
} |
|
|
|
else if ( strcmp(method,"statsdisp") == 0 ) |
|
|
|
{ |
|
|
|
return(jprint(LP_statslog_disp(juint(argjson,"starttime"),juint(argjson,"endtime"),jstr(argjson,"gui"),jbits256(argjson,"pubkey"),jstr(argjson,"base"),jstr(argjson,"rel")),1)); |
|
|
@ -299,11 +292,12 @@ zeroconf_claim(address, expiration=0)\n\ |
|
|
|
return(basilisk_swapentries(base,rel,jint(argjson,"limit"))); |
|
|
|
else return(basilisk_swaplist(0,0)); |
|
|
|
} |
|
|
|
else if ( strcmp(method,"dynamictrust") == 0 ) |
|
|
|
/*else if ( strcmp(method,"dynamictrust") == 0 )
|
|
|
|
{ |
|
|
|
struct LP_address *ap; char *coinaddr; |
|
|
|
if ( (ptr= LP_coinsearch("KMD")) != 0 && (coinaddr= jstr(argjson,"address")) != 0 ) |
|
|
|
{ |
|
|
|
LP_zeroconf_deposits(ptr); |
|
|
|
if ( (ap= LP_addressfind(ptr,coinaddr)) != 0 ) |
|
|
|
{ |
|
|
|
retjson = cJSON_CreateObject(); |
|
|
@ -314,7 +308,7 @@ zeroconf_claim(address, expiration=0)\n\ |
|
|
|
} |
|
|
|
} |
|
|
|
return(clonestr("{\"error\":\"cant find address\"}")); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
else if ( (retstr= LP_istradebots_command(ctx,pubsock,method,argjson)) != 0 ) |
|
|
|
return(retstr); |
|
|
|
if ( base[0] != 0 && rel[0] != 0 ) |
|
|
@ -630,15 +624,12 @@ zeroconf_claim(address, expiration=0)\n\ |
|
|
|
|
|
|
|
else if ( strcmp(method,"tradestatus") == 0 ) |
|
|
|
{ |
|
|
|
bits256 zero; cJSON *tmpjson; |
|
|
|
bits256 zero; cJSON *tmpjson; struct LP_quoteinfo Q; |
|
|
|
LP_tradecommand_log(argjson); |
|
|
|
//printf("GOT TRADESTATUS! %s\n",jprint(argjson,0));
|
|
|
|
if ( LP_statslog_parse() > 0 ) |
|
|
|
{ |
|
|
|
memset(zero.bytes,0,sizeof(zero)); |
|
|
|
if ( (tmpjson= LP_statslog_disp(2000000000,2000000000,"",zero,0,0))) // pending swaps
|
|
|
|
free_json(tmpjson); |
|
|
|
} |
|
|
|
LP_quoteparse(&Q,argjson); |
|
|
|
LP_requestinit(&Q.R,Q.srchash,Q.desthash,Q.srccoin,Q.satoshis-Q.txfee,Q.destcoin,Q.destsatoshis-Q.desttxfee,Q.timestamp,Q.quotetime,0); |
|
|
|
LP_tradecommand_log(argjson); |
|
|
|
printf("%-4d (%-10u %10u) %12s id.%22llu %5s/%-5s %12.8f -> %11.8f price %11.8f | RT.%d %d\n",(uint32_t)time(NULL) % 3600,Q.R.requestid,Q.R.quoteid,method,(long long)Q.aliceid,Q.srccoin,Q.destcoin,dstr(Q.satoshis),dstr(Q.destsatoshis),(double)Q.destsatoshis/Q.satoshis,LP_RTcount,LP_swapscount); |
|
|
|
retstr = clonestr("{\"result\":\"success\"}"); |
|
|
|
} |
|
|
|
else if ( strcmp(method,"wantnotify") == 0 ) |
|
|
|