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

Not able to sign the transaction when integrating Gasless transaction using web3Auth wallet. #139

Open
sudeepkotari opened this issue Jul 29, 2022 · 0 comments

Comments

@sudeepkotari
Copy link

Description
I have created an NFT minting web app, User can authenticate using either Metamask or google login using web3auth. Used Biconomy for the gasless transactions when the user mint an NFT. When I connect my web app using Metamask I can pass my transaction through Biconomy and it will ask to sign the transaction and successful mints an NFT. But if I connect my web app with google login using web3auth I can able to read and write a smart contract with paying gas commonly it works fine but if I try to call the transaction using Biconomy I am getting the "The requested account and/or method has not been authorized by the user." error, and not able to sign the transaction.

To Reproduce
import { Biconomy } from "@biconomy/mexa";
import Web3 from "web3";

const [contract, setContract] = useState({});
const [biconomyProvider, setBiconomyProvider] = useState({});

const networkProvider = new Web3.providers.HttpProvider(RPCURL);
const biconomyApiKey = <Biconomy_API_KEY>

const web3 = new Web3(Web3.givenProvider);
const biconomy = new Biconomy(networkProvider, {
walletProvider: web3.currentProvider,
apiKey: biconomyApiKey,
debug: true,
});

setBiconomyProvider(biconomy);
web3.setProvider(biconomy);

biconomy
.onEvent(biconomy.READY, () => {
const ABI: any[] = MINTNFT.abi;
const contractInst = new web3.eth.Contract(ABI, ContractAddress);
setContract(contractInst);
})
.onEvent(biconomy.ERROR, (ex: any) => {
console.log("biconomy error", ex);
});
Once Biconomy is initialized I tried calling the mint function

const tokenURI = "https://example.com/1.json";
let tx = contract.methods.mintNFT(tokenURI).send({
from: walletAddress.toString(),
to: "0xCCd18xxxxxxxxxxxxxb446b97C3", // Contract address
signatureType: biconomyProvider["EIP712_SIGN"],
});

tx.on("transactionHash", function () {})
.once("confirmation", function (transactionHash: any) {
console.log("transactionHash", transactionHash);
})
.on("error", function (ex: any) {
console.log("exception", ex);
});
And it returns

{code: 4100, message: 'The requested account and/or method has not been authorized by the user.'}

Expected behavior
Same if I try with Metamask wallet connection, It triggers the popup to sign the transaction and generated the hash

Screenshot

Screenshot from 2022-07-29 11-49-59

Device Info (please complete the following information):
Device: MacBook Pro, Apple M1
OS: Big Sur
Browser: Brave
Web3Auth Version: 1.0.0
Biconomy Version: 2.0.32
Web3 Version: 1.7.3

@sudeepkotari sudeepkotari changed the title Not able to sign the transaction when integrating Gasless transaction using Not able to sign the transaction when integrating Gasless transaction using web3Auth wallet. Jul 29, 2022
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