@oasisdex/automation
v1.6.6
Published
The set of utilities for Oasis automation
Downloads
796
Keywords
Readme
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; // mainnet
const closeCommandAddress = '0x...';
const encodedData = encodeTriggerData(closeCommandAddress, network, [cdpId, triggerType, ...params]);
Decoding
import { decodeTriggerData } from '@oasisdex/automation'
const network = 1; // mainnet
const closeCommandAddress = '0x...';
const { triggerData } = triggerInfo
const [ cdpId, triggerType, ...params ] = decodeTriggerData(closeCommandAddress, network, triggerData);