Koniverse / SubConnect

Note: We have stopped further development of this version and replaced it with a new and more complete version here
https://github.com/Koniverse/SubConnect-v2
Apache License 2.0
43 stars 14 forks source link

Don't use unknown type on returning wallet.enable('dapp') and wallet.subscribeAccounts(cb) #16

Closed GHesericsu closed 1 year ago

GHesericsu commented 1 year ago

Is your feature request related to a problem? Please describe. Thanks a lot for making this library. I'm a big frustrated with the wallet.enable() function returning unknown type. My typescript doesn't like it. It's giving me object is of type 'unknown' error

interface Connector { enable: (dappName: string) => unknown; getAccounts: (anyType?: boolean) => Promise<WalletAccount[]>; subscribeAccounts: (callback: SubscriptionFn) => unknown; }

Describe the solution you'd like Can you determine a type that's going to return? Or maybe use any instead of unknown ?

Describe alternatives you've considered const talismanWallet = installedWallets.find(wallet => wallet.extensionName === 'talisman') as any this will fix it but will consider making it more type friendly please?

Additional context Add any other context or screenshots about the feature request here.