From e9490c8b672fe68961495efbeddbb58e8ccae3f3 Mon Sep 17 00:00:00 2001 From: tripathyr Date: Mon, 10 Oct 2022 17:35:36 +0530 Subject: [PATCH] exposing encoding and decoding bech32 --- lib_btc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_btc.js b/lib_btc.js index 0df142b..c18e1bb 100644 --- a/lib_btc.js +++ b/lib_btc.js @@ -2873,7 +2873,7 @@ return coinjs.base58encode(bytes.concat(checksum)); } - function decodeBech32(source) { + decodeBech32 = btc_api.decodeBech32 = function (source) { let decode = coinjs.bech32_decode(source); if (!decode) return null; @@ -2887,7 +2887,7 @@ } } - function encodeBech32(hex, version, hrp) { + encodeBech32 = btc_api.encodeBech32 = function (hex, version, hrp) { var bytes = Crypto.util.hexToBytes(hex); bytes = coinjs.bech32_convert(bytes, 8, 5, true); bytes.unshift(version)