Hi Everyone,
I want to achieve an automatic trigger inside the Cloud function whenever Moralis.transfer(options) is called. I want to pass some custom values with options. And get the result from the transfer function call inside the Cloud trigger automatically. Can this be done? Because I am creating another table data after the transfer function, so to be on the secure side want to perform execution just after the transfer is successful inside the serverside automatically.
1 Like
Hi @Yomoo,
I am getting
Error: {“message”:“Moralis.Web3API.native.getTransaction is not a function”,“code”:141}
Moralis.Cloud.afterSave("BscTransactions", async(request) => {
const logger = Moralis.Cloud.getLogger();
const hash = request.object.get('hash');
const options = { chain: "bsc testnet", transaction_hash: hash};
const transaction = await Moralis.Web3API.native.getTransaction(options);
logger.info(transaction);
})
What I am trying to do is get the value of the transaction.
@mauriya, until we will make that getTransaction available in Moralis SDK, you can use a HTTP request like in this post: Is it possible to get contents of block using a transaction hash?