Skip to content

Commit

Permalink
[resolves Polve#46] Add support for address type parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
tdiesler committed Jun 28, 2018
1 parent f899e58 commit 63f1cf5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,11 @@ public String getNewAddress(String account) throws GenericRpcException {
return (String) query("getnewaddress", account);
}

@Override
public String getNewAddress(String account, String addressType) throws GenericRpcException {
return (String) query("getnewaddress", account, addressType);
}

@Override
public List<String> getRawMemPool() throws GenericRpcException {
return (List<String>) query("getrawmempool");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import java.util.List;
import java.util.Map;

import wf.bitcoin.javabitcoindrpcclient.BitcoindRpcClient.TxInput;

/**
*
* @author Mikhail Yevchenko m.ṥῥẚɱ.ѓѐḿởύḙ@azazar.com Small modifications by
Expand Down Expand Up @@ -57,6 +55,7 @@ public static interface TxInput extends Serializable {
public String scriptPubKey();
}

@SuppressWarnings("serial")
public static class BasicTxInput implements TxInput {

public String txid;
Expand Down Expand Up @@ -90,6 +89,7 @@ public String scriptPubKey() {

}

@SuppressWarnings("serial")
public static class ExtendedTxInput extends BasicTxInput {

public String redeemScript;
Expand Down Expand Up @@ -126,6 +126,7 @@ public static interface TxOutput extends Serializable {
public double amount();
}

@SuppressWarnings("serial")
public static class BasicTxOutput implements TxOutput {

public String address;
Expand Down Expand Up @@ -630,6 +631,15 @@ static interface TxOutSetInfo extends Serializable {
*/
String getNewAddress(String account) throws GenericRpcException;

/**
* The getnewaddress RPC returns a new Bitcoin address for receiving payments.
* If an account is specified, payments received with the address will be credited to that account.
* The address type to use. Options are "legacy", "p2sh-segwit", and "bech32".
*
* @see <a href="https://bitcoin.org/en/developer-reference#getnewaddress">getnewaddress</a>
*/
String getNewAddress(String account, String addressType) throws GenericRpcException;

/**
* The getrawmempool RPC returns all transaction identifiers (TXIDs) in the memory pool as a JSON array,
* or detailed information about each transaction in the memory pool as a JSON object.
Expand Down

0 comments on commit 63f1cf5

Please sign in to comment.