@defisaver/automation-sdk 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,9 @@ export declare const makerRatioTrigger: {
25
25
  };
26
26
  };
27
27
  export declare const aaveV3RatioTrigger: {
28
+ encode(owner: EthereumAddress, market: EthereumAddress, ratioPercentage: number, ratioState: RatioState): string[];
28
29
  decode(triggerData: string[]): {
30
+ owner: string;
29
31
  market: string;
30
32
  ratio: number;
31
33
  ratioState: number;
@@ -33,9 +33,14 @@ export const makerRatioTrigger = {
33
33
  },
34
34
  };
35
35
  export const aaveV3RatioTrigger = {
36
+ encode(owner, market, ratioPercentage, ratioState) {
37
+ const ratioWei = ratioPercentageToWei(ratioPercentage);
38
+ return [mockedWeb3.eth.abi.encodeParameters(['address', 'address', 'uint256', 'uint8'], [owner, market, ratioWei, ratioState])];
39
+ },
36
40
  decode(triggerData) {
37
41
  const decodedData = mockedWeb3.eth.abi.decodeParameters(['address', 'address', 'uint256', 'uint8'], triggerData[0]);
38
42
  return {
43
+ owner: decodedData[0],
39
44
  market: decodedData[1],
40
45
  ratio: new Dec(mockedWeb3.utils.fromWei(decodedData[2])).mul(100).toNumber(),
41
46
  ratioState: Number(decodedData[3]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/automation-sdk",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "",
5
5
  "main": "./umd/index.js",
6
6
  "module": "./esm/index.js",
@@ -14,7 +14,8 @@
14
14
  "document": "npx typedoc --out docs/default",
15
15
  "lint": "node_modules/.bin/eslint ./src",
16
16
  "gtc": "node scripts/generateContractTypes.js",
17
- "prepare": "husky install && npm run gtc"
17
+ "prepare": "husky install && npm run gtc",
18
+ "cpublish": "yarn build && yarn publish"
18
19
  },
19
20
  "author": "DeFi Saver",
20
21
  "repository": "https://github.com/defisaver/automation-sdk",