Skip to content

Commit

Permalink
Merge pull request #31 from artemii235/etomic
Browse files Browse the repository at this point in the history
Merge cancel_order(uuid) API from jl777/dev.
  • Loading branch information
artemii235 committed Apr 24, 2018
2 parents 3db749a + 3093c17 commit c3e6e21
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions iguana/exchanges/LP_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ pricearray(base, rel, starttime=0, endtime=0, timescale=60) -> [timestamp, avebi
getrawtransaction(coin, txid)\n\
inventory(coin, reset=0, [passphrase=])\n\
lastnonce()\n\
cancel(uuid)\n\
buy(base, rel, price, relvolume, timeout=10, duration=3600, nonce)\n\
sell(base, rel, price, basevolume, timeout=10, duration=3600, nonce)\n\
withdraw(coin, outputs[], broadcast=0)\n\
Expand Down Expand Up @@ -304,6 +305,10 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\
LP_deletemessages(jint(argjson,"firsti"),jint(argjson,"num"));
return(clonestr("{\"result\":\"success\"}"));
}*/
else if ( strcmp(method,"cancel") == 0 )
{
return(LP_cancel_order(jstr(argjson,"uuid")));
}
else if ( strcmp(method,"recentswaps") == 0 )
{
return(LP_recent_swaps(jint(argjson,"limit"),0));
Expand Down
11 changes: 11 additions & 0 deletions iguana/exchanges/LP_ordermatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,17 @@ int32_t LP_alice_eligible(uint32_t quotetime)
return(Alice_expiration == 0 || time(NULL) < Alice_expiration);
}

char *LP_cancel_order(char *uuidstr)
{
if ( uuidstr != 0 && strcmp(LP_Alicequery.uuidstr,uuidstr) == 0 )
{
LP_failedmsg(LP_Alicequery.R.requestid,LP_Alicequery.R.quoteid,-9998,LP_Alicequery.uuidstr);
LP_alicequery_clear();
return(clonestr("{\"result\":\"success\",\"status\":\"uuid canceled\"}"));
}
return(clonestr("{\"error\":\"uuid not cancellable\"}"));
}

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;
Expand Down

0 comments on commit c3e6e21

Please sign in to comment.