@xchainjs/xchain-util
Advanced tools
Comparing version 0.12.0 to 0.13.0
import BigNumber from 'bignumber.js'; | ||
import { Amount, Asset, AssetAmount, BaseAmount, Denomination } from './types'; | ||
export declare type Address = string; | ||
export type Address = string; | ||
/** | ||
@@ -5,0 +5,0 @@ * Guard to check whether value is a BigNumber.Value or not |
export {}; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import BigNumber from 'bignumber.js'; |
export {}; |
@@ -0,0 +0,0 @@ export * from './async'; |
@@ -0,0 +0,0 @@ import BigNumber from 'bignumber.js'; |
@@ -37,3 +37,3 @@ 'use strict'; | ||
*/ | ||
const bn = (value) => new BigNumber__default['default'](value); | ||
const bn = (value) => new BigNumber__default["default"](value); | ||
/** | ||
@@ -126,2 +126,3 @@ * Helper to check whether a BigNumber is valid or not | ||
exports.Denomination = void 0; | ||
(function (Denomination) { | ||
@@ -144,3 +145,3 @@ /** | ||
* */ | ||
const isBigNumberValue = (v) => typeof v === 'string' || typeof v === 'number' || v instanceof BigNumber__default['default']; | ||
const isBigNumberValue = (v) => typeof v === 'string' || typeof v === 'number' || v instanceof BigNumber__default["default"]; | ||
/** | ||
@@ -197,3 +198,3 @@ * Default number of asset decimals | ||
times: (v, d = decimal) => baseAmount(amount.times(isBigNumberValue(v) ? v : v.amount()), d), | ||
div: (v, d = decimal) => baseAmount(amount.div(isBigNumberValue(v) ? v : v.amount()).decimalPlaces(0, BigNumber__default['default'].ROUND_DOWN), d), | ||
div: (v, d = decimal) => baseAmount(amount.div(isBigNumberValue(v) ? v : v.amount()).decimalPlaces(0, BigNumber__default["default"].ROUND_DOWN), d), | ||
lt: (v) => amount.lt(isBigNumberValue(v) ? v : v.amount()), | ||
@@ -363,2 +364,6 @@ lte: (v) => amount.lte(isBigNumberValue(v) ? v : v.amount()), | ||
}; | ||
/** | ||
* Currency symbols currently supported | ||
*/ | ||
exports.AssetCurrencySymbol = void 0; | ||
(function (AssetCurrencySymbol) { | ||
@@ -365,0 +370,0 @@ AssetCurrencySymbol["RUNE"] = "\u16B1"; |
@@ -0,0 +0,0 @@ export declare const XCHAINJS_IDENTIFIER = "xchainjs-client"; |
@@ -0,0 +0,0 @@ /** |
export {}; |
@@ -12,3 +12,3 @@ import BigNumber from 'bignumber.js'; | ||
} | ||
export declare type Amount<T> = T extends Denomination ? { | ||
export type Amount<T> = T extends Denomination ? { | ||
type: T; | ||
@@ -27,3 +27,3 @@ amount: () => BigNumber; | ||
} : never; | ||
export declare type BaseAmount = Amount<Denomination.Base>; | ||
export declare type AssetAmount = Amount<Denomination.Asset>; | ||
export type BaseAmount = Amount<Denomination.Base>; | ||
export type AssetAmount = Amount<Denomination.Asset>; |
import { Chain } from './chain'; | ||
export declare type Asset = { | ||
export type Asset = { | ||
chain: Chain; | ||
@@ -4,0 +4,0 @@ symbol: string; |
@@ -1,1 +0,1 @@ | ||
export declare type Chain = string; | ||
export type Chain = string; |
@@ -1,3 +0,3 @@ | ||
declare type OnlyRequiredKeys<T, U = keyof T> = U extends keyof T ? (undefined extends T[U] ? never : U) : never; | ||
export declare type OnlyRequired<T> = Pick<T, OnlyRequiredKeys<T>>; | ||
type OnlyRequiredKeys<T, U = keyof T> = U extends keyof T ? (undefined extends T[U] ? never : U) : never; | ||
export type OnlyRequired<T> = Pick<T, OnlyRequiredKeys<T>>; | ||
export {}; |
@@ -0,0 +0,0 @@ export * from './amount'; |
{ | ||
"name": "@xchainjs/xchain-util", | ||
"version": "0.12.0", | ||
"version": "0.13.0", | ||
"description": "Helper utilities for XChain clients", | ||
@@ -42,2 +42,2 @@ "keywords": [ | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
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
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
121254
1390
1