below is the default.js file.
define(
[
'uiComponent',
'Magento_Checkout/js/model/payment/renderer-list'
],
function (
Component,
rendererList
) {
'use strict';
rendererList.push(
{
type: 'payment',
component: 'vendor_module/js/view/payment/method-renderer/iostpay-method'
}
);
return Component.extend({});
}
);
function log(msg) {
console.log( msg ) ;
}
var transfer;
document.addEventListener("DOMContentLoaded", async function(event) {
await new Promise(done => setTimeout(() => done(), 500));
IWalletJS.enable().then(function(account) {
if(!account) return;
const iost = IWalletJS.newIOST(IOST);
transfer = function() {
const tx = iost.callABI("token.iost", "transfer", ["iost", account, 'account****', "10", "dapp test memo"]);
tx.addApprove("iost", "10");
console.log(tx.getApproveList());
iost.signAndSend(tx)
.on('pending', function(txid) {
log("txid: " + txid);
})
.on('success', function(result) {
log("res: " + JSON.stringify(result));
})
.on('failed', function(failed) {
log("failed: " + JSON.stringify(failed));
})
}
})
})
what thing am I missing?