From 9388885047cc561de67e935c80d1bdc8f986ce91 Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 16 Jan 2023 09:17:32 -0600 Subject: [PATCH] add optional prefix param to address to script conversion --- lib/utilities/address_utils.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/utilities/address_utils.dart b/lib/utilities/address_utils.dart index a6cbb8b58..c5c4ae39b 100644 --- a/lib/utilities/address_utils.dart +++ b/lib/utilities/address_utils.dart @@ -20,9 +20,14 @@ class AddressUtils { /// attempts to convert a string to a valid scripthash /// /// Returns the scripthash or throws an exception on invalid firo address - static String convertToScriptHash(String address, NetworkType network) { + static String convertToScriptHash( + String address, + NetworkType network, [ + String overridePrefix = "", + ]) { try { - final output = Address.addressToOutputScript(address, network); + final output = + Address.addressToOutputScript(address, network, overridePrefix); final hash = sha256.convert(output.toList(growable: false)).toString(); final chars = hash.split("");