9b0e1808 |
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 | |
30f61477 |
16 | void komodo_gateway_iteration(char *symbol) |
c42b46db |
17 | { |
2c6bdd83 |
18 | char *retstr; int32_t i,num; cJSON *item,*listobj; static uint32_t r,n,counter=0; |
c42b46db |
19 | if ( r == 0 ) |
20 | r = rand(); |
21 | if ( (counter++ % 10) == (r % 10) ) |
22 | { |
30f61477 |
23 | printf("%s calling getinfo %d\n",symbol,n); |
c42b46db |
24 | if ( (retstr= komodo_issuemethod((char *)"getinfo",0,7771)) != 0 ) |
25 | { |
26 | //printf("GETINFO from.%s (%s)\n",ASSETCHAINS_SYMBOL,retstr); |
27 | free(retstr); |
2c6bdd83 |
28 | if ( (retstr= komodo_issuemethod((char *)"listtransactions",0,7771)) != 0 ) |
29 | { |
e9de5833 |
30 | printf("LIST.(%s)\n",retstr); |
2c6bdd83 |
31 | if ( (listobj= cJSON_Parse(retstr)) != 0 ) |
32 | { |
33 | if ( (num= cJSON_GetArraySize(listobj)) > 0 ) |
34 | { |
35 | for (i=0; i<num; i++) |
36 | { |
37 | item = jitem(listobj,i); |
e9de5833 |
38 | printf("%s %d of %d.(%s)\n",symbol,i,num,jprint(item,0)); |
2c6bdd83 |
39 | } |
40 | } |
41 | free_json(listobj); |
42 | } |
43 | free(retstr); |
44 | } |
c42b46db |
45 | n++; |
30f61477 |
46 | } else printf("error from %s\n",symbol); |
c42b46db |
47 | } |
48 | } |
49 | |
9b0e1808 |
50 | void komodo_gateway_issuer() // "assetchain" |
51 | { |
52 | |
53 | } |
54 | |
55 | void komodo_gateway_redeemer() // "KMD" |
56 | { |
57 | |
58 | } |