@cashscript/utils
Advanced tools
Comparing version 0.10.0-next.4 to 0.10.0-next.5
@@ -29,3 +29,3 @@ export declare const Op: typeof import("@bitauth/libauth").OpcodesBCH2023; | ||
export declare function replaceBytecodeNop(script: Script): Script; | ||
export declare function generateRedeemScript(baseScript: Script, encodedArgs: Script): Script; | ||
export declare function generateRedeemScript(baseScript: Script, encodedConstructorArgs: Script): Script; | ||
export declare function optimiseBytecode(script: Script, runs?: number): Script; |
@@ -68,3 +68,3 @@ import { OpcodesBCH, encodeDataPush, hexToBin, disassembleBytecodeBCH, flattenBinArray, encodeAuthenticationInstructions, decodeAuthenticationInstructions, } from '@bitauth/libauth'; | ||
let asm = disassembleBytecodeBCH(bytecode); | ||
// COnvert libauth's ASM format to BITBOX's | ||
// COnvert libauth's ASM format to BitAuth Script ASM | ||
asm = asm.replace(/OP_PUSHBYTES_[^\s]+/g, ''); | ||
@@ -146,4 +146,4 @@ asm = asm.replace(/OP_PUSHDATA[^\s]+ [^\s]+/g, ''); | ||
} | ||
export function generateRedeemScript(baseScript, encodedArgs) { | ||
return replaceBytecodeNop([...encodedArgs, ...baseScript]); | ||
export function generateRedeemScript(baseScript, encodedConstructorArgs) { | ||
return replaceBytecodeNop([...encodedConstructorArgs.slice().reverse(), ...baseScript]); | ||
} | ||
@@ -150,0 +150,0 @@ export function optimiseBytecode(script, runs = 1000) { |
{ | ||
"name": "@cashscript/utils", | ||
"version": "0.10.0-next.4", | ||
"version": "0.10.0-next.5", | ||
"description": "CashScript utilities and types", | ||
@@ -52,3 +52,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "9105dbcd300aa6a96f8f5297147572a9a79af6c4" | ||
"gitHead": "3d6611410e8c7ed9d760071a8c639e91c2cbb477" | ||
} |
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
44066