I have tried this solution and it worked but only if I use privateKey of the wallet which I used to create custom tokens but what if I want to send from B wallet to C wallet and when I am trying it, the transaction is happening but it's failing.
var contract = new ethers.Contract(contractAddress, abi, wallet);
var numberOfTokens = ethers.utils.parseUnits('10.0',numberOfDecimals);
var options = { gasLimit: 1500000, gasPrice: ethers.utils.parseUnits('1.0', 'gwei') };
contract.transferFrom(fromAddress, targetAddress,numberOfTokens,options).then(function (tx) { console.log(tx); });
thanks
approve
for the tokens? They can't be transferred without his consent.