Socket
Socket
Sign inDemoInstall

@chain-registry/client

Package Overview
Dependencies
Maintainers
3
Versions
216
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chain-registry/client - npm Package Compare versions

Comparing version 1.17.1 to 1.18.0

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

# [1.18.0](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/client@1.17.1...@chain-registry/client@1.18.0) (2023-12-20)
**Note:** Version bump only for package @chain-registry/client
## [1.17.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/client@1.17.0...@chain-registry/client@1.17.1) (2023-12-15)

@@ -8,0 +16,0 @@

2

main/chain-info.js

@@ -46,3 +46,3 @@ "use strict";

}, {
key: "nativeAssetLists",
key: "nativeAssetList",
get: function get() {

@@ -49,0 +49,0 @@ return this._assetList;

@@ -18,9 +18,12 @@ "use strict";

(0, _defineProperty2["default"])(this, "chainInfo", void 0);
(0, _defineProperty2["default"])(this, "allAsset", void 0);
(0, _defineProperty2["default"])(this, "_assets", []);
this.chainName = options.chainName;
this.chainInfo = options.chainInfo;
this.allAsset = this.chainInfo.assetLists.reduce(function (m, it) {
[].push.apply(m, it.assets);
return m;
}, (0, _toConsumableArray2["default"])(this.chainInfo.nativeAssetLists.assets));
this._assets = [{
assets: [].concat((0, _toConsumableArray2["default"])(this.chainInfo.nativeAssetList.assets), (0, _toConsumableArray2["default"])(this.chainInfo.assetLists.flatMap(function (_ref) {
var assets = _ref.assets;
return assets;
}))),
chain_name: this.chainName
}];
}

@@ -30,3 +33,3 @@ (0, _createClass2["default"])(ChainRegistryChainUtil, [{

value: function getAssetByDenom(denom) {
return (0, _utils.getAssetByDenom)(this.allAsset, denom);
return (0, _utils.getAssetByDenom)(this._assets, denom, this.chainName);
}

@@ -36,8 +39,15 @@ }, {

value: function getDenomByCoinGeckoId(coinGeckoId) {
return (0, _utils.getDenomByCoinGeckoId)(this.allAsset, coinGeckoId);
return (0, _utils.getDenomByCoinGeckoId)(this._assets, coinGeckoId, this.chainName);
}
}, {
key: "getCoinGeckoIdByDenom",
value: function getCoinGeckoIdByDenom(coinGeckoId) {
return (0, _utils.getCoinGeckoIdByDenom)(this._assets, coinGeckoId, {
chainName: this.chainName
});
}
}, {
key: "getSymbolByChainDenom",
value: function getSymbolByChainDenom(denom) {
return (0, _utils.getSymbolByChainDenom)(this.allAsset, denom);
return (0, _utils.getSymbolByChainDenom)(this._assets, denom, this.chainName);
}

@@ -47,3 +57,3 @@ }, {

value: function getChainDenomBySymbol(token) {
return (0, _utils.getChainDenomBySymbol)(this.allAsset, token);
return (0, _utils.getChainDenomBySymbol)(this._assets, token, this.chainName);
}

@@ -53,3 +63,3 @@ }, {

value: function getExponentByDenom(denom) {
return (0, _utils.getExponentByDenom)(this.allAsset, denom);
return (0, _utils.getExponentByDenom)(this._assets, denom, this.chainName);
}

@@ -59,3 +69,3 @@ }, {

value: function convertCoinGeckoPricesToDenomPriceMap(prices) {
return (0, _utils.convertCoinGeckoPricesToDenomPriceMap)(this.allAsset, prices);
return (0, _utils.convertCoinGeckoPricesToDenomPriceMap)(this._assets, prices);
}

@@ -70,3 +80,3 @@ }, {

value: function convertBaseUnitsToDollarValue(prices, symbol, amount) {
return (0, _utils.convertBaseUnitsToDollarValue)(this.allAsset, prices, symbol, amount);
return (0, _utils.convertBaseUnitsToDollarValue)(this._assets, prices, symbol, amount, this.chainName);
}

@@ -76,3 +86,3 @@ }, {

value: function convertDollarValueToDenomUnits(prices, symbol, value) {
return (0, _utils.convertDollarValueToDenomUnits)(this.allAsset, prices, symbol, value);
return (0, _utils.convertDollarValueToDenomUnits)(this._assets, prices, symbol, value, this.chainName);
}

@@ -82,3 +92,3 @@ }, {

value: function convertBaseUnitsToDisplayUnits(symbol, amount) {
return (0, _utils.convertBaseUnitsToDisplayUnits)(this.allAsset, symbol, amount);
return (0, _utils.convertBaseUnitsToDisplayUnits)(this._assets, symbol, amount, this.chainName);
}

@@ -85,0 +95,0 @@ }]);

{
"name": "@chain-registry/client",
"version": "1.17.1",
"version": "1.18.0",
"description": "Chain Registry Client",

@@ -79,7 +79,7 @@ "author": "Dan Lynch <pyramation@gmail.com>",

"@chain-registry/types": "^0.17.1",
"@chain-registry/utils": "^1.16.1",
"@chain-registry/utils": "^1.17.0",
"bfs-path": "^1.0.2",
"cross-fetch": "^3.1.5"
},
"gitHead": "4be96c12e66434cf3fd49ab5dc00102ccc8de551"
"gitHead": "c8644d2e748b506abf7e174f2c50bfdb77277ca8"
}

@@ -90,3 +90,3 @@ # @chain-registry/client

// AssetList[] of the generated assets
const assetes: AssetList[] = chainInfo.assetLists;
const assets: AssetList[] = chainInfo.assetLists;

@@ -96,4 +96,4 @@ // Chain

// AssetList[] of the native assets
const assetes: AssetList[] = chainInfo.nativeAssetLists;
// Native asset list
const nativeAssetList: AssetList = chainInfo.nativeAssetList;
```

@@ -100,0 +100,0 @@

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