Browse Source

cancel_order(uuid) api

jl777
jl777 7 years ago
parent
commit
015b4cec17
  1. 5
      iguana/exchanges/LP_commands.c
  2. 11
      iguana/exchanges/LP_ordermatch.c

5
iguana/exchanges/LP_commands.c

@ -116,6 +116,7 @@ pricearray(base, rel, starttime=0, endtime=0, timescale=60) -> [timestamp, avebi
getrawtransaction(coin, txid)\n\ getrawtransaction(coin, txid)\n\
inventory(coin, reset=0, [passphrase=])\n\ inventory(coin, reset=0, [passphrase=])\n\
lastnonce()\n\ lastnonce()\n\
cancel(uuid)\n\
buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce)\n\ buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce)\n\
sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce)\n\ sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce)\n\
withdraw(coin, outputs[], broadcast=0)\n\ withdraw(coin, outputs[], broadcast=0)\n\
@ -304,6 +305,10 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\
LP_deletemessages(jint(argjson,"firsti"),jint(argjson,"num")); LP_deletemessages(jint(argjson,"firsti"),jint(argjson,"num"));
return(clonestr("{\"result\":\"success\"}")); return(clonestr("{\"result\":\"success\"}"));
}*/ }*/
else if ( strcmp(method,"cancel") == 0 )
{
return(LP_cancel_order(jstr(argjson,"uuid")));
}
else if ( strcmp(method,"recentswaps") == 0 ) else if ( strcmp(method,"recentswaps") == 0 )
{ {
return(LP_recent_swaps(jint(argjson,"limit"),0)); return(LP_recent_swaps(jint(argjson,"limit"),0));

11
iguana/exchanges/LP_ordermatch.c

@ -623,6 +623,17 @@ int32_t LP_alice_eligible(uint32_t quotetime)
return(Alice_expiration == 0 || time(NULL) < Alice_expiration); return(Alice_expiration == 0 || time(NULL) < Alice_expiration);
} }
char *LP_cancel_order(char *uuidstr)
{
if ( uuidstr != 0 && strcmp(LP_Alicequery.uuidstr[0],uuidstr) == 0 )
{
LP_failedmsg(LP_Alicequery.R.requestid,LP_Alicequery.R.quoteid,-9998,LP_Alicequery.uuidstr);
LP_alicequery_clear();
clonestr("{\"result\":\"success\",\"status\":\"uuid canceled\"}")
}
return(clonestr("{\"error\":\"uuid not cancellable\"}"));
}
char *LP_connectedalice(struct LP_quoteinfo *qp,char *pairstr) // alice char *LP_connectedalice(struct LP_quoteinfo *qp,char *pairstr) // alice
{ {
cJSON *retjson; char otheraddr[64],*msg; double bid,ask,price,qprice; int32_t pairsock = -1; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,A,B,*butxo; struct basilisk_swap *swap; struct iguana_info *coin; cJSON *retjson; char otheraddr[64],*msg; double bid,ask,price,qprice; int32_t pairsock = -1; int32_t DEXselector = 0; struct LP_utxoinfo *autxo,A,B,*butxo; struct basilisk_swap *swap; struct iguana_info *coin;

Loading…
Cancel
Save