otomato-sdk 1.5.70 → 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.
@@ -334,7 +334,6 @@ export const TRIGGERS = {
334
334
  "name": "sUSDE yield",
335
335
  "description": "Fetches Ethena's sUSDE yield",
336
336
  "type": 3,
337
- "url": "https://app.ethena.fi/api/yields/protocol-and-staking-yield",
338
337
  "output": {
339
338
  "yield": "float"
340
339
  },
@@ -958,7 +957,6 @@ export const TRIGGERS = {
958
957
  "name": "Fear and Greed Index",
959
958
  "description": "Fetches the Fear and Greed Index from the specified API and processes the result.",
960
959
  "type": 3,
961
- "url": "https://api.alternative.me/fng/",
962
960
  "output": {
963
961
  "value": "integer"
964
962
  },
@@ -1021,7 +1019,6 @@ export const TRIGGERS = {
1021
1019
  "name": "Assets under management",
1022
1020
  "description": "Fetches IBIT net assets (USD)",
1023
1021
  "type": 3,
1024
- "url": "https://www.alphavantage.co/query?function=ETF_PROFILE&symbol=IBIT&apikey=V343UMWZF0715R3A",
1025
1022
  "output": {
1026
1023
  "asset_under_management": "integer"
1027
1024
  },
@@ -1093,6 +1090,82 @@ export const TRIGGERS = {
1093
1090
  ],
1094
1091
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/whalesmarket.png"
1095
1092
  }
1093
+ },
1094
+ "TECHNICAL": {
1095
+ "GAS": {
1096
+ "description": "Monitors Ethereum gas prices",
1097
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/gas.svg",
1098
+ "GAS_API": {
1099
+ "name": "Ethereum Gas Price Monitor",
1100
+ "description": "Monitors Ethereum gas prices and triggers when the gas price meets the defined condition.",
1101
+ "type": 3,
1102
+ "output": {
1103
+ "gasPrice": "float"
1104
+ },
1105
+ "parameters": [
1106
+ {
1107
+ "key": "condition",
1108
+ "type": "logic_operator",
1109
+ "description": "The logical operator to compare the gas price, such as <, >, <=, >=, ==, etc.",
1110
+ "mandatory": true,
1111
+ "category": 0
1112
+ },
1113
+ {
1114
+ "key": "comparisonValue",
1115
+ "type": "float",
1116
+ "description": "The gas price value to compare against (in Gwei).",
1117
+ "mandatory": true,
1118
+ "category": 0
1119
+ },
1120
+ ],
1121
+ "examples": [
1122
+ {
1123
+ "name": "Gas Price Below 6 Gwei",
1124
+ "description": "Triggers when the gas price is below 6 Gwei.",
1125
+ "parameters": [
1126
+ {
1127
+ "key": "condition",
1128
+ "value": "lte"
1129
+ },
1130
+ {
1131
+ "key": "comparisonValue",
1132
+ "value": "6"
1133
+ }
1134
+ ]
1135
+ },
1136
+ {
1137
+ "name": "Gas Price Below 12 Gwei",
1138
+ "description": "Triggers when the gas price is below 12 Gwei.",
1139
+ "parameters": [
1140
+ {
1141
+ "key": "condition",
1142
+ "value": "lte"
1143
+ },
1144
+ {
1145
+ "key": "comparisonValue",
1146
+ "value": "12"
1147
+ }
1148
+ ]
1149
+ },
1150
+ {
1151
+ "name": "Gas Price Above 40 Gwei",
1152
+ "description": "Triggers when the gas price exceeds 40 Gwei.",
1153
+ "parameters": [
1154
+ {
1155
+ "key": "condition",
1156
+ "value": "gte"
1157
+ },
1158
+ {
1159
+ "key": "comparisonValue",
1160
+ "value": "40"
1161
+ }
1162
+ ]
1163
+ }
1164
+ ],
1165
+ "blockId": 16,
1166
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/gas.svg"
1167
+ }
1168
+ }
1096
1169
  }
1097
1170
  };
1098
1171
  export const ACTIONS = {
@@ -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.70';
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);
@@ -95,7 +95,6 @@ export declare const TRIGGERS: {
95
95
  name: string;
96
96
  description: string;
97
97
  type: number;
98
- url: string;
99
98
  output: {
100
99
  yield: string;
101
100
  };
@@ -359,7 +358,6 @@ export declare const TRIGGERS: {
359
358
  name: string;
360
359
  description: string;
361
360
  type: number;
362
- url: string;
363
361
  output: {
364
362
  value: string;
365
363
  };
@@ -388,7 +386,6 @@ export declare const TRIGGERS: {
388
386
  name: string;
389
387
  description: string;
390
388
  type: number;
391
- url: string;
392
389
  output: {
393
390
  asset_under_management: string;
394
391
  };
@@ -423,6 +420,31 @@ export declare const TRIGGERS: {
423
420
  image: string;
424
421
  };
425
422
  };
423
+ TECHNICAL: {
424
+ GAS: {
425
+ description: string;
426
+ image: string;
427
+ GAS_API: {
428
+ name: string;
429
+ description: string;
430
+ type: number;
431
+ output: {
432
+ gasPrice: string;
433
+ };
434
+ parameters: Parameter[];
435
+ examples: {
436
+ name: string;
437
+ description: string;
438
+ parameters: {
439
+ key: string;
440
+ value: string;
441
+ }[];
442
+ }[];
443
+ blockId: number;
444
+ image: string;
445
+ };
446
+ };
447
+ };
426
448
  };
427
449
  export declare const ACTIONS: {
428
450
  CORE: {
@@ -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.70";
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.70",
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",