i copy the code and paste it on my testing page. it just doesnât work to get live update of new transaction. any help will be appreciated. following is copied code: -
//
async function listenNewTrans() {
const query = new Moralis.Query('BscTokenTransfers');
const currentUser = Moralis.User.current();
// create query
//const query = new Moralis.Query("EthTransactions");
query.equalTo("from_address", currentUser.attributes.ethAddress.toLowerCase());
// subscribe to query updates ** add this**
const subscription = await query.subscribe();
console.log(subscription);
handleNewTransaction(subscription);
}
async function handleNewTransaction(subscription) {
// log each new transaction
subscription.on("create", function(data) {
console.log("new transaction: ", data);
});
}
i get this on my chrome console: -
This is what i have in moralis dashboard
Whenever i make a transfer, this âBscTokenTransfersâ object has a new row added but it is not push to chrome.