mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-27 02:26:44 +00:00
make wallet node static inner class
This commit is contained in:
parent
a32410b538
commit
cc4f70002f
1 changed files with 13 additions and 13 deletions
|
@ -141,6 +141,10 @@ public class Wallet {
|
||||||
throw new IllegalStateException("Could not fill nodes to index " + index);
|
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) {
|
public Address getAddress(KeyPurpose keyPurpose, int index) {
|
||||||
if(policyType == PolicyType.SINGLE) {
|
if(policyType == PolicyType.SINGLE) {
|
||||||
Keystore keystore = getKeystores().get(0);
|
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) {
|
public Script getOutputScript(KeyPurpose keyPurpose, int index) {
|
||||||
if(policyType == PolicyType.SINGLE) {
|
if(policyType == PolicyType.SINGLE) {
|
||||||
Keystore keystore = getKeystores().get(0);
|
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) {
|
public String getOutputDescriptor(KeyPurpose keyPurpose, int index) {
|
||||||
if(policyType == PolicyType.SINGLE) {
|
if(policyType == PolicyType.SINGLE) {
|
||||||
Keystore keystore = getKeystores().get(0);
|
Keystore keystore = getKeystores().get(0);
|
||||||
|
@ -353,7 +365,7 @@ public class Wallet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Node implements Comparable<Node> {
|
public static class Node implements Comparable<Node> {
|
||||||
private final String derivationPath;
|
private final String derivationPath;
|
||||||
private String label;
|
private String label;
|
||||||
private Long amount;
|
private Long amount;
|
||||||
|
@ -449,18 +461,6 @@ public class Wallet {
|
||||||
this.history = history;
|
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) {
|
public void fillToIndex(int index) {
|
||||||
for(int i = 0; i <= index; i++) {
|
for(int i = 0; i <= index; i++) {
|
||||||
Node node = new Node(getKeyPurpose(), i);
|
Node node = new Node(getKeyPurpose(), i);
|
||||||
|
|
Loading…
Reference in a new issue