Browse Source

Calcaddress

dev
jl777 7 years ago
parent
commit
f516147022
  1. 15
      iguana/exchanges/LP_commands.c
  2. 3
      iguana/exchanges/calcaddress

15
iguana/exchanges/LP_commands.c

@ -159,6 +159,7 @@ bot_settings(botid, newprice, newvolume)\n\
bot_status(botid)\n\ bot_status(botid)\n\
bot_stop(botid)\n\ bot_stop(botid)\n\
bot_pause(botid)\n\ bot_pause(botid)\n\
calcaddress(passphrase)\n\
instantdex_deposit(weeks, amount, broadcast=1)\n\ instantdex_deposit(weeks, amount, broadcast=1)\n\
instantdex_claim()\n\ instantdex_claim()\n\
jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\
@ -300,6 +301,20 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\
{ {
return(LP_portfolio()); return(LP_portfolio());
} }
else if ( strcmp(method,"calcaddress") == 0 )
{
bits256 privkey,pub; uint8_t pubkey33[33]; char *passphrase,coinaddr[64];
if ( (passphrase= jstr(argjson,"passphrase")) != 0 )
{
conv_NXTpassword(privkey.bytes,pub.bytes,(uint8_t *)passphrase,(int32_t)strlen(passphrase));
bitcoin_priv2pub(ctx,"KMD",pubkey33,coinaddr,privkey,0,60);
retjson = cJSON_CreateObject();
jaddstr(retjson,"passphrase",passphrase);
jaddstr(retjson,"coinaddr",coinaddr);
jaddbits256(retjson,"privkey",privkey);
return(jprint(retjson,1));
} else return(clonestr("{\"error\":\"need to have passphrase\"}"));
}
else if ( strcmp(method,"statsdisp") == 0 ) 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)); return(jprint(LP_statslog_disp(juint(argjson,"starttime"),juint(argjson,"endtime"),jstr(argjson,"gui"),jbits256(argjson,"pubkey"),jstr(argjson,"base"),jstr(argjson,"rel")),1));

3
iguana/exchanges/calcaddress

@ -0,0 +1,3 @@
#!/bin/bash
source userpass
curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"calcaddress\",\"passphrase\":\"default\"}"
Loading…
Cancel
Save