Hi there.
I’m new to use Moralis, so I ask you not to kick me)
Is it possible to use Moralis nodes with web3Js for use something like subscribes for transactions of specified addresses in the Avalanche testnet? So I put some addresses and create subscribe for a new transactions.
On the one hand, on the main page found an interesting code:
Moralis.Web3();
binanceWallet = "0x...";
// create query
Moralis.Query("EthTransactions");
query.equalTo("to_address", binanceWallet);
// subscribe for real-time updates
query.subscribe();
subscription.on("create", function(data)
{
web3.utils.fromWei(data.attributes.value);
console.log(`${amountEth} deposited to Binance`);
});
But, he does not quite suit me … On the other hand, I found it in the documentation: Events.
- onWeb3Enabled
- onWeb3Deactivated
- onChainChanged
- onAccountChanged
- onConnect (fired from the EIP1193 provider)
- onDisconnect (fired from the EIP1193 provider)
This is also not exactly what I need (((
So for example I see code like this:
Moralis.Web3();
avalancheWallet = "0x...";
// create query
Moralis.Query("<????>");
query.equalTo("to_address", avalancheWallet);
// subscribe for real-time updates
query.subscribe();
subscription.on("Transfer", function(tx)
{
console.log(`${tx}`);
});
I will be grateful for any useful information.
Thanks.