diff --git a/src/main/java/com/sparrowwallet/drongo/OutputDescriptor.java b/src/main/java/com/sparrowwallet/drongo/OutputDescriptor.java index 4857971..292f878 100644 --- a/src/main/java/com/sparrowwallet/drongo/OutputDescriptor.java +++ b/src/main/java/com/sparrowwallet/drongo/OutputDescriptor.java @@ -73,6 +73,10 @@ public class OutputDescriptor { return Collections.unmodifiableSet(extendedPublicKeys.keySet()); } + public Map getExtendedPublicKeysMap() { + return Collections.unmodifiableMap(extendedPublicKeys); + } + public KeyDerivation getKeyDerivation(ExtendedKey extendedPublicKey) { return extendedPublicKeys.get(extendedPublicKey); } @@ -81,6 +85,10 @@ public class OutputDescriptor { return multisigThreshold; } + public Map getChildDerivationsMap() { + return Collections.unmodifiableMap(mapChildrenDerivations); + } + public String getChildDerivationPath(ExtendedKey extendedPublicKey) { return mapChildrenDerivations.get(extendedPublicKey); } @@ -671,4 +679,9 @@ public class OutputDescriptor { public int hashCode() { return toString().hashCode(); } + + public OutputDescriptor copy(boolean includeChildDerivations) { + return new OutputDescriptor(scriptType, multisigThreshold, extendedPublicKeys, + includeChildDerivations ? mapChildrenDerivations : Collections.emptyMap(), mapExtendedPublicKeyLabels, extendedMasterPrivateKeys); + } }