Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wallet signature issue #16

Open
Humayounshah opened this issue Mar 7, 2024 · 0 comments
Open

wallet signature issue #16

Humayounshah opened this issue Mar 7, 2024 · 0 comments

Comments

@Humayounshah
Copy link

I am working on verifying wallet signatures in our backend. Signatures signed using Android Venom wallet are not getting verified with everscale-inpage-provider on backend. The same code base works when using Chrome extension for venom wallet. Any help. Is this a known issue with Venom wallet?

here's is my code for frontend:
const submitWallet = async () => {
console.log(new Address(address));
const providerState = await venomProvider?.getProviderState?.();
console.log(providerState?.permissions);
const publicKey = providerState?.permissions.accountInteraction?.publicKey;
console.log(publicKey);
try {
const base64 = btoa(
JSON.stringify({
walletAddress: address,
}),
);
const sign = await venomProvider.signDataRaw({ data: base64, publicKey });
dispatch(SubmitWallet({ publicKey, base64, signature: sign.signature }));
} catch (errr) {
console.log(errr);
}
};
and my backend code:
const { publicKey, base64, signature } = req.body;
const verificaiton = await ever.verifySignature({
publicKey,
dataHash: base64,
signature: signature,
});
if (!verificaiton.isValid) {
return res.status(403).json({
error: "Signature is not valid",
});
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant