Call a smart contract function with privateKey

is it Master Key or what?

No, it is something else, not the master key. You will find it in admin interface in account settings.

I tried that code, but the result is the same - a metamask window appears to confirm the transaction…

You have to run that code in nodejs not in the browser

received error:
Error: Invalid JSON RPC response: “Method not allowed”

What is the code that you used?

Moralis = require('moralis/node');
const serverUrl = "https://xf6ve7e.........ver";
const appId = "dr............Kaxeub3zh";

x = async () => {
    console.log(Moralis.CoreManager.get("VERSION"));
    let moralisSecret = "KF................yaw5bwc9juLrI3Kgrti";
    await Moralis.start({ serverUrl, appId,  moralisSecret });
    await Moralis.enableWeb3({
        chainId: 0x89,
        privateKey:
           "0058233ed1.................e2e619e3f4795a", });
    const options = {
      type: "erc20",
      amount: Moralis.Units.Token("0.5", "18"),
      receiver: "0x3f76188FE26EA8197C6b4729f998B9Ea4425beb6",
      contractAddress: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
    };
    let result = await Moralis.transfer(options);
    console.log(result);
}

x();

you have latest version of Moralis SDK?

you don’t need to specify serverUrl and appId for this

updated SDK
but transfer didnt executed…
console:

{
  type: 2,
  chainId: 137,
  nonce: 5,
  maxPriorityFeePerGas: BigNumber { _hex: '0x59682f00', _isBigNumber: true },
  maxFeePerGas: BigNumber { _hex: '0x59682f2e', _isBigNumber: true },
  gasPrice: null,
  gasLimit: BigNumber { _hex: '0xc9ab', _isBigNumber: true },
  to: '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270',
  value: BigNumber { _hex: '0x00', _isBigNumber: true },
  data: '0xa9059cbb0000000000000000000000003f76188fe26ea8197c6b4729f998b9ea4425beb600000000000000000000000000000000000000000000000006f05b59d3b20000',
  accessList: [],
  hash: '0xd950e8968d7dfa9ab0cbc969c6271ececfc77840872f45853d0151f55a857cb4',
  v: 1,
  r: '0x3ffffdbcb80b073bb178b18c881e4fe3a9c1e90b60f58c78560f850a5a60a84f',
  s: '0x492de3e35c9c916d302c4a324ef1a29632e361f7695e2a8b1e904482ae676ee8',
  from: '0x8D3a62174a7b3C05873F856C98c9B1fbA81B8904',
  confirmations: 0,
  wait: [Function (anonymous)]
}

suspect problem is “gasPrice: null”

I tested on bsc testnet and I didn’t get any error, it looks like you try it on polygon

I have gasPrice in my case

how can I set gasprice?

I don’t think that there is a way to do that now

I tested now on bsc mainnet and it works fine there too

I don’t have a token on polygon network in order to test now

I can send ))
provide your address

meanwhile I tried native transfer on polygon and it looks like I got into same problem as you

so… the problem is unsolvable?

It looks like we don’t have a fix now for polygon in particular. We may have to add that gasPrice parameter to the function.

You can use etherjs or web3 directly for now

thank you, any way…