otomato-sdk 2.0.174 → 2.0.176
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.
|
@@ -38,7 +38,7 @@ const createETHFearAndGreedBuy = async () => {
|
|
|
38
38
|
};
|
|
39
39
|
const createDCAFearAndGreed = async () => {
|
|
40
40
|
// created with examples/UseCases/FearAndGreedDCA
|
|
41
|
-
return Workflow.fromJSON({ "id": null, "name": "Fear
|
|
41
|
+
return Workflow.fromJSON({ "id": null, "name": "Daily Fear & Greed-Based cbBTC Trading", "state": "inactive", "dateCreated": null, "dateModified": null, "executionId": null, "agentId": null, "nodes": [{ "id": null, "ref": "1", "blockId": 18, "type": "trigger", "state": "inactive", "parameters": { "period": 86400000, "timeout": null, "limit": 30 }, "frontendHelpers": {}, "position": { "x": 400, "y": 120 } }, { "id": null, "ref": "2", "blockId": 100015, "type": "action", "state": "inactive", "parameters": { "branchesAmount": 2 }, "frontendHelpers": {}, "position": { "x": 400, "y": 240 } }, { "id": null, "ref": "3", "blockId": 100016, "type": "action", "state": "inactive", "parameters": { "logic": "or", "groups": [{ "logic": "and", "checks": [{ "value1": "{{external.functions.btcFearAndGreed()}}", "condition": "gt", "value2": "80" }] }] }, "frontendHelpers": {}, "position": { "x": 150, "y": 360 } }, { "id": null, "ref": "4", "blockId": 100013, "type": "action", "state": "inactive", "parameters": { "chainId": 8453, "tokenIn": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf", "tokenOut": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "amount": 0.0001, "slippage": 0.1 }, "frontendHelpers": { "output": { "amountIn": { "formatAmount": false, "erc20Token": { "contractAddress": "{{output.tokenIn}}", "chainId": "{{parameters.chainId}}" } }, "amountOut": { "formatAmount": false, "erc20Token": { "contractAddress": "{{output.tokenOut}}", "chainId": "{{parameters.chainId}}" } } } }, "position": { "x": 150, "y": 480 } }, { "id": null, "ref": "5", "blockId": 100016, "type": "action", "state": "inactive", "parameters": { "logic": "or", "groups": [{ "logic": "and", "checks": [{ "value1": "{{external.functions.btcFearAndGreed()}}", "condition": "lt", "value2": "20" }] }] }, "frontendHelpers": {}, "position": { "x": 650, "y": 360 } }, { "id": null, "ref": "6", "blockId": 100013, "type": "action", "state": "inactive", "parameters": { "chainId": 8453, "tokenIn": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "tokenOut": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf", "amount": 10, "slippage": 0.3 }, "frontendHelpers": { "output": { "amountIn": { "formatAmount": false, "erc20Token": { "contractAddress": "{{output.tokenIn}}", "chainId": "{{parameters.chainId}}" } }, "amountOut": { "formatAmount": false, "erc20Token": { "contractAddress": "{{output.tokenOut}}", "chainId": "{{parameters.chainId}}" } } } }, "position": { "x": 650, "y": 480 } }], "edges": [{ "id": null, "source": "1", "target": "2" }, { "id": null, "source": "2", "target": "3" }, { "id": null, "source": "3", "target": "4", "label": "true", "value": "true" }, { "id": null, "source": "2", "target": "5" }, { "id": null, "source": "5", "target": "6", "label": "true", "value": "true" }], "notes": [] });
|
|
42
42
|
};
|
|
43
43
|
const createETHFearAndGreedCapitalEfficientBuy = async () => {
|
|
44
44
|
const trigger = new Trigger(TRIGGERS.SOCIALS.FEAR_AND_GREED.GET_FEAR_AND_GREED_INDEX);
|
|
@@ -67,7 +67,7 @@ const createETHFearAndGreedCapitalEfficientBuy = async () => {
|
|
|
67
67
|
const edge1 = new Edge({ source: trigger, target: ionicWithdraw });
|
|
68
68
|
const edge2 = new Edge({ source: ionicWithdraw, target: odosAction });
|
|
69
69
|
const edge3 = new Edge({ source: odosAction, target: ionicDeposit });
|
|
70
|
-
return new Workflow('
|
|
70
|
+
return new Workflow('Buy ETH when the market sentiment is extremely fearful - capital efficient', [trigger, odosAction, ionicWithdraw, ionicDeposit], [edge1, edge2, edge3]);
|
|
71
71
|
};
|
|
72
72
|
const createSUsdeYieldBuy = async () => {
|
|
73
73
|
const trigger = new Trigger(TRIGGERS.YIELD.ETHENA.SUSDE_YIELD);
|
|
@@ -138,7 +138,7 @@ const gasMonitoring = async () => {
|
|
|
138
138
|
notificationAction.setParams("subject", "Ethereum Gas Price Alert: Below 6 Gwei");
|
|
139
139
|
notificationAction.setPosition(400, 240);
|
|
140
140
|
const edge = new Edge({ source: trigger, target: notificationAction });
|
|
141
|
-
return new Workflow('Get
|
|
141
|
+
return new Workflow('Get Notified When Ethereum Gas drops below 6 Gwei', [trigger, notificationAction], [edge]);
|
|
142
142
|
};
|
|
143
143
|
const dailyYieldEmail = async () => {
|
|
144
144
|
const trigger = new Trigger(TRIGGERS.CORE.EVERY_PERIOD.EVERY_PERIOD);
|
|
@@ -194,14 +194,18 @@ const abstractGetNotifiedWhenStreamerIsLive = async () => {
|
|
|
194
194
|
};
|
|
195
195
|
export const WORKFLOW_TEMPLATES = [
|
|
196
196
|
{
|
|
197
|
-
'name': 'Get Notified When Ethereum Gas
|
|
197
|
+
'name': 'Get Notified When Ethereum Gas drops below 6 Gwei',
|
|
198
198
|
'description': 'Receive an email alert when Ethereum gas prices fall below 6 gwei.',
|
|
199
199
|
'tags': [WORKFLOW_TEMPLATES_TAGS.ON_CHAIN_MONITORING, WORKFLOW_TEMPLATES_TAGS.NOTIFICATIONS],
|
|
200
200
|
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/gasMonitoring.jpg',
|
|
201
201
|
'image': [
|
|
202
|
-
TRIGGERS.TECHNICAL.GAS.GAS_API,
|
|
202
|
+
TRIGGERS.TECHNICAL.GAS.GAS_API.image,
|
|
203
203
|
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.image
|
|
204
204
|
],
|
|
205
|
+
'blockIDs': [
|
|
206
|
+
TRIGGERS.TECHNICAL.GAS.GAS_API.blockId,
|
|
207
|
+
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.blockId
|
|
208
|
+
],
|
|
205
209
|
createWorkflow: gasMonitoring
|
|
206
210
|
},
|
|
207
211
|
{
|
|
@@ -213,6 +217,10 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
213
217
|
TRIGGERS.CORE.EVERY_PERIOD.EVERY_PERIOD.image,
|
|
214
218
|
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.image
|
|
215
219
|
],
|
|
220
|
+
'blockIDs': [
|
|
221
|
+
TRIGGERS.CORE.EVERY_PERIOD.EVERY_PERIOD.blockId,
|
|
222
|
+
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.blockId
|
|
223
|
+
],
|
|
216
224
|
createWorkflow: dailyYieldEmail
|
|
217
225
|
},
|
|
218
226
|
{
|
|
@@ -224,6 +232,10 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
224
232
|
TRIGGERS.SOCIALS.FEAR_AND_GREED.GET_FEAR_AND_GREED_INDEX.image,
|
|
225
233
|
ACTIONS.CORE.SWAP.SWAP.image
|
|
226
234
|
],
|
|
235
|
+
'blockIDs': [
|
|
236
|
+
TRIGGERS.SOCIALS.FEAR_AND_GREED.GET_FEAR_AND_GREED_INDEX.blockId,
|
|
237
|
+
ACTIONS.CORE.SWAP.SWAP.blockId
|
|
238
|
+
],
|
|
227
239
|
createWorkflow: createDCAFearAndGreed
|
|
228
240
|
},
|
|
229
241
|
{
|
|
@@ -237,6 +249,12 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
237
249
|
ACTIONS.CORE.SWAP.SWAP.image,
|
|
238
250
|
ACTIONS.LENDING.AAVE.SUPPLY.image
|
|
239
251
|
],
|
|
252
|
+
'blockIDs': [
|
|
253
|
+
TRIGGERS.SOCIALS.FEAR_AND_GREED.GET_FEAR_AND_GREED_INDEX.blockId,
|
|
254
|
+
ACTIONS.LENDING.AAVE.WITHDRAW.blockId,
|
|
255
|
+
ACTIONS.CORE.SWAP.SWAP.blockId,
|
|
256
|
+
ACTIONS.LENDING.AAVE.SUPPLY.blockId
|
|
257
|
+
],
|
|
240
258
|
createWorkflow: createETHFearAndGreedCapitalEfficientBuy
|
|
241
259
|
},
|
|
242
260
|
/*{
|
|
@@ -249,6 +267,11 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
249
267
|
ACTIONS.SWAP.ODOS.SWAP.image,
|
|
250
268
|
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.image
|
|
251
269
|
],
|
|
270
|
+
'blockIDs': [
|
|
271
|
+
TRIGGERS.YIELD.ETHENA.SUSDE_YIELD.blockId,
|
|
272
|
+
ACTIONS.SWAP.ODOS.SWAP.blockId,
|
|
273
|
+
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.blockId
|
|
274
|
+
],
|
|
252
275
|
createWorkflow: createSUsdeYieldBuy
|
|
253
276
|
},*/
|
|
254
277
|
{
|
|
@@ -260,6 +283,10 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
260
283
|
TRIGGERS.YIELD.ETHENA.SUSDE_YIELD.image,
|
|
261
284
|
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.image
|
|
262
285
|
],
|
|
286
|
+
'blockIDs': [
|
|
287
|
+
TRIGGERS.YIELD.ETHENA.SUSDE_YIELD.blockId,
|
|
288
|
+
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.blockId
|
|
289
|
+
],
|
|
263
290
|
createWorkflow: createSusdeYieldNotification
|
|
264
291
|
},
|
|
265
292
|
{
|
|
@@ -271,6 +298,10 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
271
298
|
TRIGGERS.TOKENS.TRANSFER.TRANSFER.image,
|
|
272
299
|
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.image
|
|
273
300
|
],
|
|
301
|
+
'blockIDs': [
|
|
302
|
+
TRIGGERS.TOKENS.TRANSFER.TRANSFER.blockId,
|
|
303
|
+
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.blockId
|
|
304
|
+
],
|
|
274
305
|
createWorkflow: createModeTransferNotificationWorkflow
|
|
275
306
|
},
|
|
276
307
|
{
|
|
@@ -279,13 +310,17 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
279
310
|
'tags': [WORKFLOW_TEMPLATES_TAGS.ON_CHAIN_MONITORING, WORKFLOW_TEMPLATES_TAGS.NOTIFICATIONS, WORKFLOW_TEMPLATES_TAGS.YIELD],
|
|
280
311
|
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/shortEna.jpg',
|
|
281
312
|
'image': [
|
|
282
|
-
TRIGGERS.
|
|
313
|
+
TRIGGERS.LENDING.AAVE.BORROWING_RATES.image,
|
|
283
314
|
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.image
|
|
284
315
|
],
|
|
316
|
+
'blockIDs': [
|
|
317
|
+
TRIGGERS.LENDING.AAVE.BORROWING_RATES.blockId,
|
|
318
|
+
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.blockId
|
|
319
|
+
],
|
|
285
320
|
createWorkflow: createAAVEBorrowingRateNotificationWorkflow
|
|
286
321
|
},
|
|
287
322
|
{
|
|
288
|
-
'name': '
|
|
323
|
+
'name': 'Get notified when a new flash badge is available on Abstract',
|
|
289
324
|
'description': 'Notify me when a new flash badge is available on Abstract',
|
|
290
325
|
'tags': [WORKFLOW_TEMPLATES_TAGS.ABSTRACT, WORKFLOW_TEMPLATES_TAGS.NOTIFICATIONS],
|
|
291
326
|
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/abstract-flash-badge-noti.webp',
|
|
@@ -293,6 +328,10 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
293
328
|
TRIGGERS.SOCIALS.ABSTRACT.ABSTRACT_FLASH_BADGE.image,
|
|
294
329
|
ACTIONS.NOTIFICATIONS.TELEGRAM.SEND_MESSAGE.image
|
|
295
330
|
],
|
|
331
|
+
'blockIDs': [
|
|
332
|
+
TRIGGERS.SOCIALS.ABSTRACT.ABSTRACT_FLASH_BADGE.blockId,
|
|
333
|
+
ACTIONS.NOTIFICATIONS.TELEGRAM.SEND_MESSAGE.blockId
|
|
334
|
+
],
|
|
296
335
|
createWorkflow: abstractGetNotifiedOnNewFlashBadge
|
|
297
336
|
},
|
|
298
337
|
{
|
|
@@ -304,6 +343,10 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
304
343
|
TRIGGERS.SOCIALS.ABSTRACT.ON_STREAMER_LIVE.image,
|
|
305
344
|
ACTIONS.NOTIFICATIONS.TELEGRAM.SEND_MESSAGE.image
|
|
306
345
|
],
|
|
346
|
+
'blockIDs': [
|
|
347
|
+
TRIGGERS.SOCIALS.ABSTRACT.ON_STREAMER_LIVE.blockId,
|
|
348
|
+
ACTIONS.NOTIFICATIONS.TELEGRAM.SEND_MESSAGE.blockId
|
|
349
|
+
],
|
|
307
350
|
createWorkflow: abstractGetNotifiedWhenStreamerIsLive
|
|
308
351
|
},
|
|
309
352
|
/*{
|
|
@@ -315,6 +358,10 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
315
358
|
TRIGGERS.SOCIALS.FEAR_AND_GREED.GET_FEAR_AND_GREED_INDEX.image,
|
|
316
359
|
ACTIONS.SWAP.ODOS.SWAP.image
|
|
317
360
|
],
|
|
361
|
+
'blockIDs': [
|
|
362
|
+
TRIGGERS.SOCIALS.FEAR_AND_GREED.GET_FEAR_AND_GREED_INDEX.blockId,
|
|
363
|
+
ACTIONS.SWAP.ODOS.SWAP.blockId
|
|
364
|
+
],
|
|
318
365
|
createWorkflow: createETHFearAndGreedBuy
|
|
319
366
|
},*/
|
|
320
367
|
/*{
|
|
@@ -326,6 +373,10 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
326
373
|
TRIGGERS.DEXES.ODOS.SWAP.image,
|
|
327
374
|
ACTIONS.CORE.SWAP.SWAP.image,
|
|
328
375
|
],
|
|
376
|
+
'blockIDs': [
|
|
377
|
+
TRIGGERS.DEXES.ODOS.SWAP.blockId,
|
|
378
|
+
ACTIONS.CORE.SWAP.SWAP.blockId,
|
|
379
|
+
],
|
|
329
380
|
createWorkflow: copyTradeVitalikOdos
|
|
330
381
|
},*/
|
|
331
382
|
];
|
|
@@ -13,35 +13,8 @@ export declare const WORKFLOW_TEMPLATES: ({
|
|
|
13
13
|
description: string;
|
|
14
14
|
tags: string[];
|
|
15
15
|
thumbnail: string;
|
|
16
|
-
image:
|
|
17
|
-
|
|
18
|
-
description: string;
|
|
19
|
-
prototype: string;
|
|
20
|
-
type: number;
|
|
21
|
-
output: {
|
|
22
|
-
gasPrice: string;
|
|
23
|
-
};
|
|
24
|
-
parameters: import("../index.js").Parameter[];
|
|
25
|
-
examples: ({
|
|
26
|
-
name: string;
|
|
27
|
-
description: string;
|
|
28
|
-
externalVariableDescription: string;
|
|
29
|
-
parameters: {
|
|
30
|
-
key: string;
|
|
31
|
-
value: string;
|
|
32
|
-
}[];
|
|
33
|
-
} | {
|
|
34
|
-
name: string;
|
|
35
|
-
description: string;
|
|
36
|
-
parameters: {
|
|
37
|
-
key: string;
|
|
38
|
-
value: string;
|
|
39
|
-
}[];
|
|
40
|
-
externalVariableDescription?: undefined;
|
|
41
|
-
})[];
|
|
42
|
-
blockId: number;
|
|
43
|
-
image: string;
|
|
44
|
-
})[];
|
|
16
|
+
image: string[];
|
|
17
|
+
blockIDs: number[];
|
|
45
18
|
createWorkflow: () => Promise<Workflow>;
|
|
46
19
|
} | {
|
|
47
20
|
name: string;
|
|
@@ -49,5 +22,6 @@ export declare const WORKFLOW_TEMPLATES: ({
|
|
|
49
22
|
tags: string[];
|
|
50
23
|
thumbnail: string;
|
|
51
24
|
image: string[];
|
|
25
|
+
blockIDs: number[];
|
|
52
26
|
createWorkflow: () => Workflow;
|
|
53
27
|
})[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.176";
|
|
2
2
|
export declare function compareVersions(v1: string, v2: string): number;
|