@waves/data-entities
Advanced tools
Comparing version 1.1.2 to 1.2.0
@@ -11,3 +11,3 @@ import { Asset } from './Asset'; | ||
private _tokens; | ||
constructor(coins: BigNumber, asset: Asset); | ||
constructor(coins: BigNumber | string | number, asset: Asset); | ||
getCoins(): BigNumber; | ||
@@ -33,2 +33,3 @@ getTokens(): BigNumber; | ||
private _matchAssets(money); | ||
static isMoney(object: object): object is Money; | ||
static convert(money: Money, asset: Asset, exchangeRate: BigNumber | string): Money; | ||
@@ -38,3 +39,2 @@ private static _checkAmount(amount); | ||
private static _getDivider(precision); | ||
static isMoney(object: object): object is Money; | ||
} |
@@ -10,3 +10,3 @@ "use strict"; | ||
this.asset = asset; | ||
this._coins = coins; | ||
this._coins = coins instanceof bignumber_1.BigNumber ? coins : new bignumber_1.BigNumber(coins); | ||
this._tokens = this._coins.div(divider); | ||
@@ -94,2 +94,5 @@ } | ||
}; | ||
Money.isMoney = function (object) { | ||
return object instanceof Money; | ||
}; | ||
Money.convert = function (money, asset, exchangeRate) { | ||
@@ -123,5 +126,2 @@ if (money.asset === asset) { | ||
}; | ||
Money.isMoney = function (object) { | ||
return object instanceof Money; | ||
}; | ||
return Money; | ||
@@ -128,0 +128,0 @@ }()); |
@@ -81,3 +81,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.dataEntities = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
this.asset = asset; | ||
this._coins = coins; | ||
this._coins = coins instanceof bignumber_1.BigNumber ? coins : new bignumber_1.BigNumber(coins); | ||
this._tokens = this._coins.div(divider); | ||
@@ -165,2 +165,5 @@ } | ||
}; | ||
Money.isMoney = function (object) { | ||
return object instanceof Money; | ||
}; | ||
Money.convert = function (money, asset, exchangeRate) { | ||
@@ -194,5 +197,2 @@ if (money.asset === asset) { | ||
}; | ||
Money.isMoney = function (object) { | ||
return object instanceof Money; | ||
}; | ||
return Money; | ||
@@ -199,0 +199,0 @@ }()); |
{ | ||
"name": "@waves/data-entities", | ||
"description": "Waves data types", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "private": false, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
33377
0