otomato-sdk 2.0.3 → 2.0.4

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.
Files changed (27) hide show
  1. package/dist/src/constants/Blocks.js +528 -69
  2. package/dist/src/constants/tokens.js +147 -0
  3. package/dist/src/constants/version.js +1 -1
  4. package/dist/src/utils/externalVariables.js +4 -0
  5. package/dist/types/examples/aave-trigger-borrow-action-borrow.d.ts +1 -0
  6. package/dist/types/examples/aave-trigger-supply-action-supply.d.ts +1 -0
  7. package/dist/types/examples/create-workflow-with-external-variable-condition.d.ts +1 -0
  8. package/dist/types/examples/ionic-base-supply.d.ts +1 -0
  9. package/dist/types/examples/ionic-base-withdraw.d.ts +1 -0
  10. package/dist/types/examples/ionic-trigger-lending.d.ts +1 -0
  11. package/dist/types/examples/ionic-trigger-withdraw.d.ts +1 -0
  12. package/dist/types/examples/moonwell-borrow-trigger-deposit-action.d.ts +1 -0
  13. package/dist/types/examples/moonwell-borrow.d.ts +1 -0
  14. package/dist/types/examples/moonwell-repay.d.ts +1 -0
  15. package/dist/types/examples/moonwell-supply-trigger-withdraw-action.d.ts +1 -0
  16. package/dist/types/examples/protocols/aave_trigger_borrow_action_borrow.d.ts +1 -0
  17. package/dist/types/examples/protocols/aave_trigger_borrow_action_withdraw.d.ts +1 -0
  18. package/dist/types/examples/protocols/aave_trigger_supply_action_supply.d.ts +1 -0
  19. package/dist/types/examples/protocols/ionic_base_supply.d.ts +1 -0
  20. package/dist/types/examples/protocols/ionic_base_withdraw.d.ts +1 -0
  21. package/dist/types/examples/yield-comparator.d.ts +1 -0
  22. package/dist/types/src/constants/Blocks.d.ts +197 -4
  23. package/dist/types/src/constants/WorkflowTemplates.d.ts +1 -0
  24. package/dist/types/src/constants/version.d.ts +1 -1
  25. package/dist/types/src/utils/externalVariables.d.ts +1 -0
  26. package/dist/types/test/externalVariables.spec.d.ts +1 -0
  27. package/package.json +1 -1
@@ -1,4 +1,26 @@
1
1
  export const TRIGGERS = {
2
+ "CORE": {
3
+ "EVERY_PERIOD": {
4
+ "description": "Triggers the workflow every period (e.g every hour)",
5
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/every_hour_trigger.png",
6
+ "EVERY_PERIOD": {
7
+ "name": "Every period",
8
+ "type": 4,
9
+ "description": "Triggers the workflow every period (e.g every hour)",
10
+ "parameters": [
11
+ {
12
+ "key": "period",
13
+ "type": "integer",
14
+ "description": "The period to wait between each run (in ms)",
15
+ "mandatory": true,
16
+ "category": 0
17
+ },
18
+ ],
19
+ "blockId": 18,
20
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/every_hour_trigger.png"
21
+ }
22
+ }
23
+ },
2
24
  "TOKENS": {
3
25
  "TRANSFER": {
4
26
  "description": "Monitors token transfers",
@@ -93,6 +115,7 @@ export const TRIGGERS = {
93
115
  "BALANCE": {
94
116
  "name": "ERC20 balance check",
95
117
  "description": "Fetches the balance of an ERC20 and checks it against the specified condition.",
118
+ "prototype": "erc20Balance",
96
119
  "type": 1,
97
120
  "method": "function balanceOf(address account) view returns (uint256)",
98
121
  "output": {
@@ -215,6 +238,7 @@ export const TRIGGERS = {
215
238
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/trend-up.png",
216
239
  "PRICE_MOVEMENT_AGAINST_CURRENCY": {
217
240
  "name": "On-Chain Price Movement Against Fiat Currency",
241
+ "prototype": "priceMovementAgainstCurrency",
218
242
  "description": "This trigger activates when the on-chain price of an asset moves against a specified currency based on the given condition.",
219
243
  "type": 2,
220
244
  "output": {
@@ -354,6 +378,7 @@ export const TRIGGERS = {
354
378
  "name": "sUSDE yield",
355
379
  "description": "Fetches Ethena's sUSDE yield",
356
380
  "type": 3,
381
+ "prototype": "sUSDEYield",
357
382
  "output": {
358
383
  "yield": "float"
359
384
  },
@@ -410,6 +435,7 @@ export const TRIGGERS = {
410
435
  "name": "USDE supply",
411
436
  "description": "Fetches Ethena's USDE supply",
412
437
  "type": 1,
438
+ "prototype": "usdeSupply",
413
439
  "method": "function totalSupply() public view virtual override returns (uint256)",
414
440
  "output": {
415
441
  "supply": "integer"
@@ -659,12 +685,14 @@ export const TRIGGERS = {
659
685
  "IONIC": {
660
686
  "description": "#1 money market for Yield Bearing Assets on the OP Superchain",
661
687
  "chains": [
662
- 34443
688
+ 34443,
689
+ 8453
663
690
  ],
664
691
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ionic.jpg",
665
692
  "LENDING_RATE": {
666
693
  "name": "Lending rate",
667
694
  "description": "Get the lending rate of any asset on Ionic",
695
+ "prototype": "ionicLendingRate",
668
696
  "type": 1,
669
697
  "method": "function supplyRatePerBlock() external view returns (uint256)",
670
698
  "parameters": [
@@ -680,7 +708,7 @@ export const TRIGGERS = {
680
708
  "type": "erc20",
681
709
  "description": "The token you want to fetch the yield",
682
710
  "mandatory": true,
683
- "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"34443\": [\n \"0xf0F161fDA2712DB8b566946122a5af183995e2eD\",\n \"0xd988097fb8612cc24eeC14542bC03424c656005f\",\n \"0x2416092f143378750bb29b79eD961ab195CcEea5\",\n \"0x4200000000000000000000000000000000000006\",\n \"0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF\",\n \"0x80137510979822322193FC997d400D5A6C747bf7\",\n \"0xe7903B1F75C534Dd8159b313d92cDCfbC62cB3Cd\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x59889b7021243dB5B1e065385F918316cD90D46c\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
711
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"8453\": [\n \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"0x4200000000000000000000000000000000000006\"\n ],\n \"34443\": [\n \"0xf0F161fDA2712DB8b566946122a5af183995e2eD\",\n \"0xd988097fb8612cc24eeC14542bC03424c656005f\",\n \"0x2416092f143378750bb29b79eD961ab195CcEea5\",\n \"0x4200000000000000000000000000000000000006\",\n \"0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF\",\n \"0x80137510979822322193FC997d400D5A6C747bf7\",\n \"0xe7903B1F75C534Dd8159b313d92cDCfbC62cB3Cd\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x59889b7021243dB5B1e065385F918316cD90D46c\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
684
712
  "category": 0
685
713
  },
686
714
  {
@@ -732,6 +760,7 @@ export const TRIGGERS = {
732
760
  "name": "Borrowing rate",
733
761
  "description": "Get the borrowing rate of any asset on Ionic",
734
762
  "type": 1,
763
+ "prototype": "ionicBorrowingRate",
735
764
  "method": "function borrowRatePerBlock() external view returns (uint256)",
736
765
  "parameters": [
737
766
  {
@@ -746,7 +775,7 @@ export const TRIGGERS = {
746
775
  "type": "erc20",
747
776
  "description": "The token you want to fetch the borrow rate for",
748
777
  "mandatory": true,
749
- "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"34443\": [\n \"0xf0F161fDA2712DB8b566946122a5af183995e2eD\",\n \"0xd988097fb8612cc24eeC14542bC03424c656005f\",\n \"0x2416092f143378750bb29b79eD961ab195CcEea5\",\n \"0x4200000000000000000000000000000000000006\",\n \"0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF\",\n \"0x80137510979822322193FC997d400D5A6C747bf7\",\n \"0xe7903B1F75C534Dd8159b313d92cDCfbC62cB3Cd\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x59889b7021243dB5B1e065385F918316cD90D46c\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
778
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"8453\": [\n \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"0x4200000000000000000000000000000000000006\"\n ],\n \"34443\": [\n \"0xf0F161fDA2712DB8b566946122a5af183995e2eD\",\n \"0xd988097fb8612cc24eeC14542bC03424c656005f\",\n \"0x2416092f143378750bb29b79eD961ab195CcEea5\",\n \"0x4200000000000000000000000000000000000006\",\n \"0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF\",\n \"0x80137510979822322193FC997d400D5A6C747bf7\",\n \"0xe7903B1F75C534Dd8159b313d92cDCfbC62cB3Cd\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x59889b7021243dB5B1e065385F918316cD90D46c\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
750
779
  "category": 0
751
780
  },
752
781
  {
@@ -882,6 +911,209 @@ export const TRIGGERS = {
882
911
  "blockId": 8,
883
912
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/astaria.png"
884
913
  }
914
+ },
915
+ "AAVE": {
916
+ "description": "Aave",
917
+ "chains": [
918
+ 8453
919
+ ],
920
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/aave.jpg",
921
+ "LENDING_RATE": {
922
+ "name": "Lending rate",
923
+ "description": "Get the lending rate of any asset on Aave",
924
+ "prototype": "aaveLendingRate",
925
+ "type": 1,
926
+ "method": "function getReserveData(address asset) external view returns (uint256 totalLiquidity, uint256 availableLiquidity, uint256 totalBorrowsStable, uint256 totalBorrowsVariable, uint256 liquidityRate, uint256 variableBorrowRate, uint256 stableBorrowRate, uint256 averageStableBorrowRate, uint256 utilizationRate, uint256 liquidityIndex, uint256 variableBorrowIndex, address aTokenAddress, uint40 lastUpdateTimestamp)",
927
+ "parameters": [
928
+ {
929
+ "key": "chainId",
930
+ "type": "chainId",
931
+ "description": "Chain ID of the network",
932
+ "mandatory": true,
933
+ "category": 0
934
+ },
935
+ {
936
+ "key": "abiParams.asset",
937
+ "type": "erc20",
938
+ "description": "The token you want to fetch the lending rate",
939
+ "mandatory": true,
940
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n\n return availableLendingTokens[env.parameters.chainId] || [];\n }",
941
+ "category": 0
942
+ },
943
+ {
944
+ "key": "condition",
945
+ "type": "logic_operator",
946
+ "description": "Logic operator used for the comparison: <, >, <=, >=, ==, ...",
947
+ "mandatory": true,
948
+ "category": 0
949
+ },
950
+ {
951
+ "key": "comparisonValue",
952
+ "type": "float",
953
+ "description": "The value to compare to",
954
+ "mandatory": true,
955
+ "category": 0
956
+ },
957
+ ],
958
+ "output": {
959
+ "lendingRate": "float"
960
+ },
961
+ "blockId": 19,
962
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/aave.jpg"
963
+ },
964
+ "BORROWING_RATES": {
965
+ "name": "Borrowing rate",
966
+ "description": "Get the borrowing rate of any asset on Aave",
967
+ "type": 1,
968
+ "prototype": "aaveBorrowingRate",
969
+ "method": "function getReserveData(address asset) external view returns (uint256 totalLiquidity, uint256 availableLiquidity, uint256 totalBorrowsStable, uint256 totalBorrowsVariable, uint256 liquidityRate, uint256 variableBorrowRate, uint256 stableBorrowRate, uint256 averageStableBorrowRate, uint256 utilizationRate, uint256 liquidityIndex, uint256 variableBorrowIndex, address aTokenAddress, uint40 lastUpdateTimestamp)",
970
+ "parameters": [
971
+ {
972
+ "key": "chainId",
973
+ "type": "chainId",
974
+ "description": "Chain ID of the network",
975
+ "mandatory": true,
976
+ "category": 0
977
+ },
978
+ {
979
+ "key": "abiParams.asset",
980
+ "type": "erc20",
981
+ "description": "The token you want to fetch the borrow rate for",
982
+ "mandatory": true,
983
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n\n return availableLendingTokens[env.parameters.chainId] || [];\n }",
984
+ "category": 0
985
+ },
986
+ {
987
+ "key": "condition",
988
+ "type": "logic_operator",
989
+ "description": "Logic operator used for the comparison: <, >, <=, >=, ==, ...",
990
+ "mandatory": true,
991
+ "category": 0
992
+ },
993
+ {
994
+ "key": "comparisonValue",
995
+ "type": "float",
996
+ "description": "The value to compare to",
997
+ "mandatory": true,
998
+ "category": 0
999
+ },
1000
+ ],
1001
+ "output": {
1002
+ "borrowingRate": "float"
1003
+ },
1004
+ "blockId": 20,
1005
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/aave.jpg"
1006
+ }
1007
+ },
1008
+ "MOONWELL": {
1009
+ "description": "#1 money market for Yield Bearing Assets on the OP Superchain",
1010
+ "chains": [
1011
+ 34443,
1012
+ 8453
1013
+ ],
1014
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/moonwell.jpg",
1015
+ "LENDING_RATE": {
1016
+ "name": "Lending rate",
1017
+ "description": "Get the lending rate of any asset on Moonwell",
1018
+ "prototype": "moonwellLendingRate",
1019
+ "type": 1,
1020
+ "method": "function getMarketInfo(address token) external view returns ((address market, bool isListed, uint256 borrowCap, uint256 supplyCap, bool mintPaused, bool borrowPaused, uint256 collateralFactor, uint256 underlyingPrice, uint256 totalSupply, uint256 totalBorrows, uint256 totalReserves, uint256 cash, uint256 exchangeRate, uint256 borrowIndex, uint256 reserveFactor, uint256 borrowRate, uint256 supplyRate, (address token, uint256 supplyIncentivesPerSec, uint256 borrowIncentivesPerSec)[] incentives))",
1021
+ "parameters": [
1022
+ {
1023
+ "key": "chainId",
1024
+ "type": "chainId",
1025
+ "description": "Chain ID of the network",
1026
+ "mandatory": true,
1027
+ "category": 0
1028
+ },
1029
+ {
1030
+ "key": "lendingRateToken",
1031
+ "type": "erc20",
1032
+ "description": "The token you want to fetch the yield",
1033
+ "mandatory": true,
1034
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"8453\": [\n \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"0x4200000000000000000000000000000000000006\",\n \"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22\",\n \"0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x940181a94a35a4569e4529a3cdfb74e38fd98631\",\n \"0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf\",\n \"0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
1035
+ "category": 0
1036
+ },
1037
+ {
1038
+ "key": "abiParams.token",
1039
+ "type": "erc20",
1040
+ "description": "The token you want to fetch the yield",
1041
+ "mandatory": true,
1042
+ "hideInUI": true,
1043
+ "category": 0
1044
+ },
1045
+ {
1046
+ "key": "condition",
1047
+ "type": "logic_operator",
1048
+ "description": "Logic operator used for the comparison: <, >, <=, >=, ==, ...",
1049
+ "mandatory": true,
1050
+ "category": 0
1051
+ },
1052
+ {
1053
+ "key": "comparisonValue",
1054
+ "type": "float",
1055
+ "description": "The value to compare to",
1056
+ "mandatory": true,
1057
+ "category": 0
1058
+ },
1059
+ ],
1060
+ "output": {
1061
+ "lendingRate": "float"
1062
+ },
1063
+ "blockId": 21,
1064
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/moonwell.jpg"
1065
+ },
1066
+ "BORROWING_RATES": {
1067
+ "name": "Borrowing rate",
1068
+ "description": "Get the borrowing rate of any asset on Moonwell",
1069
+ "type": 1,
1070
+ "prototype": "moonwellBorrowingRate",
1071
+ "method": "function getMarketInfo(address token) external view returns ((address market, bool isListed, uint256 borrowCap, uint256 supplyCap, bool mintPaused, bool borrowPaused, uint256 collateralFactor, uint256 underlyingPrice, uint256 totalSupply, uint256 totalBorrows, uint256 totalReserves, uint256 cash, uint256 exchangeRate, uint256 borrowIndex, uint256 reserveFactor, uint256 borrowRate, uint256 supplyRate, (address token, uint256 supplyIncentivesPerSec, uint256 borrowIncentivesPerSec)[] incentives))",
1072
+ "parameters": [
1073
+ {
1074
+ "key": "chainId",
1075
+ "type": "chainId",
1076
+ "description": "Chain ID of the network",
1077
+ "mandatory": true,
1078
+ "category": 0
1079
+ },
1080
+ {
1081
+ "key": "borrowingRateToken",
1082
+ "type": "erc20",
1083
+ "description": "The token you want to fetch the borrow rate for",
1084
+ "mandatory": true,
1085
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"8453\": [\n \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"0x4200000000000000000000000000000000000006\",\n \"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22\",\n \"0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x940181a94a35a4569e4529a3cdfb74e38fd98631\",\n \"0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf\",\n \"0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
1086
+ "category": 0
1087
+ },
1088
+ {
1089
+ "key": "abiParams.token",
1090
+ "type": "erc20",
1091
+ "description": "The token you want to fetch the borrow rate for",
1092
+ "mandatory": true,
1093
+ "hideInUI": true,
1094
+ "category": 0
1095
+ },
1096
+ {
1097
+ "key": "condition",
1098
+ "type": "logic_operator",
1099
+ "description": "Logic operator used for the comparison: <, >, <=, >=, ==, ...",
1100
+ "mandatory": true,
1101
+ "category": 0
1102
+ },
1103
+ {
1104
+ "key": "comparisonValue",
1105
+ "type": "float",
1106
+ "description": "The value to compare to",
1107
+ "mandatory": true,
1108
+ "category": 0
1109
+ },
1110
+ ],
1111
+ "output": {
1112
+ "borrowingRate": "float"
1113
+ },
1114
+ "blockId": 22,
1115
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/moonwell.jpg"
1116
+ }
885
1117
  }
886
1118
  },
887
1119
  "DEXES": {
@@ -944,7 +1176,7 @@ export const TRIGGERS = {
944
1176
  },
945
1177
  {
946
1178
  "key": "abiParams.inputToken",
947
- "type": "address",
1179
+ "type": "erc20",
948
1180
  "description": "Input token address",
949
1181
  "category": 0
950
1182
  },
@@ -956,7 +1188,7 @@ export const TRIGGERS = {
956
1188
  },
957
1189
  {
958
1190
  "key": "abiParams.outputToken",
959
- "type": "address",
1191
+ "type": "erc20",
960
1192
  "description": "Output token address",
961
1193
  "category": 0
962
1194
  },
@@ -1042,6 +1274,7 @@ export const TRIGGERS = {
1042
1274
  "GET_FEAR_AND_GREED_INDEX": {
1043
1275
  "name": "Fear and Greed Index",
1044
1276
  "description": "Fetches the Fear and Greed Index from the specified API and processes the result.",
1277
+ "prototype": "btcFearAndGreed",
1045
1278
  "type": 3,
1046
1279
  "output": {
1047
1280
  "value": "integer"
@@ -1104,6 +1337,7 @@ export const TRIGGERS = {
1104
1337
  "AUM": {
1105
1338
  "name": "Assets under management",
1106
1339
  "description": "Fetches IBIT net assets (USD)",
1340
+ "prototype": "ibitAum",
1107
1341
  "type": 3,
1108
1342
  "output": {
1109
1343
  "asset_under_management": "integer"
@@ -1184,6 +1418,7 @@ export const TRIGGERS = {
1184
1418
  "GAS_API": {
1185
1419
  "name": "Ethereum Gas Price Monitor",
1186
1420
  "description": "Monitors Ethereum gas prices and triggers when the gas price meets the defined condition.",
1421
+ "prototype": "mainnetGasPrice",
1187
1422
  "type": 3,
1188
1423
  "output": {
1189
1424
  "gasPrice": "float"
@@ -1741,7 +1976,8 @@ export const ACTIONS = {
1741
1976
  "IONIC": {
1742
1977
  "description": "#1 money market for Yield Bearing Assets on the OP Superchain",
1743
1978
  "chains": [
1744
- 34443
1979
+ 34443,
1980
+ 8453
1745
1981
  ],
1746
1982
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ionic.jpg",
1747
1983
  "DEPOSIT": {
@@ -1762,7 +1998,7 @@ export const ACTIONS = {
1762
1998
  "type": "erc20",
1763
1999
  "description": "The token to deposit",
1764
2000
  "mandatory": true,
1765
- "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"34443\": [\n \"0xf0F161fDA2712DB8b566946122a5af183995e2eD\",\n \"0xd988097fb8612cc24eeC14542bC03424c656005f\",\n \"0x2416092f143378750bb29b79eD961ab195CcEea5\",\n \"0x4200000000000000000000000000000000000006\",\n \"0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF\",\n \"0x80137510979822322193FC997d400D5A6C747bf7\",\n \"0xe7903B1F75C534Dd8159b313d92cDCfbC62cB3Cd\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x59889b7021243dB5B1e065385F918316cD90D46c\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
2001
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"8453\": [\n \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"0x4200000000000000000000000000000000000006\"\n ],\n \"34443\": [\n \"0xf0F161fDA2712DB8b566946122a5af183995e2eD\",\n \"0xd988097fb8612cc24eeC14542bC03424c656005f\",\n \"0x2416092f143378750bb29b79eD961ab195CcEea5\",\n \"0x4200000000000000000000000000000000000006\",\n \"0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF\",\n \"0x80137510979822322193FC997d400D5A6C747bf7\",\n \"0xe7903B1F75C534Dd8159b313d92cDCfbC62cB3Cd\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x59889b7021243dB5B1e065385F918316cD90D46c\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
1766
2002
  "category": 0
1767
2003
  },
1768
2004
  {
@@ -1865,7 +2101,7 @@ export const ACTIONS = {
1865
2101
  "type": "erc20",
1866
2102
  "description": "The token to withdraw",
1867
2103
  "mandatory": true,
1868
- "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"34443\": [\n \"0xf0F161fDA2712DB8b566946122a5af183995e2eD\",\n \"0xd988097fb8612cc24eeC14542bC03424c656005f\",\n \"0x2416092f143378750bb29b79eD961ab195CcEea5\",\n \"0x4200000000000000000000000000000000000006\",\n \"0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF\",\n \"0x80137510979822322193FC997d400D5A6C747bf7\",\n \"0xe7903B1F75C534Dd8159b313d92cDCfbC62cB3Cd\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x59889b7021243dB5B1e065385F918316cD90D46c\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
2104
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"8453\": [\n \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"0x4200000000000000000000000000000000000006\"\n ],\n \"34443\": [\n \"0xf0F161fDA2712DB8b566946122a5af183995e2eD\",\n \"0xd988097fb8612cc24eeC14542bC03424c656005f\",\n \"0x2416092f143378750bb29b79eD961ab195CcEea5\",\n \"0x4200000000000000000000000000000000000006\",\n \"0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF\",\n \"0x80137510979822322193FC997d400D5A6C747bf7\",\n \"0xe7903B1F75C534Dd8159b313d92cDCfbC62cB3Cd\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x59889b7021243dB5B1e065385F918316cD90D46c\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
1869
2105
  "category": 0
1870
2106
  },
1871
2107
  {
@@ -1944,7 +2180,7 @@ export const ACTIONS = {
1944
2180
  "type": "erc20",
1945
2181
  "description": "The token to borrow",
1946
2182
  "mandatory": true,
1947
- "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"34443\": [\n \"0xf0F161fDA2712DB8b566946122a5af183995e2eD\",\n \"0xd988097fb8612cc24eeC14542bC03424c656005f\",\n \"0x2416092f143378750bb29b79eD961ab195CcEea5\",\n \"0x4200000000000000000000000000000000000006\",\n \"0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF\",\n \"0x80137510979822322193FC997d400D5A6C747bf7\",\n \"0xe7903B1F75C534Dd8159b313d92cDCfbC62cB3Cd\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x59889b7021243dB5B1e065385F918316cD90D46c\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
2183
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"8453\": [\n \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"0x4200000000000000000000000000000000000006\"\n ],\n \"34443\": [\n \"0xf0F161fDA2712DB8b566946122a5af183995e2eD\",\n \"0xd988097fb8612cc24eeC14542bC03424c656005f\",\n \"0x2416092f143378750bb29b79eD961ab195CcEea5\",\n \"0x4200000000000000000000000000000000000006\",\n \"0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF\",\n \"0x80137510979822322193FC997d400D5A6C747bf7\",\n \"0xe7903B1F75C534Dd8159b313d92cDCfbC62cB3Cd\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x59889b7021243dB5B1e065385F918316cD90D46c\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
1948
2184
  "category": 0
1949
2185
  },
1950
2186
  {
@@ -2023,7 +2259,7 @@ export const ACTIONS = {
2023
2259
  "type": "erc20",
2024
2260
  "description": "The token to repay",
2025
2261
  "mandatory": true,
2026
- "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"34443\": [\n \"0xf0F161fDA2712DB8b566946122a5af183995e2eD\",\n \"0xd988097fb8612cc24eeC14542bC03424c656005f\",\n \"0x2416092f143378750bb29b79eD961ab195CcEea5\",\n \"0x4200000000000000000000000000000000000006\",\n \"0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF\",\n \"0x80137510979822322193FC997d400D5A6C747bf7\",\n \"0xe7903B1F75C534Dd8159b313d92cDCfbC62cB3Cd\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x59889b7021243dB5B1e065385F918316cD90D46c\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
2262
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"8453\": [\n \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"0x4200000000000000000000000000000000000006\"\n ],\n \"34443\": [\n \"0xf0F161fDA2712DB8b566946122a5af183995e2eD\",\n \"0xd988097fb8612cc24eeC14542bC03424c656005f\",\n \"0x2416092f143378750bb29b79eD961ab195CcEea5\",\n \"0x4200000000000000000000000000000000000006\",\n \"0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF\",\n \"0x80137510979822322193FC997d400D5A6C747bf7\",\n \"0xe7903B1F75C534Dd8159b313d92cDCfbC62cB3Cd\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x59889b7021243dB5B1e065385F918316cD90D46c\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
2027
2263
  "category": 0
2028
2264
  },
2029
2265
  {
@@ -2149,13 +2385,12 @@ export const ACTIONS = {
2149
2385
  8453,
2150
2386
  534352
2151
2387
  ],
2152
- "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/aave.jpg",
2388
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/aave.png",
2153
2389
  "SUPPLY": {
2154
2390
  "name": "Supply Asset to Aave",
2155
2391
  "description": "Supply an asset to AAVE",
2156
2392
  "type": 1,
2157
2393
  "method": "function supply(address asset, uint256 amount, address onBehalfOf, uint16 referralCode)",
2158
- "contractAddress": "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5",
2159
2394
  "parameters": [
2160
2395
  {
2161
2396
  "key": "chainId",
@@ -2165,26 +2400,26 @@ export const ACTIONS = {
2165
2400
  "category": 0
2166
2401
  },
2167
2402
  {
2168
- "key": "asset",
2403
+ "key": "abiParams.asset",
2169
2404
  "type": "erc20",
2170
2405
  "description": "The token to supply",
2171
2406
  "mandatory": true,
2172
- "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n\n return availableLendingTokens[env.parameters.chainId];\n }",
2407
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n\n return availableLendingTokens[env.parameters.chainId] || [];\n }",
2173
2408
  "category": 0
2174
2409
  },
2175
2410
  {
2176
- "key": "amount",
2411
+ "key": "abiParams.amount",
2177
2412
  "type": "uint256",
2178
2413
  "description": "The amount of the asset to supply",
2179
2414
  "mandatory": true,
2180
2415
  "category": 0,
2181
2416
  "erc20FormattedAmount": {
2182
- "contractAddress": "{{parameters.asset}}",
2417
+ "contractAddress": "{{parameters.abi.parameters.asset}}",
2183
2418
  "chain": "{{parameters.chainId}}"
2184
2419
  }
2185
2420
  },
2186
2421
  {
2187
- "key": "onBehalfOf",
2422
+ "key": "abiParams.onBehalfOf",
2188
2423
  "type": "address",
2189
2424
  "description": "The address to receive aTokens",
2190
2425
  "mandatory": true,
@@ -2193,7 +2428,7 @@ export const ACTIONS = {
2193
2428
  "value": "{{user.smartAccountAddress}}"
2194
2429
  },
2195
2430
  {
2196
- "key": "referralCode",
2431
+ "key": "abiParams.referralCode",
2197
2432
  "type": "uint16",
2198
2433
  "description": "Referral code (use 0, as inactive)",
2199
2434
  "mandatory": true,
@@ -2204,35 +2439,41 @@ export const ACTIONS = {
2204
2439
  ],
2205
2440
  "requiredApprovals": [
2206
2441
  {
2207
- "address": "{{parameters.asset}}",
2208
- "amount": "{{parameters.amount}}",
2442
+ "address": "{{parameters.abi.parameters.asset}}",
2443
+ "amount": "{{parameters.abi.parameters.amount}}",
2209
2444
  "to": "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5"
2210
2445
  }
2211
2446
  ],
2447
+ "checks": [
2448
+ {
2449
+ "type": 0,
2450
+ "chainId": "{{parameters.chainId}}",
2451
+ "contractAddress": "{{parameters.abi.parameters.asset}}",
2452
+ "amount": "{{parameters.abi.parameters.amount}}"
2453
+ }
2454
+ ],
2212
2455
  "output": {
2213
2456
  "transactionHash": "string"
2214
2457
  },
2215
2458
  "permissions": {
2216
2459
  "approvedTargets": [
2217
- "{{parameters.asset}}",
2218
- "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5"
2460
+ "{{before.contractAddress}}"
2219
2461
  ],
2220
2462
  "label": [
2221
- "Supply {{tokenSymbol({{parameters.chainId}}, {{parameters.asset}})}} on Aave"
2463
+ "Supply {{tokenSymbol({{parameters.chainId}}, {{parameters.abi.parameters.asset}})}} on Aave"
2222
2464
  ],
2223
2465
  "labelNotAuthorized": [
2224
- "Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.asset}})}}"
2466
+ "Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.abi.parameters.asset}})}}"
2225
2467
  ]
2226
2468
  },
2227
2469
  "blockId": 100020,
2228
- "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/aave.jpg"
2470
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/aave.png"
2229
2471
  },
2230
2472
  "WITHDRAW": {
2231
2473
  "name": "Withdraw Asset from Aave",
2232
2474
  "description": "Withdraw a supplied asset from the Aave pool.",
2233
2475
  "type": 1,
2234
2476
  "method": "function withdraw(address asset, uint256 amount, address to) returns (uint256)",
2235
- "contractAddress": "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5",
2236
2477
  "parameters": [
2237
2478
  {
2238
2479
  "key": "chainId",
@@ -2242,27 +2483,27 @@ export const ACTIONS = {
2242
2483
  "category": 0
2243
2484
  },
2244
2485
  {
2245
- "key": "asset",
2486
+ "key": "abiParams.asset",
2246
2487
  "type": "erc20",
2247
2488
  "description": "The address of the asset to withdraw",
2248
2489
  "mandatory": true,
2249
- "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n\n return availableLendingTokens[env.parameters.chainId];\n }",
2490
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n\n return availableLendingTokens[env.parameters.chainId] || [];\n }",
2250
2491
  "category": 0
2251
2492
  },
2252
2493
  {
2253
- "key": "amount",
2494
+ "key": "abiParams.amount",
2254
2495
  "type": "uint256",
2255
2496
  "description": "The amount of the asset to withdraw. Use type(uint).max for full balance.",
2256
2497
  "mandatory": true,
2257
2498
  "category": 0,
2258
2499
  "erc20FormattedAmount": {
2259
- "contractAddress": "{{parameters.asset}}",
2500
+ "contractAddress": "{{parameters.abi.parameters.asset}}",
2260
2501
  "chain": "{{parameters.chainId}}"
2261
2502
  },
2262
2503
  "default": "type(uint256).max"
2263
2504
  },
2264
2505
  {
2265
- "key": "to",
2506
+ "key": "abiParams.to",
2266
2507
  "type": "address",
2267
2508
  "description": "The address to receive the withdrawn asset",
2268
2509
  "mandatory": true,
@@ -2277,31 +2518,30 @@ export const ACTIONS = {
2277
2518
  },
2278
2519
  "permissions": {
2279
2520
  "approvedTargets": [
2280
- "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5"
2521
+ "{{before.contractAddress}}"
2281
2522
  ],
2282
2523
  "label": [
2283
- "Withdraw {{tokenSymbol({{parameters.chainId}}, {{parameters.asset}})}} from Aave"
2524
+ "Withdraw {{tokenSymbol({{parameters.chainId}}, {{parameters.abi.parameters.asset}})}} from Aave"
2284
2525
  ],
2285
2526
  "labelNotAuthorized": [
2286
- "Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.asset}})}}"
2527
+ "Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.abi.parameters.asset}})}}"
2287
2528
  ]
2288
2529
  },
2289
2530
  "blockId": 100021,
2290
- "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/aave.jpg"
2531
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/aave.png"
2291
2532
  }
2292
2533
  },
2293
- "COMPOUND": {
2294
- "description": "Decentralized lending protocol",
2534
+ "MOONWELL": {
2535
+ "description": "Put your digital assets to work. Lend or borrow to handle whatever life throws your way. Pay it back on your own schedule, with no monthly payments or additional fees.",
2295
2536
  "chains": [
2296
2537
  8453
2297
2538
  ],
2298
- "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/aave.jpg",
2539
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/moonwell.jpg",
2299
2540
  "DEPOSIT": {
2300
- "name": "Supply Asset to Aave",
2301
- "description": "Supply an asset to AAVE",
2541
+ "name": "Lend asset",
2542
+ "description": "Deposit token in any Moonwell lending pool",
2302
2543
  "type": 1,
2303
- "method": "function supply(address asset, uint256 amount, address onBehalfOf, uint16 referralCode)",
2304
- "contractAddress": "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5",
2544
+ "method": "function mint(uint256 amount) external returns (uint256)",
2305
2545
  "parameters": [
2306
2546
  {
2307
2547
  "key": "chainId",
@@ -2311,48 +2551,231 @@ export const ACTIONS = {
2311
2551
  "category": 0
2312
2552
  },
2313
2553
  {
2314
- "key": "asset",
2554
+ "key": "tokenToDeposit",
2315
2555
  "type": "erc20",
2316
- "description": "The token to supply",
2556
+ "description": "The token to deposit",
2317
2557
  "mandatory": true,
2318
- "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n\n return availableLendingTokens[env.parameters.chainId];\n }",
2558
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"8453\": [\n \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"0x4200000000000000000000000000000000000006\",\n \"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22\",\n \"0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x940181a94a35a4569e4529a3cdfb74e38fd98631\",\n \"0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf\",\n \"0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
2319
2559
  "category": 0
2320
2560
  },
2321
2561
  {
2322
- "key": "amount",
2562
+ "key": "abiParams.amount",
2323
2563
  "type": "uint256",
2324
- "description": "The amount of the asset to supply",
2564
+ "description": "Amount of crypto to deposit",
2325
2565
  "mandatory": true,
2326
2566
  "category": 0,
2327
2567
  "erc20FormattedAmount": {
2328
- "contractAddress": "{{parameters.asset}}",
2568
+ "contractAddress": "{{parameters.tokenToDeposit}}",
2329
2569
  "chain": "{{parameters.chainId}}"
2330
2570
  }
2331
2571
  },
2572
+ ],
2573
+ "checks": [
2332
2574
  {
2333
- "key": "onBehalfOf",
2334
- "type": "address",
2335
- "description": "The address to receive aTokens",
2575
+ "type": 0,
2576
+ "chainId": "{{parameters.chainId}}",
2577
+ "contractAddress": "{{parameters.tokenToDeposit}}",
2578
+ "amount": "{{parameters.abi.parameters.amount}}"
2579
+ }
2580
+ ],
2581
+ "requiredApprovals": [
2582
+ {
2583
+ "address": "{{parameters.tokenToDeposit}}",
2584
+ "amount": "{{parameters.abi.parameters.amount}}",
2585
+ "to": "{{before.contractAddress}}"
2586
+ }
2587
+ ],
2588
+ "output": {
2589
+ "transactionHash": "string"
2590
+ },
2591
+ "permissions": {
2592
+ "approvedTargets": [
2593
+ "{{parameters.tokenToDeposit}}",
2594
+ "{{before.contractAddress}}"
2595
+ ],
2596
+ "label": [
2597
+ "Deposit {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToDeposit}})}} on MOONWELL"
2598
+ ],
2599
+ "labelNotAuthorized": [
2600
+ "Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToDeposit}})}}"
2601
+ ]
2602
+ },
2603
+ "batchWith": [
2604
+ {
2605
+ "id": 100012,
2606
+ "type": 1,
2607
+ "conditions": [],
2608
+ "parameters": {
2609
+ "chainId": "{{parameters.chainId}}",
2610
+ "abi": {
2611
+ "parameters": {
2612
+ "tokens": [
2613
+ "{{parameters.tokenToDeposit}}"
2614
+ ]
2615
+ }
2616
+ }
2617
+ }
2618
+ }
2619
+ ],
2620
+ "blockId": 100022,
2621
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/moonwell.jpg"
2622
+ },
2623
+ "WITHDRAW": {
2624
+ "name": "Withdraw asset",
2625
+ "description": "Withdraw token deposited in any lending pool",
2626
+ "type": 1,
2627
+ "method": "function redeemUnderlying(uint256 amount) external returns (uint256)",
2628
+ "parameters": [
2629
+ {
2630
+ "key": "chainId",
2631
+ "type": "chainId",
2632
+ "description": "Chain ID of the network",
2336
2633
  "mandatory": true,
2337
- "hideInUI": true,
2338
- "category": 1,
2339
- "value": "{{user.smartAccountAddress}}"
2634
+ "category": 0
2340
2635
  },
2341
2636
  {
2342
- "key": "referralCode",
2343
- "type": "uint16",
2344
- "description": "Referral code (use 0, as inactive)",
2637
+ "key": "tokenToWithdraw",
2638
+ "type": "erc20",
2639
+ "description": "The token to withdraw",
2345
2640
  "mandatory": true,
2346
- "hideInUI": true,
2347
- "category": 1,
2348
- "value": 0
2641
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"8453\": [\n \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"0x4200000000000000000000000000000000000006\",\n \"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22\",\n \"0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x940181a94a35a4569e4529a3cdfb74e38fd98631\",\n \"0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf\",\n \"0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
2642
+ "category": 0
2349
2643
  },
2644
+ {
2645
+ "key": "abiParams.amount",
2646
+ "type": "uint256",
2647
+ "description": "Amount of crypto to withdraw",
2648
+ "mandatory": true,
2649
+ "category": 0,
2650
+ "erc20FormattedAmount": {
2651
+ "contractAddress": "{{parameters.tokenToWithdraw}}",
2652
+ "chain": "{{parameters.chainId}}"
2653
+ }
2654
+ },
2655
+ ],
2656
+ "requiredApprovals": [],
2657
+ "output": {
2658
+ "transactionHash": "string"
2659
+ },
2660
+ "permissions": {
2661
+ "approvedTargets": [
2662
+ "{{before.contractAddress}}"
2663
+ ],
2664
+ "label": [
2665
+ "Withdraw {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToWithdraw}})}} from MOONWELL"
2666
+ ],
2667
+ "labelNotAuthorized": [
2668
+ "Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToWithdraw}})}}"
2669
+ ]
2670
+ },
2671
+ "checks": [
2672
+ {
2673
+ "type": 0,
2674
+ "chainId": "{{parameters.chainId}}",
2675
+ "contractAddress": "{{before.contractAddress}}",
2676
+ "amount": "{{parameters.abi.parameters.amount}}"
2677
+ }
2678
+ ],
2679
+ "blockId": 100023,
2680
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/moonwell.jpg"
2681
+ },
2682
+ "BORROW": {
2683
+ "name": "Borrow asset",
2684
+ "description": "Borrow any token against your collateral",
2685
+ "type": 1,
2686
+ "method": "function borrow(uint256 amount) external returns (uint256)",
2687
+ "parameters": [
2688
+ {
2689
+ "key": "chainId",
2690
+ "type": "chainId",
2691
+ "description": "Chain ID of the network",
2692
+ "mandatory": true,
2693
+ "category": 0
2694
+ },
2695
+ {
2696
+ "key": "tokenToBorrow",
2697
+ "type": "erc20",
2698
+ "description": "The token to borrow",
2699
+ "mandatory": true,
2700
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"8453\": [\n \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"0x4200000000000000000000000000000000000006\",\n \"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22\",\n \"0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x940181a94a35a4569e4529a3cdfb74e38fd98631\",\n \"0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf\",\n \"0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
2701
+ "category": 0
2702
+ },
2703
+ {
2704
+ "key": "abiParams.amount",
2705
+ "type": "uint256",
2706
+ "description": "Amount of crypto to borrow",
2707
+ "mandatory": true,
2708
+ "category": 0,
2709
+ "erc20FormattedAmount": {
2710
+ "contractAddress": "{{parameters.tokenToBorrow}}",
2711
+ "chain": "{{parameters.chainId}}"
2712
+ }
2713
+ },
2714
+ ],
2715
+ "requiredApprovals": [],
2716
+ "output": {
2717
+ "transactionHash": "string"
2718
+ },
2719
+ "permissions": {
2720
+ "approvedTargets": [
2721
+ "{{before.contractAddress}}"
2722
+ ],
2723
+ "label": [
2724
+ "Borrow {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToBorrow}})}} on MOONWELL"
2725
+ ],
2726
+ "labelNotAuthorized": [
2727
+ "Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToBorrow}})}}"
2728
+ ]
2729
+ },
2730
+ "blockId": 100024,
2731
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/moonwell.jpg"
2732
+ },
2733
+ "REPAY": {
2734
+ "name": "Repay asset",
2735
+ "description": "Repay a token that you borrowed",
2736
+ "type": 1,
2737
+ "method": "function repayBorrow(uint256 amount) external returns (uint256)",
2738
+ "parameters": [
2739
+ {
2740
+ "key": "chainId",
2741
+ "type": "chainId",
2742
+ "description": "Chain ID of the network",
2743
+ "mandatory": true,
2744
+ "category": 0
2745
+ },
2746
+ {
2747
+ "key": "tokenToRepay",
2748
+ "type": "erc20",
2749
+ "description": "The token to repay",
2750
+ "mandatory": true,
2751
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"8453\": [\n \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"0x4200000000000000000000000000000000000006\",\n \"0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22\",\n \"0xc1cba3fcea344f92d9239c08c0568f6f2f0ee452\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x940181a94a35a4569e4529a3cdfb74e38fd98631\",\n \"0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf\",\n \"0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
2752
+ "category": 0
2753
+ },
2754
+ {
2755
+ "key": "abiParams.amount",
2756
+ "type": "uint256",
2757
+ "description": "Amount of crypto to repay",
2758
+ "mandatory": true,
2759
+ "category": 0,
2760
+ "erc20FormattedAmount": {
2761
+ "contractAddress": "{{parameters.tokenToRepay}}",
2762
+ "chain": "{{parameters.chainId}}"
2763
+ }
2764
+ },
2765
+ ],
2766
+ "checks": [
2767
+ {
2768
+ "type": 0,
2769
+ "chainId": "{{parameters.chainId}}",
2770
+ "contractAddress": "{{parameters.tokenToRepay}}",
2771
+ "amount": "{{parameters.abi.parameters.amount}}"
2772
+ }
2350
2773
  ],
2351
2774
  "requiredApprovals": [
2352
2775
  {
2353
- "address": "{{parameters.asset}}",
2354
- "amount": "{{parameters.amount}}",
2355
- "to": "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5"
2776
+ "address": "{{parameters.tokenToRepay}}",
2777
+ "amount": "{{parameters.abi.parameters.amount}}",
2778
+ "to": "{{before.contractAddress}}"
2356
2779
  }
2357
2780
  ],
2358
2781
  "output": {
@@ -2360,18 +2783,54 @@ export const ACTIONS = {
2360
2783
  },
2361
2784
  "permissions": {
2362
2785
  "approvedTargets": [
2363
- "{{parameters.asset}}",
2364
- "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5"
2786
+ "{{before.contractAddress}}"
2365
2787
  ],
2366
2788
  "label": [
2367
- "Supply {{tokenSymbol({{parameters.chainId}}, {{parameters.asset}})}} on Aave"
2789
+ "Repay {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToRepay}})}} on MOONWELL"
2368
2790
  ],
2369
2791
  "labelNotAuthorized": [
2370
- "Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.asset}})}}"
2792
+ "Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToRepay}})}}"
2371
2793
  ]
2372
2794
  },
2373
- "blockId": 100022,
2374
- "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/aave.jpg"
2795
+ "blockId": 100025,
2796
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/moonwell.jpg"
2797
+ },
2798
+ "ENABLE_COLLATERAL": {
2799
+ "showInUI": false,
2800
+ "name": "Enable collaterals",
2801
+ "description": "Enable collateral to be able to borrow against it.",
2802
+ "type": 1,
2803
+ "method": "function enterMarkets(address[] tokens) returns (uint256[])",
2804
+ "parameters": [
2805
+ {
2806
+ "key": "chainId",
2807
+ "type": "chainId",
2808
+ "description": "Chain ID of the network",
2809
+ "mandatory": true,
2810
+ "category": 0
2811
+ },
2812
+ {
2813
+ "key": "abiParams.tokens",
2814
+ "type": "addresses_array",
2815
+ "description": "List of collaterals",
2816
+ "mandatory": true,
2817
+ "category": 0
2818
+ },
2819
+ ],
2820
+ "examples": [],
2821
+ "permissions": {
2822
+ "approvedTargets": [
2823
+ "{{before.contractAddress}}"
2824
+ ],
2825
+ "label": [
2826
+ "Enable {{tokenSymbol({{parameters.chainId}}, {{parameters.abi.parameters.tokens[0]}})}} as collateral on MOONWELL"
2827
+ ],
2828
+ "labelNotAuthorized": [
2829
+ "Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.abi.parameters.tokens[0]}})}}"
2830
+ ]
2831
+ },
2832
+ "blockId": 100026,
2833
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/moonwell.jpg"
2375
2834
  }
2376
2835
  }
2377
2836
  },