How to display transaction status efficiently?

Moralis.Cloud.define("watchAddress", async(request)=>{
  const logger = Moralis.Cloud.getLogger();
  logger.info("watchAddress called from front end")
  const address = request.params.address;
  
  if(!address) throw Error("no address provided");
   const result = await Moralis.Cloud.run("watchEthAddress",{address: address, sync_historical: false}, {useMasterKey:true});
  return result ;
});

This is the code is use as cloud function and when I pass the address from the front end it says invalid function “watchEthAddress” .
As you said “if a user authenticates with metamask, then you don’t have to add that particular eth address to watch because it will be synced automatically”. so you mean that I don’t need to run the above code for every individual user if the use metamask login to access my app ?

  1. I have been using Metamask login for past one month but I couldn’t get the transaction history !

  2. Is it available only for the paid version ?

My computer science degree is in your hands :slight_smile: am building my final semester project using moralis. :+1:

that functionality is available for every server.

what is the server url?

did you update the server recently and it is a nitro server with coreservices plugin?

https://exboijyxfajc.usemoralis.com:2053/server

Server url above…

Nitro server ???

yes, that is a nitro server, and it seems to be updated

what evms/chains did you enable for that server? you can find that information in admin interface

Poylgon mumbai and avax testnet

try to enable also an eth chain if you want to add to watch an address on eth

That’s okay but the problem is that the cloud functions says watchXxxAddress is invalid
(irrespective of any chains)

you tried with other chains too?

This is what I get :frowning:

you tried with watchEthAddress only here?

:slight_smile:

`Moralis.Cloud.define(“watchAddress”, async(request)=>{
const logger = Moralis.Cloud.getLogger();
logger.info(“watchAddress called from front end”)
const address = request.params.address;

if(!address) throw Error(“no address provided”);
const result = await Moralis.Cloud.run(“watchXxxAddress”,{address: address, sync_historical: false}, {useMasterKey:true});
return result ;
});`

that is not how it should work, you have to replace watchXxxAddress with the chain where you want to add that watch, for example on eth is watchEthAddress

Yes I have done so just for the example I have shown… But while defining in the cloud function I did the way you mentioned… you could have seen in that output.

try to enable an eth chain first, then try to use watchEthAddress, also try to enable bsc chain if you try watchbscaddress, for matic you can try watchPolygonAddress

Oh man. I have been tryin with watchMaticAddress instead of watchPolygonAddress. Please update the same in the docs also. :slight_smile:

So for each new user I need to run the code (add to the watchlist) so that I could monitor their transactions right ?

if the user authenticates with metamask, you don’t need to run that code, unless you also want full history of the user transactions

So you mean that if an user authenticate with metamask then Moralis itself shows the transaction data without explicit invocation of cloud function ? But in my case its not showing the transactions ? Should I enable anything ?

you should not enable anything, it should work automatically, in your server settings you can select for each evm/chain how many transactions to sync historically on every chain for an address

So you’re that the transactions gets updated in the DB in the name of PolygonTransactions, EthTransactions etc class. or you’re telling about the _AddressSyncStatus ?

first option with EthTransactions as example