Closed twhy closed 1 year ago
These TypeErrors are generally caused by using older versions of cosmos-kit relatated packages when creating projects with cca
. So the solution is to upgrade related packages to lastest stable versions.
Upgrade packages with comment // upgrade
to versions specified in the package.json
below should solve the problem
{
"name": "@cosmology/asset-list",
"version": "0.2.1",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@chain-registry/assets": "1.11.0",
"@chain-registry/osmosis": "1.11.0",
"@chain-registry/types": "0.14.0",
"@chakra-ui/icons": "2.0.12",
"@chakra-ui/react": "2.5.1",
"@cosmjs/amino": "0.30.1",
"@cosmjs/cosmwasm-stargate": "0.29.5",
"@cosmjs/stargate": "0.29.5",
"@cosmology-ui/react": "0.1.8-beta.30",
"@cosmos-kit/core": "1.7.0", // upgrade
"@cosmos-kit/cosmostation": "0.15.38", // upgrade
"@cosmos-kit/keplr": "0.33.40", // upgrade
"@cosmos-kit/leap": "0.15.10", // upgrade
"@cosmos-kit/react": "1.3.33", // upgrade
"@cosmos-kit/xdefi-extension": "^0.16.1", // upgrade
"@emotion/styled": "11.10.6",
"bignumber.js": "9.1.1",
"chain-registry": "1.14.0",
"chakra-react-select": "4.4.3",
"fast-fuzzy": "1.12.0",
"framer-motion": "9.0.7",
"long": "5.2.1",
"next": "12.2.5",
"osmojs": "15.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-icons": "4.6.0"
},
"devDependencies": {
"@types/node": "18.11.9",
"@types/react": "18.0.25",
"@types/react-dom": "18.0.9",
"eslint": "8.28.0",
"eslint-config-next": "13.0.5",
"typescript": "4.9.3"
}
}
TS2322: Type ‘(KeplrExtensionWallet | KeplrMobileWallet | LeapExtensionWallet | LeapMobileWallet | CosmostationExtensionWallet | CosmostationMobileWallet | XDEFIExtensionWallet)[]' is not assignable to type ‘MainWalletBase[]’. Type ‘KeplrExtensionWallet | KeplrMobileWallet | LeapExtensionWallet | LeapMobileWallet | CosmostationExtensionWallet | CosmostationMobileWallet | XDEFIExtensionWallet’ is not assignable to type ‘MainWalletBase’. Type ‘XDEFIExtensionWallet’ is not assignable to type ‘MainWalletBase’. Property ‘_chainWalletMap’ is protected but type ‘MainWalletBase’ is not a class derived from ‘MainWalletBase’.
// ...xdefi
is not related to this error, it's for other reasons or by accident.