timer_callback

timer_callback | code​

/**
* LiquidScheduler uses the timer_callback to run the cron logic within the consumer contract
*
* @param {name} timer - account name to scope the timer within
* @param {std::vector<char>} payload - payload to be accessed within the timer_callback function in the consumer contract
* @param {uint32_t} seconds - seconds to repeat the cron
*
* Notes
* - can return true to create an infinite loop, false breaks the loop
*
* Example:
*
* @code
* bool timer_callback(name timer, std::vector<char> payload, uint32_t seconds){
* stats_def statstable(_self, _self.value);
* stat newstats;
* if(!statstable.exists()){
* statstable.set(newstats, _self);
* }
* else {
* newstats = statstable.get();
* }
* newstats.counter++;
* statstable.set(newstats, _self);
* return (newstats.counter < 10);
* }
* @endcode
*/
Copy link