Esempio n. 1
0
}

char *ORDERSTATUS(struct exchange_info *exchange,uint64_t quoteid,cJSON *argjson)
{
    return(clonestr("{\"error\":\"yahoo is readonly data source\"}"));
}

char *CANCELORDER(struct exchange_info *exchange,uint64_t quoteid,cJSON *argjson)
{
    return(clonestr("{\"error\":\"yahoo is readonly data source\"}"));
}

char *OPENORDERS(struct exchange_info *exchange,cJSON *argjson)
{
    return(clonestr("{\"error\":\"yahoo is readonly data source\"}"));
}

char *TRADEHISTORY(struct exchange_info *exchange,cJSON *argjson)
{
    return(clonestr("{\"error\":\"yahoo is readonly data source\"}"));
}

char *WITHDRAW(struct exchange_info *exchange,char *base,double amount,char *destaddr,cJSON *argjson)
{
    return(clonestr("{\"error\":\"yahoo is readonly data source\"}"));
}

struct exchange_funcs yahoo_funcs = EXCHANGE_FUNCS(yahoo,EXCHANGE_NAME);

#include "exchange_undefs.h"
Esempio n. 2
0
}

char *ORDERSTATUS(struct exchange_info *exchange,uint64_t quoteid,cJSON *argjson)
{
    return(clonestr("{\"error\":\"instaforex is readonly data source\"}"));
}

char *CANCELORDER(struct exchange_info *exchange,uint64_t quoteid,cJSON *argjson)
{
    return(clonestr("{\"error\":\"instaforex is readonly data source\"}"));
}

char *OPENORDERS(struct exchange_info *exchange,cJSON *argjson)
{
    return(clonestr("{\"error\":\"instaforex is readonly data source\"}"));
}

char *TRADEHISTORY(struct exchange_info *exchange,cJSON *argjson)
{
    return(clonestr("{\"error\":\"instaforex is readonly data source\"}"));
}

char *WITHDRAW(struct exchange_info *exchange,char *base,double amount,char *destaddr,cJSON *argjson)
{
    return(clonestr("{\"error\":\"instaforex is readonly data source\"}"));
}

struct exchange_funcs instaforex_funcs = EXCHANGE_FUNCS(instaforex,EXCHANGE_NAME);

#include "exchange_undefs.h"
Esempio n. 3
0
char *OPENORDERS(void **cHandlep,struct exchange_info *exchange,cJSON *argjson)
{
    return(jprint(SIGNPOST(cHandlep,1,0,exchange,"open_orders",""),1));
}

char *TRADEHISTORY(void **cHandlep,struct exchange_info *exchange,cJSON *argjson)
{
    return(jprint(SIGNPOST(cHandlep,1,0,exchange,"user_transactions",""),1));
}

char *WITHDRAW(void **cHandlep,struct exchange_info *exchange,cJSON *argjson)
{
    return(clonestr("{\"error\":\"withdraw not yet\"}"));
}

struct exchange_funcs bitstamp_funcs = EXCHANGE_FUNCS(bitstamp,EXCHANGE_NAME);

#undef UPDATE
#undef SUPPORTS
#undef SIGNPOST
#undef TRADE
#undef ORDERSTATUS
#undef CANCELORDER
#undef OPENORDERS
#undef TRADEHISTORY
#undef BALANCES
#undef PARSEBALANCE
#undef WITHDRAW
#undef EXCHANGE_NAME
#undef EXCHANGE_AUTHURL
#undef CHECKBALANCE
Esempio n. 4
0
    else if ( strcmp(base,"DRK") == 0 )
        base = "darkcoin";
    else return(clonestr("{\"error\":\"invalid base specified\"}"));
    if ( (type= jstr(argjson,"extra")) == 0 )
        type = "exchange";
    else if ( strcmp(type,"exchange") != 0 && strcmp(type,"trading") != 0 && strcmp(type,"deposit") != 0 )
        return(clonestr("{\"error\":\"invalid wallet type specified\"}"));
    method = "withdraw";
    sprintf(payload,"{\"request\":\"/v1/%s\",\"nonce\":\"%llu\",\"amount\":\"%.6f\",\"withdraw_type\":\"%s\",\"walletselected\":\"%s\",\"address\":\"%s\"}",method,(long long)exchange_nonce(exchange),amount,base,type,destaddr);
    if ( (json= SIGNPOST(&retstr,exchange,payload,method)) != 0 )
    {
        free_json(json);
    }
    return(retstr); // return standardized withdraw
}

struct exchange_funcs bitfinex_funcs = EXCHANGE_FUNCS(bitfinex,EXCHANGE_NAME);

#undef UPDATE
#undef SUPPORTS
#undef SIGNPOST
#undef TRADE
#undef ORDERSTATUS
#undef CANCELORDER
#undef OPENORDERS
#undef TRADEHISTORY
#undef BALANCES
#undef PARSEBALANCE
#undef WITHDRAW
#undef EXCHANGE_NAME
Esempio n. 5
0
char *WITHDRAW(struct exchange_info *exchange,cJSON *argjson)
{
    char payload[1024],*base,*destaddr,*method; double amount;
    if ( (base= jstr(argjson,"base")) == 0 || strcmp(base,"BTC") != 0 )
        return(clonestr("{\"error\":\"base not specified or base != BTC\"}"));
    if ( (destaddr= jstr(argjson,"destaddr")) == 0 )
        return(clonestr("{\"error\":\"destaddr not specified\"}"));
    if ( (amount= jdouble(argjson,"amount")) < SMALLVAL )
        return(clonestr("{\"error\":\"amount not specified\"}"));
    method = "withdraw_coin";
    sprintf(payload,"&coin_type=1&withdraw_address=%s&withdraw_amount=%.4f",destaddr,amount);
    return(jprint(huobi_issue_auth(exchange,method,payload),1));
}

struct exchange_funcs huobi_funcs = EXCHANGE_FUNCS(huobi,EXCHANGE_NAME);

#undef UPDATE
#undef SUPPORTS
#undef SIGNPOST
#undef TRADE
#undef ORDERSTATUS
#undef CANCELORDER
#undef OPENORDERS
#undef TRADEHISTORY
#undef BALANCES
#undef PARSEBALANCE
#undef WITHDRAW
#undef EXCHANGE_NAME

Esempio n. 6
0
{
    char payload[1024],*base,*destaddr,*method,*tradepassword; double amount;
    if ( (base= jstr(argjson,"base")) == 0 || strcmp(base,"BTC") != 0 )
        return(clonestr("{\"error\":\"base not specified or base != BTC\"}"));
    if ( (destaddr= jstr(argjson,"destaddr")) == 0 )
        return(clonestr("{\"error\":\"destaddr not specified\"}"));
    if ( (amount= jdouble(argjson,"amount")) < SMALLVAL )
        return(clonestr("{\"error\":\"amount not specified\"}"));
    if ( (tradepassword= jstr(argjson,"tradepassword")) == 0 )
        return(clonestr("{\"error\":\"tradepassword not specified\"}"));
    method = "withdraw_coin";
    sprintf(payload,"&symbol=btc_usd&chargefee=0.0001&withdraw_address=%s&withdraw_amount=%.4f&trade_pwd=%s",destaddr,amount,tradepassword);
    return(jprint(okcoin_issue_auth(cHandlep,exchange,method,payload),1));
}

struct exchange_funcs okcoin_funcs = EXCHANGE_FUNCS(okcoin,EXCHANGE_NAME);

#undef UPDATE
#undef SUPPORTS
#undef SIGNPOST
#undef TRADE
#undef ORDERSTATUS
#undef CANCELORDER
#undef OPENORDERS
#undef TRADEHISTORY
#undef BALANCES
#undef PARSEBALANCE
#undef WITHDRAW
#undef EXCHANGE_NAME
#undef EXCHANGE_AUTHURL
#undef CHECKBALANCE
Esempio n. 7
0
}

char *ORDERSTATUS(void **cHandlep,struct exchange_info *exchange,cJSON *argjson,uint64_t quoteid)
{
    char *status,*retstr;
    status = OPENORDERS(cHandlep,exchange,argjson);
    if ( (retstr= exchange_extractorderid(0,status,quoteid,"order_id")) != 0 )
    {
        free(status);
        return(retstr);
    }
    free(status);
    return(clonestr("{\"result\":\"order not pending\"}"));
}

struct exchange_funcs btc38_funcs = EXCHANGE_FUNCS(btc38,EXCHANGE_NAME);

#undef UPDATE
#undef SUPPORTS
#undef SIGNPOST
#undef TRADE
#undef ORDERSTATUS
#undef CANCELORDER
#undef OPENORDERS
#undef TRADEHISTORY
#undef BALANCES
#undef PARSEBALANCE
#undef WITHDRAW
#undef EXCHANGE_NAME
#undef EXCHANGE_AUTHURL
#undef CHECKBALANCE
Esempio n. 8
0
    if ( (destaddr= jstr(argjson,"destaddr")) == 0 )
        return(clonestr("{\"error\":\"destaddr not specified\"}"));
    if ( (amount= jdouble(argjson,"amount")) < SMALLVAL )
        return(clonestr("{\"error\":\"amount not specified\"}"));
    paymentid = jstr(argjson,"paymentid");
    sprintf(payload,"command=withdraw&nonce=%llu&currency=%s&amount=%.6f&address=%s",(long long)exchange_nonce(exchange),base,amount,destaddr);
    if ( paymentid != 0 )
        sprintf(payload + strlen(payload),"&paymentId=%s",paymentid);
    if ( (json= SIGNPOST(cHandlep,1,&retstr,exchange,EXCHANGE_AUTHURL,payload)) != 0 )
    {
        free_json(json);
    }
    return(retstr); // return standardized withdraw
}

struct exchange_funcs poloniex_funcs = EXCHANGE_FUNCS(poloniex,EXCHANGE_NAME);


#undef UPDATE
#undef SUPPORTS
#undef SIGNPOST
#undef TRADE
#undef ORDERSTATUS
#undef CANCELORDER
#undef OPENORDERS
#undef TRADEHISTORY
#undef BALANCES
#undef PARSEBALANCE
#undef WITHDRAW
#undef EXCHANGE_NAME
#undef EXCHANGE_AUTHURL
Esempio n. 9
0
}

char *ORDERSTATUS(struct exchange_info *exchange,uint64_t quoteid,cJSON *argjson)
{
    return(clonestr("{\"error\":\"jumblr is not yet\"}"));
}

char *CANCELORDER(struct exchange_info *exchange,uint64_t quoteid,cJSON *argjson)
{
    return(clonestr("{\"error\":\"jumblr is not yet\"}"));
}

char *OPENORDERS(struct exchange_info *exchange,cJSON *argjson)
{
    return(clonestr("{\"error\":\"jumblr is not yet\"}"));
}

char *TRADEHISTORY(struct exchange_info *exchange,cJSON *argjson)
{
    return(clonestr("{\"error\":\"jumblr is not yet\"}"));
}

char *WITHDRAW(struct exchange_info *exchange,char *base,double amount,char *destaddr,cJSON *argjson)
{
    return(clonestr("{\"error\":\"jumblr is not yet\"}"));
}

struct exchange_funcs jumblr_funcs = EXCHANGE_FUNCS(jumblr,EXCHANGE_NAME);

#include "exchange_undefs.h"
Esempio n. 10
0
char *WITHDRAW(void **cHandlep,struct exchange_info *exchange,cJSON *argjson)
{
    char buf[1024],*base,*destaddr; double amount;
    if ( (base= jstr(argjson,"base")) == 0 || strcmp(base,"BTC") != 0 )
        return(clonestr("{\"error\":\"base not specified or base != BTC\"}"));
    if ( (destaddr= jstr(argjson,"destaddr")) == 0 )
        return(clonestr("{\"error\":\"destaddr not specified\"}"));
    if ( (amount= jdouble(argjson,"amount")) < SMALLVAL )
        return(clonestr("{\"error\":\"amount not specified\"}"));
    sprintf(buf,"\"amount\":%.4f,\"address\":\"%s\",",amount,destaddr);
    printf("submit.(%s)\n",buf);
    return(jprint(SIGNPOST(cHandlep,1,0,exchange,"","bitcoin_withdrawal"),1));
}

struct exchange_funcs quadriga_funcs = EXCHANGE_FUNCS(quadriga,EXCHANGE_NAME);

#undef UPDATE
#undef SUPPORTS
#undef SIGNPOST
#undef TRADE
#undef ORDERSTATUS
#undef CANCELORDER
#undef OPENORDERS
#undef TRADEHISTORY
#undef BALANCES
#undef PARSEBALANCE
#undef WITHDRAW
#undef EXCHANGE_NAME
#undef CHECKBALANCE