@chain-registry/keplr 0.4.2 → 0.4.3
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 +8 -0
- package/main/index.js +12 -5
- package/module/index.js +11 -4
- package/package.json +3 -2
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.3](https://github.com/cosmology-tech/chain-registry/compare/@chain-registry/keplr@0.4.2...@chain-registry/keplr@0.4.3) (2022-08-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @chain-registry/keplr
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [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
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$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;
|
|
29
|
+
var _assets$find, _chain$fees, _chain$fees$fee_token, _chain$fees2, _chain$fees2$fee_toke, _chain$fees2$fee_toke2, _chain$fees$fee_token2, _chain$fees3, _chain$fees3$fee_toke, _chain$fees3$fee_toke2, _chain$fees$fee_token3, _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,10 +42,17 @@ 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
|
+
/**
|
|
46
|
+
* FROM KEPLR chain-info.d.ts:
|
|
47
|
+
* This is used to set the fee of the transaction.
|
|
48
|
+
* If this field is empty, it just use the default gas price step (low: 0.01, average: 0.025, high: 0.04).
|
|
49
|
+
* And, set field's type as primitive number because it is hard to restore the prototype after deserialzing if field's type is `Dec`.
|
|
50
|
+
*/
|
|
51
|
+
|
|
45
52
|
var gasPriceStep = {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
low: (_chain$fees$fee_token = (_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.low_gas_price) !== null && _chain$fees$fee_token !== void 0 ? _chain$fees$fee_token : 0.01,
|
|
54
|
+
average: (_chain$fees$fee_token2 = (_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.average_gas_price) !== null && _chain$fees$fee_token2 !== void 0 ? _chain$fees$fee_token2 : 0.025,
|
|
55
|
+
high: (_chain$fees$fee_token3 = (_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.high_gas_price) !== null && _chain$fees$fee_token3 !== void 0 ? _chain$fees$fee_token3 : 0.04
|
|
49
56
|
};
|
|
50
57
|
var stakingDenoms = ((_chain$staking = chain.staking) === null || _chain$staking === void 0 ? void 0 : _chain$staking.staking_tokens.map(function (stakingToken) {
|
|
51
58
|
return stakingToken.denom;
|
|
@@ -77,7 +84,7 @@ var chainRegistryChainToKeplr = function chainRegistryChainToKeplr(chain, assets
|
|
|
77
84
|
bip44: {
|
|
78
85
|
coinType: chain.slip44
|
|
79
86
|
},
|
|
80
|
-
gasPriceStep:
|
|
87
|
+
gasPriceStep: gasPriceStep,
|
|
81
88
|
bech32Config: _cosmos.Bech32Address.defaultBech32Config(chain.bech32_prefix),
|
|
82
89
|
currencies: currencies,
|
|
83
90
|
stakeCurrency: stakeCurrency || currencies[0],
|
package/module/index.js
CHANGED
|
@@ -16,10 +16,17 @@ 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
|
+
/**
|
|
20
|
+
* FROM KEPLR chain-info.d.ts:
|
|
21
|
+
* This is used to set the fee of the transaction.
|
|
22
|
+
* If this field is empty, it just use the default gas price step (low: 0.01, average: 0.025, high: 0.04).
|
|
23
|
+
* And, set field's type as primitive number because it is hard to restore the prototype after deserialzing if field's type is `Dec`.
|
|
24
|
+
*/
|
|
25
|
+
|
|
19
26
|
const gasPriceStep = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
low: chain.fees?.fee_tokens?.[0]?.low_gas_price ?? 0.01,
|
|
28
|
+
average: chain.fees?.fee_tokens?.[0]?.average_gas_price ?? 0.025,
|
|
29
|
+
high: chain.fees?.fee_tokens?.[0]?.high_gas_price ?? 0.04
|
|
23
30
|
};
|
|
24
31
|
const stakingDenoms = chain.staking?.staking_tokens.map(stakingToken => stakingToken.denom) || [];
|
|
25
32
|
const currencies = chainAssets.map(currency => {
|
|
@@ -41,7 +48,7 @@ export const chainRegistryChainToKeplr = (chain, assets, options = {
|
|
|
41
48
|
bip44: {
|
|
42
49
|
coinType: chain.slip44
|
|
43
50
|
},
|
|
44
|
-
gasPriceStep
|
|
51
|
+
gasPriceStep,
|
|
45
52
|
bech32Config: Bech32Address.defaultBech32Config(chain.bech32_prefix),
|
|
46
53
|
currencies: currencies,
|
|
47
54
|
stakeCurrency: stakeCurrency || currencies[0],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chain-registry/keplr",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
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",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"babel-core": "7.0.0-bridge.0",
|
|
62
62
|
"babel-jest": "28.1.1",
|
|
63
63
|
"babel-watch": "^7.0.0",
|
|
64
|
+
"chain-registry": "^0.6.3",
|
|
64
65
|
"cross-env": "^7.0.2",
|
|
65
66
|
"eslint": "8.20.0",
|
|
66
67
|
"eslint-config-prettier": "^8.5.0",
|
|
@@ -80,5 +81,5 @@
|
|
|
80
81
|
"@keplr-wallet/cosmos": "^0.10.3",
|
|
81
82
|
"@keplr-wallet/crypto": "^0.10.11"
|
|
82
83
|
},
|
|
83
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "b751f793a93371963ac75e3dc7ec37461bea43db"
|
|
84
85
|
}
|