Comparing version 0.1.15 to 0.1.16
@@ -13,6 +13,9 @@ import { getElectrumClient } from "./network"; | ||
export const getInputAddress = async (address) => { | ||
let script = bitcoin.address.toOutputScript(address); | ||
let hash = bitcoin.crypto.sha256(script); | ||
export const getInputAddress = async (address, o_options) => { | ||
let options = {} | ||
if(o_options===undefined || o_options.network===undefined) | ||
options.network=bitcoin.networks.bitcoin | ||
else options.network = o_options.network | ||
const script = bitcoin.address.toOutputScript(address,options.network); | ||
const hash = bitcoin.crypto.sha256(script); | ||
let reversedHash = new Buffer.from(hash.reverse()); | ||
@@ -19,0 +22,0 @@ console.log(address, " maps to ", reversedHash.toString("hex")) |
{ | ||
"name": "doichain", | ||
"version": "0.1.15", | ||
"version": "0.1.16", | ||
"description": "A js-Doichain library. The goal is to fully cover the Doichain protocol", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86020
1786