Moralis way of Adding a Custom Token to Metamask

I’d like to find out what’s the Moralis way of adding a custom token to metamask

In the past, this is the typical code. I am just wondering if there’s a Moralis way of doing this.

const tokenAddress = '0xd00981105e61274c8a5cd5a88fe7e037d935b513';
const tokenSymbol = 'TUT';
const tokenDecimals = 18;
const tokenImage = 'http://placekitten.com/200/300';

try {
  // wasAdded is a boolean. Like any RPC method, an error may be thrown.
  const wasAdded = await ethereum.request({
    method: 'wallet_watchAsset',
    params: {
      type: 'ERC20', // Initially only supports ERC20, but eventually more!
      options: {
        address: tokenAddress, // The address that the token is at.
        symbol: tokenSymbol, // A ticker symbol or shorthand, up to 5 chars.
        decimals: tokenDecimals, // The number of decimals in the token
        image: tokenImage, // A string url of the token logo
      },
    },
  });

  if (wasAdded) {
    console.log('Thanks for your interest!');
  } else {
    console.log('Your loss!');
  }
} catch (error) {
  console.log(error);
}

I don’t think that there is a specific way to do it for Moralis.

Is there something like Moralis.getProvider.request() that wraps window.ethereum?

maybe after calling Moralis.enableWeb3() window.ethereum is accessible, if the fact that window.ethereum is not accessible is the problem that you want to mention

Thank you. No, actually I don’t have a problem. It just seems that Moralis has a web3 provider manager. I am wondering if it’s preferred to call metamask api through that manager. If there isn’t one, it’s ok. Thank you for the quick response.