otomato-sdk 1.5.32 → 1.5.34

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.
@@ -92,7 +92,7 @@ export const TRIGGERS = {
92
92
  {
93
93
  "key": "abiParams.account",
94
94
  "type": "address",
95
- "description": "Amount of crypto to transfer",
95
+ "description": "The wallet address to check for the token balance",
96
96
  "mandatory": true,
97
97
  "category": 0
98
98
  },
@@ -463,6 +463,79 @@ export const TRIGGERS = {
463
463
  "blockId": 9,
464
464
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/splicefi.png"
465
465
  }
466
+ },
467
+ "IONIC": {
468
+ "description": "#1 money market for Yield Bearing Assets on the OP Superchain",
469
+ "chains": [
470
+ 34443
471
+ ],
472
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ionic.jpg",
473
+ "DEPOSIT": {
474
+ "name": "Lending rate",
475
+ "description": "Get the lending rate of any asset on Ionic",
476
+ "type": 1,
477
+ "method": "function supplyRatePerBlock() external view returns (uint256)",
478
+ "parameters": [
479
+ {
480
+ "key": "chainId",
481
+ "type": "chainId",
482
+ "description": "Chain ID of the network",
483
+ "mandatory": true,
484
+ "category": 0
485
+ },
486
+ {
487
+ "key": "token",
488
+ "type": "erc20",
489
+ "description": "The token you want to fetch the yield",
490
+ "mandatory": true,
491
+ "enum": "\n (env) => {\n if (!env.parameters.chainId)\n throw new Error('You need to provide the chainId first');\n \n const availableTokens = {\n \"34443\": [\n \"0xf0F161fDA2712DB8b566946122a5af183995e2eD\",\n \"0xd988097fb8612cc24eeC14542bC03424c656005f\",\n \"0x2416092f143378750bb29b79eD961ab195CcEea5\",\n \"0x4200000000000000000000000000000000000006\",\n \"0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF\",\n \"0x80137510979822322193FC997d400D5A6C747bf7\",\n \"0xe7903B1F75C534Dd8159b313d92cDCfbC62cB3Cd\",\n \"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A\",\n \"0x59889b7021243dB5B1e065385F918316cD90D46c\"\n ]\n};\n const chainId = env.parameters.chainId;\n return availableTokens[chainId] || [];\n }",
492
+ "category": 0
493
+ },
494
+ {
495
+ "key": "condition",
496
+ "type": "logic_operator",
497
+ "description": "Logic operator used for the comparison: <, >, <=, >=, ==, ...",
498
+ "mandatory": true,
499
+ "category": 0
500
+ },
501
+ {
502
+ "key": "comparisonValue",
503
+ "type": "float",
504
+ "description": "The value to compare to",
505
+ "mandatory": true,
506
+ "category": 0
507
+ },
508
+ ],
509
+ "examples": [
510
+ {
511
+ "name": "USDT Yield is above 5%",
512
+ "description": "Gets triggered when USDT yield rises above 5% on Ionic",
513
+ "parameters": [
514
+ {
515
+ "key": "chainId",
516
+ "value": 34443
517
+ },
518
+ {
519
+ "key": "token",
520
+ "value": "0xf0F161fDA2712DB8b566946122a5af183995e2eD"
521
+ },
522
+ {
523
+ "key": "condition",
524
+ "value": "gte"
525
+ },
526
+ {
527
+ "key": "comparisonValue",
528
+ "value": 5
529
+ }
530
+ ]
531
+ }
532
+ ],
533
+ "output": {
534
+ "lendingRate": "float"
535
+ },
536
+ "blockId": 15,
537
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/ionic.jpg"
538
+ }
466
539
  }
467
540
  },
468
541
  "LENDING": {
@@ -49,8 +49,12 @@ const createSUsdeYieldBuy = () => __awaiter(void 0, void 0, void 0, function* ()
49
49
  odosAction.setParams("tokenOut", getTokenFromSymbol(chain, 'sUSDE').contractAddress);
50
50
  odosAction.setParams("amount", yield convertToTokenUnitsFromSymbol(100, chain, 'USDC'));
51
51
  odosAction.setPosition(400, 240);
52
+ const telegramAction = new Action(ACTIONS.NOTIFICATIONS.TELEGRAM.SEND_MESSAGE);
53
+ telegramAction.setParams("message", "The sUSDE is now negative. You're losing money by holding it.");
54
+ telegramAction.setPosition(400, 360);
52
55
  const edge = new Edge({ source: trigger, target: odosAction });
53
- return new Workflow('Buy sUSDE when the yield is above 20%', [trigger, odosAction], [edge]);
56
+ const edge2 = new Edge({ source: odosAction, target: telegramAction });
57
+ return new Workflow('Buy sUSDE when the yield is above 20%', [trigger, odosAction, telegramAction], [edge, edge2]);
54
58
  });
55
59
  const createSusdeYieldNotification = () => __awaiter(void 0, void 0, void 0, function* () {
56
60
  const trigger = new Trigger(TRIGGERS.YIELD.ETHENA.SUSDE_YIELD);
@@ -183,6 +183,34 @@ export declare const TRIGGERS: {
183
183
  image: string;
184
184
  };
185
185
  };
186
+ IONIC: {
187
+ description: string;
188
+ chains: number[];
189
+ image: string;
190
+ DEPOSIT: {
191
+ name: string;
192
+ description: string;
193
+ type: number;
194
+ method: string;
195
+ parameters: Parameter[];
196
+ examples: {
197
+ name: string;
198
+ description: string;
199
+ parameters: ({
200
+ key: string;
201
+ value: number;
202
+ } | {
203
+ key: string;
204
+ value: string;
205
+ })[];
206
+ }[];
207
+ output: {
208
+ lendingRate: string;
209
+ };
210
+ blockId: number;
211
+ image: string;
212
+ };
213
+ };
186
214
  };
187
215
  LENDING: {
188
216
  ASTARIA: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "otomato-sdk",
3
- "version": "1.5.32",
3
+ "version": "1.5.34",
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",