1212
1313/**
1414 * @author Ub - H. MARTEAU
15- * @version 3.0
15+ * @version 4.2
1616 */
1717public class QueryBuilderAddress extends QueryBuilderCommon {
1818
1919 /**
2020 * addmultisigaddress nrequired ["key",...] ( "account" )
2121 *
22- * Add a nrequired-to-sign multisignature address to the wallet.
23- * Each key is a address or hex-encoded public key.
24- * If 'account' is specified, assign address to that account.
22+ * Add a nrequired-to-sign multisignature address to the wallet. Each key is
23+ * a address or hex-encoded public key. If 'account' is specified, assign
24+ * address to that account.
2525 *
26- * Arguments:
27- * 1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.
28- * 2. "keysobject" (string, required) A json array of addresses or hex-encoded public keys
29- * [
30- * "address" (string) address or hex-encoded public key
31- * ...,
32- * ]
33- * 3. "account" (string, optional) An account to assign the addresses to.
26+ * Arguments: 1. nrequired (numeric, required) The number of required
27+ * signatures out of the n keys or addresses. 2. "keysobject" (string,
28+ * required) A json array of addresses or hex-encoded public keys [
29+ * "address" (string) address or hex-encoded public key ..., ] 3. "account"
30+ * (string, optional) An account to assign the addresses to.
3431 *
35- * Result:
36- * "address" (string) A address associated with the keys.
32+ * Result: "address" (string) A address associated with the keys.
3733 *
3834 *
3935 * @param numberOfSigRequired
4036 * @param publicKeys
4137 * @return the P2SH address
4238 * @throws MultichainException
4339 */
44- protected Object executeAddMultiSigAddress (int numberOfSigRequired , String [] publicKeys ) throws MultichainException {
40+ protected Object executeAddMultiSigAddress (int numberOfSigRequired , String [] publicKeys )
41+ throws MultichainException {
4542 MultichainTestParameter .valueIsPositive ("number of signature required" , numberOfSigRequired );
4643 MultichainTestParameter .isNotNullOrEmpty ("publicKeys" , publicKeys );
4744 MultichainTestParameter .arrayNotContainNullOrEmptyValues ("publicKeys" , publicKeys );
@@ -55,22 +52,17 @@ protected Object executeAddMultiSigAddress(int numberOfSigRequired, String[] pub
5552 /**
5653 * createmultisig nrequired ["key",...]
5754 *
58- * Creates a multi-signature address with n signature of m keys required.
59- * It returns a json object with the address and redeemScript.
55+ * Creates a multi-signature address with n signature of m keys required. It
56+ * returns a json object with the address and redeemScript.
6057 *
61- * Arguments:
62- * 1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.
63- * 2. "keys" (string, required) A json array of keys which are addresses or hex-encoded public keys
64- * [
65- * "key" (string) address or hex-encoded public key
66- * ,...
67- * ]
58+ * Arguments: 1. nrequired (numeric, required) The number of required
59+ * signatures out of the n keys or addresses. 2. "keys" (string, required) A
60+ * json array of keys which are addresses or hex-encoded public keys [ "key"
61+ * (string) address or hex-encoded public key ,... ]
6862 *
69- * Result:
70- * {
71- * "address":"multisigaddress", (string) The value of the new multisig address.
72- * "redeemScript":"script" (string) The string value of the hex-encoded redemption script.
73- * }
63+ * Result: { "address":"multisigaddress", (string) The value of the new
64+ * multisig address. "redeemScript":"script" (string) The string value of
65+ * the hex-encoded redemption script. }
7466 *
7567 *
7668 * @param numberOfSigRequired
@@ -96,11 +88,11 @@ protected Object executeCreateMultiSig(int numberOfSigRequired, String[] publicK
9688 *
9789 * Returns asset balances for specified address
9890 *
99- * Arguments:
100- * 1. "address" (string, required) Address to return balance for.
101- * 2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.
102- * 3. includeLocked (bool, optional, default=false) Also take locked outputs into account
103- * Results are an array of Objects with totals and details for each asset.
91+ * Arguments: 1. "address" (string, required) Address to return balance for.
92+ * 2. minconf (numeric, optional, default=1) Only include transactions
93+ * confirmed at least this many times. 3. includeLocked (bool, optional,
94+ * default=false) Also take locked outputs into account Results are an array
95+ * of Objects with totals and details for each asset.
10496 *
10597 * @param address
10698 * @return a list of all the asset balances for address in this node’s
@@ -117,16 +109,11 @@ protected Object executeGetAddressBalances(String address) throws MultichainExce
117109 *
118110 * Returns the list of all addresses in the wallet.
119111 *
120- * Arguments:
121- * 1. "verbose" (boolean, optional, default=false) The account name.
112+ * Arguments: 1. "verbose" (boolean, optional, default=false) The account
113+ * name.
122114 *
123- * Result:
124- * [ (json array of )
125- * "address" (string) an address
126- * or
127- * "address-datails" (object) address details if verbose=true
128- * ,...
129- * ]
115+ * Result: [ (json array of ) "address" (string) an address or
116+ * "address-datails" (object) address details if verbose=true ,... ]
130117 *
131118 * @param verbose
132119 * t verbose to true to get more information about each address,
@@ -141,41 +128,81 @@ protected Object executeGetAddresses(boolean verbose) throws MultichainException
141128 /**
142129 * Returns a list of balances of all addresses in this node’s wallet
143130 *
144- * getmultibalances ("address(es)" assets minconf includeLocked includeWatchonly)
131+ * getmultibalances ("address(es)" assets minconf includeLocked
132+ * includeWatchonly)
145133 *
146134 * Returns asset balances for specified address
147135 *
148- * Arguments:
149- * 1. "address(es)" (string, optional) Address(es) to return balance for, comma delimited. Default - all
150- * or
151- * 1. "address(es)" (array, optional) A json array of addresses to return balance for
152- * 2. "assets" (array, optional) A json array of asset identifiers to return balance for, default - all []
153- * 3. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.
154- * 4. includeWatchonly (bool, optional, default=false) Include transactions to watchonly addresses (see
155- * 'importaddress')
156- * 5. includeLocked (bool, optional, default=false) Also take locked outputs into account
157- * Results are an Object of balance arrays with totals and details for each asset.
136+ * Arguments: 1. "address(es)" (string, optional) Address(es) to return
137+ * balance for, comma delimited. Default - all or 1. "address(es)" (array,
138+ * optional) A json array of addresses to return balance for 2. "assets"
139+ * (array, optional) A json array of asset identifiers to return balance
140+ * for, default - all [] 3. minconf (numeric, optional, default=1) Only
141+ * include transactions confirmed at least this many times. 4.
142+ * includeWatchonly (bool, optional, default=false) Include transactions to
143+ * watchonly addresses (see 'importaddress') 5. includeLocked (bool,
144+ * optional, default=false) Also take locked outputs into account Results
145+ * are an Object of balance arrays with totals and details for each asset.
146+ *
147+ * @return Balances
148+ */
149+ protected Object executeGetMultiBalances (String [] addresses , String [] assets ) throws MultichainException {
150+ MultichainTestParameter .isNotNullOrEmpty ("addresses" , addresses );
151+ MultichainTestParameter .arrayNotContainNullOrEmptyValues ("addresses" , addresses );
152+ MultichainTestParameter .isNotNullOrEmpty ("assets" , assets );
153+ MultichainTestParameter .arrayNotContainNullOrEmptyValues ("assets" , assets );
154+ return execute (CommandEnum .GETMULTIBALANCES , formatJson (addresses ), formatJson (assets ));
155+ }
156+
157+ /**
158+ * Returns a list of balances of all addresses in this node’s wallet
159+ *
160+ * getmultibalances ("address(es)" assets minconf includeLocked
161+ * includeWatchonly)
162+ *
163+ * Returns asset balances for specified address
164+ *
165+ * Arguments: 1. "address(es)" (string, optional) Address(es) to return
166+ * balance for, comma delimited. Default - all or 1. "address(es)" (array,
167+ * optional) A json array of addresses to return balance for 2. "assets"
168+ * (array, optional) A json array of asset identifiers to return balance
169+ * for, default - all [] 3. minconf (numeric, optional, default=1) Only
170+ * include transactions confirmed at least this many times. 4.
171+ * includeWatchonly (bool, optional, default=false) Include transactions to
172+ * watchonly addresses (see 'importaddress') 5. includeLocked (bool,
173+ * optional, default=false) Also take locked outputs into account Results
174+ * are an Object of balance arrays with totals and details for each asset.
158175 *
159176 * @return Balances
160177 */
161178 protected Object executeGetMultiBalances (String [] addresses ) throws MultichainException {
179+ MultichainTestParameter .isNotNullOrEmpty ("addresses" , addresses );
180+ MultichainTestParameter .arrayNotContainNullOrEmptyValues ("addresses" , addresses );
162181 return execute (CommandEnum .GETMULTIBALANCES , formatJson (addresses ));
163182 }
164183
184+ protected Object executeGetMultiBalances (String address ) throws MultichainException {
185+ return execute (CommandEnum .GETMULTIBALANCES , address );
186+ }
187+
188+ protected Object executeGetMultiBalances () throws MultichainException {
189+ return execute (CommandEnum .GETMULTIBALANCES );
190+ }
191+
165192 /**
166193 * getnewaddress ( "account" )
167194 *
168- * Returns a new address for receiving payments.
169- * If 'account' is specified (recommended), it is added to the address book
170- * so payments received with the address will be credited to 'account'.
195+ * Returns a new address for receiving payments. If 'account' is specified
196+ * (recommended), it is added to the address book so payments received with
197+ * the address will be credited to 'account'.
171198 *
172- * Arguments:
173- * 1. "account" (string, optional) The account name for the address to be linked to. if not provided, the default
174- * account "" is used. It can also be set to the empty string "" to represent the default account. The account does
175- * not need to exist, it will be created if there is no account by the given name.
199+ * Arguments: 1. "account" (string, optional) The account name for the
200+ * address to be linked to. if not provided, the default account "" is used.
201+ * It can also be set to the empty string "" to represent the default
202+ * account. The account does not need to exist, it will be created if there
203+ * is no account by the given name.
176204 *
177- * Result:
178- * "address" (string) The new address
205+ * Result: "address" (string) The new address
179206 *
180207 * @return a new address whose private key is added to the wallet.
181208 * @throws MultichainException
@@ -191,12 +218,12 @@ protected Object executeGetNewAddress() throws MultichainException {
191218 *
192219 * importaddress "address" ( "label" rescan )
193220 *
194- * Adds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend.
221+ * Adds an address or script (in hex) that can be watched as if it were in
222+ * your wallet but cannot be used to spend.
195223 *
196- * Arguments:
197- * 1. "address" (string, required) The address
198- * 2. "label" (string, optional, default="") An optional label
199- * 3. rescan (boolean, optional, default=true) Rescan the wallet for transactions
224+ * Arguments: 1. "address" (string, required) The address 2. "label"
225+ * (string, optional, default="") An optional label 3. rescan (boolean,
226+ * optional, default=true) Rescan the wallet for transactions
200227 *
201228 * Note: This call can take minutes to complete if rescan is true.
202229 *
@@ -221,19 +248,16 @@ protected Object executeImportAddress(String address, String label, boolean resc
221248 *
222249 * Return information about the given address.
223250 *
224- * Arguments:
225- * 1. "address" (string, required) The address to validate
226- *
227- * Result:
228- * {
229- * "isvalid" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.
230- * "address" : "address", (string) The address validated
231- * "ismine" : true|false, (boolean) If the address is yours or not
232- * "isscript" : true|false, (boolean) If the key is a script
233- * "pubkey" : "publickeyhex", (string) The hex value of the raw public key
234- * "iscompressed" : true|false, (boolean) If the address is compressed
235- * "account" : "account" (string) The account associated with the address, "" is the default account
236- * }
251+ * Arguments: 1. "address" (string, required) The address to validate
252+ *
253+ * Result: { "isvalid" : true|false, (boolean) If the address is valid or
254+ * not. If not, this is the only property returned. "address" : "address",
255+ * (string) The address validated "ismine" : true|false, (boolean) If the
256+ * address is yours or not "isscript" : true|false, (boolean) If the key is
257+ * a script "pubkey" : "publickeyhex", (string) The hex value of the raw
258+ * public key "iscompressed" : true|false, (boolean) If the address is
259+ * compressed "account" : "account" (string) The account associated with the
260+ * address, "" is the default account }
237261 *
238262 *
239263 * @param address
0 commit comments