New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@stacks/storage

Package Overview
Dependencies
Maintainers
9
Versions
661
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stacks/storage - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2-beta.0

6

dist/esm/hub.js
import { BadPathError, Buffer, ConflictError, DoesNotExist, fetchPrivate, Logger, megabytesToBytes, NotEnoughProofError, PayloadTooLargeError, PreconditionFailedError, ValidationError, } from '@stacks/common';
import { compressPrivateKey, ecSign, getPublicKeyFromPrivate, hashSha256Sync, publicKeyToAddress, randomBytes, } from '@stacks/encryption';
import { script, Transaction } from 'bitcoinjs-lib';
import { compressPrivateKey, ecSign, getPublicKeyFromPrivate, hashSha256Sync, publicKeyToAddress, randomBytes, Signature, } from '@stacks/encryption';
import { TokenSigner } from 'jsontokens';

@@ -57,4 +56,3 @@ export const BLOCKSTACK_GAIA_HUB_LABEL = 'blockstack-gaia-hub-config';

const signatureBuffer = ecSign(digest, compressPrivateKey(signerKeyHex));
const signatureWithHash = script.signature.encode(signatureBuffer, Transaction.SIGHASH_NONE);
const signature = signatureWithHash.toString('hex').slice(0, -2);
const signature = Signature.fromCompact(signatureBuffer.toString('hex')).toDERHex();
const publickey = getPublicKeyFromPrivate(signerKeyHex);

@@ -61,0 +59,0 @@ const token = Buffer.from(JSON.stringify({ publickey, signature })).toString('base64');

@@ -6,3 +6,2 @@ "use strict";

const encryption_1 = require("@stacks/encryption");
const bitcoinjs_lib_1 = require("bitcoinjs-lib");
const jsontokens_1 = require("jsontokens");

@@ -64,4 +63,3 @@ exports.BLOCKSTACK_GAIA_HUB_LABEL = 'blockstack-gaia-hub-config';

const signatureBuffer = (0, encryption_1.ecSign)(digest, (0, encryption_1.compressPrivateKey)(signerKeyHex));
const signatureWithHash = bitcoinjs_lib_1.script.signature.encode(signatureBuffer, bitcoinjs_lib_1.Transaction.SIGHASH_NONE);
const signature = signatureWithHash.toString('hex').slice(0, -2);
const signature = encryption_1.Signature.fromCompact(signatureBuffer.toString('hex')).toDERHex();
const publickey = (0, encryption_1.getPublicKeyFromPrivate)(signerKeyHex);

@@ -68,0 +66,0 @@ const token = common_1.Buffer.from(JSON.stringify({ publickey, signature })).toString('base64');

{
"name": "@stacks/storage",
"version": "4.0.1",
"version": "4.0.2-beta.0",
"description": "Stacks storage library",

@@ -35,6 +35,5 @@ "author": "yknl <yukanliao@gmail.com>",

"dependencies": {
"@stacks/auth": "^4.0.0",
"@stacks/auth": "^4.0.2-beta.0",
"@stacks/common": "^4.0.1",
"@stacks/encryption": "^4.0.1",
"bitcoinjs-lib": "^5.2.0",
"@stacks/encryption": "^4.0.2-beta.0",
"jsontokens": "^3.0.0"

@@ -66,3 +65,3 @@ },

"unpkg": "dist/umd/index.js",
"gitHead": "2add622be6429d5d73559af12872eab0fb66b996"
"gitHead": "f578a0d9f8e7afe9836c2ad48acd34951e30cf7d"
}

@@ -22,4 +22,4 @@ import {

randomBytes,
Signature,
} from '@stacks/encryption';
import { script, Transaction } from 'bitcoinjs-lib';
import { TokenSigner } from 'jsontokens';

@@ -155,8 +155,5 @@

const signatureBuffer = ecSign(digest, compressPrivateKey(signerKeyHex));
const signatureWithHash = script.signature.encode(signatureBuffer, Transaction.SIGHASH_NONE);
// We only want the DER encoding so use toDERHex provided by @noble/secp256k1
const signature = Signature.fromCompact(signatureBuffer.toString('hex')).toDERHex();
// We only want the DER encoding so remove the sighash version byte at the end.
// See: https://github.com/bitcoinjs/bitcoinjs-lib/issues/1241#issuecomment-428062912
const signature = signatureWithHash.toString('hex').slice(0, -2);
const publickey = getPublicKeyFromPrivate(signerKeyHex);

@@ -163,0 +160,0 @@ const token = Buffer.from(JSON.stringify({ publickey, signature })).toString('base64');

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 too big to display

Sorry, the diff of this file is too big to display

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