otomato-sdk 2.0.37 → 2.0.39

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.
@@ -66,7 +66,7 @@ export const TRIGGERS = {
66
66
  "description": "This block gets triggered when someone transfers the ERC20 configured in the params",
67
67
  "type": 0,
68
68
  "output": {
69
- "value": "uint256",
69
+ "value": "float",
70
70
  "from": "address",
71
71
  "to": "address",
72
72
  "transactionHash": "string"
@@ -112,6 +112,7 @@ export const TRIGGERS = {
112
112
  "frontendHelpers": {
113
113
  "output": {
114
114
  "value": {
115
+ "formatAmount": false,
115
116
  "erc20Token": {
116
117
  "contractAddress": "{{parameters.contractAddress}}",
117
118
  "chainId": "{{parameters.chainId}}"
@@ -152,11 +153,12 @@ export const TRIGGERS = {
152
153
  "type": 1,
153
154
  "method": "function balanceOf(address account) view returns (uint256)",
154
155
  "output": {
155
- "balance": "integer"
156
+ "balance": "float"
156
157
  },
157
158
  "frontendHelpers": {
158
159
  "output": {
159
160
  "balance": {
161
+ "formatAmount": false,
160
162
  "erc20Token": {
161
163
  "contractAddress": "{{parameters.contractAddress}}",
162
164
  "chainId": "{{parameters.chainId}}"
@@ -195,14 +197,10 @@ export const TRIGGERS = {
195
197
  },
196
198
  {
197
199
  "key": "comparisonValue",
198
- "type": "any",
200
+ "type": "float",
199
201
  "description": "The value to compare to",
200
202
  "mandatory": true,
201
- "category": 0,
202
- "erc20FormattedAmount": {
203
- "contractAddress": "{{parameters.contractAddress}}",
204
- "chain": "{{parameters.chainId}}"
205
- }
203
+ "category": 0
206
204
  },
207
205
  ],
208
206
  "examples": [
@@ -216,7 +214,7 @@ export const TRIGGERS = {
216
214
  },
217
215
  {
218
216
  "key": "comparisonValue",
219
- "value": "10000000000000000000000n"
217
+ "value": 10000
220
218
  },
221
219
  {
222
220
  "key": "condition",
@@ -242,7 +240,7 @@ export const TRIGGERS = {
242
240
  },
243
241
  {
244
242
  "key": "comparisonValue",
245
- "value": "7000000000000000000000000000n"
243
+ "value": 7000000000
246
244
  },
247
245
  {
248
246
  "key": "condition",
@@ -276,7 +274,7 @@ export const TRIGGERS = {
276
274
  "output": {
277
275
  "owner": "address",
278
276
  "spender": "address",
279
- "value": "uint256",
277
+ "value": "float",
280
278
  "transactionHash": "string"
281
279
  },
282
280
  "parameters": [
@@ -316,6 +314,7 @@ export const TRIGGERS = {
316
314
  "frontendHelpers": {
317
315
  "output": {
318
316
  "value": {
317
+ "formatAmount": false,
319
318
  "erc20Token": {
320
319
  "contractAddress": "{{parameters.contractAddress}}",
321
320
  "chainId": "{{parameters.chainId}}"
@@ -1448,9 +1447,9 @@ export const TRIGGERS = {
1448
1447
  "type": 0,
1449
1448
  "output": {
1450
1449
  "sender": "address",
1451
- "inputAmount": "uint256",
1450
+ "inputAmount": "float",
1452
1451
  "inputToken": "erc20",
1453
- "amountOut": "uint256",
1452
+ "amountOut": "float",
1454
1453
  "outputToken": "erc20",
1455
1454
  "exchangeRate": "float",
1456
1455
  "transactionHash": "string"
@@ -1458,12 +1457,14 @@ export const TRIGGERS = {
1458
1457
  "frontendHelpers": {
1459
1458
  "output": {
1460
1459
  "inputAmount": {
1460
+ "formatAmount": false,
1461
1461
  "erc20Token": {
1462
1462
  "contractAddress": "{{output.inputToken}}",
1463
1463
  "chainId": "{{parameters.chainId}}"
1464
1464
  }
1465
1465
  },
1466
1466
  "amountOut": {
1467
+ "formatAmount": false,
1467
1468
  "erc20Token": {
1468
1469
  "contractAddress": "{{output.outputToken}}",
1469
1470
  "chainId": "{{parameters.chainId}}"
@@ -2210,6 +2211,57 @@ export const TRIGGERS = {
2210
2211
  "blockId": 11,
2211
2212
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/fearAndGreed.png"
2212
2213
  }
2214
+ },
2215
+ "X": {
2216
+ "description": "X, formerly known as Twitter, is a social media platform that allows users to share short messages, photos, videos, and more.",
2217
+ "tags": {},
2218
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/x.webp",
2219
+ "X_POST_TRIGGER": {
2220
+ "name": "X Post Trigger",
2221
+ "description": "Track an account activity via their posts",
2222
+ "type": 5,
2223
+ "output": {
2224
+ "tweetContent": "string",
2225
+ "tweetURL": "string",
2226
+ "timestamp": "string",
2227
+ "account": "string"
2228
+ },
2229
+ "parameters": [
2230
+ {
2231
+ "key": "username",
2232
+ "type": "string",
2233
+ "description": "Username of the twitter account you want to track",
2234
+ "mandatory": true,
2235
+ "category": 0
2236
+ },
2237
+ {
2238
+ "key": "includeRetweets",
2239
+ "type": "string",
2240
+ "description": "Toggle trigger if it is retweet",
2241
+ "category": 0,
2242
+ "default": "false",
2243
+ "value": "false"
2244
+ },
2245
+ ],
2246
+ "examples": [
2247
+ {
2248
+ "name": "GCR tweets",
2249
+ "description": "Gets triggered when GCR tweets something",
2250
+ "parameters": [
2251
+ {
2252
+ "key": "username",
2253
+ "value": "GiganticRebirth"
2254
+ },
2255
+ {
2256
+ "key": "includeRetweets",
2257
+ "value": false
2258
+ }
2259
+ ]
2260
+ }
2261
+ ],
2262
+ "blockId": 34,
2263
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/x.webp"
2264
+ }
2213
2265
  }
2214
2266
  },
2215
2267
  "ETFS": {
@@ -2277,11 +2329,68 @@ export const TRIGGERS = {
2277
2329
  },
2278
2330
  "NFTS": {
2279
2331
  "BLUR": {
2280
- "description": "The NFT marketplace for pro traders",
2332
+ "description": "Get real-time NFT listings",
2281
2333
  "chains": [
2282
2334
  1
2283
2335
  ],
2284
- "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/blur.jpg"
2336
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/blur.jpg",
2337
+ "LISTING": {
2338
+ "name": "NFT Listing",
2339
+ "description": "Subscribe to live NFT listing events based on filters.",
2340
+ "type": 5,
2341
+ "parameters": [
2342
+ {
2343
+ "key": "contract",
2344
+ "type": "address",
2345
+ "description": "The NFT collection to monitor.",
2346
+ "mandatory": true,
2347
+ "category": 0
2348
+ },
2349
+ {
2350
+ "key": "price",
2351
+ "type": "float",
2352
+ "description": "Maximum price filter for the listings (in ETH). The workflow won't be triggered if a NFT that matches the other criterias is listed above this defined price limit.",
2353
+ "mandatory": false,
2354
+ "category": 1
2355
+ },
2356
+ {
2357
+ "key": "traits",
2358
+ "description": "Trait-based filters. For example, you can only monitor punks with specific traits you are interested in.",
2359
+ "mandatory": false,
2360
+ "category": 1
2361
+ },
2362
+ ],
2363
+ "output": {
2364
+ "listingId": "string",
2365
+ "tokenId": "string",
2366
+ "price": "float",
2367
+ "source": "string",
2368
+ "imageUrl": "string",
2369
+ "attributes": "array"
2370
+ },
2371
+ "examples": [
2372
+ {
2373
+ "name": "Monitor Pudgy listings",
2374
+ "description": "Subscribe to Pudgy Penguins listings with a pineapple suit and blue background filtered for prices below 30 ETH.",
2375
+ "parameters": [
2376
+ {
2377
+ "key": "contract",
2378
+ "value": "0xbd3531da5cf5857e7cfaa92426877b022e612cf8"
2379
+ },
2380
+ {
2381
+ "key": "price",
2382
+ "value": 30
2383
+ },
2384
+ {
2385
+ "key": "traits",
2386
+ "value": "{\"Background\":[\"Blue\"],\"Body\":[\"Pineapple Suit\"]}"
2387
+ }
2388
+ ]
2389
+ }
2390
+ ],
2391
+ "blockId": 35,
2392
+ "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/blur.jpg"
2393
+ }
2285
2394
  }
2286
2395
  },
2287
2396
  "PRE_MARKET": {
@@ -2378,130 +2487,13 @@ export const ACTIONS = {
2378
2487
  "description": "",
2379
2488
  "chains": [],
2380
2489
  "EMPTYBLOCK": {
2381
- "name": "Odos swap",
2382
- "description": "Swap on Odos to get the best market rates accross multiple pools",
2383
- "type": 1,
2384
- "requiredApprovals": [
2385
- {
2386
- "address": "{{parameters.tokenIn}}",
2387
- "amount": "{{parameters.amount}}",
2388
- "to": "{{before.contractAddress}}"
2389
- }
2390
- ],
2391
- "checks": [
2392
- {
2393
- "type": 0,
2394
- "chainId": "{{parameters.chainId}}",
2395
- "contractAddress": "{{parameters.tokenIn}}",
2396
- "amount": "{{parameters.amount}}"
2397
- }
2398
- ],
2399
- "output": {
2400
- "amountIn": "uint256",
2401
- "tokenIn": "erc20",
2402
- "amountOut": "uint256",
2403
- "tokenOut": "erc20",
2404
- "transactionHash": "string"
2405
- },
2406
- "frontendHelpers": {
2407
- "output": {
2408
- "amountIn": {
2409
- "erc20Token": {
2410
- "contractAddress": "{{output.tokenIn}}",
2411
- "chainId": "{{parameters.chainId}}"
2412
- }
2413
- },
2414
- "amountOut": {
2415
- "erc20Token": {
2416
- "contractAddress": "{{output.tokenOut}}",
2417
- "chainId": "{{parameters.chainId}}"
2418
- }
2419
- }
2420
- }
2421
- },
2422
- "parameters": [
2423
- {
2424
- "key": "chainId",
2425
- "type": "chainId",
2426
- "description": "Chain ID of the network",
2427
- "mandatory": true,
2428
- "category": 0
2429
- },
2430
- {
2431
- "key": "tokenIn",
2432
- "type": "erc20",
2433
- "description": "Token to sell",
2434
- "mandatory": true,
2435
- "category": 0
2436
- },
2437
- {
2438
- "key": "tokenOut",
2439
- "type": "erc20",
2440
- "description": "Token to buy",
2441
- "mandatory": true,
2442
- "category": 0
2443
- },
2444
- {
2445
- "key": "amount",
2446
- "type": "uint256",
2447
- "description": "Amount to sell",
2448
- "mandatory": true,
2449
- "category": 0,
2450
- "erc20FormattedAmount": {
2451
- "contractAddress": "{{parameters.tokenIn}}",
2452
- "chain": "{{parameters.chainId}}"
2453
- }
2454
- },
2455
- {
2456
- "key": "slippage",
2457
- "type": "percentage",
2458
- "description": "The maximum allowable difference between the expected price and the actual price at the time of execution, expressed as a percentage. This protects the transaction from significant price fluctuations.",
2459
- "value": 1,
2460
- "mandatory": true,
2461
- "category": 1
2462
- },
2463
- ],
2464
- "examples": [
2465
- {
2466
- "name": "Swap USDC to WETH",
2467
- "description": "Swap 100 USDC to WETH on Mode Network using Odos",
2468
- "parameters": [
2469
- {
2470
- "key": "chainId",
2471
- "value": 34443
2472
- },
2473
- {
2474
- "key": "tokenIn",
2475
- "value": "0xd988097fb8612cc24eeC14542bC03424c656005f"
2476
- },
2477
- {
2478
- "key": "tokenOut",
2479
- "value": "0x4200000000000000000000000000000000000006"
2480
- },
2481
- {
2482
- "key": "amount",
2483
- "value": "100000000n"
2484
- },
2485
- {
2486
- "key": "slippage",
2487
- "value": 1
2488
- }
2489
- ]
2490
- }
2491
- ],
2492
- "permissions": {
2493
- "chainId": "{{parameters.chainId}}",
2494
- "approvedTargets": [
2495
- "{{before.contractAddress}}",
2496
- "{{parameters.tokenIn}}"
2497
- ],
2498
- "label": [
2499
- "Swap {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenIn}})}} to {{tokenSymbol({{parameters.chainId}}, {{parameters.tokenOut}})}}"
2500
- ],
2501
- "labelNotAuthorized": [
2502
- "Transfer ETH"
2503
- ]
2504
- },
2490
+ "name": "Empty block",
2491
+ "description": "This block is just used in the app while waiting for the user to choose an actual block.",
2492
+ "type": 2,
2493
+ "checks": [],
2494
+ "output": {},
2495
+ "parameters": [],
2496
+ "examples": [],
2505
2497
  "blockId": 0,
2506
2498
  "image": ""
2507
2499
  }
@@ -2736,12 +2728,12 @@ export const ACTIONS = {
2736
2728
  }
2737
2729
  },
2738
2730
  "SPLIT": {
2739
- "description": "Split a branch in multiple ones",
2731
+ "description": "Split a branch in multiple ones to parallelized executions",
2740
2732
  "image": "https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/split.png",
2741
2733
  "SPLIT": {
2742
2734
  "name": "Split",
2743
2735
  "type": 4,
2744
- "description": "Split a branch in multiples ones",
2736
+ "description": "Split a branch in multiple ones to parallelized executions",
2745
2737
  "parameters": [],
2746
2738
  "examples": [],
2747
2739
  "blockId": 100015,
@@ -1,4 +1,4 @@
1
- export const SDK_VERSION = '2.0.36';
1
+ export const SDK_VERSION = '2.0.39';
2
2
  export function compareVersions(v1, v2) {
3
3
  // Split the version strings into parts
4
4
  const v1Parts = v1.split('.').map(Number);
@@ -1,5 +1,5 @@
1
1
  // Note: Using 'dagre' for layered DAG layout
2
- import dagre from 'dagre';
2
+ import * as dagre from 'dagre';
3
3
  // or: import * as dagre from 'dagre';
4
4
  export const xSpacing = 700; // used by dagre as node separation
5
5
  export const ySpacing = 75;
@@ -83,7 +83,7 @@ export function getEndNodePositions(workflow) {
83
83
  var _a, _b, _c, _d;
84
84
  return ({
85
85
  x: (_b = (_a = node.position) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0,
86
- y: ((_d = (_c = node.position) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0) + ySpacing,
86
+ y: ((_d = (_c = node.position) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : 0) + ySpacing * 2,
87
87
  });
88
88
  });
89
89
  }
@@ -41,6 +41,7 @@ export declare const TRIGGERS: {
41
41
  frontendHelpers: {
42
42
  output: {
43
43
  value: {
44
+ formatAmount: boolean;
44
45
  erc20Token: {
45
46
  contractAddress: string;
46
47
  chainId: string;
@@ -79,6 +80,7 @@ export declare const TRIGGERS: {
79
80
  frontendHelpers: {
80
81
  output: {
81
82
  balance: {
83
+ formatAmount: boolean;
82
84
  erc20Token: {
83
85
  contractAddress: string;
84
86
  chainId: string;
@@ -120,6 +122,7 @@ export declare const TRIGGERS: {
120
122
  frontendHelpers: {
121
123
  output: {
122
124
  value: {
125
+ formatAmount: boolean;
123
126
  erc20Token: {
124
127
  contractAddress: string;
125
128
  chainId: string;
@@ -557,12 +560,14 @@ export declare const TRIGGERS: {
557
560
  frontendHelpers: {
558
561
  output: {
559
562
  inputAmount: {
563
+ formatAmount: boolean;
560
564
  erc20Token: {
561
565
  contractAddress: string;
562
566
  chainId: string;
563
567
  };
564
568
  };
565
569
  amountOut: {
570
+ formatAmount: boolean;
566
571
  erc20Token: {
567
572
  contractAddress: string;
568
573
  chainId: string;
@@ -919,6 +924,36 @@ export declare const TRIGGERS: {
919
924
  image: string;
920
925
  };
921
926
  };
927
+ X: {
928
+ description: string;
929
+ tags: {};
930
+ image: string;
931
+ X_POST_TRIGGER: {
932
+ name: string;
933
+ description: string;
934
+ type: number;
935
+ output: {
936
+ tweetContent: string;
937
+ tweetURL: string;
938
+ timestamp: string;
939
+ account: string;
940
+ };
941
+ parameters: Parameter[];
942
+ examples: {
943
+ name: string;
944
+ description: string;
945
+ parameters: ({
946
+ key: string;
947
+ value: string;
948
+ } | {
949
+ key: string;
950
+ value: boolean;
951
+ })[];
952
+ }[];
953
+ blockId: number;
954
+ image: string;
955
+ };
956
+ };
922
957
  };
923
958
  ETFS: {
924
959
  IBIT: {
@@ -954,6 +989,33 @@ export declare const TRIGGERS: {
954
989
  description: string;
955
990
  chains: number[];
956
991
  image: string;
992
+ LISTING: {
993
+ name: string;
994
+ description: string;
995
+ type: number;
996
+ parameters: Parameter[];
997
+ output: {
998
+ listingId: string;
999
+ tokenId: string;
1000
+ price: string;
1001
+ source: string;
1002
+ imageUrl: string;
1003
+ attributes: string;
1004
+ };
1005
+ examples: {
1006
+ name: string;
1007
+ description: string;
1008
+ parameters: ({
1009
+ key: string;
1010
+ value: string;
1011
+ } | {
1012
+ key: string;
1013
+ value: number;
1014
+ })[];
1015
+ }[];
1016
+ blockId: number;
1017
+ image: string;
1018
+ };
957
1019
  };
958
1020
  };
959
1021
  PRE_MARKET: {
@@ -1000,58 +1062,10 @@ export declare const ACTIONS: {
1000
1062
  name: string;
1001
1063
  description: string;
1002
1064
  type: number;
1003
- requiredApprovals: {
1004
- address: string;
1005
- amount: string;
1006
- to: string;
1007
- }[];
1008
- checks: {
1009
- type: number;
1010
- chainId: string;
1011
- contractAddress: string;
1012
- amount: string;
1013
- }[];
1014
- output: {
1015
- amountIn: string;
1016
- tokenIn: string;
1017
- amountOut: string;
1018
- tokenOut: string;
1019
- transactionHash: string;
1020
- };
1021
- frontendHelpers: {
1022
- output: {
1023
- amountIn: {
1024
- erc20Token: {
1025
- contractAddress: string;
1026
- chainId: string;
1027
- };
1028
- };
1029
- amountOut: {
1030
- erc20Token: {
1031
- contractAddress: string;
1032
- chainId: string;
1033
- };
1034
- };
1035
- };
1036
- };
1065
+ checks: never[];
1066
+ output: {};
1037
1067
  parameters: Parameter[];
1038
- examples: {
1039
- name: string;
1040
- description: string;
1041
- parameters: ({
1042
- key: string;
1043
- value: number;
1044
- } | {
1045
- key: string;
1046
- value: string;
1047
- })[];
1048
- }[];
1049
- permissions: {
1050
- chainId: string;
1051
- approvedTargets: string[];
1052
- label: string[];
1053
- labelNotAuthorized: string[];
1054
- };
1068
+ examples: never[];
1055
1069
  blockId: number;
1056
1070
  image: string;
1057
1071
  };
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "2.0.36";
1
+ export declare const SDK_VERSION = "2.0.39";
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": "2.0.37",
3
+ "version": "2.0.39",
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",