Socket
Socket
Sign inDemoInstall

@bitaccess/coinlib-common

Package Overview
Dependencies
Maintainers
23
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bitaccess/coinlib-common - npm Package Compare versions

Comparing version 7.0.0 to 7.0.1

14

dist/index.cjs.js

@@ -476,10 +476,14 @@ 'use strict';

function deriveHDNode(hdKey, derivationPath, network) {
const rootNode = typeof hdKey === 'string'
const baseNode = typeof hdKey === 'string'
? hdKeyToHdNode(hdKey, network)
: hdKey;
const parts = splitDerivationPath(derivationPath).slice(rootNode.depth);
let node = rootNode;
if (parts.length > 0) {
node = rootNode.derivePath(parts.join('/'));
const fullPathParts = splitDerivationPath(derivationPath);
if (baseNode.depth > fullPathParts.length) {
throw new Error(`Cannot deriveHDNode to path ${derivationPath} because hdKey depth (${baseNode.depth}) is already deeper`);
}
const partialPathParts = fullPathParts.slice(baseNode.depth);
let node = baseNode;
if (partialPathParts.length > 0) {
node = baseNode.derivePath(partialPathParts.join('/'));
}
return node;

@@ -486,0 +490,0 @@ }

@@ -450,10 +450,14 @@ import * as t from 'io-ts';

function deriveHDNode(hdKey, derivationPath, network) {
const rootNode = typeof hdKey === 'string'
const baseNode = typeof hdKey === 'string'
? hdKeyToHdNode(hdKey, network)
: hdKey;
const parts = splitDerivationPath(derivationPath).slice(rootNode.depth);
let node = rootNode;
if (parts.length > 0) {
node = rootNode.derivePath(parts.join('/'));
const fullPathParts = splitDerivationPath(derivationPath);
if (baseNode.depth > fullPathParts.length) {
throw new Error(`Cannot deriveHDNode to path ${derivationPath} because hdKey depth (${baseNode.depth}) is already deeper`);
}
const partialPathParts = fullPathParts.slice(baseNode.depth);
let node = baseNode;
if (partialPathParts.length > 0) {
node = baseNode.derivePath(partialPathParts.join('/'));
}
return node;

@@ -460,0 +464,0 @@ }

@@ -469,10 +469,14 @@ (function (global, factory) {

function deriveHDNode(hdKey, derivationPath, network) {
const rootNode = typeof hdKey === 'string'
const baseNode = typeof hdKey === 'string'
? hdKeyToHdNode(hdKey, network)
: hdKey;
const parts = splitDerivationPath(derivationPath).slice(rootNode.depth);
let node = rootNode;
if (parts.length > 0) {
node = rootNode.derivePath(parts.join('/'));
const fullPathParts = splitDerivationPath(derivationPath);
if (baseNode.depth > fullPathParts.length) {
throw new Error(`Cannot deriveHDNode to path ${derivationPath} because hdKey depth (${baseNode.depth}) is already deeper`);
}
const partialPathParts = fullPathParts.slice(baseNode.depth);
let node = baseNode;
if (partialPathParts.length > 0) {
node = baseNode.derivePath(partialPathParts.join('/'));
}
return node;

@@ -479,0 +483,0 @@ }

@@ -48,10 +48,14 @@ import crypto from 'crypto';

export function deriveHDNode(hdKey, derivationPath, network) {
const rootNode = typeof hdKey === 'string'
const baseNode = typeof hdKey === 'string'
? hdKeyToHdNode(hdKey, network)
: hdKey;
const parts = splitDerivationPath(derivationPath).slice(rootNode.depth);
let node = rootNode;
if (parts.length > 0) {
node = rootNode.derivePath(parts.join('/'));
const fullPathParts = splitDerivationPath(derivationPath);
if (baseNode.depth > fullPathParts.length) {
throw new Error(`Cannot deriveHDNode to path ${derivationPath} because hdKey depth (${baseNode.depth}) is already deeper`);
}
const partialPathParts = fullPathParts.slice(baseNode.depth);
let node = baseNode;
if (partialPathParts.length > 0) {
node = baseNode.derivePath(partialPathParts.join('/'));
}
return node;

@@ -58,0 +62,0 @@ }

{
"name": "@bitaccess/coinlib-common",
"version": "7.0.0",
"version": "7.0.1",
"description": "Common module used by coinlib",

@@ -47,3 +47,2 @@ "main": "dist/index.cjs.js",

"@bitaccess/ts-common": "^1.0.2",
"@faast/ts-common": "^0.6.0",
"bip32": "^3.0.1",

@@ -56,3 +55,3 @@ "bip39": "^3.0.4",

},
"gitHead": "98fed792eebe30aadf3f421f0cf3e720350d6e01"
"gitHead": "c6846f6d5b498ac229506fa46513592928e7452f"
}

@@ -69,10 +69,16 @@ import crypto from 'crypto'

export function deriveHDNode(hdKey: string | HDNode, derivationPath: string, network?: Bip32Network): HDNode {
const rootNode = typeof hdKey === 'string'
const baseNode = typeof hdKey === 'string'
? hdKeyToHdNode(hdKey, network)
: hdKey
const parts = splitDerivationPath(derivationPath).slice(rootNode.depth)
let node = rootNode
if (parts.length > 0) {
node = rootNode.derivePath(parts.join('/'))
const fullPathParts = splitDerivationPath(derivationPath)
if (baseNode.depth > fullPathParts.length) {
throw new Error(
`Cannot deriveHDNode to path ${derivationPath} because hdKey depth (${baseNode.depth}) is already deeper`
)
}
const partialPathParts = fullPathParts.slice(baseNode.depth)
let node = baseNode
if (partialPathParts.length > 0) {
node = baseNode.derivePath(partialPathParts.join('/'))
}
return node

@@ -79,0 +85,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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