From e23abf81002243cd9bc110a5ab59b841b2ee5d58 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 9 Jan 2024 14:17:35 +0200 Subject: [PATCH] add new types to ur decode from registry, bump to v1.7.1 --- README.md | 2 +- build.gradle | 2 +- .../com/sparrowwallet/hummingbird/UR.java | 20 +++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a849268..b63fa81 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Hummingbird requires a minimum of Java 8. Hummingbird is hosted in Maven Central and can be added as a dependency with the following: ``` -implementation('com.sparrowwallet:hummingbird:1.7.0') +implementation('com.sparrowwallet:hummingbird:1.7.1') ``` ## Usage diff --git a/build.gradle b/build.gradle index cc6000f..49789a2 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ apply plugin: 'com.bmuschko.nexus' archivesBaseName = 'hummingbird' group 'com.sparrowwallet' -version '1.7.0' +version '1.7.1' repositories { mavenCentral() diff --git a/src/main/java/com/sparrowwallet/hummingbird/UR.java b/src/main/java/com/sparrowwallet/hummingbird/UR.java index dacfdb8..024575b 100644 --- a/src/main/java/com/sparrowwallet/hummingbird/UR.java +++ b/src/main/java/com/sparrowwallet/hummingbird/UR.java @@ -78,6 +78,26 @@ public class UR { return CryptoAccount.fromCbor(item); } else if(registryType == RegistryType.CRYPTO_SSKR) { return CryptoSskr.fromCbor(item); + } else if(registryType == RegistryType.SEED) { + return URSeed.fromCbor(item); + } else if(registryType == RegistryType.HDKEY) { + return URHDKey.fromCbor(item); + } else if(registryType == RegistryType.KEYPATH) { + return URKeypath.fromCbor(item); + } else if(registryType == RegistryType.COIN_INFO) { + return URCoinInfo.fromCbor(item); + } else if(registryType == RegistryType.ECKEY) { + return URECKey.fromCbor(item); + } else if(registryType == RegistryType.ADDRESS) { + return URAddress.fromCbor(item); + } else if(registryType == RegistryType.OUTPUT_DESCRIPTOR) { + return UROutputDescriptor.fromCbor(item); + } else if(registryType == RegistryType.PSBT) { + return URPSBT.fromCbor(item); + } else if(registryType == RegistryType.ACCOUNT_DESCRIPTOR) { + return URAccountDescriptor.fromCbor(item); + } else if(registryType == RegistryType.SSKR) { + return URSSKR.fromCbor(item); } } catch(CborException e) { throw new InvalidCBORException(e.getMessage());