|
1 | | -/* |
2 | | - * Copyright (C) 2017 Worldline, Inc. |
3 | | - * |
4 | | - * MultiChainJavaAPI code distributed under the GPLv3 license, see COPYING file. |
5 | | - * https://github.com/SimplyUb/MultiChainJavaAPI/blob/master/LICENSE |
6 | | - * |
7 | | - */ |
8 | | -package multichain.command; |
9 | | - |
10 | | -import multichain.command.builders.QueryBuilderChain; |
11 | | - |
12 | | -/** |
13 | | - * @author Ub - H. MARTEAU |
14 | | - * @version 4.13 |
15 | | - */ |
16 | | -public class ChainCommand extends QueryBuilderChain { |
17 | | - |
18 | | - public ChainCommand(String ip, String port, String login, String password) { |
19 | | - initialize(ip, port, login, password); |
20 | | - } |
21 | | - |
22 | | - /** |
23 | | - * getinfo |
24 | | - * Returns an object containing various state info. |
25 | | - * |
26 | | - * Result: |
27 | | - * { |
28 | | - * "version": xxxxx, (numeric) the server version |
29 | | - * "protocolversion": xxxxx, (numeric) the protocol version |
30 | | - * "chainname": "xxxx", (string) multichain network name |
31 | | - * "description": "xxxx", (string) network desctription |
32 | | - * "protocol": "xxxx", (string) protocol - multichain or bitcoin |
33 | | - * "port": xxxx, (numeric) network port |
34 | | - * "setupblocks": "xxxx", (string) number of network setup blocks |
35 | | - * "walletversion": xxxxx, (numeric) the wallet version |
36 | | - * "balance": xxxxxxx, (numeric) the total native currency balance of the wallet |
37 | | - * "walletdbversion": xxxxx, (numeric) the wallet database version |
38 | | - * "blocks": xxxxxx, (numeric) the current number of blocks processed in the server |
39 | | - * "timeoffset": xxxxx, (numeric) the time offset |
40 | | - * "connections": xxxxx, (numeric) the number of connections |
41 | | - * "proxy": "host:port", (string, optional) the proxy used by the server |
42 | | - * "difficulty": xxxxxx, (numeric) the current difficulty |
43 | | - * "testnet": true|false, (boolean) if the server is using testnet or not |
44 | | - * "keypoololdest": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the |
45 | | - * key pool |
46 | | - * "keypoolsize": xxxx, (numeric) how many new keys are pre-generated |
47 | | - * "unlocked_until": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet |
48 | | - * is unlocked for transfers, or 0 |
49 | | - * if the wallet is locked |
50 | | - * "paytxfee": x.xxxx, (numeric) the transaction fee set in btc/kb |
51 | | - * "relayfee": x.xxxx, (numeric) minimum relay fee for non-free transactions in btc/kb |
52 | | - * "errors": "..." (string) any error messages |
53 | | - * } |
54 | | - * |
55 | | - * @return |
56 | | - * @throws MultichainException |
57 | | - */ |
58 | | - public String getInfo() throws MultichainException { |
59 | | - return executeGetInfo(); |
60 | | - } |
61 | | - |
62 | | - /** |
63 | | - * help ( command ) |
64 | | - * |
65 | | - * List all commands, or get help for a specified command. |
66 | | - * |
67 | | - * Arguments: |
68 | | - * 1. "command" (string, optional) The command to get help on |
69 | | - * |
70 | | - * Result: |
71 | | - * "text" (string) The help text |
72 | | - * @return |
73 | | - * @throws MultichainException |
74 | | - */ |
75 | | - public String help() throws MultichainException { |
76 | | - return executeHelp(null); |
77 | | - } |
78 | | - |
79 | | - public String help(String command) throws MultichainException { |
80 | | - return executeHelp(command); |
81 | | - } |
82 | | -} |
| 1 | +/* |
| 2 | + * Copyright (C) 2017 Worldline, Inc. |
| 3 | + * |
| 4 | + * MultiChainJavaAPI code distributed under the GPLv3 license, see COPYING file. |
| 5 | + * https://github.com/SimplyUb/MultiChainJavaAPI/blob/master/LICENSE |
| 6 | + * |
| 7 | + */ |
| 8 | +package multichain.command; |
| 9 | + |
| 10 | +import multichain.command.builders.QueryBuilderChain; |
| 11 | + |
| 12 | +/** |
| 13 | + * @author Ub - H. MARTEAU |
| 14 | + * @version 4.13 |
| 15 | + */ |
| 16 | +public class ChainCommand extends QueryBuilderChain { |
| 17 | + |
| 18 | + public ChainCommand(String ip, String port, String login, String password) { |
| 19 | + initialize(ip, port, login, password); |
| 20 | + } |
| 21 | + |
| 22 | + /** |
| 23 | + * getinfo |
| 24 | + * Returns an object containing various state info. |
| 25 | + * |
| 26 | + * Result: |
| 27 | + * { |
| 28 | + * "version": xxxxx, (numeric) the server version |
| 29 | + * "protocolversion": xxxxx, (numeric) the protocol version |
| 30 | + * "chainname": "xxxx", (string) multichain network name |
| 31 | + * "description": "xxxx", (string) network desctription |
| 32 | + * "protocol": "xxxx", (string) protocol - multichain or bitcoin |
| 33 | + * "port": xxxx, (numeric) network port |
| 34 | + * "setupblocks": "xxxx", (string) number of network setup blocks |
| 35 | + * "walletversion": xxxxx, (numeric) the wallet version |
| 36 | + * "balance": xxxxxxx, (numeric) the total native currency balance of the wallet |
| 37 | + * "walletdbversion": xxxxx, (numeric) the wallet database version |
| 38 | + * "blocks": xxxxxx, (numeric) the current number of blocks processed in the server |
| 39 | + * "timeoffset": xxxxx, (numeric) the time offset |
| 40 | + * "connections": xxxxx, (numeric) the number of connections |
| 41 | + * "proxy": "host:port", (string, optional) the proxy used by the server |
| 42 | + * "difficulty": xxxxxx, (numeric) the current difficulty |
| 43 | + * "testnet": true|false, (boolean) if the server is using testnet or not |
| 44 | + * "keypoololdest": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the |
| 45 | + * key pool |
| 46 | + * "keypoolsize": xxxx, (numeric) how many new keys are pre-generated |
| 47 | + * "unlocked_until": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet |
| 48 | + * is unlocked for transfers, or 0 |
| 49 | + * if the wallet is locked |
| 50 | + * "paytxfee": x.xxxx, (numeric) the transaction fee set in btc/kb |
| 51 | + * "relayfee": x.xxxx, (numeric) minimum relay fee for non-free transactions in btc/kb |
| 52 | + * "errors": "..." (string) any error messages |
| 53 | + * } |
| 54 | + * |
| 55 | + * @return |
| 56 | + * @throws MultichainException |
| 57 | + */ |
| 58 | + public String getInfo() throws MultichainException { |
| 59 | + return executeGetInfo(); |
| 60 | + } |
| 61 | + |
| 62 | + /** |
| 63 | + * help ( command ) |
| 64 | + * |
| 65 | + * List all commands, or get help for a specified command. |
| 66 | + * |
| 67 | + * Arguments: |
| 68 | + * 1. "command" (string, optional) The command to get help on |
| 69 | + * |
| 70 | + * Result: |
| 71 | + * "text" (string) The help text |
| 72 | + * @return |
| 73 | + * @throws MultichainException |
| 74 | + */ |
| 75 | + public String help() throws MultichainException { |
| 76 | + return executeHelp(null); |
| 77 | + } |
| 78 | + |
| 79 | + public String help(String command) throws MultichainException { |
| 80 | + return executeHelp(command); |
| 81 | + } |
| 82 | +} |
0 commit comments