@dfinity_oisy-wallet-signer_icrc-wallet.js?v=54cdd1a5:8434 Uncaught TypeError: (void 0) is not a function
at s2 (@dfinity_oisy-wallet-signer_icrc-wallet.js?v=54cdd1a5:8434:84)
at @dfinity_oisy-wallet-signer_icrc-wallet.js?v=54cdd1a5:8442:10
var s2 = ({ additionalProtocols: e2 = [], allowHttpLocally: l = true }) => (void 0)().refine((n) => {
error at ().refine((n) => {
Hi @AliSci
We will look into this as soon a possible. Meanwhile, did you check the source code of the relying party of the demo app inside the oisy wallet signer?
You might find a good pattern on how to initiate the connection to an icrc-wallet. (specifically the Connect.svelte in the lib)
There’s a bit of an inconvenient situation right now with the zod-schemas. Zod rolled out v4, which is used in the latest schema, but since not all dependencies have migrated to it yet, we’re currently dealing with two versions.
I’m not entirely sure, but I believe the issue you’re encountering might be caused by this incompatibility. Long story short—could you try downgrading @dfinity/zod-schemas to version 1.0.0 and see if that helps?
npm rm @dfinity/zod-schemas && npm i @dfinity/zod-schemas@1.0.0
I’m not entirely sure, but I believe the foundation generally recommends using Identity Kit. I’m not sure if it’s still “only” supported for React or if it supports now other frameworks. Many dapps are using it, so it’s probably worth a shot.
Unrelated — if you try out the suggestion I mentioned above, please let me know. I’d be curious to see whether that was the issue or if it’s something else.
This one is a bit harder to diagnose based on the stack trace alone. Is your dapp open source? If so, could you share a link to the branch, or perhaps share some additional code?
–
Unrelated side note: We just released a new version of the @dfinity/oisy-wallet-signer library, which explicitly pins zod-schemas to version 1.0.0 instead of using ^1.0.0. This should prevent others from encountering the same issue you ran into earlier.
Oh, I forgot to mention earlier that Identity Kit is, I believe, using signer-js under the hood. So, if you’re not using React — and assuming it’s still required for the kit — you can try using this library directly instead which is itself agnostic.
I was able to replicate the same issue using your code.
@dfinity_oisy-wallet-signer_icrc-wallet.js?v=dc18f2f1:530 Uncaught (in promise) j2: The request sent by the relying party is not supported by the signer.
In my case, I encountered the issue because import.meta.env.VITE_CANISTER_ID_CKUSDC_LEDGER was undefined.
Can you double check if this environment variable is defined in your app?
Not sure why you’re mentioning “$100” and “palace” — I assume those are typos for 100 ckTESTUSDC and balance, is that right?
Also, I’m not sure what you mean by “When I check the palace of the user from the CKUSDC ledger it shows zero”. How exactly are you checking the balance? Through your frontend? Are you sure both are pointing to the same network, not one on mainnet and the other locally? Are the ICRC account details you’re using for the calls exactly the same?
In addition, if you’re referring to the code you shared yesterday, note that it was an ICRC approve call, not a transfer as displayed in your DFX command. An approval does not credit or debit any tokens, so the balance remains unchanged. Could that be the confusion?
this is how i check balance const balanceResult = await ckUSDCActor?.icrc1_balance_of({ owner: Principal.fromText(userPrincipal), subaccount: [], });
yes i also use i mean cktestusdc
I had a look at your code here and noticed that you are using transferFrom, which is the function to call after an approval.
Is that correct? Are you trying to implement an approve/transferFrom pattern, and was the approval granted beforehand?
I’m a bit confused. The screenshot you shared shows a request from localhost:5173 on staging.oisy.com, but you’re mentioning a dfx deploy command.
Are you perhaps testing with a local frontend connected to a local replica, while trying to approve a sign message using OISY running on mainnet? Could that be true and if yes, probably an issue?
I just want to test the user make a deposit, “localy”. I think I did it wrong, staging does not work with localhost, right? i should run oisy locally ?
Correct. OISY staging (on mainnet) does not work if you want to test your frontend with other canisters and a replica running locally.
I’m not sure how easy it is to set up OISY to run locally nowadays, but literally last week I documented in the README how to run the pseudo Wallet — which we use for E2E testing of the signer — locally.
If you wish to test locally, maybe you can give it a try?