Any help would be amazing!
I am using a uniswap router to create a stable way of making donations. OZ sentinel is picking up the events I have emitted. As per the OZ workshop on minting NFT's when a swap occurs, i wish to do a similar thing. However, the .JS auto task code is very specific to the tutorial, and i wish to trigger an NFT mint on the simple act of a function being manually called.
The entry point is causing my issues, specifying event.params.to;
. I am looking for a syntax that broadly executes the NFT mint function when the monitored contract function is called manually, via MEW for instance. The sentinel picks up the emitted events, i just need some broader terminology, .JS is not my strong point!
Any input is greatly appreciated
// Entrypoint for the Autotask
exports.handler = async function(params) {
const provider = new DefenderRelayProvider(params);
const signer = new DefenderRelaySigner(params, provider, { speed: 'fast' });
const { KeyValueStoreClient } = require('defender-kvstore-client');
const storage = new KeyValueStoreClient(params);
const [event] = params.request.body.matchReasons;
console.log('Received match', JSON.stringify(event));
const recipient = event.params.to;
console.log(`Processing trade for ${recipient}`);
await main(recipient, signer, storage);
}
Link to OZ .JS code.
Link to this AWESOME workshop!