cosmology-tech / cosmos-kit

Universal wallet connector for the Cosmos ⚛️
https://cosmology.zone/products/cosmos-kit
BSD 3-Clause Clear License
183 stars 132 forks source link

`TS2322: Type error` when I trying to integrate Trust wallet #287

Closed Violet-Bora-Lee closed 1 year ago

Violet-Bora-Lee commented 1 year ago

In the process of integrating the Trust Wallet, a type error occurs like the previous issue. Here is the detailed information.

TS2322: Type '(KeplrExtensionWallet | KeplrMobileWallet | LeapExtensionWallet | LeapMobileWallet | CosmostationExtensionWallet | CosmostationMobileWallet | XDEFIExtensionWallet | TrustMobileWallet)[]' is not assignable to type 'MainWalletBase[]'.   Type 'KeplrExtensionWallet | KeplrMobileWallet | LeapExtensionWallet | LeapMobileWallet | CosmostationExtensionWallet | CosmostationMobileWallet | XDEFIExtensionWallet | TrustMobileWallet' is not assignable to type 'MainWalletBase'.     Type 'TrustMobileWallet' is not assignable to type 'MainWalletBase'.       Property '_chainWalletMap' is protected but type 'MainWalletBase' is not a class derived from 'MainWalletBase'.

Current packages' versions I'm using.

    "@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 

https://github.com/cosmology-tech/cosmos-kit/issues/248

twhy commented 1 year ago

@Violet-Bora-Lee Please upgrade these packages' version to ^2.1.2

Violet-Bora-Lee commented 1 year ago

A new error has occurred with this versions

    "@cosmos-kit/core": "^2.1.2",
    "@cosmos-kit/cosmostation": "^2.1.2",
    "@cosmos-kit/keplr": "^2.1.2",
    "@cosmos-kit/leap": "^2.1.2",
    "@cosmos-kit/react": "^2.1.3",
    "@cosmos-kit/trust": "^2.1.2",

TS2322: Type '(KeplrExtensionWallet | KeplrMobileWallet | LeapExtensionWallet | LeapMobileWallet | CosmostationExtensionWallet | CosmostationMobileWallet | XDEFIExtensionWallet | TrustMobileWallet)[]' is not assignable to type 'MainWalletBase[]'.   Type 'KeplrExtensionWallet | KeplrMobileWallet | LeapExtensionWallet | LeapMobileWallet | CosmostationExtensionWallet | CosmostationMobileWallet | XDEFIExtensionWallet | TrustMobileWallet' 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'.

twhy commented 1 year ago

@Violet-Bora-Lee Have you upgraded @cosmos-kit/xdefi to version ^2.1.2 ?

Violet-Bora-Lee commented 1 year ago

@Violet-Bora-Lee Have you upgraded @cosmos-kit/xdefi to version ^2.1.2 ?

Ah. I forgot to upgrade the package. Sorry. It's working now 🎉