Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@makerdao/currency

Package Overview
Dependencies
Maintainers
18
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@makerdao/currency - npm Package Compare versions

Comparing version 0.9.3 to 0.9.5

3

dist/Currency.js

@@ -176,2 +176,5 @@ 'use strict';

if (!(right instanceof Currency) || left.isSameType(right)) {
if (left instanceof CurrencyRatio) {
return new left.constructor(value, left.numerator, left.denominator, left.shift);
}
return new left.constructor(value);

@@ -178,0 +181,0 @@ }

{
"name": "@makerdao/currency",
"description": "Utilities for working with currency amounts",
"version": "0.9.3",
"version": "0.9.5",
"license": "MIT",

@@ -11,2 +11,10 @@ "main": "dist/index.js",

},
"files": [
"package.json",
"README.md",
"LICENSE",
"src/**/*.js",
"dist/**/*.js",
"test/**/*.js"
],
"devDependencies": {

@@ -13,0 +21,0 @@ "babel-cli": "^6.26.0",

2

README.md
# @makerdao/currency
A set of utilities for working with currencies on Ethereum, extracted from
[dai.js](https://github.com/makerdao/dai.js).
[dai.js](https://github.com/makerdao/dai.js). Available as an [NPM module](https://www.npmjs.com/package/@makerdao/currency).
Check out the test file to see how this is used.

@@ -106,3 +106,3 @@ import BigNumber from 'bignumber.js';

case 'div':
return;
return;
}

@@ -125,2 +125,10 @@ }

if (!(right instanceof Currency) || left.isSameType(right)) {
if (left instanceof CurrencyRatio) {
return new left.constructor(
value,
left.numerator,
left.denominator,
left.shift
);
}
return new left.constructor(value);

@@ -127,0 +135,0 @@ }

@@ -126,2 +126,7 @@ import {

test('basic math with ratios', () => {
const val = USD_DAI(10);
expect(val.times(10)).toEqual(USD_DAI(100));
});
test('instanceof Currency', () => {

@@ -128,0 +133,0 @@ expect(ETH(5) instanceof Currency).toBeTruthy();

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