@chain-registry/keplr 1.69.13 → 1.69.15

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.
Files changed (3) hide show
  1. package/esm/index.js +34 -20
  2. package/index.js +34 -20
  3. package/package.json +4 -4
package/esm/index.js CHANGED
@@ -62,26 +62,40 @@ export const chainRegistryChainToKeplr = (chain, assets, options = {
62
62
  if (!options.getExplorer)
63
63
  options.getExplorer = getExplr;
64
64
  const features = [];
65
- // if NOT specified, we assume stargate, sorry not sorry
66
- const sdkVer = chain.codebase?.cosmos_sdk_version
67
- ? extractVersion(chain.codebase?.cosmos_sdk_version)
68
- : '0.40';
69
- // stargate
70
- if (semver.satisfies(sdkVer, '>=0.40'))
71
- features.push('stargate');
72
- // no-legacy-stdTx
73
- if (semver.satisfies(sdkVer, '>=0.43'))
74
- features.push('no-legacy-stdTx');
75
- // until further notice, assume 'ibc-transfer'
76
- features.push('ibc-transfer');
77
- // ibc-go
78
- if (semver.satisfies(sdkVer, '>=0.45'))
79
- features.push('ibc-go');
80
- if (chain.codebase?.cosmwasm_enabled) {
81
- features.push('cosmwasm');
82
- const wasmVer = extractVersion(chain.codebase.cosmwasm_version ?? '0.24');
83
- if (semver.satisfies(wasmVer, '>=0.24'))
84
- features.push('wasmd_0.24+');
65
+ // check if it's a Cosmos SDK chain (either new or old format)
66
+ const isCosmosSDKChain = chain.codebase?.sdk?.type === 'cosmos' || !!chain.codebase?.cosmos_sdk_version;
67
+ if (isCosmosSDKChain) {
68
+ // determine SDK version
69
+ let sdkVer;
70
+ if (chain.codebase?.sdk?.type === 'cosmos' && chain.codebase.sdk.version) {
71
+ sdkVer = extractVersion(chain.codebase.sdk.version);
72
+ }
73
+ else if (chain.codebase?.cosmos_sdk_version) {
74
+ sdkVer = extractVersion(chain.codebase.cosmos_sdk_version);
75
+ }
76
+ else {
77
+ // if NOT specified, we assume stargate, sorry not sorry
78
+ sdkVer = '0.40.0';
79
+ }
80
+ // stargate
81
+ if (semver.satisfies(sdkVer, '>=0.40'))
82
+ features.push('stargate');
83
+ // no-legacy-stdTx
84
+ if (semver.satisfies(sdkVer, '>=0.43'))
85
+ features.push('no-legacy-stdTx');
86
+ // until further notice, assume 'ibc-transfer'
87
+ features.push('ibc-transfer');
88
+ // ibc-go
89
+ if (semver.satisfies(sdkVer, '>=0.45'))
90
+ features.push('ibc-go');
91
+ // CosmWasm feature detection
92
+ const cosmwasmEnabled = chain.codebase?.cosmwasm?.enabled ?? chain.codebase?.cosmwasm_enabled ?? false;
93
+ if (cosmwasmEnabled) {
94
+ features.push('cosmwasm');
95
+ const wasmVer = extractVersion(chain.codebase?.cosmwasm?.version ?? chain.codebase?.cosmwasm_version ?? '0.24.0');
96
+ if (semver.satisfies(wasmVer, '>=0.24.0'))
97
+ features.push('wasmd_0.24+');
98
+ }
85
99
  }
86
100
  const chainAssets = assets.find((asset) => asset.chain_name === chain.chain_name)?.assets || [];
87
101
  const feeDenoms = chain.fees?.fee_tokens.map((feeToken) => feeToken.denom) || [];
package/index.js CHANGED
@@ -69,26 +69,40 @@ const chainRegistryChainToKeplr = (chain, assets, options = {
69
69
  if (!options.getExplorer)
70
70
  options.getExplorer = getExplr;
71
71
  const features = [];
72
- // if NOT specified, we assume stargate, sorry not sorry
73
- const sdkVer = chain.codebase?.cosmos_sdk_version
74
- ? extractVersion(chain.codebase?.cosmos_sdk_version)
75
- : '0.40';
76
- // stargate
77
- if (semver_1.default.satisfies(sdkVer, '>=0.40'))
78
- features.push('stargate');
79
- // no-legacy-stdTx
80
- if (semver_1.default.satisfies(sdkVer, '>=0.43'))
81
- features.push('no-legacy-stdTx');
82
- // until further notice, assume 'ibc-transfer'
83
- features.push('ibc-transfer');
84
- // ibc-go
85
- if (semver_1.default.satisfies(sdkVer, '>=0.45'))
86
- features.push('ibc-go');
87
- if (chain.codebase?.cosmwasm_enabled) {
88
- features.push('cosmwasm');
89
- const wasmVer = extractVersion(chain.codebase.cosmwasm_version ?? '0.24');
90
- if (semver_1.default.satisfies(wasmVer, '>=0.24'))
91
- features.push('wasmd_0.24+');
72
+ // check if it's a Cosmos SDK chain (either new or old format)
73
+ const isCosmosSDKChain = chain.codebase?.sdk?.type === 'cosmos' || !!chain.codebase?.cosmos_sdk_version;
74
+ if (isCosmosSDKChain) {
75
+ // determine SDK version
76
+ let sdkVer;
77
+ if (chain.codebase?.sdk?.type === 'cosmos' && chain.codebase.sdk.version) {
78
+ sdkVer = extractVersion(chain.codebase.sdk.version);
79
+ }
80
+ else if (chain.codebase?.cosmos_sdk_version) {
81
+ sdkVer = extractVersion(chain.codebase.cosmos_sdk_version);
82
+ }
83
+ else {
84
+ // if NOT specified, we assume stargate, sorry not sorry
85
+ sdkVer = '0.40.0';
86
+ }
87
+ // stargate
88
+ if (semver_1.default.satisfies(sdkVer, '>=0.40'))
89
+ features.push('stargate');
90
+ // no-legacy-stdTx
91
+ if (semver_1.default.satisfies(sdkVer, '>=0.43'))
92
+ features.push('no-legacy-stdTx');
93
+ // until further notice, assume 'ibc-transfer'
94
+ features.push('ibc-transfer');
95
+ // ibc-go
96
+ if (semver_1.default.satisfies(sdkVer, '>=0.45'))
97
+ features.push('ibc-go');
98
+ // CosmWasm feature detection
99
+ const cosmwasmEnabled = chain.codebase?.cosmwasm?.enabled ?? chain.codebase?.cosmwasm_enabled ?? false;
100
+ if (cosmwasmEnabled) {
101
+ features.push('cosmwasm');
102
+ const wasmVer = extractVersion(chain.codebase?.cosmwasm?.version ?? chain.codebase?.cosmwasm_version ?? '0.24.0');
103
+ if (semver_1.default.satisfies(wasmVer, '>=0.24.0'))
104
+ features.push('wasmd_0.24+');
105
+ }
92
106
  }
93
107
  const chainAssets = assets.find((asset) => asset.chain_name === chain.chain_name)?.assets || [];
94
108
  const feeDenoms = chain.fees?.fee_tokens.map((feeToken) => feeToken.denom) || [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chain-registry/keplr",
3
- "version": "1.69.13",
3
+ "version": "1.69.15",
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",
@@ -29,10 +29,10 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/semver": "^7.5.8",
32
- "chain-registry": "^1.64.13"
32
+ "chain-registry": "^1.64.15"
33
33
  },
34
34
  "dependencies": {
35
- "@chain-registry/types": "^0.46.11",
35
+ "@chain-registry/types": "^0.46.13",
36
36
  "@keplr-wallet/cosmos": "0.12.28",
37
37
  "@keplr-wallet/crypto": "0.12.28",
38
38
  "semver": "^7.5.0"
@@ -44,5 +44,5 @@
44
44
  "interchain",
45
45
  "keplr"
46
46
  ],
47
- "gitHead": "53e964152ecd3773a74c5addec28cff32d27ba9f"
47
+ "gitHead": "8f99070d9a75e4ed11a3ac574bf051ce7312bf4d"
48
48
  }