I am using this setup with sveltekit.
I am setting the code like this and including my biconmy paypaster described here from thirdweb documentation: Bundler & Paymaster Infrastructure | thirdweb
const TWFactoryAddress = TW_FACTORY_SMART_ADDRESS; // on Mumbai
const wallet = new EmbeddedWallet({
chain: Mumbai,
clientId: THIRD_WEB_CLIENT_ID,
});
// const authResult = await wallet.authenticate({
// strategy: "jwt",
// jwt: currentToken,
// encryptionKey: THIRD_WEB_ENCRYPT_SECRET,
// });
// const authResult = await wallet.authenticate({
// strategy: "google",
// });
console.log("🎟️ wallet", wallet)
let user_custo_wallet = await wallet.getAddress()
console.log("🎟️ user_custo_wallet", user_custo_wallet)
let walletSigner = await wallet.getSigner();
console.log("🔵 walletSigner", walletSigner);
const config = {
chain: Mumbai,
factoryAddress: TWFactoryAddress,
clientId: THIRD_WEB_CLIENT_ID,
gasless: true,
// bundlerUrl: "your-bundler-url",
paymasterUrl: `https://paymaster.biconomy.io/api/v1/80001/${BICONOMY_API_KEY}`,
};
// Connect the smart wallet
const smartWallet = new SmartWallet(config);
await smartWallet.connect({ personalWallet: wallet });
const isDeployed = await smartWallet.isDeployed();
if(!isDeployed){
await smartWallet.deploy();
}
const t3_smartAccount = await smartWallet.getAddress();
then here during the contract.safeMint call is where I get the 400 error as mentioned.
const totalValue = ethers.BigNumber.from(voucher.price);
//sends transaction
const transaction = await contract.safeMint(voucher, { value: totalValue.toString(), gasLimit: 400000 });
const receipt = await transaction.wait();
// Process the transaction
txnHash = transaction.hash;
persistedTxnHash = transaction.hash;
and now when I proceed to trigger the transaction, I get this error: