otomato-sdk 1.5.71 → 1.5.72

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.
@@ -152,6 +152,18 @@ const copyTradeVitalikOdos = () => __awaiter(void 0, void 0, void 0, function* (
152
152
  const edge = new Edge({ source: trigger, target: swap });
153
153
  return new Workflow('Copy-trade the trades done on Odos by vitalik.eth', [trigger, swap], [edge]);
154
154
  });
155
+ const gasMonitoring = () => __awaiter(void 0, void 0, void 0, function* () {
156
+ const trigger = new Trigger(TRIGGERS.TECHNICAL.GAS.GAS_API);
157
+ trigger.setComparisonValue(6);
158
+ trigger.setCondition('lt');
159
+ trigger.setPosition(400, 120);
160
+ const notificationAction = new Action(ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL);
161
+ notificationAction.setParams("body", "Ethereum gas prices have dropped below 6 gwei. Consider making transactions now.");
162
+ notificationAction.setParams("subject", "Ethereum Gas Price Alert: Below 6 Gwei");
163
+ notificationAction.setPosition(400, 240);
164
+ const edge = new Edge({ source: trigger, target: notificationAction });
165
+ return new Workflow('Get notified when the gas price on Ethereum drops below 6 gwei', [trigger, notificationAction], [edge]);
166
+ });
155
167
  export const WORKFLOW_TEMPLATES = [
156
168
  {
157
169
  'name': 'MODE transfer notification',
@@ -244,4 +256,15 @@ export const WORKFLOW_TEMPLATES = [
244
256
  ],
245
257
  createWorkflow: copyTradeVitalikOdos
246
258
  },
259
+ {
260
+ 'name': 'Get Notified When Ethereum Gas is Below 6 Gwei',
261
+ 'description': 'Receive an email alert when Ethereum gas prices fall below 6 gwei.',
262
+ 'tags': [WORKFLOW_TEMPLATES_TAGS.ON_CHAIN_MONITORING, WORKFLOW_TEMPLATES_TAGS.NOTIFICATIONS],
263
+ 'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/gasMonitoring.jpg',
264
+ 'image': [
265
+ TRIGGERS.TECHNICAL.GAS.GAS_API,
266
+ ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.image
267
+ ],
268
+ createWorkflow: gasMonitoring
269
+ }
247
270
  ];
@@ -1,4 +1,4 @@
1
- export const SDK_VERSION = '1.5.71';
1
+ export const SDK_VERSION = '1.5.72';
2
2
  export function compareVersions(v1, v2) {
3
3
  // Split the version strings into parts
4
4
  const v1Parts = v1.split('.').map(Number);
@@ -19,6 +19,24 @@ export declare const WORKFLOW_TEMPLATES: ({
19
19
  description: string;
20
20
  tags: string[];
21
21
  thumbnail: string;
22
- image: string[];
22
+ image: (string | {
23
+ name: string;
24
+ description: string;
25
+ type: number;
26
+ output: {
27
+ gasPrice: string;
28
+ };
29
+ parameters: import("../index.js").Parameter[];
30
+ examples: {
31
+ name: string;
32
+ description: string;
33
+ parameters: {
34
+ key: string;
35
+ value: string;
36
+ }[];
37
+ }[];
38
+ blockId: number;
39
+ image: string;
40
+ })[];
23
41
  createWorkflow: () => Promise<Workflow>;
24
42
  })[];
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "1.5.71";
1
+ export declare const SDK_VERSION = "1.5.72";
2
2
  export declare function compareVersions(v1: string, v2: string): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "otomato-sdk",
3
- "version": "1.5.71",
3
+ "version": "1.5.72",
4
4
  "description": "An SDK for building and managing automations on Otomato",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/types/src/index.d.ts",