otomato-sdk 1.5.24 → 1.5.26
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.
- package/dist/src/constants/Blocks.js +314 -29
- package/dist/src/constants/WorkflowTemplates.js +2 -0
- package/dist/src/services/ApiService.js +4 -1
- package/dist/types/src/constants/Blocks.d.ts +141 -12
- package/dist/types/src/constants/WorkflowTemplates.d.ts +1 -0
- package/dist/types/src/services/ApiService.d.ts +1 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ export const TRIGGERS = {
|
|
|
10
10
|
"name": "Transfer token",
|
|
11
11
|
"description": "This block gets triggered when someone transfers the ERC20 configured in the params",
|
|
12
12
|
"type": 0,
|
|
13
|
+
"after": "async (params) => { return params }",
|
|
13
14
|
"output": {
|
|
14
15
|
"value": "uint256",
|
|
15
16
|
"from": "address",
|
|
@@ -78,7 +79,7 @@ export const TRIGGERS = {
|
|
|
78
79
|
"description": "Fetches the balance of an ERC20 and checks it against the specified condition.",
|
|
79
80
|
"type": 1,
|
|
80
81
|
"method": "function balanceOf(address account) view returns (uint256)",
|
|
81
|
-
"
|
|
82
|
+
"after": "(output) => { const params=JSON.parse(output);const balance = BigInt(params)/1000000n; return {balance: Number(balance), comparisonValue: Number(balance)}; }",
|
|
82
83
|
"output": {
|
|
83
84
|
"balance": "integer"
|
|
84
85
|
},
|
|
@@ -134,7 +135,7 @@ export const TRIGGERS = {
|
|
|
134
135
|
},
|
|
135
136
|
{
|
|
136
137
|
"key": "comparisonValue",
|
|
137
|
-
"value":
|
|
138
|
+
"value": "10000000000000000000000n"
|
|
138
139
|
},
|
|
139
140
|
{
|
|
140
141
|
"key": "condition",
|
|
@@ -168,6 +169,7 @@ export const TRIGGERS = {
|
|
|
168
169
|
"description": "Swap in Splice Finance",
|
|
169
170
|
"type": 0,
|
|
170
171
|
"contractAddress": "0x7A3a94AE0fC1421A3eac23eA6371036ac8d8f448",
|
|
172
|
+
"after": "async (params) => { return params }",
|
|
171
173
|
"output": {
|
|
172
174
|
"caller": "address",
|
|
173
175
|
"market": "address",
|
|
@@ -217,6 +219,7 @@ export const TRIGGERS = {
|
|
|
217
219
|
"description": "Liquidity removed in Splice Finance",
|
|
218
220
|
"type": 0,
|
|
219
221
|
"contractAddress": "0x7A3a94AE0fC1421A3eac23eA6371036ac8d8f448",
|
|
222
|
+
"after": "async (params) => { return params }",
|
|
220
223
|
"output": {
|
|
221
224
|
"caller": "address",
|
|
222
225
|
"market": "address",
|
|
@@ -273,6 +276,7 @@ export const TRIGGERS = {
|
|
|
273
276
|
"description": "Market creation in Splice Finance",
|
|
274
277
|
"type": 0,
|
|
275
278
|
"contractAddress": "0x7A3a94AE0fC1421A3eac23eA6371036ac8d8f448",
|
|
279
|
+
"after": "async (params) => { return params }",
|
|
276
280
|
"output": {
|
|
277
281
|
"market": "address",
|
|
278
282
|
"PT": "erc20",
|
|
@@ -322,6 +326,7 @@ export const TRIGGERS = {
|
|
|
322
326
|
"description": "Interest rate update in Splice Finance",
|
|
323
327
|
"type": 0,
|
|
324
328
|
"contractAddress": "0x7A3a94AE0fC1421A3eac23eA6371036ac8d8f448",
|
|
329
|
+
"after": "async (params) => { return params }",
|
|
325
330
|
"output": {
|
|
326
331
|
"timestamp": "uint256",
|
|
327
332
|
"lastLnImpliedRate": "int256",
|
|
@@ -554,6 +559,7 @@ export const TRIGGERS = {
|
|
|
554
559
|
"description": "Name registered in Mode Name Service",
|
|
555
560
|
"type": 0,
|
|
556
561
|
"contractAddress": "0x2aD86eeEC513AC16804bb05310214C3Fd496835B",
|
|
562
|
+
"after": "async (params) => { return params }",
|
|
557
563
|
"output": {
|
|
558
564
|
"id": "uint256",
|
|
559
565
|
"owner": "address",
|
|
@@ -594,7 +600,7 @@ export const TRIGGERS = {
|
|
|
594
600
|
"description": "Fetches the Fear and Greed Index from the specified API and processes the result.",
|
|
595
601
|
"type": 3,
|
|
596
602
|
"url": "https://api.alternative.me/fng/",
|
|
597
|
-
"
|
|
603
|
+
"after": "async (res) => { return {value: res.data?.[0]?.value, comparisonValue: res.data?.[0]?.value} }",
|
|
598
604
|
"output": {
|
|
599
605
|
"value": "integer"
|
|
600
606
|
},
|
|
@@ -791,6 +797,74 @@ export const TRIGGERS = {
|
|
|
791
797
|
}
|
|
792
798
|
};
|
|
793
799
|
export const ACTIONS = {
|
|
800
|
+
"CORE": {
|
|
801
|
+
"DELAY": {
|
|
802
|
+
"description": "Set of functions to delay the executions of the following blocks.",
|
|
803
|
+
"image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/discord.png",
|
|
804
|
+
"WAIT_FOR": {
|
|
805
|
+
"name": "Wait for",
|
|
806
|
+
"type": 2,
|
|
807
|
+
"description": "Wait before executing the following blocks",
|
|
808
|
+
"output": {
|
|
809
|
+
"message": "string"
|
|
810
|
+
},
|
|
811
|
+
"parameters": [
|
|
812
|
+
{
|
|
813
|
+
"key": "time",
|
|
814
|
+
"type": "string",
|
|
815
|
+
"description": "The time to wait (in milliseconds)",
|
|
816
|
+
"mandatory": true,
|
|
817
|
+
"category": 0
|
|
818
|
+
},
|
|
819
|
+
],
|
|
820
|
+
"examples": [
|
|
821
|
+
{
|
|
822
|
+
"name": "Wait 1 hour",
|
|
823
|
+
"description": "Wait for an hour before executing the next block",
|
|
824
|
+
"parameters": [
|
|
825
|
+
{
|
|
826
|
+
"key": "time",
|
|
827
|
+
"value": "3600000"
|
|
828
|
+
}
|
|
829
|
+
]
|
|
830
|
+
}
|
|
831
|
+
],
|
|
832
|
+
"blockId": 100007,
|
|
833
|
+
"image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/discord.png"
|
|
834
|
+
},
|
|
835
|
+
"WAIT_UNTIL": {
|
|
836
|
+
"name": "Wait until",
|
|
837
|
+
"type": 2,
|
|
838
|
+
"description": "Wait before executing the following blocks",
|
|
839
|
+
"output": {
|
|
840
|
+
"message": "string"
|
|
841
|
+
},
|
|
842
|
+
"parameters": [
|
|
843
|
+
{
|
|
844
|
+
"key": "until",
|
|
845
|
+
"type": "string",
|
|
846
|
+
"description": "The date to wait for (UTC timestamp in milliseconds)",
|
|
847
|
+
"mandatory": true,
|
|
848
|
+
"category": 0
|
|
849
|
+
},
|
|
850
|
+
],
|
|
851
|
+
"examples": [
|
|
852
|
+
{
|
|
853
|
+
"name": "Wait until a specific date",
|
|
854
|
+
"description": "Wait until 00:00 (UTC) Friday 23rd of August 2024",
|
|
855
|
+
"parameters": [
|
|
856
|
+
{
|
|
857
|
+
"key": "until",
|
|
858
|
+
"value": "1724371200000"
|
|
859
|
+
}
|
|
860
|
+
]
|
|
861
|
+
}
|
|
862
|
+
],
|
|
863
|
+
"blockId": 100008,
|
|
864
|
+
"image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/discord.png"
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
},
|
|
794
868
|
"NOTIFICATIONS": {
|
|
795
869
|
"SLACK": {
|
|
796
870
|
"description": "Slack is a messaging app for businesses that connects people to the information they need.",
|
|
@@ -926,7 +1000,7 @@ export const ACTIONS = {
|
|
|
926
1000
|
"name": "Transfer token",
|
|
927
1001
|
"description": "Transfers an ERC20 token",
|
|
928
1002
|
"type": 1,
|
|
929
|
-
"method": "function transfer(address
|
|
1003
|
+
"method": "function transfer(address to, uint256 value)",
|
|
930
1004
|
"output": {
|
|
931
1005
|
"transactionHash": "string"
|
|
932
1006
|
},
|
|
@@ -975,7 +1049,7 @@ export const ACTIONS = {
|
|
|
975
1049
|
},
|
|
976
1050
|
{
|
|
977
1051
|
"key": "abiParams.value",
|
|
978
|
-
"value":
|
|
1052
|
+
"value": "100000000n"
|
|
979
1053
|
},
|
|
980
1054
|
{
|
|
981
1055
|
"key": "abiParams.to",
|
|
@@ -1015,7 +1089,7 @@ export const ACTIONS = {
|
|
|
1015
1089
|
"name": "Lend asset",
|
|
1016
1090
|
"description": "Deposit token in any Ionic lending pool",
|
|
1017
1091
|
"type": 1,
|
|
1018
|
-
"method": "function mint(uint256
|
|
1092
|
+
"method": "function mint(uint256 amount) public returns (uint256)",
|
|
1019
1093
|
"parameters": [
|
|
1020
1094
|
{
|
|
1021
1095
|
"key": "chainId",
|
|
@@ -1025,45 +1099,256 @@ export const ACTIONS = {
|
|
|
1025
1099
|
"category": 0
|
|
1026
1100
|
},
|
|
1027
1101
|
{
|
|
1028
|
-
"key": "
|
|
1102
|
+
"key": "tokenToDeposit",
|
|
1103
|
+
"type": "erc20",
|
|
1104
|
+
"description": "The token to deposit",
|
|
1105
|
+
"mandatory": true,
|
|
1106
|
+
"category": 0
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
"key": "abiParams.amount",
|
|
1029
1110
|
"type": "uint256",
|
|
1030
1111
|
"description": "Amount of crypto to deposit",
|
|
1031
1112
|
"mandatory": true,
|
|
1032
1113
|
"category": 0,
|
|
1033
1114
|
"erc20FormattedAmount": {
|
|
1034
|
-
"contractAddress": "{{parameters.
|
|
1115
|
+
"contractAddress": "{{parameters.tokenToDeposit}}",
|
|
1035
1116
|
"chain": "{{parameters.chainId}}"
|
|
1036
1117
|
}
|
|
1037
1118
|
},
|
|
1119
|
+
],
|
|
1120
|
+
"examples": [
|
|
1038
1121
|
{
|
|
1039
|
-
"
|
|
1122
|
+
"name": "Deposit 100 USDT",
|
|
1123
|
+
"description": "Lend 100 USDT on Ionic on Mode",
|
|
1124
|
+
"parameters": [
|
|
1125
|
+
{
|
|
1126
|
+
"key": "chainId",
|
|
1127
|
+
"value": 34443
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
"key": "abiParams.amount",
|
|
1131
|
+
"value": "100000000n"
|
|
1132
|
+
},
|
|
1133
|
+
{
|
|
1134
|
+
"key": "tokenToDeposit",
|
|
1135
|
+
"value": "0xf0F161fDA2712DB8b566946122a5af183995e2eD"
|
|
1136
|
+
}
|
|
1137
|
+
]
|
|
1138
|
+
}
|
|
1139
|
+
],
|
|
1140
|
+
"requiredApprovals": [
|
|
1141
|
+
{
|
|
1142
|
+
"address": "{{parameters.tokenToDeposit}}",
|
|
1143
|
+
"amount": "{{parameters.abiParams.amount}}",
|
|
1144
|
+
"to": "{{before.contractAddress}}"
|
|
1145
|
+
}
|
|
1146
|
+
],
|
|
1147
|
+
"output": {
|
|
1148
|
+
"transactionHash": "string"
|
|
1149
|
+
},
|
|
1150
|
+
"permissions": {
|
|
1151
|
+
"approvedTargets": [
|
|
1152
|
+
"{{parameters.tokenToDeposit}}",
|
|
1153
|
+
"{{before.contractAddress}}"
|
|
1154
|
+
],
|
|
1155
|
+
"label": [
|
|
1156
|
+
"Deposit {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToDeposit}})}} on IONIC"
|
|
1157
|
+
],
|
|
1158
|
+
"labelNotAuthorized": [
|
|
1159
|
+
"Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToDeposit}})}}"
|
|
1160
|
+
]
|
|
1161
|
+
},
|
|
1162
|
+
"blockId": 100006,
|
|
1163
|
+
"image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ionic.jpg"
|
|
1164
|
+
},
|
|
1165
|
+
"WITHDRAW": {
|
|
1166
|
+
"name": "Withdraw asset",
|
|
1167
|
+
"description": "Withdraw token deposited in any lending pool",
|
|
1168
|
+
"type": 1,
|
|
1169
|
+
"method": "function redeemUnderlying(uint256 amount) public returns (uint256)",
|
|
1170
|
+
"parameters": [
|
|
1171
|
+
{
|
|
1172
|
+
"key": "chainId",
|
|
1173
|
+
"type": "chainId",
|
|
1174
|
+
"description": "Chain ID of the network",
|
|
1175
|
+
"mandatory": true,
|
|
1176
|
+
"category": 0
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
"key": "tokenToWithdraw",
|
|
1040
1180
|
"type": "erc20",
|
|
1041
|
-
"description": "The token to
|
|
1181
|
+
"description": "The token to withdraw",
|
|
1042
1182
|
"mandatory": true,
|
|
1043
|
-
"enum": [
|
|
1044
|
-
"0xf0F161fDA2712DB8b566946122a5af183995e2eD",
|
|
1045
|
-
"0xd988097fb8612cc24eeC14542bC03424c656005f",
|
|
1046
|
-
"0x4200000000000000000000000000000000000006",
|
|
1047
|
-
"0x2416092f143378750bb29b79eD961ab195CcEea5"
|
|
1048
|
-
],
|
|
1049
1183
|
"category": 0
|
|
1050
1184
|
},
|
|
1185
|
+
{
|
|
1186
|
+
"key": "abiParams.amount",
|
|
1187
|
+
"type": "uint256",
|
|
1188
|
+
"description": "Amount of crypto to withdraw",
|
|
1189
|
+
"mandatory": true,
|
|
1190
|
+
"category": 0,
|
|
1191
|
+
"erc20FormattedAmount": {
|
|
1192
|
+
"contractAddress": "{{parameters.tokenToWithdraw}}",
|
|
1193
|
+
"chain": "{{parameters.chainId}}"
|
|
1194
|
+
}
|
|
1195
|
+
},
|
|
1051
1196
|
],
|
|
1052
1197
|
"examples": [
|
|
1053
1198
|
{
|
|
1054
|
-
"name": "
|
|
1055
|
-
"description": "
|
|
1199
|
+
"name": "Withdraw 100 USDT",
|
|
1200
|
+
"description": "Withdraw 100 USDT on Ionic on Mode",
|
|
1056
1201
|
"parameters": [
|
|
1057
1202
|
{
|
|
1058
1203
|
"key": "chainId",
|
|
1059
1204
|
"value": 34443
|
|
1060
1205
|
},
|
|
1061
1206
|
{
|
|
1062
|
-
"key": "abiParams.
|
|
1063
|
-
"value":
|
|
1207
|
+
"key": "abiParams.amount",
|
|
1208
|
+
"value": "100000000n"
|
|
1064
1209
|
},
|
|
1065
1210
|
{
|
|
1066
|
-
"key": "
|
|
1211
|
+
"key": "tokenToWithdraw",
|
|
1212
|
+
"value": "0xf0F161fDA2712DB8b566946122a5af183995e2eD"
|
|
1213
|
+
}
|
|
1214
|
+
]
|
|
1215
|
+
}
|
|
1216
|
+
],
|
|
1217
|
+
"requiredApprovals": [],
|
|
1218
|
+
"output": {
|
|
1219
|
+
"transactionHash": "string"
|
|
1220
|
+
},
|
|
1221
|
+
"permissions": {
|
|
1222
|
+
"approvedTargets": [
|
|
1223
|
+
"{{before.contractAddress}}"
|
|
1224
|
+
],
|
|
1225
|
+
"label": [
|
|
1226
|
+
"Withdraw {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToWithdraw}})}} from IONIC"
|
|
1227
|
+
],
|
|
1228
|
+
"labelNotAuthorized": [
|
|
1229
|
+
"Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToWithdraw}})}}"
|
|
1230
|
+
]
|
|
1231
|
+
},
|
|
1232
|
+
"blockId": 100007,
|
|
1233
|
+
"image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ionic.jpg"
|
|
1234
|
+
},
|
|
1235
|
+
"BORROW": {
|
|
1236
|
+
"name": "Borrow asset",
|
|
1237
|
+
"description": "Borrow any token against your collateral",
|
|
1238
|
+
"type": 1,
|
|
1239
|
+
"method": "function borrow(uint256 amount) external returns (uint256)",
|
|
1240
|
+
"parameters": [
|
|
1241
|
+
{
|
|
1242
|
+
"key": "chainId",
|
|
1243
|
+
"type": "chainId",
|
|
1244
|
+
"description": "Chain ID of the network",
|
|
1245
|
+
"mandatory": true,
|
|
1246
|
+
"category": 0
|
|
1247
|
+
},
|
|
1248
|
+
{
|
|
1249
|
+
"key": "tokenToBorrow",
|
|
1250
|
+
"type": "erc20",
|
|
1251
|
+
"description": "The token to borrow",
|
|
1252
|
+
"mandatory": true,
|
|
1253
|
+
"category": 0
|
|
1254
|
+
},
|
|
1255
|
+
{
|
|
1256
|
+
"key": "abiParams.amount",
|
|
1257
|
+
"type": "uint256",
|
|
1258
|
+
"description": "Amount of crypto to borrow",
|
|
1259
|
+
"mandatory": true,
|
|
1260
|
+
"category": 0,
|
|
1261
|
+
"erc20FormattedAmount": {
|
|
1262
|
+
"contractAddress": "{{parameters.tokenToBorrow}}",
|
|
1263
|
+
"chain": "{{parameters.chainId}}"
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
1266
|
+
],
|
|
1267
|
+
"examples": [
|
|
1268
|
+
{
|
|
1269
|
+
"name": "Borrow 100 USDT",
|
|
1270
|
+
"description": "Borrow 100 USDT on Ionic on Mode",
|
|
1271
|
+
"parameters": [
|
|
1272
|
+
{
|
|
1273
|
+
"key": "chainId",
|
|
1274
|
+
"value": 34443
|
|
1275
|
+
},
|
|
1276
|
+
{
|
|
1277
|
+
"key": "abiParams.amount",
|
|
1278
|
+
"value": "100000000n"
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
"key": "tokenToBorrow",
|
|
1282
|
+
"value": "0xf0F161fDA2712DB8b566946122a5af183995e2eD"
|
|
1283
|
+
}
|
|
1284
|
+
]
|
|
1285
|
+
}
|
|
1286
|
+
],
|
|
1287
|
+
"requiredApprovals": [],
|
|
1288
|
+
"output": {
|
|
1289
|
+
"transactionHash": "string"
|
|
1290
|
+
},
|
|
1291
|
+
"permissions": {
|
|
1292
|
+
"approvedTargets": [
|
|
1293
|
+
"{{before.contractAddress}}"
|
|
1294
|
+
],
|
|
1295
|
+
"label": [
|
|
1296
|
+
"Borrow {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToBorrow}})}} on IONIC"
|
|
1297
|
+
],
|
|
1298
|
+
"labelNotAuthorized": [
|
|
1299
|
+
"Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToBorrow}})}}"
|
|
1300
|
+
]
|
|
1301
|
+
},
|
|
1302
|
+
"blockId": 100008,
|
|
1303
|
+
"image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ionic.jpg"
|
|
1304
|
+
},
|
|
1305
|
+
"REPAY": {
|
|
1306
|
+
"name": "Repay asset",
|
|
1307
|
+
"description": "Repay a token that you borrowed",
|
|
1308
|
+
"type": 1,
|
|
1309
|
+
"method": "function repayBorrow(uint256 amount) external returns (uint256)",
|
|
1310
|
+
"parameters": [
|
|
1311
|
+
{
|
|
1312
|
+
"key": "chainId",
|
|
1313
|
+
"type": "chainId",
|
|
1314
|
+
"description": "Chain ID of the network",
|
|
1315
|
+
"mandatory": true,
|
|
1316
|
+
"category": 0
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
"key": "tokenToRepay",
|
|
1320
|
+
"type": "erc20",
|
|
1321
|
+
"description": "The token to repay",
|
|
1322
|
+
"mandatory": true,
|
|
1323
|
+
"category": 0
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
"key": "abiParams.amount",
|
|
1327
|
+
"type": "uint256",
|
|
1328
|
+
"description": "Amount of crypto to repay",
|
|
1329
|
+
"mandatory": true,
|
|
1330
|
+
"category": 0,
|
|
1331
|
+
"erc20FormattedAmount": {
|
|
1332
|
+
"contractAddress": "{{parameters.tokenToRepay}}",
|
|
1333
|
+
"chain": "{{parameters.chainId}}"
|
|
1334
|
+
}
|
|
1335
|
+
},
|
|
1336
|
+
],
|
|
1337
|
+
"examples": [
|
|
1338
|
+
{
|
|
1339
|
+
"name": "Repay 100 USDT",
|
|
1340
|
+
"description": "Repay 100 USDT on Ionic on Mode",
|
|
1341
|
+
"parameters": [
|
|
1342
|
+
{
|
|
1343
|
+
"key": "chainId",
|
|
1344
|
+
"value": 34443
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
"key": "abiParams.amount",
|
|
1348
|
+
"value": "100000000n"
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
"key": "tokenToRepay",
|
|
1067
1352
|
"value": "0xf0F161fDA2712DB8b566946122a5af183995e2eD"
|
|
1068
1353
|
}
|
|
1069
1354
|
]
|
|
@@ -1071,9 +1356,9 @@ export const ACTIONS = {
|
|
|
1071
1356
|
],
|
|
1072
1357
|
"requiredApprovals": [
|
|
1073
1358
|
{
|
|
1074
|
-
"address": "{{parameters.
|
|
1075
|
-
"amount": "{{parameters.
|
|
1076
|
-
"to": "{{before.
|
|
1359
|
+
"address": "{{parameters.tokenToRepay}}",
|
|
1360
|
+
"amount": "{{parameters.abiParams.amount}}",
|
|
1361
|
+
"to": "{{before.contractAddress}}"
|
|
1077
1362
|
}
|
|
1078
1363
|
],
|
|
1079
1364
|
"output": {
|
|
@@ -1081,16 +1366,16 @@ export const ACTIONS = {
|
|
|
1081
1366
|
},
|
|
1082
1367
|
"permissions": {
|
|
1083
1368
|
"approvedTargets": [
|
|
1084
|
-
"{{before.
|
|
1369
|
+
"{{before.contractAddress}}"
|
|
1085
1370
|
],
|
|
1086
1371
|
"label": [
|
|
1087
|
-
"
|
|
1372
|
+
"Repay {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToRepay}})}} on IONIC"
|
|
1088
1373
|
],
|
|
1089
1374
|
"labelNotAuthorized": [
|
|
1090
|
-
"Transfer {{
|
|
1375
|
+
"Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToRepay}})}}"
|
|
1091
1376
|
]
|
|
1092
1377
|
},
|
|
1093
|
-
"blockId":
|
|
1378
|
+
"blockId": 100009,
|
|
1094
1379
|
"image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ionic.jpg"
|
|
1095
1380
|
}
|
|
1096
1381
|
}
|
|
@@ -1182,7 +1467,7 @@ export const ACTIONS = {
|
|
|
1182
1467
|
},
|
|
1183
1468
|
{
|
|
1184
1469
|
"key": "amount",
|
|
1185
|
-
"value":
|
|
1470
|
+
"value": "100000000000000000000n"
|
|
1186
1471
|
},
|
|
1187
1472
|
{
|
|
1188
1473
|
"key": "slippage",
|
|
@@ -33,12 +33,14 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
33
33
|
'name': 'MODE transfer notification',
|
|
34
34
|
'description': 'Receive notifications when a top $MODE holder (0x74B8....C6B4) transfers $MODE',
|
|
35
35
|
'tags': [WORKFLOW_TEMPLATES_TAGS.ON_CHAIN_MONITORING],
|
|
36
|
+
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/transfer-monitoring.png',
|
|
36
37
|
createWorkflow: createModeTransferNotificationWorkflow
|
|
37
38
|
},
|
|
38
39
|
{
|
|
39
40
|
'name': 'Buy ETH when the market sentiment is extremely fearful',
|
|
40
41
|
'description': 'Buy ETH when the Bitcoin Fear and Greed Index is below 30',
|
|
41
42
|
'tags': [WORKFLOW_TEMPLATES_TAGS.TRADING, WORKFLOW_TEMPLATES_TAGS.SOCIALS],
|
|
43
|
+
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/fear-and-greed-eth-buy.png',
|
|
42
44
|
createWorkflow: createETHFearAndGreedBuy
|
|
43
45
|
},
|
|
44
46
|
];
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import axios from 'axios';
|
|
11
11
|
const API_CONFIG = {
|
|
12
|
-
BASE_URL: 'https://
|
|
12
|
+
BASE_URL: 'https://api.otomato.xyz/api',
|
|
13
13
|
HEADERS: {
|
|
14
14
|
'Content-Type': 'application/json',
|
|
15
15
|
}
|
|
@@ -25,6 +25,9 @@ class ApiServices {
|
|
|
25
25
|
setAuth(auth) {
|
|
26
26
|
this.auth = auth;
|
|
27
27
|
}
|
|
28
|
+
setUrl(baseUrl) {
|
|
29
|
+
axiosInstance.defaults.baseURL = baseUrl;
|
|
30
|
+
}
|
|
28
31
|
post(url, data) {
|
|
29
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
33
|
const headers = this.auth ? { 'Authorization': this.auth } : {};
|
|
@@ -9,6 +9,7 @@ export declare const TRIGGERS: {
|
|
|
9
9
|
name: string;
|
|
10
10
|
description: string;
|
|
11
11
|
type: number;
|
|
12
|
+
after: string;
|
|
12
13
|
output: {
|
|
13
14
|
value: string;
|
|
14
15
|
from: string;
|
|
@@ -35,7 +36,7 @@ export declare const TRIGGERS: {
|
|
|
35
36
|
description: string;
|
|
36
37
|
type: number;
|
|
37
38
|
method: string;
|
|
38
|
-
|
|
39
|
+
after: string;
|
|
39
40
|
output: {
|
|
40
41
|
balance: string;
|
|
41
42
|
};
|
|
@@ -46,9 +47,6 @@ export declare const TRIGGERS: {
|
|
|
46
47
|
parameters: ({
|
|
47
48
|
key: string;
|
|
48
49
|
value: number;
|
|
49
|
-
} | {
|
|
50
|
-
key: string;
|
|
51
|
-
value: {};
|
|
52
50
|
} | {
|
|
53
51
|
key: string;
|
|
54
52
|
value: string;
|
|
@@ -69,6 +67,7 @@ export declare const TRIGGERS: {
|
|
|
69
67
|
description: string;
|
|
70
68
|
type: number;
|
|
71
69
|
contractAddress: string;
|
|
70
|
+
after: string;
|
|
72
71
|
output: {
|
|
73
72
|
caller: string;
|
|
74
73
|
market: string;
|
|
@@ -87,6 +86,7 @@ export declare const TRIGGERS: {
|
|
|
87
86
|
description: string;
|
|
88
87
|
type: number;
|
|
89
88
|
contractAddress: string;
|
|
89
|
+
after: string;
|
|
90
90
|
output: {
|
|
91
91
|
caller: string;
|
|
92
92
|
market: string;
|
|
@@ -106,6 +106,7 @@ export declare const TRIGGERS: {
|
|
|
106
106
|
description: string;
|
|
107
107
|
type: number;
|
|
108
108
|
contractAddress: string;
|
|
109
|
+
after: string;
|
|
109
110
|
output: {
|
|
110
111
|
market: string;
|
|
111
112
|
PT: string;
|
|
@@ -124,6 +125,7 @@ export declare const TRIGGERS: {
|
|
|
124
125
|
description: string;
|
|
125
126
|
type: number;
|
|
126
127
|
contractAddress: string;
|
|
128
|
+
after: string;
|
|
127
129
|
output: {
|
|
128
130
|
timestamp: string;
|
|
129
131
|
lastLnImpliedRate: string;
|
|
@@ -215,6 +217,7 @@ export declare const TRIGGERS: {
|
|
|
215
217
|
description: string;
|
|
216
218
|
type: number;
|
|
217
219
|
contractAddress: string;
|
|
220
|
+
after: string;
|
|
218
221
|
output: {
|
|
219
222
|
id: string;
|
|
220
223
|
owner: string;
|
|
@@ -236,7 +239,7 @@ export declare const TRIGGERS: {
|
|
|
236
239
|
description: string;
|
|
237
240
|
type: number;
|
|
238
241
|
url: string;
|
|
239
|
-
|
|
242
|
+
after: string;
|
|
240
243
|
output: {
|
|
241
244
|
value: string;
|
|
242
245
|
};
|
|
@@ -288,6 +291,50 @@ export declare const TRIGGERS: {
|
|
|
288
291
|
};
|
|
289
292
|
};
|
|
290
293
|
export declare const ACTIONS: {
|
|
294
|
+
CORE: {
|
|
295
|
+
DELAY: {
|
|
296
|
+
description: string;
|
|
297
|
+
image: string;
|
|
298
|
+
WAIT_FOR: {
|
|
299
|
+
name: string;
|
|
300
|
+
type: number;
|
|
301
|
+
description: string;
|
|
302
|
+
output: {
|
|
303
|
+
message: string;
|
|
304
|
+
};
|
|
305
|
+
parameters: Parameter[];
|
|
306
|
+
examples: {
|
|
307
|
+
name: string;
|
|
308
|
+
description: string;
|
|
309
|
+
parameters: {
|
|
310
|
+
key: string;
|
|
311
|
+
value: string;
|
|
312
|
+
}[];
|
|
313
|
+
}[];
|
|
314
|
+
blockId: number;
|
|
315
|
+
image: string;
|
|
316
|
+
};
|
|
317
|
+
WAIT_UNTIL: {
|
|
318
|
+
name: string;
|
|
319
|
+
type: number;
|
|
320
|
+
description: string;
|
|
321
|
+
output: {
|
|
322
|
+
message: string;
|
|
323
|
+
};
|
|
324
|
+
parameters: Parameter[];
|
|
325
|
+
examples: {
|
|
326
|
+
name: string;
|
|
327
|
+
description: string;
|
|
328
|
+
parameters: {
|
|
329
|
+
key: string;
|
|
330
|
+
value: string;
|
|
331
|
+
}[];
|
|
332
|
+
}[];
|
|
333
|
+
blockId: number;
|
|
334
|
+
image: string;
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
};
|
|
291
338
|
NOTIFICATIONS: {
|
|
292
339
|
SLACK: {
|
|
293
340
|
description: string;
|
|
@@ -377,9 +424,6 @@ export declare const ACTIONS: {
|
|
|
377
424
|
parameters: ({
|
|
378
425
|
key: string;
|
|
379
426
|
value: number;
|
|
380
|
-
} | {
|
|
381
|
-
key: string;
|
|
382
|
-
value: {};
|
|
383
427
|
} | {
|
|
384
428
|
key: string;
|
|
385
429
|
value: string;
|
|
@@ -414,7 +458,95 @@ export declare const ACTIONS: {
|
|
|
414
458
|
value: number;
|
|
415
459
|
} | {
|
|
416
460
|
key: string;
|
|
417
|
-
value:
|
|
461
|
+
value: string;
|
|
462
|
+
})[];
|
|
463
|
+
}[];
|
|
464
|
+
requiredApprovals: {
|
|
465
|
+
address: string;
|
|
466
|
+
amount: string;
|
|
467
|
+
to: string;
|
|
468
|
+
}[];
|
|
469
|
+
output: {
|
|
470
|
+
transactionHash: string;
|
|
471
|
+
};
|
|
472
|
+
permissions: {
|
|
473
|
+
approvedTargets: string[];
|
|
474
|
+
label: string[];
|
|
475
|
+
labelNotAuthorized: string[];
|
|
476
|
+
};
|
|
477
|
+
blockId: number;
|
|
478
|
+
image: string;
|
|
479
|
+
};
|
|
480
|
+
WITHDRAW: {
|
|
481
|
+
name: string;
|
|
482
|
+
description: string;
|
|
483
|
+
type: number;
|
|
484
|
+
method: string;
|
|
485
|
+
parameters: Parameter[];
|
|
486
|
+
examples: {
|
|
487
|
+
name: string;
|
|
488
|
+
description: string;
|
|
489
|
+
parameters: ({
|
|
490
|
+
key: string;
|
|
491
|
+
value: number;
|
|
492
|
+
} | {
|
|
493
|
+
key: string;
|
|
494
|
+
value: string;
|
|
495
|
+
})[];
|
|
496
|
+
}[];
|
|
497
|
+
requiredApprovals: never[];
|
|
498
|
+
output: {
|
|
499
|
+
transactionHash: string;
|
|
500
|
+
};
|
|
501
|
+
permissions: {
|
|
502
|
+
approvedTargets: string[];
|
|
503
|
+
label: string[];
|
|
504
|
+
labelNotAuthorized: string[];
|
|
505
|
+
};
|
|
506
|
+
blockId: number;
|
|
507
|
+
image: string;
|
|
508
|
+
};
|
|
509
|
+
BORROW: {
|
|
510
|
+
name: string;
|
|
511
|
+
description: string;
|
|
512
|
+
type: number;
|
|
513
|
+
method: string;
|
|
514
|
+
parameters: Parameter[];
|
|
515
|
+
examples: {
|
|
516
|
+
name: string;
|
|
517
|
+
description: string;
|
|
518
|
+
parameters: ({
|
|
519
|
+
key: string;
|
|
520
|
+
value: number;
|
|
521
|
+
} | {
|
|
522
|
+
key: string;
|
|
523
|
+
value: string;
|
|
524
|
+
})[];
|
|
525
|
+
}[];
|
|
526
|
+
requiredApprovals: never[];
|
|
527
|
+
output: {
|
|
528
|
+
transactionHash: string;
|
|
529
|
+
};
|
|
530
|
+
permissions: {
|
|
531
|
+
approvedTargets: string[];
|
|
532
|
+
label: string[];
|
|
533
|
+
labelNotAuthorized: string[];
|
|
534
|
+
};
|
|
535
|
+
blockId: number;
|
|
536
|
+
image: string;
|
|
537
|
+
};
|
|
538
|
+
REPAY: {
|
|
539
|
+
name: string;
|
|
540
|
+
description: string;
|
|
541
|
+
type: number;
|
|
542
|
+
method: string;
|
|
543
|
+
parameters: Parameter[];
|
|
544
|
+
examples: {
|
|
545
|
+
name: string;
|
|
546
|
+
description: string;
|
|
547
|
+
parameters: ({
|
|
548
|
+
key: string;
|
|
549
|
+
value: number;
|
|
418
550
|
} | {
|
|
419
551
|
key: string;
|
|
420
552
|
value: string;
|
|
@@ -470,9 +602,6 @@ export declare const ACTIONS: {
|
|
|
470
602
|
} | {
|
|
471
603
|
key: string;
|
|
472
604
|
value: string;
|
|
473
|
-
} | {
|
|
474
|
-
key: string;
|
|
475
|
-
value: {};
|
|
476
605
|
})[];
|
|
477
606
|
}[];
|
|
478
607
|
permissions: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare class ApiServices {
|
|
2
2
|
private auth;
|
|
3
3
|
setAuth(auth: string): void;
|
|
4
|
+
setUrl(baseUrl: string): void;
|
|
4
5
|
post(url: string, data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
6
|
patch(url: string, data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
7
|
get(url: string): Promise<any>;
|