Hey Moralis Team,
i was following Ivans tutorial on the new fiat onramp plugins. was copying the code, unfortunately it throws the following error(s):
after posting the issue in discord/troubleshooting i ran the following commands npm install react, react-dom , moralis , moralis-react & vanillajs. nothing worked unfortunately.
Appreciate your help once again!
code:
<html>
<head>
<title>Vanilla Boilerplate</title>
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<script src="https://npmcdn.com/[email protected]/dist/moralis.js"></script>
</head>
<body>
<button id="btn-login" onclick="dumpFiat()">Dump Fiat</button>
<iframe id="myIframe" src="" width = "350" height="650" style ="display:none"></iframe> <br>
<script>
// connect to Moralis server
Moralis.initialize("9xPG6EnH2JW77pGfdcSZzHZCCP4Yd28csymO4Dcv");
Moralis.serverURL = "https://qejutygvunvz.moralisweb3.com:2053/server";
(async function init(){
await Moralis.initPlugins();
})();
function dumpFiat(){
console.log("dumping");
Moralis.Plugins.fiat.buy();
}
async function iframefiat(){
let result = await Moralis.Plugins.fiat.buy( undefined, {disableTriggers: true});
document.getElementById("myIframe").style.display = "block";
document.getElementById("myIframe").src = result.result.data;
}
</script>
</body>
</html>