I added smart contract in dashboard .
my code
static createPatientAccount = async (
patientID: any,
name: any,
gender: any,
age: number,
location: any,
birthday: any,
emailAddress: any,smartAccount:any
) => {
try {
const contract = await Contract.fetchContract();
const tx = await contract?.populateTransaction.setPatient(
BigInt(patientID * 1),
name,
gender,
BigInt(age * 1),
location,birthday,emailAddress
);
const tx1 = {
to: contractAddress,
data: tx?.data,
};
const userOpResponse = await smartAccount.sendTransaction(tx1, {
paymasterServiceData: { mode: PaymasterMode.ERC20 },
});
console.log('userOpResponse',userOpResponse)
} catch (error) {
console.log(error)
}
};
smart wallet config
const smartWallet = await createSmartAccountClient({
signer: signer,
biconomyPaymasterApiKey: config.biconomyPaymasterApiKey,
bundlerUrl: config.bundlerUrl,
rpcUrl: chains.providerUrl,
chainId: chains.chainId,
});