@uniswap/conedison
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -13,3 +13,4 @@ import { Currency, CurrencyAmount, Percent, Price } from '@uniswap/sdk-core'; | ||
NFTTokenFloorPrice = "nft-token-floor-price", | ||
NFTCollectionStats = "nft-collection-stats" | ||
NFTCollectionStats = "nft-collection-stats", | ||
NFTTokenFloorPriceTrailingZeros = "nft-token-floor-price-trailing-zeros" | ||
} | ||
@@ -16,0 +17,0 @@ export declare function formatNumber(input: Nullish<number>, type?: NumberType, placeholder?: string): string; |
@@ -29,2 +29,6 @@ var __read = (this && this.__read) || function (o, n) { | ||
// https://www.notion.so/uniswaplabs/Number-standards-fbb9f533f10e4e22820722c2f66d23c0 | ||
var FIVE_DECIMALS_NO_TRAILING_ZEROS = new Intl.NumberFormat('en-US', { | ||
notation: 'standard', | ||
maximumFractionDigits: 5, | ||
}); | ||
var FIVE_DECIMALS_MAX_TWO_DECIMALS_MIN = new Intl.NumberFormat('en-US', { | ||
@@ -41,5 +45,5 @@ notation: 'standard', | ||
}); | ||
var NO_DECIMALS = new Intl.NumberFormat('en-US', { | ||
var THREE_DECIMALS_NO_TRAILING_ZEROS = new Intl.NumberFormat('en-US', { | ||
notation: 'standard', | ||
maximumFractionDigits: 0, | ||
maximumFractionDigits: 3, | ||
minimumFractionDigits: 0, | ||
@@ -59,2 +63,6 @@ }); | ||
}); | ||
var TWO_DECIMALS_NO_TRAILING_ZEROS = new Intl.NumberFormat('en-US', { | ||
notation: 'standard', | ||
maximumFractionDigits: 2, | ||
}); | ||
var TWO_DECIMALS = new Intl.NumberFormat('en-US', { | ||
@@ -72,7 +80,2 @@ notation: 'standard', | ||
}); | ||
var SHORTHAND_ONE_DECIMAL = new Intl.NumberFormat('en-US', { | ||
notation: 'compact', | ||
minimumFractionDigits: 1, | ||
maximumFractionDigits: 1, | ||
}); | ||
var SHORTHAND_TWO_DECIMALS = new Intl.NumberFormat('en-US', { | ||
@@ -83,2 +86,10 @@ notation: 'compact', | ||
}); | ||
var SHORTHAND_TWO_DECIMALS_NO_TRAILING_ZEROS = new Intl.NumberFormat('en-US', { | ||
notation: 'compact', | ||
maximumFractionDigits: 2, | ||
}); | ||
var SHORTHAND_FIVE_DECIMALS_NO_TRAILING_ZEROS = new Intl.NumberFormat('en-US', { | ||
notation: 'compact', | ||
maximumFractionDigits: 5, | ||
}); | ||
var SHORTHAND_USD_TWO_DECIMALS = new Intl.NumberFormat('en-US', { | ||
@@ -102,2 +113,6 @@ notation: 'compact', | ||
}); | ||
var SCIENTIFIC_SIX_DIGITS = new Intl.NumberFormat('en-US', { | ||
notation: 'scientific', | ||
maximumSignificantDigits: 6, | ||
}); | ||
var SCIENTIFIC_USD = new Intl.NumberFormat('en-US', { | ||
@@ -186,3 +201,3 @@ notation: 'scientific', | ||
var fiatTokenQuantityFormatter = __spreadArray([{ exact: 0, formatter: '$0.00' }], __read(fiatGasPriceFormatter), false); | ||
var ntfTokenFloorPriceFormatter = [ | ||
var ntfTokenFloorPriceFormatterTrailingZeros = [ | ||
{ exact: 0, formatter: '0' }, | ||
@@ -195,5 +210,17 @@ { upperBound: 0.001, formatter: '<0.001' }, | ||
]; | ||
var ntfTokenFloorPriceFormatter = [ | ||
{ exact: 0, formatter: '0' }, | ||
{ upperBound: 0.001, formatter: '<0.001' }, | ||
{ upperBound: 1, formatter: THREE_DECIMALS_NO_TRAILING_ZEROS }, | ||
{ upperBound: 1000, formatter: TWO_DECIMALS_NO_TRAILING_ZEROS }, | ||
{ upperBound: 1e15, formatter: SHORTHAND_TWO_DECIMALS_NO_TRAILING_ZEROS }, | ||
{ upperBound: Infinity, formatter: SCIENTIFIC }, | ||
]; | ||
var ntfCollectionStatsFormatter = [ | ||
{ upperBound: 1000, formatter: NO_DECIMALS }, | ||
{ upperBound: Infinity, formatter: SHORTHAND_ONE_DECIMAL }, | ||
{ exact: 0, formatter: '0' }, | ||
{ upperBound: 0.00001, formatter: '<0.00001' }, | ||
{ upperBound: 1, formatter: FIVE_DECIMALS_NO_TRAILING_ZEROS }, | ||
{ upperBound: 1e6, formatter: SIX_SIG_FIGS_NO_COMMAS }, | ||
{ upperBound: 1e15, formatter: SHORTHAND_FIVE_DECIMALS_NO_TRAILING_ZEROS }, | ||
{ upperBound: Infinity, formatter: SCIENTIFIC_SIX_DIGITS }, | ||
]; | ||
@@ -223,2 +250,4 @@ export var NumberType; | ||
NumberType["NFTCollectionStats"] = "nft-collection-stats"; | ||
// nft floor price with trailing zeros | ||
NumberType["NFTTokenFloorPriceTrailingZeros"] = "nft-token-floor-price-trailing-zeros"; | ||
})(NumberType || (NumberType = {})); | ||
@@ -235,2 +264,3 @@ var TYPE_TO_FORMATTER_RULES = (_a = {}, | ||
_a[NumberType.NFTTokenFloorPrice] = ntfTokenFloorPriceFormatter, | ||
_a[NumberType.NFTTokenFloorPriceTrailingZeros] = ntfTokenFloorPriceFormatterTrailingZeros, | ||
_a[NumberType.NFTCollectionStats] = ntfCollectionStatsFormatter, | ||
@@ -237,0 +267,0 @@ _a); |
{ | ||
"name": "@uniswap/conedison", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Utilities for Uniswap front-end development", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/Uniswap/conedison", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
16571
351
0