kristoferlund / ic-siwe

SIWE, Sign in with Ethereum for ICP, the Internet Computer. Build cross chain Ethereum apps on ICP!
https://shtr2-2iaaa-aaaal-qckva-cai.icp0.io
MIT License
19 stars 12 forks source link

Type mismatch when trying to prepare login #11

Open Jair-SDSharp opened 2 months ago

Jair-SDSharp commented 2 months ago

Summary

Using new ic-use-siwe-identity package 0.1.0, I'm getting an error in the in the callPrepareLogin function. The error shows the following message : "type mismatch: type on the wire rec_3, expect type text".

I'm using this packages:

{ ...
 "ic-use-siwe-identity": "^0.1.0"
 "viem": "^2.20.1"
 "wagmi": "^2.12.7"
 "@rainbow-me/rainbowkit": "^2.1.5"
... }

and also the latest candid and wasm:

"ic_siwe_provider": {
      "type": "custom",
      "candid": "https://github.com/kristoferlund/ic-siwe/releases/download/v0.1.0/ic_siwe_provider.did",
      "wasm": "https://github.com/kristoferlund/ic-siwe/releases/download/v0.1.0/ic_siwe_provider.wasm.gz",
      "declarations": {
        "output": "frontend/candid/ic_siwe_provider"
      }
    }

When using the 0.0.6 candid version of the files, the preparation function (callPrepareLogin) works normally but in this case the function login doesn't showing the error:

Cannot read properties of undefined (reading 'raw')

You can give it a validation in my project: icrc1-wallet Branch: icrc1-new-features

kristoferlund commented 2 weeks ago

Hey @Jair-SDSharp, I just saw this issue. Is this still an issue?

To begin with, make sure you are using the latest versions of the provider canister and React hook. I just made some small upgrades and also updated the example app: https://github.com/kristoferlund/ic-siws-react-demo-rust

Compare your settings with that app.