diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java index 600599b..cd9ef03 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/Wallet.java @@ -141,6 +141,10 @@ public class Wallet { throw new IllegalStateException("Could not fill nodes to index " + index); } + public Address getAddress(Node node) { + return getAddress(node.getKeyPurpose(), node.getIndex()); + } + public Address getAddress(KeyPurpose keyPurpose, int index) { if(policyType == PolicyType.SINGLE) { Keystore keystore = getKeystores().get(0); @@ -155,6 +159,10 @@ public class Wallet { } } + public Script getOutputScript(Node node) { + return getOutputScript(node.getKeyPurpose(), node.getIndex()); + } + public Script getOutputScript(KeyPurpose keyPurpose, int index) { if(policyType == PolicyType.SINGLE) { Keystore keystore = getKeystores().get(0); @@ -169,6 +177,10 @@ public class Wallet { } } + public String getOutputDescriptor(Node node) { + return getOutputDescriptor(node.getKeyPurpose(), node.getIndex()); + } + public String getOutputDescriptor(KeyPurpose keyPurpose, int index) { if(policyType == PolicyType.SINGLE) { Keystore keystore = getKeystores().get(0); @@ -353,7 +365,7 @@ public class Wallet { } } - public class Node implements Comparable { + public static class Node implements Comparable { private final String derivationPath; private String label; private Long amount; @@ -449,18 +461,6 @@ public class Wallet { this.history = history; } - public Address getAddress() { - return Wallet.this.getAddress(keyPurpose, index); - } - - public Script getOutputScript() { - return Wallet.this.getOutputScript(keyPurpose, index); - } - - public String getOutputDescriptor() { - return Wallet.this.getOutputDescriptor(keyPurpose, index); - } - public void fillToIndex(int index) { for(int i = 0; i <= index; i++) { Node node = new Node(getKeyPurpose(), i);