automation
The package provides a set of utility functions to handle
interactions with Automation smart contracts.
Automation V2 triggers start with id = 101.
Usage
Encoding
import { encodeTriggerData } from '@oasisdex/automation'
const network = 1;
const closeCommandAddress = '0x...';
const encodedData = encodeTriggerData(closeCommandAddress, network, [cdpId, triggerType, ...params]);
Decoding
import { decodeTriggerData } from '@oasisdex/automation'
const network = 1;
const closeCommandAddress = '0x...';
const { triggerData } = triggerInfo
const [ cdpId, triggerType, ...params ] = decodeTriggerData(closeCommandAddress, network, triggerData);