Moralis Transfer Native not working on Polygon

I just start using moralis & create some function transfer on polygon mainnet but its not working

code :slight_smile:

  const { Moralis } = useMoralis();
  const [tx, setTx] = useState();
  const [amount, setAmount] = useState();
  const [isPending, setIsPending] = useState(false);

  useEffect(() => {
    amount? setTx({ amount}) : setTx();
  }, [amount]);
  
    async function transfer() {
      const { amount} = tx;
      let options = {};
      {
          options = {
            native: "native",
            amount: Moralis.Units.ETH(amount),
            receiver: "0xd...........( example receiver address)"
          };
      }
      await Moralis.transfer(options);
  }

metamask call errors :

297018754_5833313653365104_626672478458385183_n

pls help thanks

does it pop up metamask where you can click on confirm and it fails after that, or it doesn’t even get to that metamask popup?

it seems to be related to the gas price

the pop up is showing, after i clicked transfer it always failed. i just try sending 1 matic, 0.1 matic or 0.001 matic still failed.

working on mumbai but it failed on mainnet

what is the gas price that is set? does that transaction fail or it doesn’t even get to be submitted on chain?

yes the problem is in the gas, i need to apply it manually.

can i set the gas charge in the transfer function to make it automatic?

I don’t know of a way to set it in that transfer function, you could do that if you use web3 or ethers directly, in that case you’ll have to write more code to do that transfer

maybe i can add a function to set gas price in options? or outside?

has anyone experienced this on a polygon network pls :sweat_smile:

the speedy-nodes feature moralis is gone now right? I can’t find it

speedy nodes are discontinued, there isn’t a way to set gas price in options for transfer from what I know, you can use ethers directly, same thing that Moralis.transfer uses

try to use another RPC url in metamask, it’s just a problem w some bad RPC url

you can use one from https://moralis.io/largenodes since speedy node is deprecated