Socket
Socket
Sign inDemoInstall

liquidjs-lib

Package Overview
Dependencies
Maintainers
3
Versions
52
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.27 to 6.0.2-liquid.31

test/ts-node-register.js

10

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

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

"@types/randombytes": "^2.0.0",
"@types/wif": "^2.0.2",
"axios": "^0.21.1",
"bech32": "^2.0.0",
"bip174-liquid": "^1.0.3",
"bip66": "^1.1.0",
"bitcoin-ops": "^1.4.0",
"bitcoinjs-lib": "^6.0.2",

@@ -64,7 +61,6 @@ "bitset": "^5.1.1",

"create-hash": "^1.2.0",
"ecpair": "^2.0.1",
"ecpair": "^2.1.0",
"slip77": "^0.2.0",
"typeforce": "^1.11.3",
"varuint-bitcoin": "^1.1.2",
"wif": "^2.0.1"
"varuint-bitcoin": "^1.1.2"
},

@@ -71,0 +67,0 @@ "devDependencies": {

# LiquidJS
[![Build Status](https://travis-ci.org/vulpemventures/liquidjs-lib.svg?branch=master)](https://travis-ci.org/vulpemventures/liquidjs-lib)
![Build & Test](https://github.com/vulpemventures/liquidjs-lib/actions/workflows/ci.yml/badge.svg)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

@@ -6,0 +5,0 @@

/// <reference types="node" />
import type { Ecc as Secp256k1Interface } from './secp256k1-zkp';
import { TinySecp256k1Interface } from 'ecpair';
export interface BIP341Secp256k1Interface extends TinySecp256k1Interface {
privateSub(d: Uint8Array, tweak: Uint8Array): Uint8Array | null;
signSchnorr(h: Uint8Array, d: Uint8Array, e?: Uint8Array): Uint8Array;
verifySchnorr(h: Uint8Array, Q: Uint8Array, signature: Uint8Array): boolean;
}
export declare const LEAF_VERSION_TAPSCRIPT = 196;

@@ -13,3 +18,3 @@ export interface XOnlyPointAddTweakResult {

}
export declare function BIP341Factory(ecc: Secp256k1Interface): BIP341API;
export declare function BIP341Factory(ecc: BIP341Secp256k1Interface): BIP341API;
export interface TaprootLeaf {

@@ -16,0 +21,0 @@ scriptHex: string;

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

const parityBit = Buffer.of(
leaf.version || exports.LEAF_VERSION_TAPSCRIPT + parity,
(leaf.version || exports.LEAF_VERSION_TAPSCRIPT) + parity,
);

@@ -126,0 +126,0 @@ const control = Buffer.concat([

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

import { Psbt as PsbtBase } from 'bip174-liquid';
import { Ecc as TinySecp256k1Interface } from './secp256k1-zkp';
import { TinySecp256k1Interface } from 'ecpair';
export interface AddIssuanceArgs {

@@ -12,0 +12,0 @@ assetSats: number;

@@ -717,4 +717,8 @@ 'use strict';

return (
(this.finalScriptSig && this.finalScriptSig.length > 0) ||
(this.finalScriptWitness && this.finalScriptWitness.length > 0)
(this.finalScriptSig &&
this.finalScriptSig.length > 0 &&
!Buffer.alloc(1).equals(this.finalScriptSig)) ||
(this.finalScriptWitness &&
this.finalScriptWitness.length > 0 &&
!Buffer.alloc(1).equals(this.finalScriptWitness))
);

@@ -721,0 +725,0 @@ }

/// <reference types="node" />
import type { Ecc as Secp256k1Interface } from '../secp256k1-zkp';
import { Transaction } from '../transaction';

@@ -15,8 +14,17 @@ import { PsetGlobal } from './globals';

};
export interface KeysGeneratorSecp256k1Interface {
pointFromScalar(privateKey: Uint8Array, compressed?: boolean): Uint8Array | null;
}
export interface ECDSAVerifier {
verify(h: Uint8Array, Q: Uint8Array, signature: Uint8Array, strict?: boolean): boolean;
}
export interface SchnorrVerifier {
verifySchnorr: (msghash: Buffer, pubkey: Uint8Array, signature: Uint8Array, extra?: Uint8Array) => boolean;
}
export declare class Pset {
static fromBase64(data: string): Pset;
static fromBuffer(buf: Buffer): Pset;
static ECCKeysGenerator(ec: Secp256k1Interface): KeysGenerator;
static ECDSASigValidator(ecc: Secp256k1Interface): ValidateSigFunction;
static SchnorrSigValidator(ecc: Secp256k1Interface): ValidateSigFunction;
static ECCKeysGenerator(ecc: KeysGeneratorSecp256k1Interface): KeysGenerator;
static ECDSASigValidator(ecc: ECDSAVerifier): ValidateSigFunction;
static SchnorrSigValidator(ecc: SchnorrVerifier): ValidateSigFunction;
inputs: PsetInput[];

@@ -23,0 +31,0 @@ outputs: PsetOutput[];

@@ -48,3 +48,2 @@ 'use strict';

exports.Pset = exports.magicPrefixWithSeparator = exports.magicPrefix = void 0;
const ecpair_1 = require('ecpair');
const bufferutils_1 = require('../bufferutils');

@@ -99,11 +98,10 @@ const crypto_1 = require('../crypto');

}
static ECCKeysGenerator(ec) {
static ECCKeysGenerator(ecc) {
return (opts) => {
const privateKey = (0, utils_1.randomBytes)(opts);
const publicKey = (0, ecpair_1.ECPairFactory)(ec).fromPrivateKey(
privateKey,
).publicKey;
const publicKey = ecc.pointFromScalar(privateKey);
if (!publicKey) throw new Error('Failed to generate public key');
return {
privateKey,
publicKey,
publicKey: Buffer.from(publicKey),
};

@@ -114,5 +112,3 @@ };

return (pubkey, msghash, signature) => {
return (0, ecpair_1.ECPairFactory)(ecc)
.fromPublicKey(pubkey)
.verify(msghash, signature);
return ecc.verify(msghash, pubkey, signature);
};

@@ -119,0 +115,0 @@ }

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