// code example of creating a sync event from cloud code
let options = {
chainId: â0x38â,
topic: âSwap(address,uint256,uint256,uint256,uint256,address)â,
address:â0x05faf555522fa3f93959f86b41a3808666093210â
abi: {
anonymous: false,
inputs: [
{
indexed: true,
internalType: âaddressâ,
name: âsenderâ,
type: âaddressâ,
},
{
indexed: false,
internalType: âuint256â,
name: âamount0Inâ,
type: âuint256â,
},
{
indexed: false,
internalType: âuint256â,
name: âamount1Inâ,
type: âuint256â,
},
{
indexed: false,
internalType: âuint256â,
name: âamount0Outâ,
type: âuint256â,
},
{
indexed: false,
internalType: âuint256â,
name: âamount1Outâ,
type: âuint256â,
},
{
indexed: true,
internalType: âaddressâ,
name: âtoâ,
type: âaddressâ,
},
],
name: âSwapâ,
type: âeventâ,
},
limit: 500000,
tableName: âUniPairCreatedwqâ,
sync_historical: false,
};
Moralis.Cloud.run(âwatchContractEventâ, options, { useMasterKey: true });