Skip to content

Commit fca240a

Browse files
author
[a561842] hubert marteau
committed
# Conflicts: # pom.xml # src/main/java/multichain/object/AddressBalanceAsset.java # src/main/java/multichain/object/AssetWalletTransaction.java # src/main/java/multichain/object/BalanceAsset.java # src/main/java/multichain/object/BalanceAssetGeneral.java # src/main/java/multichain/object/BalanceAssetWalletTransaction.java # src/main/java/multichain/object/BalanceWalletTransaction.java # src/main/java/multichain/object/MultiBalance.java # src/main/java/multichain/object/PermissionDetailed.java # src/main/java/multichain/object/TransactionBase.java # src/main/java/multichain/object/TransactionWallet.java # src/main/java/multichain/object/TransactionWalletDetailed.java # src/main/java/multichain/object/TransactionWalletVInfo.java # src/main/java/multichain/object/TransactionWalletVout.java
2 parents 7268a86 + 14739de commit fca240a

15 files changed

+4023
-4024
lines changed

src/main/java/multichain/command/AddressCommand.java

Lines changed: 465 additions & 465 deletions
Large diffs are not rendered by default.
Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,78 @@
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 java.util.ArrayList;
11-
import java.util.List;
12-
13-
import multichain.command.builders.QueryBuilderBalance;
14-
import multichain.object.BalanceAssetGeneral;
15-
import multichain.object.formatters.BalanceFormatter;
16-
17-
/**
18-
* @author Ub - H. MARTEAU
19-
* @version 4.13
20-
*/
21-
public class BalanceCommand extends QueryBuilderBalance {
22-
public BalanceCommand(String ip, String port, String login, String password) {
23-
initialize(ip, port, login, password);
24-
}
25-
26-
/**
27-
*
28-
* gettotalbalances ( minconf includeWatchonly includeLocked)
29-
*
30-
* If account is not specified, returns the server's total available asset
31-
* balances. If account is specified, returns the balances in the account.
32-
* Note that the account "" is not the same as leaving the parameter out.
33-
* The server total may be different to the balance in the default ""
34-
* account.
35-
*
36-
* Arguments: 1. minconf (numeric, optional, default=1) Only include
37-
* transactions confirmed at least this many times. 2. includeWatchonly
38-
* (bool, optional, default=false) Also include balance in watchonly
39-
* addresses (see 'importaddress') 3. includeLocked (bool, optional,
40-
* default=false) Also take locked outputs into account Results are an array
41-
* of Objects with totals and details for each asset.
42-
*
43-
* @return a list of all the asset balances in this node’s wallet
44-
* @throws MultichainException
45-
*/
46-
@SuppressWarnings("unchecked")
47-
public List<BalanceAssetGeneral> getTotalBalances() throws MultichainException {
48-
List<BalanceAssetGeneral> listBalanceAsset = new ArrayList<BalanceAssetGeneral>();
49-
50-
Object objectBalanceAsset = executeGetTotalBalances();
51-
52-
if (verifyInstance(objectBalanceAsset, ArrayList.class)
53-
&& verifyInstanceofList((ArrayList<Object>) objectBalanceAsset, BalanceAssetGeneral.class)) {
54-
listBalanceAsset = BalanceFormatter.formatBalanceAssetsGeneral((ArrayList<Object>) objectBalanceAsset);
55-
}
56-
57-
return listBalanceAsset;
58-
}
59-
60-
/**
61-
*
62-
* getunconfirmedbalance Returns the server's total unconfirmed balance
63-
*
64-
* @return not formated balance
65-
* @throws MultichainException
66-
*/
67-
public String getUnconfirmedBalance() throws MultichainException {
68-
String stringUnconfirmedBalance = "";
69-
70-
Object objectUnconfirmedBalance = executeGetUnconfirmedBalance();
71-
if (verifyInstance(objectUnconfirmedBalance, String.class)) {
72-
stringUnconfirmedBalance = (String) objectUnconfirmedBalance;
73-
}
74-
75-
return stringUnconfirmedBalance;
76-
}
77-
78-
}
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 java.util.ArrayList;
11+
import java.util.List;
12+
13+
import multichain.command.builders.QueryBuilderBalance;
14+
import multichain.object.BalanceAssetGeneral;
15+
import multichain.object.formatters.BalanceFormatter;
16+
17+
/**
18+
* @author Ub - H. MARTEAU
19+
* @version 4.13
20+
*/
21+
public class BalanceCommand extends QueryBuilderBalance {
22+
public BalanceCommand(String ip, String port, String login, String password) {
23+
initialize(ip, port, login, password);
24+
}
25+
26+
/**
27+
*
28+
* gettotalbalances ( minconf includeWatchonly includeLocked)
29+
*
30+
* If account is not specified, returns the server's total available asset
31+
* balances. If account is specified, returns the balances in the account.
32+
* Note that the account "" is not the same as leaving the parameter out.
33+
* The server total may be different to the balance in the default ""
34+
* account.
35+
*
36+
* Arguments: 1. minconf (numeric, optional, default=1) Only include
37+
* transactions confirmed at least this many times. 2. includeWatchonly
38+
* (bool, optional, default=false) Also include balance in watchonly
39+
* addresses (see 'importaddress') 3. includeLocked (bool, optional,
40+
* default=false) Also take locked outputs into account Results are an array
41+
* of Objects with totals and details for each asset.
42+
*
43+
* @return a list of all the asset balances in this node’s wallet
44+
* @throws MultichainException
45+
*/
46+
@SuppressWarnings("unchecked")
47+
public List<BalanceAssetGeneral> getTotalBalances() throws MultichainException {
48+
List<BalanceAssetGeneral> listBalanceAsset = new ArrayList<BalanceAssetGeneral>();
49+
50+
Object objectBalanceAsset = executeGetTotalBalances();
51+
52+
if (verifyInstance(objectBalanceAsset, ArrayList.class)
53+
&& verifyInstanceofList((ArrayList<Object>) objectBalanceAsset, BalanceAssetGeneral.class)) {
54+
listBalanceAsset = BalanceFormatter.formatBalanceAssetsGeneral((ArrayList<Object>) objectBalanceAsset);
55+
}
56+
57+
return listBalanceAsset;
58+
}
59+
60+
/**
61+
*
62+
* getunconfirmedbalance Returns the server's total unconfirmed balance
63+
*
64+
* @return not formated balance
65+
* @throws MultichainException
66+
*/
67+
public String getUnconfirmedBalance() throws MultichainException {
68+
String stringUnconfirmedBalance = "";
69+
70+
Object objectUnconfirmedBalance = executeGetUnconfirmedBalance();
71+
if (verifyInstance(objectUnconfirmedBalance, String.class)) {
72+
stringUnconfirmedBalance = (String) objectUnconfirmedBalance;
73+
}
74+
75+
return stringUnconfirmedBalance;
76+
}
77+
78+
}
Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,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-
}
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

Comments
 (0)