otomato-sdk 1.5.55 → 1.5.57

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.
@@ -1010,7 +1010,7 @@ export const TRIGGERS = {
1010
1010
  "type": 3,
1011
1011
  "url": "https://www.alphavantage.co/query?function=ETF_PROFILE&symbol=IBIT&apikey=V343UMWZF0715R3A",
1012
1012
  "output": {
1013
- "yield": "float"
1013
+ "asset_under_management": "integer"
1014
1014
  },
1015
1015
  "parameters": [
1016
1016
  {
@@ -1268,9 +1268,74 @@ export const ACTIONS = {
1268
1268
  "blockId": 100013,
1269
1269
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/swap.png"
1270
1270
  }
1271
+ },
1272
+ "CONDITION": {
1273
+ "description": "Checks for a condition before proceeding",
1274
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/if.png",
1275
+ },
1276
+ "SPLIT": {
1277
+ "description": "Split a branch in multiple ones",
1278
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/if.png",
1271
1279
  }
1272
1280
  },
1273
1281
  "NOTIFICATIONS": {
1282
+ "EMAIL": {
1283
+ "description": "Sends an email to the specified recipient",
1284
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/email.png",
1285
+ "SEND_EMAIL": {
1286
+ "name": "Send email",
1287
+ "type": 3,
1288
+ "description": "Sends an email to the specified recipient",
1289
+ "output": {
1290
+ "message": "string"
1291
+ },
1292
+ "parameters": [
1293
+ {
1294
+ "key": "to",
1295
+ "type": "email",
1296
+ "description": "The recipient's email address",
1297
+ "mandatory": true,
1298
+ "category": 0
1299
+ },
1300
+ {
1301
+ "key": "subject",
1302
+ "type": "string",
1303
+ "description": "The subject of the email",
1304
+ "mandatory": true,
1305
+ "category": 0
1306
+ },
1307
+ {
1308
+ "key": "body",
1309
+ "type": "paragraph",
1310
+ "description": "The body content of the email",
1311
+ "mandatory": true,
1312
+ "category": 0
1313
+ },
1314
+ ],
1315
+ "examples": [
1316
+ {
1317
+ "name": "Basic notification",
1318
+ "description": "Notify you that the flow has been triggered",
1319
+ "parameters": [
1320
+ {
1321
+ "key": "to",
1322
+ "value": "your-email@gmail.com"
1323
+ },
1324
+ {
1325
+ "key": "subject",
1326
+ "value": "Workflow triggered"
1327
+ },
1328
+ {
1329
+ "key": "body",
1330
+ "value": "Your workflow has been triggered! Go to https://app.otomato.xyz/execution-history to see its execution details"
1331
+ }
1332
+ ]
1333
+ }
1334
+ ],
1335
+ "blockId": 100014,
1336
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/email.png"
1337
+ }
1338
+ },
1274
1339
  "SLACK": {
1275
1340
  "description": "Slack is a messaging app for businesses that connects people to the information they need.",
1276
1341
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/slack.png",
@@ -1664,6 +1729,14 @@ export const ACTIONS = {
1664
1729
  "Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToWithdraw}})}}"
1665
1730
  ]
1666
1731
  },
1732
+ "checks": [
1733
+ {
1734
+ "type": 0,
1735
+ "chainId": "{{parameters.chainId}}",
1736
+ "contractAddress": "{{before.contractAddress}}",
1737
+ "amount": "{{parameters.abi.parameters.amount}}"
1738
+ }
1739
+ ],
1667
1740
  "blockId": 100007,
1668
1741
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ionic.jpg"
1669
1742
  },
@@ -1736,6 +1809,14 @@ export const ACTIONS = {
1736
1809
  "Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToBorrow}})}}"
1737
1810
  ]
1738
1811
  },
1812
+ "checks": [
1813
+ {
1814
+ "type": 0,
1815
+ "chainId": "{{parameters.chainId}}",
1816
+ "contractAddress": "{{before.contractAddress}}",
1817
+ "amount": "{{parameters.abi.parameters.amount}}"
1818
+ }
1819
+ ],
1739
1820
  "blockId": 100008,
1740
1821
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ionic.jpg"
1741
1822
  },
@@ -38,6 +38,8 @@ export function validateType(expectedType, value) {
38
38
  return typeof value === 'string' && isValidUrl(value);
39
39
  case 'phone_number':
40
40
  return typeof value === 'string' && isValidPhoneNumber(value);
41
+ case 'email':
42
+ return typeof value === 'string' && isValidEmail(value);
41
43
  case 'string':
42
44
  case 'paragraph':
43
45
  return typeof value === 'string';
@@ -106,3 +108,6 @@ export function isValidUrl(value) {
106
108
  export function isValidPhoneNumber(value) {
107
109
  return /^[\+]?[0-9]{0,3}\W?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im.test(value);
108
110
  }
111
+ export function isValidEmail(value) {
112
+ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
113
+ }
@@ -377,7 +377,7 @@ export declare const TRIGGERS: {
377
377
  type: number;
378
378
  url: string;
379
379
  output: {
380
- yield: string;
380
+ asset_under_management: string;
381
381
  };
382
382
  parameters: Parameter[];
383
383
  examples: {
@@ -503,8 +503,39 @@ export declare const ACTIONS: {
503
503
  image: string;
504
504
  };
505
505
  };
506
+ CONDITION: {
507
+ description: string;
508
+ image: string;
509
+ };
510
+ SPLIT: {
511
+ description: string;
512
+ image: string;
513
+ };
506
514
  };
507
515
  NOTIFICATIONS: {
516
+ EMAIL: {
517
+ description: string;
518
+ image: string;
519
+ SEND_EMAIL: {
520
+ name: string;
521
+ type: number;
522
+ description: string;
523
+ output: {
524
+ message: string;
525
+ };
526
+ parameters: Parameter[];
527
+ examples: {
528
+ name: string;
529
+ description: string;
530
+ parameters: {
531
+ key: string;
532
+ value: string;
533
+ }[];
534
+ }[];
535
+ blockId: number;
536
+ image: string;
537
+ };
538
+ };
508
539
  SLACK: {
509
540
  description: string;
510
541
  image: string;
@@ -699,6 +730,12 @@ export declare const ACTIONS: {
699
730
  label: string[];
700
731
  labelNotAuthorized: string[];
701
732
  };
733
+ checks: {
734
+ type: number;
735
+ chainId: string;
736
+ contractAddress: string;
737
+ amount: string;
738
+ }[];
702
739
  blockId: number;
703
740
  image: string;
704
741
  };
@@ -729,6 +766,12 @@ export declare const ACTIONS: {
729
766
  label: string[];
730
767
  labelNotAuthorized: string[];
731
768
  };
769
+ checks: {
770
+ type: number;
771
+ chainId: string;
772
+ contractAddress: string;
773
+ amount: string;
774
+ }[];
732
775
  blockId: number;
733
776
  image: string;
734
777
  };
@@ -3,3 +3,4 @@ export declare function typeIsNumber(type: string): boolean;
3
3
  export declare function isAddress(value: string): boolean;
4
4
  export declare function isValidUrl(value: string): boolean;
5
5
  export declare function isValidPhoneNumber(value: string): boolean;
6
+ export declare function isValidEmail(value: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "otomato-sdk",
3
- "version": "1.5.55",
3
+ "version": "1.5.57",
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",