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

@injectivelabs/utils

Package Overview
Dependencies
Maintainers
10
Versions
309
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@injectivelabs/utils - npm Package Compare versions

Comparing version 0.0.63 to 0.0.64

2

dist/helpers.d.ts

@@ -0,3 +1,5 @@

import { Web3GatewayMessage } from '@injectivelabs/ts-types';
export declare const sleep: (timeout: number) => Promise<void>;
export declare const isServerSide: () => boolean;
export declare const getWeb3GatewayMessage: <T>(message: T, type: string) => Web3GatewayMessage<T>;
//# sourceMappingURL=helpers.d.ts.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isServerSide = exports.sleep = void 0;
exports.getWeb3GatewayMessage = exports.isServerSide = exports.sleep = void 0;
const snakecase_keys_1 = __importDefault(require("snakecase-keys"));
const sleep = (timeout) => new Promise((resolve) => setTimeout(resolve, timeout));

@@ -8,2 +12,4 @@ exports.sleep = sleep;

exports.isServerSide = isServerSide;
const getWeb3GatewayMessage = (message, type) => (Object.assign(Object.assign({}, (0, snakecase_keys_1.default)(message)), { '@type': type }));
exports.getWeb3GatewayMessage = getWeb3GatewayMessage;
//# sourceMappingURL=helpers.js.map

@@ -18,2 +18,10 @@ import { BigNumber } from './classes';

/**
* On chain amounts (based on the cosmosSdk.Dec type)
* broadcasted to a sentry directly using the
* gRPC API should be passed with an extra decimal point
* 18 places from the beginning (i.e multiplied by 1e18), so we need to add it
* to get a workable amount
*/
export declare const amountToCosmosSdkDecAmount: (value: string | number | BigNumber) => BigNumber;
/**
* Amount that the chain requires is in the x * 10^(quoteDecimals) format

@@ -20,0 +28,0 @@ * where x is a human readable number

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.spotQuantityFromChainQuantityToFixed = exports.spotQuantityFromChainQuantity = exports.spotQuantityToChainQuantityToFixed = exports.spotQuantityToChainQuantity = exports.spotPriceFromChainPriceToFixed = exports.spotPriceFromChainPrice = exports.spotPriceToChainPriceToFixed = exports.spotPriceToChainPrice = exports.derivativeQuantityFromChainQuantityToFixed = exports.derivativeQuantityFromChainQuantity = exports.derivativeQuantityToChainQuantityToFixed = exports.derivativeQuantityToChainQuantity = exports.derivativePriceFromChainPriceToFixed = exports.derivativePriceFromChainPrice = exports.derivativePriceToChainPriceToFixed = exports.derivativePriceToChainPrice = exports.derivativeMarginFromChainMarginToFixed = exports.derivativeMarginFromChainMargin = exports.derivativeMarginToChainMarginToFixed = exports.derivativeMarginToChainMargin = exports.denomAmountFromChainDenomAmountToFixed = exports.denomAmountFromChainDenomAmount = exports.denomAmountToChainDenomAmountToFixed = exports.denomAmountToChainDenomAmount = exports.denomAmountToGrpcChainDenomAmount = exports.denomAmountFromGrpcChainDenomAmount = exports.getSignificantDecimalsFromNumber = void 0;
exports.spotQuantityFromChainQuantityToFixed = exports.spotQuantityFromChainQuantity = exports.spotQuantityToChainQuantityToFixed = exports.spotQuantityToChainQuantity = exports.spotPriceFromChainPriceToFixed = exports.spotPriceFromChainPrice = exports.spotPriceToChainPriceToFixed = exports.spotPriceToChainPrice = exports.derivativeQuantityFromChainQuantityToFixed = exports.derivativeQuantityFromChainQuantity = exports.derivativeQuantityToChainQuantityToFixed = exports.derivativeQuantityToChainQuantity = exports.derivativePriceFromChainPriceToFixed = exports.derivativePriceFromChainPrice = exports.derivativePriceToChainPriceToFixed = exports.derivativePriceToChainPrice = exports.derivativeMarginFromChainMarginToFixed = exports.derivativeMarginFromChainMargin = exports.derivativeMarginToChainMarginToFixed = exports.derivativeMarginToChainMargin = exports.denomAmountFromChainDenomAmountToFixed = exports.denomAmountFromChainDenomAmount = exports.denomAmountToChainDenomAmountToFixed = exports.denomAmountToChainDenomAmount = exports.amountToCosmosSdkDecAmount = exports.denomAmountToGrpcChainDenomAmount = exports.denomAmountFromGrpcChainDenomAmount = exports.getSignificantDecimalsFromNumber = void 0;
const classes_1 = require("./classes");

@@ -36,2 +36,11 @@ const $BigNumber = classes_1.BigNumber.clone({ ROUNDING_MODE: classes_1.BigNumber.ROUND_DOWN });

/**
* On chain amounts (based on the cosmosSdk.Dec type)
* broadcasted to a sentry directly using the
* gRPC API should be passed with an extra decimal point
* 18 places from the beginning (i.e multiplied by 1e18), so we need to add it
* to get a workable amount
*/
const amountToCosmosSdkDecAmount = (value) => new $BigNumber(value).multipliedBy(new $BigNumber(10).pow(18));
exports.amountToCosmosSdkDecAmount = amountToCosmosSdkDecAmount;
/**
* Amount that the chain requires is in the x * 10^(quoteDecimals) format

@@ -38,0 +47,0 @@ * where x is a human readable number

9

package.json
{
"name": "@injectivelabs/utils",
"description": "List of utils and helper functions that can be reused throughout Injective's projects.",
"version": "0.0.63",
"version": "0.0.64",
"license": "MIT",

@@ -30,4 +30,4 @@ "main": "dist/index.js",

"dependencies": {
"@injectivelabs/exceptions": "^0.0.45",
"@injectivelabs/ts-types": "^0.0.40",
"@injectivelabs/exceptions": "^0.0.46",
"@injectivelabs/ts-types": "^0.0.41",
"axios": "^0.21.1",

@@ -37,5 +37,6 @@ "bignumber.js": "^9.0.1",

"shx": "^0.3.2",
"snakecase-keys": "^5.1.2",
"store2": "^2.12.0"
},
"gitHead": "787ad83e119ad03f33489a2cfc35d41259993425"
"gitHead": "a04fe2b57ef24f7bb0c3cb57a53f3414ba3577a8"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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