Socket
Socket
Sign inDemoInstall

@xchainjs/xchain-util

Package Overview
Dependencies
Maintainers
10
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xchainjs/xchain-util - npm Package Compare versions

Comparing version 0.12.0 to 0.13.0

2

lib/asset.d.ts
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

@@ -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 @@ /**

@@ -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

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