Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
f9cf3b44e6
  1. 9
      iguana/iguana_instantdex.c
  2. 1
      iguana/tests/available

9
iguana/iguana_instantdex.c

@ -1720,12 +1720,17 @@ TWO_STRINGS(InstantDEX,events,base,rel)
ZERO_ARGS(InstantDEX,allcoins) ZERO_ARGS(InstantDEX,allcoins)
{ {
return(clonestr("{\"result\":\"this will return array of available coins\"}")); return(clonestr("{\"result\":\"[\"BTC\", \"BTCD\", \"LTC\", \"SYS\", \"ZEC\"]\"}"));
} }
STRING_ARG(InstantDEX,available,source) STRING_ARG(InstantDEX,available,source)
{ {
return(clonestr("{\"result\":\"this will return available balance for source\"}")); if ( (coin= iguana_coinfind(source)) != 0 )
{
if ( myinfo->expiration != 0 )
return(bitcoinrpc_getbalance(myinfo,coin,json,remoteaddr,"*",coin->chain->minconfirms,1,1<<30));
else return(clonestr("{\"error\":\"need to unlock wallet\"}"));
} else return(clonestr("{\"error\":\"specified coin is not active\"}"));
} }
THREE_STRINGS_AND_DOUBLE(InstantDEX,request,message,dest,source,amount) THREE_STRINGS_AND_DOUBLE(InstantDEX,request,message,dest,source,amount)

1
iguana/tests/available

@ -0,0 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"available\",\"source\":\"BTCD\"}"
Loading…
Cancel
Save