otomato-sdk 1.2.0 → 1.3.0

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 (55) hide show
  1. package/dist/examples/create-action.js +2 -2
  2. package/dist/examples/create-automation.js +2 -8
  3. package/dist/examples/create-trigger.js +2 -2
  4. package/dist/examples/create-workflow.js +44 -0
  5. package/dist/examples/load-workflow.js +16 -0
  6. package/dist/examples/sandbox.js +18 -0
  7. package/dist/src/constants/Blocks.js +422 -293
  8. package/dist/src/index.js +1 -1
  9. package/dist/src/models/Edge.js +6 -1
  10. package/dist/src/models/Node.js +79 -6
  11. package/dist/src/models/Trigger.js +6 -3
  12. package/dist/src/models/Workflow.js +67 -0
  13. package/dist/src/services/ApiService.js +24 -18
  14. package/dist/src/utils/typeValidator.js +2 -1
  15. package/dist/test/action.spec.js +20 -17
  16. package/dist/test/automation.spec.js +26 -25
  17. package/dist/test/node.spec.js +34 -30
  18. package/dist/test/trigger.spec.js +8 -3
  19. package/dist/test/typeValidator.spec.js +2 -1
  20. package/dist/types/examples/create-workflow.d.ts +1 -0
  21. package/dist/types/examples/load-workflow.d.ts +1 -0
  22. package/dist/types/examples/sandbox.d.ts +1 -0
  23. package/dist/types/src/constants/Blocks.d.ts +101 -29
  24. package/dist/types/src/index.d.ts +1 -1
  25. package/dist/types/src/models/Action.d.ts +2 -1
  26. package/dist/types/src/models/Edge.d.ts +3 -0
  27. package/dist/types/src/models/Node.d.ts +9 -2
  28. package/dist/types/src/models/Parameter.d.ts +1 -1
  29. package/dist/types/src/models/Trigger.d.ts +3 -1
  30. package/dist/types/src/models/Workflow.d.ts +26 -0
  31. package/dist/types/src/services/ApiService.d.ts +8 -3
  32. package/examples/create-action.ts +2 -2
  33. package/examples/create-trigger.ts +2 -2
  34. package/examples/create-workflow.ts +44 -0
  35. package/examples/load-workflow.ts +10 -0
  36. package/package.json +2 -3
  37. package/src/constants/Blocks.ts +422 -292
  38. package/src/index.ts +1 -1
  39. package/src/models/Action.ts +1 -1
  40. package/src/models/Condition.ts +5 -5
  41. package/src/models/Edge.ts +8 -2
  42. package/src/models/Node.ts +90 -10
  43. package/src/models/Parameter.ts +5 -5
  44. package/src/models/Trigger.ts +9 -5
  45. package/src/models/Workflow.ts +69 -0
  46. package/src/services/ApiService.ts +26 -19
  47. package/src/utils/typeValidator.ts +2 -1
  48. package/test/action.spec.ts +11 -9
  49. package/test/automation.spec.ts +27 -26
  50. package/test/node.spec.ts +34 -30
  51. package/test/trigger.spec.ts +8 -3
  52. package/test/typeValidator.spec.ts +2 -1
  53. package/examples/create-automation.ts +0 -41
  54. package/src/constants/json.json +0 -16
  55. package/src/models/Automation.ts +0 -47
@@ -7,389 +7,519 @@ const TRIGGER_TYPE = {
7
7
  }
8
8
 
9
9
  export const TRIGGERS = {
10
- TOKENS: {
11
- ERC20: {
12
- CHAINS: [CHAINS.ALL],
13
- TRANSFER: {
14
- id: 1,
15
- name: "Transfer token",
16
- description: "Transfer an ERC-20 token",
17
- type: TRIGGER_TYPE.SUBSCRIPTION,
18
- parameters: [
10
+ "TOKENS": {
11
+ "ERC20": {
12
+ "description": "The most used standard for tokens on ethereum compatible blockchains",
13
+ "chains": [
14
+ 0
15
+ ],
16
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ethereum.webp",
17
+ "TRANSFER": {
18
+ "name": "Transfer token",
19
+ "description": "This block gets triggered when someone transfers the ERC20 configured in the params",
20
+ "type": 0,
21
+ "parameters": [
19
22
  {
20
- key: "chainId",
21
- type: "chainId",
22
- description: "Chain ID of the ETH blockchain"
23
+ "key": "chainId",
24
+ "type": "chainId",
25
+ "description": "Chain ID of the ETH blockchain",
26
+ "mandatory": true
23
27
  },
24
28
  {
25
- key: "abiParams.value",
26
- type: "uint256",
27
- description: "Amount of crypto to transfer"
29
+ "key": "abiParams.from",
30
+ "type": "address",
31
+ "description": "Address that transfers the funds"
28
32
  },
29
33
  {
30
- key: "abiParams.to",
31
- type: "address",
32
- description: "Address to transfer crypto to"
34
+ "key": "abiParams.value",
35
+ "type": "uint256",
36
+ "description": "Amount of crypto to transfer"
33
37
  },
34
38
  {
35
- key: "contractAddress",
36
- type: "address",
37
- description: "The contract address of the ERC20"
38
- }
39
- ] as Parameter[]
39
+ "key": "abiParams.to",
40
+ "type": "address",
41
+ "description": "Address that receives the funds"
42
+ },
43
+ {
44
+ "key": "contractAddress",
45
+ "type": "erc20",
46
+ "description": "The contract address of the ERC20",
47
+ "mandatory": true
48
+ },
49
+ ] as Parameter[],
50
+ "blockId": 1,
51
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ethereum.webp"
40
52
  },
41
- BALANCE: {
42
- id: 1000,
43
- name: "ERC20 balance check",
44
- description: "Fetches the balance of an ERC20 and checks it against the specified condition.",
45
- type: TRIGGER_TYPE.POLLING,
46
- parameters: [
53
+ "BALANCE": {
54
+ "name": "ERC20 balance check",
55
+ "description": "Fetches the balance of an ERC20 and checks it against the specified condition.",
56
+ "type": 1,
57
+ "method": "function balanceOf(address account) view returns (uint256)",
58
+ "handler": "output => { const params=JSON.parse(output);const balance = BigInt(params)/1000000n; return Number(balance); }",
59
+ "parameters": [
47
60
  {
48
- key: "chainId",
49
- type: "chainId",
50
- description: "Chain ID of the ETH blockchain"
61
+ "key": "chainId",
62
+ "type": "chainId",
63
+ "description": "Chain ID of the ETH blockchain"
51
64
  },
52
65
  {
53
- key: "abiParams.account",
54
- type: "address",
55
- description: "Amount of crypto to transfer"
66
+ "key": "abiParams.account",
67
+ "type": "address",
68
+ "description": "Amount of crypto to transfer"
56
69
  },
57
70
  {
58
- key: "contractAddress",
59
- type: "address",
60
- description: "The contract address of the ERC20"
71
+ "key": "contractAddress",
72
+ "type": "address",
73
+ "description": "The contract address of the ERC20"
61
74
  },
62
75
  {
63
- key: "condition",
64
- type: "logic_operator",
65
- description: "Logic operator used for the comparison: <, >, <=, >=, ==, ..."
76
+ "key": "condition",
77
+ "type": "logic_operator",
78
+ "description": "Logic operator used for the comparison: <, >, <=, >=, ==, ..."
66
79
  },
67
- // todo: it should be in the same type as the output of the function
68
80
  {
69
- key: "comparisonValue",
70
- type: "any",
71
- description: "The value to compare to"
81
+ "key": "comparisonValue",
82
+ "type": "any",
83
+ "description": "The value to compare to"
72
84
  },
73
85
  {
74
- key: "interval",
75
- type: "integer",
76
- description: "The waiting time between each polling"
86
+ "key": "interval",
87
+ "type": "integer",
88
+ "description": "The waiting time between each polling"
77
89
  },
78
90
  ] as Parameter[],
91
+ "blockId": 5,
92
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ethereum.webp"
79
93
  }
80
- },
94
+ }
81
95
  },
82
- YIELD: {
83
- SPLICE_FI: {
84
- CHAINS: [CHAINS.MODE],
85
- SWAP: {
86
- id: 2,
87
- name: "Splice Finance Swap",
88
- description: "Swap in Splice Finance",
89
- type: TRIGGER_TYPE.SUBSCRIPTION,
90
- parameters: [
96
+ "YIELD": {
97
+ "SPLICE_FI": {
98
+ "description": "Split any yield-bearing asset into separate yield and principal components",
99
+ "chains": [
100
+ 43334
101
+ ],
102
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/splicefi.png",
103
+ "SWAP": {
104
+ "name": "Splice Finance Swap",
105
+ "description": "Swap in Splice Finance",
106
+ "type": 0,
107
+ "contractAddress": "0x7A3a94AE0fC1421A3eac23eA6371036ac8d8f448",
108
+ "parameters": [
91
109
  {
92
- key: "abiParams.caller",
93
- type: "address",
94
- description: "Caller address"
110
+ "key": "abiParams.caller",
111
+ "type": "address",
112
+ "description": "Caller address"
95
113
  },
96
114
  {
97
- key: "abiParams.market",
98
- type: "address",
99
- description: "Market address"
115
+ "key": "abiParams.market",
116
+ "type": "address",
117
+ "description": "Market address"
100
118
  },
101
119
  {
102
- key: "abiParams.receiver",
103
- type: "address",
104
- description: "Receiver address"
120
+ "key": "abiParams.receiver",
121
+ "type": "address",
122
+ "description": "Receiver address"
105
123
  },
106
124
  {
107
- key: "abiParams.netPtToAccount",
108
- type: "int256",
109
- description: "Net PT to account"
125
+ "key": "abiParams.netPtToAccount",
126
+ "type": "int256",
127
+ "description": "Net PT to account"
110
128
  },
111
129
  {
112
- key: "abiParams.netSyToAccount",
113
- type: "int256",
114
- description: "Net SY to account"
115
- }
116
- ] as Parameter[]
130
+ "key": "abiParams.netSyToAccount",
131
+ "type": "int256",
132
+ "description": "Net SY to account"
133
+ },
134
+ ] as Parameter[],
135
+ "blockId": 2,
136
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/splicefi.png"
117
137
  },
118
- LIQUIDITY_REMOVED: {
119
- id: 6,
120
- name: "Liquidity Removed",
121
- description: "Liquidity removed in Splice Finance",
122
- type: TRIGGER_TYPE.SUBSCRIPTION,
123
- parameters: [
138
+ "LIQUIDITY_REMOVED": {
139
+ "name": "Liquidity Removed",
140
+ "description": "Liquidity removed in Splice Finance",
141
+ "type": 0,
142
+ "contractAddress": "0x7A3a94AE0fC1421A3eac23eA6371036ac8d8f448",
143
+ "parameters": [
124
144
  {
125
- key: "abiParams.caller",
126
- type: "address",
127
- description: "Caller address"
145
+ "key": "abiParams.caller",
146
+ "type": "address",
147
+ "description": "Caller address"
128
148
  },
129
149
  {
130
- key: "abiParams.market",
131
- type: "address",
132
- description: "Market address"
150
+ "key": "abiParams.market",
151
+ "type": "address",
152
+ "description": "Market address"
133
153
  },
134
154
  {
135
- key: "abiParams.receiver",
136
- type: "address",
137
- description: "Receiver address"
155
+ "key": "abiParams.receiver",
156
+ "type": "address",
157
+ "description": "Receiver address"
138
158
  },
139
159
  {
140
- key: "abiParams.netLpToRemove",
141
- type: "uint256",
142
- description: "Net LP to remove"
160
+ "key": "abiParams.netLpToRemove",
161
+ "type": "uint256",
162
+ "description": "Net LP to remove"
143
163
  },
144
164
  {
145
- key: "abiParams.netPtOut",
146
- type: "uint256",
147
- description: "Net PT out"
165
+ "key": "abiParams.netPtOut",
166
+ "type": "uint256",
167
+ "description": "Net PT out"
148
168
  },
149
169
  {
150
- key: "abiParams.netSyOut",
151
- type: "uint256",
152
- description: "Net SY out"
153
- }
154
- ] as Parameter[]
170
+ "key": "abiParams.netSyOut",
171
+ "type": "uint256",
172
+ "description": "Net SY out"
173
+ },
174
+ ] as Parameter[],
175
+ "blockId": 6,
176
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/splicefi.png"
155
177
  },
156
- MARKET_CREATION: {
157
- id: 7,
158
- name: "Market Creation",
159
- description: "Market creation in Splice Finance",
160
- type: TRIGGER_TYPE.SUBSCRIPTION,
161
- parameters: [
178
+ "MARKET_CREATION": {
179
+ "name": "Market Creation",
180
+ "description": "Market creation in Splice Finance",
181
+ "type": 0,
182
+ "contractAddress": "0x7A3a94AE0fC1421A3eac23eA6371036ac8d8f448",
183
+ "parameters": [
162
184
  {
163
- key: "abiParams.market",
164
- type: "address",
165
- description: "Market address"
185
+ "key": "abiParams.market",
186
+ "type": "address",
187
+ "description": "Market address"
166
188
  },
167
189
  {
168
- key: "abiParams.PT",
169
- type: "address",
170
- description: "PT address"
190
+ "key": "abiParams.PT",
191
+ "type": "address",
192
+ "description": "PT address"
171
193
  },
172
194
  {
173
- key: "abiParams.scalarRoot",
174
- type: "int256",
175
- description: "Scalar root"
195
+ "key": "abiParams.scalarRoot",
196
+ "type": "int256",
197
+ "description": "Scalar root"
176
198
  },
177
199
  {
178
- key: "abiParams.initialAnchor",
179
- type: "int256",
180
- description: "Initial anchor"
200
+ "key": "abiParams.initialAnchor",
201
+ "type": "int256",
202
+ "description": "Initial anchor"
181
203
  },
182
204
  {
183
- key: "abiParams.lnFeeRateRoot",
184
- type: "uint256",
185
- description: "LN fee rate root"
186
- }
187
- ] as Parameter[]
205
+ "key": "abiParams.lnFeeRateRoot",
206
+ "type": "uint256",
207
+ "description": "LN fee rate root"
208
+ },
209
+ ] as Parameter[],
210
+ "blockId": 7,
211
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/splicefi.png"
188
212
  },
189
- INTEREST_RATE_UPDATE: {
190
- id: 9,
191
- name: "Interest Rate Update",
192
- description: "Interest rate update in Splice Finance",
193
- type: TRIGGER_TYPE.SUBSCRIPTION,
194
- parameters: [
195
- {
196
- key: "abiParams.timestamp",
197
- type: "uint256",
198
- description: "Timestamp"
199
- },
200
- {
201
- key: "abiParams.lastLnImpliedRate",
202
- type: "int256",
203
- description: "Last LN implied rate"
204
- },
205
- {
206
- key: "contractAddress",
207
- type: "address",
208
- description: "Contract address to monitor",
209
- enum: [
210
- "0xDE95511418EBD8Bd36294B11C86314DdFA50e212", // wrsETH
211
- "0x34cf9BF641bd5f34197060A3f3478a1f97f78f0a", // ezETH
212
- "0xb950A73Ea0842B0Cd06D0e369aE974799BB346f1", // MODE
213
- "0xbF14932e1A7962C77D0b31be80075936bE1A43D4" // weETH
213
+ "INTEREST_RATE_UPDATE": {
214
+ "name": "Interest Rate Update",
215
+ "description": "Interest rate update in Splice Finance",
216
+ "type": 0,
217
+ "contractAddress": "0x7A3a94AE0fC1421A3eac23eA6371036ac8d8f448",
218
+ "parameters": [
219
+ {
220
+ "key": "abiParams.timestamp",
221
+ "type": "uint256",
222
+ "description": "Timestamp"
223
+ },
224
+ {
225
+ "key": "abiParams.lastLnImpliedRate",
226
+ "type": "int256",
227
+ "description": "Last LN implied rate"
228
+ },
229
+ {
230
+ "key": "contractAddress",
231
+ "type": "address",
232
+ "description": "Contract address to monitor",
233
+ "mandatory": true,
234
+ "enum": [
235
+ "0xDE95511418EBD8Bd36294B11C86314DdFA50e212",
236
+ "0x34cf9BF641bd5f34197060A3f3478a1f97f78f0a",
237
+ "0xb950A73Ea0842B0Cd06D0e369aE974799BB346f1",
238
+ "0xbF14932e1A7962C77D0b31be80075936bE1A43D4"
214
239
  ]
215
- }
216
- ] as Parameter[]
240
+ },
241
+ ] as Parameter[],
242
+ "blockId": 9,
243
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/splicefi.png"
217
244
  }
218
245
  }
219
246
  },
220
- LENDING: {
221
- ASTARIA: {
222
- CHAINS: [CHAINS.MODE],
223
- LEND_RECALLED: {
224
- id: 8,
225
- name: "Lend Recalled",
226
- description: "Lend recalled in Astaria",
227
- type: TRIGGER_TYPE.SUBSCRIPTION,
228
- parameters: [
229
- {
230
- key: "abiParams.loanId",
231
- type: "uint256",
232
- description: "Loan ID"
233
- },
234
- {
235
- key: "abiParams.recaller",
236
- type: "address",
237
- description: "Recaller address"
238
- },
239
- {
240
- key: "abiParams.end",
241
- type: "uint256",
242
- description: "End time"
243
- }
244
- ] as Parameter[]
247
+ "LENDING": {
248
+ "ASTARIA": {
249
+ "description": "Astaria is an oracle-less, intent-based, fixed-rate lending protocol supporting unlimited loan durations for any asset",
250
+ "chains": [
251
+ 43334
252
+ ],
253
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/astaria.png",
254
+ "LEND_RECALLED": {
255
+ "name": "Lend Recalled",
256
+ "description": "Lend recalled in Astaria",
257
+ "type": 0,
258
+ "contractAddress": "0x34cf9BF641bd5f34197060A3f3478a1f97f78f0a",
259
+ "parameters": [
260
+ {
261
+ "key": "abiParams.loanId",
262
+ "type": "uint256",
263
+ "description": "Loan ID"
264
+ },
265
+ {
266
+ "key": "abiParams.recaller",
267
+ "type": "address",
268
+ "description": "Recaller address"
269
+ },
270
+ {
271
+ "key": "abiParams.end",
272
+ "type": "uint256",
273
+ "description": "End time"
274
+ },
275
+ ] as Parameter[],
276
+ "blockId": 8,
277
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/astaria.png"
245
278
  }
246
279
  }
247
280
  },
248
- DEXES: {
249
- ODOS: {
250
- CHAINS: [CHAINS.MODE, CHAINS.ETHEREUM],
251
- SWAP: {
252
- id: 4,
253
- name: "Odos Swap",
254
- description: "Swap on Odos",
255
- type: TRIGGER_TYPE.SUBSCRIPTION,
256
- parameters: [
281
+ "DEXES": {
282
+ "ODOS": {
283
+ "description": "Smart Order Routing across multiple blockchain protocols, 700+ Liquidity Sources and thousands of token pairs, delivering ultimate savings to users",
284
+ "chains": [
285
+ 43334,
286
+ 1
287
+ ],
288
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/odos.jpg",
289
+ "SWAP": {
290
+ "name": "Odos Swap",
291
+ "description": "Swap on Odos",
292
+ "type": 0,
293
+ "contractAddress": "0x7E15EB462cdc67Cf92Af1f7102465a8F8c784874",
294
+ "parameters": [
257
295
  {
258
- key: "chainId",
259
- type: "int",
260
- description: "Chain ID of the ETH blockchain"
296
+ "key": "chainId",
297
+ "type": "chainId",
298
+ "description": "Chain ID of the ETH blockchain",
299
+ "mandatory": true
261
300
  },
262
301
  {
263
- key: "abiParams.sender",
264
- type: "address",
265
- description: "Sender address"
302
+ "key": "abiParams.sender",
303
+ "type": "address",
304
+ "description": "Sender address"
266
305
  },
267
306
  {
268
- key: "abiParams.inputAmount",
269
- type: "uint256",
270
- description: "Input amount"
307
+ "key": "abiParams.inputAmount",
308
+ "type": "uint256",
309
+ "description": "Input amount"
271
310
  },
272
311
  {
273
- key: "abiParams.inputToken",
274
- type: "address",
275
- description: "Input token address"
312
+ "key": "abiParams.inputToken",
313
+ "type": "address",
314
+ "description": "Input token address"
276
315
  },
277
316
  {
278
- key: "abiParams.amountOut",
279
- type: "uint256",
280
- description: "Output amount"
317
+ "key": "abiParams.amountOut",
318
+ "type": "uint256",
319
+ "description": "Output amount"
281
320
  },
282
321
  {
283
- key: "abiParams.outputToken",
284
- type: "address",
285
- description: "Output token address"
322
+ "key": "abiParams.outputToken",
323
+ "type": "address",
324
+ "description": "Output token address"
286
325
  },
287
- {
288
- key: "abiParams.exchangeRate",
289
- type: "float",
290
- description: "Exchange rate"
291
- }
292
- ] as Parameter[]
326
+ ] as Parameter[],
327
+ "blockId": 4,
328
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/odos.jpg"
293
329
  }
294
330
  }
295
331
  },
296
- SOCIALS: {
297
- MODE_NAME_SERVICE: {
298
- CHAINS: [CHAINS.MODE],
299
- NAME_REGISTERED: {
300
- id: 3,
301
- name: "Name Registered",
302
- description: "Name registered in Mode Name Service",
303
- type: TRIGGER_TYPE.SUBSCRIPTION,
304
- parameters: [
305
- {
306
- key: "abiParams.id",
307
- type: "uint256",
308
- description: "ID of the name registered"
309
- },
310
- {
311
- key: "abiParams.owner",
312
- type: "address",
313
- description: "Owner address"
314
- },
315
- {
316
- key: "abiParams.expires",
317
- type: "uint256",
318
- description: "Expiration time"
319
- }
320
- ] as Parameter[]
332
+ "SOCIALS": {
333
+ "MODE_NAME_SERVICE": {
334
+ "description": "Next generation of Mode Mainnet Domains",
335
+ "chains": [
336
+ 43334
337
+ ],
338
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/modens.png",
339
+ "NAME_REGISTERED": {
340
+ "name": "Name Registered",
341
+ "description": "Name registered in Mode Name Service",
342
+ "type": 0,
343
+ "contractAddress": "0x2aD86eeEC513AC16804bb05310214C3Fd496835B",
344
+ "parameters": [
345
+ {
346
+ "key": "abiParams.id",
347
+ "type": "uint256",
348
+ "description": "ID of the name registered"
349
+ },
350
+ {
351
+ "key": "abiParams.owner",
352
+ "type": "address",
353
+ "description": "Owner address"
354
+ },
355
+ {
356
+ "key": "abiParams.expires",
357
+ "type": "uint256",
358
+ "description": "Expiration time"
359
+ },
360
+ ] as Parameter[],
361
+ "blockId": 3,
362
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/modens.png"
363
+ }
364
+ }
365
+ },
366
+ "PRICE_ACTION": {
367
+ "ON_CHAIN_PRICE_MOVEMENT": {
368
+ "description": "Triggers based on the movement of on-chain prices against specified currencies",
369
+ "chains": [
370
+ 0
371
+ ],
372
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/trend-up.png",
373
+ "PRICE_MOVEMENT_AGAINST_CURRENCY": {
374
+ "name": "On-Chain Price Movement Against Fiat Currency",
375
+ "description": "This trigger activates when the on-chain price of an asset moves against a specified currency based on the given condition.",
376
+ "type": 2,
377
+ "parameters": [
378
+ {
379
+ "key": "chainId",
380
+ "type": "chainId",
381
+ "description": "Chain ID of the blockchain to monitor"
382
+ },
383
+ {
384
+ "key": "comparisonValue",
385
+ "type": "float",
386
+ "description": "The price to compare against"
387
+ },
388
+ {
389
+ "key": "currency",
390
+ "type": "string",
391
+ "description": "The currency in which the comparison price is denominated",
392
+ "enum": [
393
+ "USD"
394
+ ]
395
+ },
396
+ {
397
+ "key": "condition",
398
+ "type": "logic_operator",
399
+ "description": "The logic operator used for the comparison (e.g., >, <, >=, <=, ==, !=)"
400
+ },
401
+ {
402
+ "key": "contractAddress",
403
+ "type": "erc20",
404
+ "description": "The asset that you want to track"
405
+ },
406
+ ] as Parameter[],
407
+ "blockId": 10,
408
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/trend-up.png"
321
409
  }
322
410
  }
323
411
  }
324
412
  };
325
413
 
326
414
  export const ACTIONS = {
327
- TOKENS: {
328
- ERC20: {
329
- CHAINS: [CHAINS.ALL],
330
- TRANSFER: {
331
- id: 1,
332
- name: "Transfer ERC-20 Token",
333
- description: "Transfer an ERC-20 token",
334
- parameters: [
415
+ "NOTIFICATIONS": {
416
+ "SLACK": {
417
+ "description": "Slack is a messaging app for businesses that connects people to the information they need.",
418
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/slack.png",
419
+ "SEND_MESSAGE": {
420
+ "name": "Send message",
421
+ "type": 0,
422
+ "description": "Notifies you by sending a Slack message to the channel of your choice",
423
+ "parameters": [
335
424
  {
336
- key: "chainId",
337
- type: "chainId",
338
- description: "Chain ID of the blockchain"
425
+ "key": "webhook",
426
+ "type": "url",
427
+ "description": "The webhook URL for the Slack channel"
339
428
  },
340
429
  {
341
- key: "abiParams.value",
342
- type: "uint256",
343
- description: "Amount of crypto to transfer"
430
+ "key": "message",
431
+ "type": "paragraph",
432
+ "description": "The text content to send"
344
433
  },
434
+ ] as Parameter[],
435
+ "blockId": 100002,
436
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/slack.png"
437
+ }
438
+ },
439
+ "DISCORD": {
440
+ "description": "Discord is a communication service to talk with your favorite communities.",
441
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/discord.png",
442
+ "SEND_MESSAGE": {
443
+ "name": "Send message",
444
+ "type": 0,
445
+ "description": "Notifies you by sending a Discord message to the channel of your choice",
446
+ "parameters": [
345
447
  {
346
- key: "abiParams.to",
347
- type: "address",
348
- description: "Address to transfer crypto to"
448
+ "key": "webhook",
449
+ "type": "url",
450
+ "description": "The webhook URL for the Discord channel"
349
451
  },
350
452
  {
351
- key: "contractAddress",
352
- type: "address",
353
- description: "The contract address of the ERC-20 token"
354
- }
355
- ] as Parameter[]
356
- },
453
+ "key": "message",
454
+ "type": "paragraph",
455
+ "description": "The text content to send"
456
+ },
457
+ ] as Parameter[],
458
+ "blockId": 100003,
459
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/discord.png"
460
+ }
357
461
  },
462
+ "TELEGRAM": {
463
+ "description": "Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.",
464
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/telegram.jpeg",
465
+ "SEND_MESSAGE": {
466
+ "name": "Send message",
467
+ "type": 0,
468
+ "description": "Notifies you by sending a Telegram message to the chat of your choice",
469
+ "parameters": [
470
+ {
471
+ "key": "webhook",
472
+ "type": "url",
473
+ "description": "The webhook URL for the Telegram bot"
474
+ },
475
+ {
476
+ "key": "message",
477
+ "type": "paragraph",
478
+ "description": "The text content to send"
479
+ },
480
+ ] as Parameter[],
481
+ "blockId": 100001,
482
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/telegram.jpeg"
483
+ }
484
+ }
358
485
  },
359
- NOTIFICATIONS: {
360
- SMS: {
361
- id: 3,
362
- name: "Send SMS",
363
- description: "Send an SMS notification to a specified phone number",
364
- parameters: [
365
- {
366
- key: "phoneNumber",
367
- type: "phone_number",
368
- description: "Phone number to send the message to"
369
- },
370
- {
371
- key: "text",
372
- type: "paragraph",
373
- description: "Content of the SMS message"
374
- },
375
- ] as Parameter[]
376
- },
377
- SLACK: {
378
- id: 4,
379
- name: "Send Slack Message",
380
- description: "Send a message to a specified Slack channel via webhook",
381
- parameters: [
382
- {
383
- key: "webhook",
384
- type: "url",
385
- description: "Slack channel webhook URL"
386
- },
387
- {
388
- key: "text",
389
- type: "paragraph",
390
- description: "Content of the Slack message"
391
- },
392
- ] as Parameter[]
393
- },
486
+ "TOKENS": {
487
+ "ERC20": {
488
+ "description": "The most used standard for tokens on ethereum compatible blockchains",
489
+ "chains": [
490
+ 0
491
+ ],
492
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ethereum.webp",
493
+ "TRANSFER": {
494
+ "name": "Transfer token",
495
+ "description": "Transfers an ERC20 token",
496
+ "type": 1,
497
+ "method": "Transfer(address from, address to, uint256 value)",
498
+ "parameters": [
499
+ {
500
+ "key": "chainId",
501
+ "type": "chainId",
502
+ "description": "Chain ID of the network"
503
+ },
504
+ {
505
+ "key": "abiParams.value",
506
+ "type": "uint256",
507
+ "description": "Amount of crypto to transfer"
508
+ },
509
+ {
510
+ "key": "abiParams.to",
511
+ "type": "address",
512
+ "description": "Address to transfer crypto to"
513
+ },
514
+ {
515
+ "key": "contractAddress",
516
+ "type": "erc20",
517
+ "description": "The contract address of the ERC20"
518
+ },
519
+ ] as Parameter[],
520
+ "blockId": 100004,
521
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ethereum.webp"
522
+ }
523
+ }
394
524
  }
395
525
  };