I am using wagmi usePrepareContractWrite
and write
to write to my contract. I am allowing the user to upload fields and create an NFT. Is there a way to set the args in the write function? For example i have
const { config, status } = usePrepareContractWrite({
addressOrName: "0xADDRESS",
contractInterface: "abi file",
functionName: "safeMint",
});
const { data, isLoading, isSuccess, write } = useContractWrite(config);
write();
It works fine if i add the args:["address", "NFT data"]
in the usePrepareContractWrite
. However is there a way to set this in write()
instead? As the NFT information is only available later after the user uploads and image and fields.