otomato-sdk 1.5.55 → 1.5.56

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
  {
@@ -1271,6 +1271,63 @@ export const ACTIONS = {
1271
1271
  }
1272
1272
  },
1273
1273
  "NOTIFICATIONS": {
1274
+ "EMAIL": {
1275
+ "description": "Sends an email to the specified recipient",
1276
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/email.png",
1277
+ "SEND_EMAIL": {
1278
+ "name": "Send email",
1279
+ "type": 0,
1280
+ "description": "Sends an email to the specified recipient",
1281
+ "output": {
1282
+ "message": "string"
1283
+ },
1284
+ "parameters": [
1285
+ {
1286
+ "key": "to",
1287
+ "type": "email",
1288
+ "description": "The recipient's email address",
1289
+ "mandatory": true,
1290
+ "category": 0
1291
+ },
1292
+ {
1293
+ "key": "subject",
1294
+ "type": "string",
1295
+ "description": "The subject of the email",
1296
+ "mandatory": true,
1297
+ "category": 0
1298
+ },
1299
+ {
1300
+ "key": "body",
1301
+ "type": "paragraph",
1302
+ "description": "The body content of the email",
1303
+ "mandatory": true,
1304
+ "category": 0
1305
+ },
1306
+ ],
1307
+ "examples": [
1308
+ {
1309
+ "name": "Basic notification",
1310
+ "description": "Notify you that the flow has been triggered",
1311
+ "parameters": [
1312
+ {
1313
+ "key": "to",
1314
+ "value": "your-email@gmail.com"
1315
+ },
1316
+ {
1317
+ "key": "subject",
1318
+ "value": "Workflow triggered"
1319
+ },
1320
+ {
1321
+ "key": "body",
1322
+ "value": "Your workflow has been triggered! Go to https://app.otomato.xyz/execution-history to see its execution details"
1323
+ }
1324
+ ]
1325
+ }
1326
+ ],
1327
+ "blockId": 100014,
1328
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/email.png"
1329
+ }
1330
+ },
1274
1331
  "SLACK": {
1275
1332
  "description": "Slack is a messaging app for businesses that connects people to the information they need.",
1276
1333
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/slack.png",
@@ -1664,6 +1721,14 @@ export const ACTIONS = {
1664
1721
  "Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToWithdraw}})}}"
1665
1722
  ]
1666
1723
  },
1724
+ "checks": [
1725
+ {
1726
+ "type": 0,
1727
+ "chainId": "{{parameters.chainId}}",
1728
+ "contractAddress": "{{before.contractAddress}}",
1729
+ "amount": "{{parameters.abi.parameters.amount}}"
1730
+ }
1731
+ ],
1667
1732
  "blockId": 100007,
1668
1733
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ionic.jpg"
1669
1734
  },
@@ -1736,6 +1801,14 @@ export const ACTIONS = {
1736
1801
  "Transfer {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenToBorrow}})}}"
1737
1802
  ]
1738
1803
  },
1804
+ "checks": [
1805
+ {
1806
+ "type": 0,
1807
+ "chainId": "{{parameters.chainId}}",
1808
+ "contractAddress": "{{before.contractAddress}}",
1809
+ "amount": "{{parameters.abi.parameters.amount}}"
1810
+ }
1811
+ ],
1739
1812
  "blockId": 100008,
1740
1813
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ionic.jpg"
1741
1814
  },
@@ -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: {
@@ -505,6 +505,29 @@ export declare const ACTIONS: {
505
505
  };
506
506
  };
507
507
  NOTIFICATIONS: {
508
+ EMAIL: {
509
+ description: string;
510
+ image: string;
511
+ SEND_EMAIL: {
512
+ name: string;
513
+ type: number;
514
+ description: string;
515
+ output: {
516
+ message: string;
517
+ };
518
+ parameters: Parameter[];
519
+ examples: {
520
+ name: string;
521
+ description: string;
522
+ parameters: {
523
+ key: string;
524
+ value: string;
525
+ }[];
526
+ }[];
527
+ blockId: number;
528
+ image: string;
529
+ };
530
+ };
508
531
  SLACK: {
509
532
  description: string;
510
533
  image: string;
@@ -699,6 +722,12 @@ export declare const ACTIONS: {
699
722
  label: string[];
700
723
  labelNotAuthorized: string[];
701
724
  };
725
+ checks: {
726
+ type: number;
727
+ chainId: string;
728
+ contractAddress: string;
729
+ amount: string;
730
+ }[];
702
731
  blockId: number;
703
732
  image: string;
704
733
  };
@@ -729,6 +758,12 @@ export declare const ACTIONS: {
729
758
  label: string[];
730
759
  labelNotAuthorized: string[];
731
760
  };
761
+ checks: {
762
+ type: number;
763
+ chainId: string;
764
+ contractAddress: string;
765
+ amount: string;
766
+ }[];
732
767
  blockId: number;
733
768
  image: string;
734
769
  };
@@ -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.56",
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",