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

@defichain/jellyfish-transaction

Package Overview
Dependencies
Maintainers
2
Versions
293
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@defichain/jellyfish-transaction - npm Package Compare versions

Comparing version 0.29.1 to 0.30.0

1

dist/buffer/buffer_bignumber.d.ts
import BigNumber from 'bignumber.js';
import { SmartBuffer } from 'smart-buffer';
export declare const ONE_HUNDRED_MILLION: BigNumber;
export declare const MAX_INT64: BigNumber;
/**

@@ -5,0 +6,0 @@ * @param {SmartBuffer} buffer to read as unsigned BigNumber (LE)

3

dist/buffer/buffer_bignumber.js

@@ -6,5 +6,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.writeBigNumberUInt64 = exports.readBigNumberUInt64 = exports.ONE_HUNDRED_MILLION = void 0;
exports.writeBigNumberUInt64 = exports.readBigNumberUInt64 = exports.MAX_INT64 = exports.ONE_HUNDRED_MILLION = void 0;
const bignumber_js_1 = __importDefault(require("bignumber.js"));
exports.ONE_HUNDRED_MILLION = new bignumber_js_1.default('100000000');
exports.MAX_INT64 = new bignumber_js_1.default('9223372036854775807');
/**

@@ -11,0 +12,0 @@ * @param {SmartBuffer} buffer to read as unsigned BigNumber (LE)

@@ -493,6 +493,14 @@ "use strict";

const fraction = buffer_bignumber_1.readBigNumberUInt64(buffer);
if (fraction.gt(new bignumber_js_1.default('99999999'))) {
// NOTE(canonbrother): max price default value is max int64 (9223372036854775807)
// https://github.com/DeFiCh/ain/blob/aed00d09075094a3a0cedebde5248c006216ba09/src/masternodes/rpc_poolpair.cpp#L115-L123
if (fraction.gt(new bignumber_js_1.default('99999999')) && !fraction.eq(buffer_bignumber_1.MAX_INT64)) {
throw new Error('Too many decimals read from buffer. Will lose precision with more than 8 decimals');
}
setter(integer.plus(fraction.dividedBy(buffer_bignumber_1.ONE_HUNDRED_MILLION)));
if (integer.eq(buffer_bignumber_1.MAX_INT64) && fraction.eq(buffer_bignumber_1.MAX_INT64)) {
setter(integer);
setter(fraction);
}
else {
setter(integer.plus(fraction.dividedBy(buffer_bignumber_1.ONE_HUNDRED_MILLION)));
}
},

@@ -503,8 +511,13 @@ toBuffer: (buffer) => {

}
const n = getter()
.multipliedBy(buffer_bignumber_1.ONE_HUNDRED_MILLION);
const fraction = n.mod(buffer_bignumber_1.ONE_HUNDRED_MILLION);
const integer = n.minus(fraction).dividedBy(buffer_bignumber_1.ONE_HUNDRED_MILLION);
buffer_bignumber_1.writeBigNumberUInt64(integer, buffer);
buffer_bignumber_1.writeBigNumberUInt64(fraction, buffer);
if (getter().eq(buffer_bignumber_1.MAX_INT64)) {
buffer_bignumber_1.writeBigNumberUInt64(getter(), buffer);
buffer_bignumber_1.writeBigNumberUInt64(getter(), buffer);
}
else {
const n = getter().multipliedBy(buffer_bignumber_1.ONE_HUNDRED_MILLION);
const fraction = n.mod(buffer_bignumber_1.ONE_HUNDRED_MILLION);
const integer = n.minus(fraction).dividedBy(buffer_bignumber_1.ONE_HUNDRED_MILLION);
buffer_bignumber_1.writeBigNumberUInt64(integer, buffer);
buffer_bignumber_1.writeBigNumberUInt64(fraction, buffer);
}
}

@@ -511,0 +524,0 @@ };

{
"private": false,
"name": "@defichain/jellyfish-transaction",
"version": "0.29.1",
"version": "0.30.0",
"description": "A collection of TypeScript + JavaScript tools and libraries for DeFi Blockchain developers to build decentralized finance on Bitcoin",

@@ -41,5 +41,5 @@ "keywords": [

"dependencies": {
"@defichain/jellyfish-crypto": "^0.29.1",
"@defichain/jellyfish-crypto": "^0.30.0",
"smart-buffer": "^4.1.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