Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

liquidjs-lib

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

liquidjs-lib - npm Package Compare versions

Comparing version 6.0.2-liquid.6 to 6.0.2-liquid.7

2

package.json
{
"name": "liquidjs-lib",
"version": "6.0.2-liquid.6",
"version": "6.0.2-liquid.7",
"description": "Client-side Liquid JavaScript library",

@@ -5,0 +5,0 @@ "main": "./src/index.js",

@@ -31,3 +31,3 @@ /// <reference types="node" />

export declare function tapLeafHash(leaf: TaprootLeaf): Buffer;
export declare function toHashTree(leaves: TaprootLeaf[]): HashTree;
export declare function toHashTree(leaves: TaprootLeaf[], withScriptHex?: boolean): HashTree;
/**

@@ -34,0 +34,0 @@ * Given a MAST tree, it finds the path of a particular hash.

@@ -29,3 +29,3 @@ 'use strict';

// recursively build the Taproot tree from a ScriptTree structure
function toHashTree(leaves) {
function toHashTree(leaves, withScriptHex = false) {
switch (leaves.length) {

@@ -42,2 +42,3 @@ case 0:

hash: tapLeafHash(leaf),
scriptHex: withScriptHex ? leaf.scriptHex : undefined,
};

@@ -47,4 +48,4 @@ default:

const middleIndex = Math.ceil(leaves.length / 2);
const left = toHashTree(leaves.slice(0, middleIndex));
const right = toHashTree(leaves.slice(middleIndex));
const left = toHashTree(leaves.slice(0, middleIndex), withScriptHex);
const right = toHashTree(leaves.slice(middleIndex), withScriptHex);
let leftHash = left.hash;

@@ -51,0 +52,0 @@ let rightHash = right.hash;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc