otomato-sdk 1.5.3 → 1.5.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.
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { Workflow, Trigger, Action, Edge, TRIGGERS, ACTIONS, CHAINS, getTokenFromSymbol } from '../index.js';
|
|
2
|
+
export const WORKFLOW_TEMPLATES_TAGS = {
|
|
3
|
+
NFTS: 'NFTs',
|
|
4
|
+
SOCIALS: 'Socials',
|
|
5
|
+
TRADING: 'Trading',
|
|
6
|
+
ON_CHAIN_MONITORING: 'On chain monitoring'
|
|
7
|
+
};
|
|
2
8
|
const createModeTransferNotificationWorkflow = () => {
|
|
3
9
|
const modeTransferTrigger = new Trigger(TRIGGERS.TOKENS.ERC20.TRANSFER);
|
|
4
10
|
modeTransferTrigger.setChainId(CHAINS.MODE);
|
|
@@ -7,27 +13,28 @@ const createModeTransferNotificationWorkflow = () => {
|
|
|
7
13
|
const telegramAction = new Action(ACTIONS.NOTIFICATIONS.TELEGRAM.SEND_MESSAGE);
|
|
8
14
|
telegramAction.setParams("message", "0x74B8....C6B4 transferred $MODE");
|
|
9
15
|
const edge = new Edge({ source: modeTransferTrigger, target: telegramAction });
|
|
10
|
-
return new Workflow('
|
|
16
|
+
return new Workflow('MODE transfer notification', [modeTransferTrigger, telegramAction], [edge]);
|
|
11
17
|
};
|
|
12
18
|
const createETHFearAndGreedBuy = () => {
|
|
13
19
|
const trigger = new Trigger(TRIGGERS.SOCIALS.FEAR_AND_GREED.GET_FEAR_AND_GREED_INDEX);
|
|
14
20
|
trigger.setCondition('lt');
|
|
15
21
|
trigger.setComparisonValue(30);
|
|
16
|
-
// todo: change to swap
|
|
17
22
|
const telegramAction = new Action(ACTIONS.NOTIFICATIONS.TELEGRAM.SEND_MESSAGE);
|
|
18
|
-
telegramAction.setParams("message", "
|
|
23
|
+
telegramAction.setParams("message", "The market sentiment is extremely fearful. Consider buying ETH.");
|
|
19
24
|
const edge = new Edge({ source: trigger, target: telegramAction });
|
|
20
|
-
return new Workflow('
|
|
25
|
+
return new Workflow('Buy ETH when the market sentiment is extremely fearful', [trigger, telegramAction], [edge]);
|
|
21
26
|
};
|
|
22
27
|
export const WORKFLOW_TEMPLATES = [
|
|
23
28
|
{
|
|
24
29
|
'name': 'MODE transfer notification',
|
|
25
30
|
'description': 'Receive notifications when a top $MODE holder (0x74B8....C6B4) transfers $MODE',
|
|
31
|
+
'tags': [WORKFLOW_TEMPLATES_TAGS.ON_CHAIN_MONITORING],
|
|
26
32
|
createWorkflow: createModeTransferNotificationWorkflow
|
|
27
33
|
},
|
|
28
34
|
{
|
|
29
|
-
'name': 'Buy ETH when the market sentiment is fearful',
|
|
30
|
-
'description': 'Buy
|
|
35
|
+
'name': 'Buy ETH when the market sentiment is extremely fearful',
|
|
36
|
+
'description': 'Buy ETH when the Bitcoin Fear and Greed Index is below 30',
|
|
37
|
+
'tags': [WORKFLOW_TEMPLATES_TAGS.TRADING, WORKFLOW_TEMPLATES_TAGS.SOCIALS],
|
|
31
38
|
createWorkflow: createETHFearAndGreedBuy
|
|
32
39
|
},
|
|
33
40
|
];
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { Workflow } from '../index.js';
|
|
2
|
+
export declare const WORKFLOW_TEMPLATES_TAGS: {
|
|
3
|
+
NFTS: string;
|
|
4
|
+
SOCIALS: string;
|
|
5
|
+
TRADING: string;
|
|
6
|
+
ON_CHAIN_MONITORING: string;
|
|
7
|
+
};
|
|
2
8
|
export declare const WORKFLOW_TEMPLATES: {
|
|
3
9
|
name: string;
|
|
4
10
|
description: string;
|
|
11
|
+
tags: string[];
|
|
5
12
|
createWorkflow: () => Workflow;
|
|
6
13
|
}[];
|