Failed to get the account address

let storageProtocol = self.web3Auth!.state as! any EthereumSingleKeyStorageProtocol
let userEthAddress = try EthereumAccount(keyStorage: storageProtocol).address.toChecksumAddress()

I got error:

Could not cast value of type 'Web3Auth.Web3AuthState' (0x106985098) to 'web3.EthereumSingleKeyStorageProtocol' (0x11defecf0).

However, I found the code example (https://github.com/Web3Auth/web3auth-pnp-examples/blob/4341c65480b3a106ed1724c6b96bad76d28a4b85/ios/ios-quick-start/ios-example/web3RPC.swift#L27) is doing this.

What did I do wrong? thanks!

@zhew1991 Thanks for your recent post.

Your issue has been forwarded to our team and we will get back with further updates.

@zhew1991 I tried reproducing but it’s working fine. Any chance you can share the repo link?

I installed a another 3rd lib to get around that.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.