test
[VerusCoin.git] / src / komodo_gateway.h
1 /******************************************************************************
2  * Copyright © 2014-2016 The SuperNET Developers.                             *
3  *                                                                            *
4  * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at                  *
5  * the top-level directory of this distribution for the individual copyright  *
6  * holder information and the developer policies on copyright and licensing.  *
7  *                                                                            *
8  * Unless otherwise agreed in a custom licensing agreement, no part of the    *
9  * SuperNET software, including this file may be copied, modified, propagated *
10  * or distributed except according to the terms contained in the LICENSE file *
11  *                                                                            *
12  * Removal or modification of this copyright notice is prohibited.            *
13  *                                                                            *
14  ******************************************************************************/
15
16 void komodo_gateway_iteration(char *symbol)
17 {
18     char *retstr,*coinaddr; int32_t i,num; cJSON *item,*array,*listobj; static uint32_t r,n,counter=0;
19     if ( r == 0 )
20         r = rand();
21     if ( (counter++ % 10) == (r % 10) )
22     {
23         printf("%s calling getinfo %d\n",symbol,n);
24         if ( (retstr= komodo_issuemethod((char *)"getinfo",0,7771)) != 0 )
25         {
26             //printf("GETINFO from.%s (%s)\n",ASSETCHAINS_SYMBOL,retstr);
27             free(retstr);
28             if ( (retstr= komodo_issuemethod((char *)"listtransactions",0,7771)) != 0 )
29             {
30                 //printf("LIST.(%s)\n",retstr);
31                 if ( (listobj= cJSON_Parse(retstr)) != 0 )
32                 {
33                     if ( (array= jarray(&num,listobj,(char *)"result")) != 0 )
34                     {
35                         for (i=0; i<num; i++)
36                         {
37                             item = jitem(array,i);
38                             if ( (coinaddr= jstr(item,(char *)"address")) != 0 && strcmp(coinaddr,(char *)CRYPTO777_KMDADDR) == 0 )
39                                 printf("%s %d of %d.(%s)\n",symbol,i,num,jprint(item,0));
40                         }
41                     }
42                     free_json(listobj);
43                 }
44                 free(retstr);
45             }
46             n++;
47         } else printf("error from %s\n",symbol);
48     }
49 }
50
51 void komodo_gateway_issuer() // "assetchain"
52 {
53     
54 }
55
56 void komodo_gateway_redeemer() // "KMD"
57 {
58     
59 }
This page took 0.027871 seconds and 4 git commands to generate.