melis-api-js
Advanced tools
Comparing version 0.11.1 to 0.11.2
@@ -6,3 +6,3 @@ { | ||
"license": "ISC", | ||
"version": "0.11.1", | ||
"version": "0.11.2", | ||
"main": "src/index.js", | ||
@@ -9,0 +9,0 @@ "keywords": [ |
@@ -89,2 +89,13 @@ const Bitcoin = require('bitcoinjs-lib') | ||
function toScriptSignatureLegacy(signature, hashFlags) { | ||
return signature.toScriptSignature(hashFlags) | ||
} | ||
function toScriptSignatureCash(signature, hashFlags) { | ||
const hashTypeBuffer = Buffer.alloc(1) | ||
hashFlags |= SIGHASH_BITCOINCASHBIP143 | ||
hashTypeBuffer.writeUInt8(hashFlags, 0) | ||
return Buffer.concat([signature.toDER(), hashTypeBuffer]) | ||
} | ||
function convertBech32CashAddressToLegacy(address, self) { | ||
@@ -271,2 +282,3 @@ if (C.LEGACY_BITCOIN_REGEX.test(address)) | ||
hashForSignature: hashForSignatureLegacy, | ||
toScriptSignature: toScriptSignatureLegacy, | ||
getAddressBytes: getAddressBytesFromLegacyAddr, | ||
@@ -280,2 +292,3 @@ toOutputScript: toOutputScriptLegacy | ||
hashForSignature: hashForSignatureCash, | ||
toScriptSignature: toScriptSignatureCash, | ||
getAddressBytes: getAddressBytesFromBchAddress, | ||
@@ -282,0 +295,0 @@ toOutputScript: toOutputScriptCash |
Sorry, the diff of this file is too big to display
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
124094
3225