@chain-registry/keplr 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.4.2](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/keplr@0.4.1...@chain-registry/keplr@0.4.2) (2022-08-17)
7
+
8
+ **Note:** Version bump only for package @chain-registry/keplr
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.4.1](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/keplr@0.4.0...@chain-registry/keplr@0.4.1) (2022-08-17)
7
15
 
8
16
  **Note:** Version bump only for package @chain-registry/keplr
package/main/index.js CHANGED
@@ -26,7 +26,7 @@ var getExplr = function getExplr(chain) {
26
26
  };
27
27
 
28
28
  var chainRegistryChainToKeplr = function chainRegistryChainToKeplr(chain, assets) {
29
- var _assets$find, _chain$fees, _chain$staking, _currencies$find;
29
+ var _assets$find, _chain$fees, _chain$fees2, _chain$fees2$fee_toke, _chain$fees2$fee_toke2, _chain$fees3, _chain$fees3$fee_toke, _chain$fees3$fee_toke2, _chain$fees4, _chain$fees4$fee_toke, _chain$fees4$fee_toke2, _chain$staking, _currencies$find;
30
30
 
31
31
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
32
32
  getRpcEndpoint: getRpc,
@@ -42,6 +42,11 @@ var chainRegistryChainToKeplr = function chainRegistryChainToKeplr(chain, assets
42
42
  var feeDenoms = ((_chain$fees = chain.fees) === null || _chain$fees === void 0 ? void 0 : _chain$fees.fee_tokens.map(function (feeToken) {
43
43
  return feeToken.denom;
44
44
  })) || [];
45
+ var gasPriceStep = {
46
+ average: (_chain$fees2 = chain.fees) === null || _chain$fees2 === void 0 ? void 0 : (_chain$fees2$fee_toke = _chain$fees2.fee_tokens) === null || _chain$fees2$fee_toke === void 0 ? void 0 : (_chain$fees2$fee_toke2 = _chain$fees2$fee_toke[0]) === null || _chain$fees2$fee_toke2 === void 0 ? void 0 : _chain$fees2$fee_toke2.average_gas_price,
47
+ high: (_chain$fees3 = chain.fees) === null || _chain$fees3 === void 0 ? void 0 : (_chain$fees3$fee_toke = _chain$fees3.fee_tokens) === null || _chain$fees3$fee_toke === void 0 ? void 0 : (_chain$fees3$fee_toke2 = _chain$fees3$fee_toke[0]) === null || _chain$fees3$fee_toke2 === void 0 ? void 0 : _chain$fees3$fee_toke2.high_gas_price,
48
+ low: (_chain$fees4 = chain.fees) === null || _chain$fees4 === void 0 ? void 0 : (_chain$fees4$fee_toke = _chain$fees4.fee_tokens) === null || _chain$fees4$fee_toke === void 0 ? void 0 : (_chain$fees4$fee_toke2 = _chain$fees4$fee_toke[0]) === null || _chain$fees4$fee_toke2 === void 0 ? void 0 : _chain$fees4$fee_toke2.low_gas_price
49
+ };
45
50
  var stakingDenoms = ((_chain$staking = chain.staking) === null || _chain$staking === void 0 ? void 0 : _chain$staking.staking_tokens.map(function (stakingToken) {
46
51
  return stakingToken.denom;
47
52
  })) || [];
@@ -72,11 +77,11 @@ var chainRegistryChainToKeplr = function chainRegistryChainToKeplr(chain, assets
72
77
  bip44: {
73
78
  coinType: chain.slip44
74
79
  },
80
+ gasPriceStep: Object.keys(gasPriceStep).length > 0 ? gasPriceStep : undefined,
75
81
  bech32Config: _cosmos.Bech32Address.defaultBech32Config(chain.bech32_prefix),
76
82
  currencies: currencies,
77
83
  stakeCurrency: stakeCurrency || currencies[0],
78
- feeCurrencies: feeCurrencies.length !== 0 ? feeCurrencies : currencies,
79
- explorerUrl: options.getExplorer(chain)
84
+ feeCurrencies: feeCurrencies.length !== 0 ? feeCurrencies : currencies
80
85
  };
81
86
  return chainInfo;
82
87
  };
package/module/index.js CHANGED
@@ -16,6 +16,11 @@ export const chainRegistryChainToKeplr = (chain, assets, options = {
16
16
  if (!options.getExplorer) options.getExplorer = getExplr;
17
17
  const chainAssets = assets.find(asset => asset.chain_name === chain.chain_name)?.assets || [];
18
18
  const feeDenoms = chain.fees?.fee_tokens.map(feeToken => feeToken.denom) || [];
19
+ const gasPriceStep = {
20
+ average: chain.fees?.fee_tokens?.[0]?.average_gas_price,
21
+ high: chain.fees?.fee_tokens?.[0]?.high_gas_price,
22
+ low: chain.fees?.fee_tokens?.[0]?.low_gas_price
23
+ };
19
24
  const stakingDenoms = chain.staking?.staking_tokens.map(stakingToken => stakingToken.denom) || [];
20
25
  const currencies = chainAssets.map(currency => {
21
26
  return {
@@ -36,11 +41,11 @@ export const chainRegistryChainToKeplr = (chain, assets, options = {
36
41
  bip44: {
37
42
  coinType: chain.slip44
38
43
  },
44
+ gasPriceStep: Object.keys(gasPriceStep).length > 0 ? gasPriceStep : undefined,
39
45
  bech32Config: Bech32Address.defaultBech32Config(chain.bech32_prefix),
40
46
  currencies: currencies,
41
47
  stakeCurrency: stakeCurrency || currencies[0],
42
- feeCurrencies: feeCurrencies.length !== 0 ? feeCurrencies : currencies,
43
- explorerUrl: options.getExplorer(chain)
48
+ feeCurrencies: feeCurrencies.length !== 0 ? feeCurrencies : currencies
44
49
  };
45
50
  return chainInfo;
46
51
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chain-registry/keplr",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Chain Registry to Keplr",
5
5
  "author": "Dan Lynch <pyramation@gmail.com>",
6
6
  "homepage": "https://github.com/cosmology-tech/chain-registry",
@@ -80,5 +80,5 @@
80
80
  "@keplr-wallet/cosmos": "^0.10.3",
81
81
  "@keplr-wallet/crypto": "^0.10.11"
82
82
  },
83
- "gitHead": "3647fb7731ca902d7486c6c812a7bcbc1640704a"
83
+ "gitHead": "675c082e93e66834fd8f5f06f99cf1634f0e7c1d"
84
84
  }