Socket
Socket
Sign inDemoInstall

@cosmjs/math

Package Overview
Dependencies
Maintainers
1
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cosmjs/math - npm Package Compare versions

Comparing version 0.22.3 to 0.23.0-alpha.0

9

build/decimal.js

@@ -131,2 +131,11 @@ "use strict";

}
/**
* a.multiply(b) returns a*b.
*
* We only allow multiplication by unsigned integers to avoid rounding errors.
*/
multiply(b) {
const product = this.data.atomics.mul(new bn_js_1.default(b.toString()));
return new Decimal(product.toString(), this.fractionalDigits);
}
equals(b) {

@@ -133,0 +142,0 @@ return Decimal.compare(this, b) === 0;

8

package.json
{
"name": "@cosmjs/math",
"version": "0.22.3",
"version": "0.23.0-alpha.0",
"description": "Math helpers for blockchain projects",

@@ -40,3 +40,5 @@ "contributors": [

"format-types": "prettier --write --loglevel warn \"./types/**/*.d.ts\"",
"build": "shx rm -rf ./build && tsc && yarn move-types && yarn format-types",
"prebuild": "shx rm -rf ./build",
"build": "tsc",
"postbuild": "yarn move-types && yarn format-types",
"build-or-skip": "[ -n \"$SKIP_BUILD\" ] || yarn build",

@@ -51,3 +53,3 @@ "pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js"

},
"gitHead": "ee205cc5f7b1154f2e8a5149092b19c82672b951"
"gitHead": "5e79100fe341f7f745d28d8d4616912e2122e1ed"
}

@@ -0,1 +1,2 @@

import { Uint32, Uint53, Uint64 } from "./integers";
/**

@@ -34,2 +35,8 @@ * A type for arbitrary precision, non-negative decimals.

minus(b: Decimal): Decimal;
/**
* a.multiply(b) returns a*b.
*
* We only allow multiplication by unsigned integers to avoid rounding errors.
*/
multiply(b: Uint32 | Uint53 | Uint64): Decimal;
equals(b: Decimal): boolean;

@@ -36,0 +43,0 @@ isLessThan(b: Decimal): boolean;

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