otomato-sdk 2.0.32 → 2.0.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.
- package/README.md +1 -1
- package/dist/src/constants/WorkflowTemplates.js +37 -37
- package/dist/src/constants/version.js +1 -1
- package/dist/src/services/ApiService.js +2 -2
- package/dist/src/utils/externalVariables.js +2 -6
- package/dist/types/src/constants/WorkflowTemplates.d.ts +7 -7
- package/dist/types/src/constants/version.d.ts +1 -1
- package/dist/types/src/services/ApiService.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ async function authenticate() {
|
|
|
50
50
|
const chainId = CHAINS.ETHEREUM;
|
|
51
51
|
const accessCode = 'YOUR_ACCESS_CODE';
|
|
52
52
|
|
|
53
|
-
const loginPayload = await apiServices.generateLoginPayload(address, chainId, accessCode);
|
|
53
|
+
const loginPayload = await apiServices.generateLoginPayload(address, chainId, accessCode, ownerWalletAddress);
|
|
54
54
|
const signature = 'SIGNATURE_OF_LOGIN_PAYLOAD';
|
|
55
55
|
const { token } = await apiServices.getToken(loginPayload, signature);
|
|
56
56
|
|
|
@@ -207,26 +207,26 @@ See you tomorrow!`);
|
|
|
207
207
|
});
|
|
208
208
|
export const WORKFLOW_TEMPLATES = [
|
|
209
209
|
{
|
|
210
|
-
'name': '
|
|
211
|
-
'description': 'Receive
|
|
210
|
+
'name': 'Get Notified When Ethereum Gas is Below 6 Gwei',
|
|
211
|
+
'description': 'Receive an email alert when Ethereum gas prices fall below 6 gwei.',
|
|
212
212
|
'tags': [WORKFLOW_TEMPLATES_TAGS.ON_CHAIN_MONITORING, WORKFLOW_TEMPLATES_TAGS.NOTIFICATIONS],
|
|
213
|
-
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/
|
|
213
|
+
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/gasMonitoring.jpg',
|
|
214
214
|
'image': [
|
|
215
|
-
TRIGGERS.
|
|
215
|
+
TRIGGERS.TECHNICAL.GAS.GAS_API,
|
|
216
216
|
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.image
|
|
217
217
|
],
|
|
218
|
-
createWorkflow:
|
|
218
|
+
createWorkflow: gasMonitoring
|
|
219
219
|
},
|
|
220
220
|
{
|
|
221
|
-
'name': '
|
|
222
|
-
'description': '
|
|
223
|
-
'tags': [WORKFLOW_TEMPLATES_TAGS.
|
|
224
|
-
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/
|
|
221
|
+
'name': 'Daily yield updates',
|
|
222
|
+
'description': 'Receive an email every day with a recap from all the money market yields for ETH and USDC.',
|
|
223
|
+
'tags': [WORKFLOW_TEMPLATES_TAGS.ON_CHAIN_MONITORING, WORKFLOW_TEMPLATES_TAGS.NOTIFICATIONS],
|
|
224
|
+
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/dailyYieldUpdates.jpg',
|
|
225
225
|
'image': [
|
|
226
|
-
TRIGGERS.
|
|
227
|
-
ACTIONS.
|
|
226
|
+
TRIGGERS.CORE.EVERY_PERIOD.EVERY_PERIOD.image,
|
|
227
|
+
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.image
|
|
228
228
|
],
|
|
229
|
-
createWorkflow:
|
|
229
|
+
createWorkflow: dailyYieldEmail
|
|
230
230
|
},
|
|
231
231
|
{
|
|
232
232
|
'name': 'Buy ETH when the market sentiment is extremely fearful - capital efficient',
|
|
@@ -241,7 +241,7 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
241
241
|
],
|
|
242
242
|
createWorkflow: createETHFearAndGreedCapitalEfficientBuy
|
|
243
243
|
},
|
|
244
|
-
{
|
|
244
|
+
/*{
|
|
245
245
|
'name': 'Buy sUSDE when the yield is above 20%',
|
|
246
246
|
'description': 'Buy sUSDE when the yield is above 20%',
|
|
247
247
|
'tags': [WORKFLOW_TEMPLATES_TAGS.TRADING, WORKFLOW_TEMPLATES_TAGS.ON_CHAIN_MONITORING],
|
|
@@ -252,7 +252,7 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
252
252
|
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.image
|
|
253
253
|
],
|
|
254
254
|
createWorkflow: createSUsdeYieldBuy
|
|
255
|
-
}
|
|
255
|
+
},*/
|
|
256
256
|
{
|
|
257
257
|
'name': 'sUSDE yield notification',
|
|
258
258
|
'description': 'Notify me when the sUSDe yield becomes negative',
|
|
@@ -287,36 +287,36 @@ export const WORKFLOW_TEMPLATES = [
|
|
|
287
287
|
createWorkflow: ionicWithdrawIfYieldIsLow
|
|
288
288
|
},
|
|
289
289
|
{
|
|
290
|
-
'name': '
|
|
291
|
-
'description': '
|
|
292
|
-
'tags': [WORKFLOW_TEMPLATES_TAGS.ON_CHAIN_MONITORING, WORKFLOW_TEMPLATES_TAGS.
|
|
293
|
-
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/
|
|
290
|
+
'name': 'MODE transfer notification',
|
|
291
|
+
'description': 'Receive notifications when a top $MODE holder (0x74B8....C6B4) transfers $MODE',
|
|
292
|
+
'tags': [WORKFLOW_TEMPLATES_TAGS.ON_CHAIN_MONITORING, WORKFLOW_TEMPLATES_TAGS.NOTIFICATIONS],
|
|
293
|
+
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/transfer-monitoring.png',
|
|
294
294
|
'image': [
|
|
295
|
-
TRIGGERS.
|
|
296
|
-
ACTIONS.
|
|
295
|
+
TRIGGERS.TOKENS.TRANSFER.TRANSFER.image,
|
|
296
|
+
ACTIONS.NOTIFICATIONS.EMAIL.SEND_EMAIL.image
|
|
297
297
|
],
|
|
298
|
-
createWorkflow:
|
|
298
|
+
createWorkflow: createModeTransferNotificationWorkflow
|
|
299
299
|
},
|
|
300
300
|
{
|
|
301
|
-
'name': '
|
|
302
|
-
'description': '
|
|
303
|
-
'tags': [WORKFLOW_TEMPLATES_TAGS.
|
|
304
|
-
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/
|
|
301
|
+
'name': 'Buy ETH when the market sentiment is extremely fearful',
|
|
302
|
+
'description': 'Buy ETH when the Bitcoin Fear and Greed Index is below 30',
|
|
303
|
+
'tags': [WORKFLOW_TEMPLATES_TAGS.TRADING, WORKFLOW_TEMPLATES_TAGS.SOCIALS],
|
|
304
|
+
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/fear_and_greed.jpg',
|
|
305
305
|
'image': [
|
|
306
|
-
TRIGGERS.
|
|
307
|
-
ACTIONS.
|
|
306
|
+
TRIGGERS.SOCIALS.FEAR_AND_GREED.GET_FEAR_AND_GREED_INDEX.image,
|
|
307
|
+
ACTIONS.SWAP.ODOS.SWAP.image
|
|
308
308
|
],
|
|
309
|
-
createWorkflow:
|
|
309
|
+
createWorkflow: createETHFearAndGreedBuy
|
|
310
310
|
},
|
|
311
|
-
{
|
|
312
|
-
'name': '
|
|
313
|
-
'description': '
|
|
314
|
-
'tags': [WORKFLOW_TEMPLATES_TAGS.ON_CHAIN_MONITORING, WORKFLOW_TEMPLATES_TAGS.
|
|
315
|
-
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/
|
|
311
|
+
/*{
|
|
312
|
+
'name': 'Copy-trade the trades done on Odos by vitalik.eth',
|
|
313
|
+
'description': 'Buy 100$ of each token that vitalik.eth buys using Odos',
|
|
314
|
+
'tags': [WORKFLOW_TEMPLATES_TAGS.ON_CHAIN_MONITORING, WORKFLOW_TEMPLATES_TAGS.TRADING],
|
|
315
|
+
'thumbnail': 'https://otomato-sdk-images.s3.eu-west-1.amazonaws.com/templates/copyTrading.png',
|
|
316
316
|
'image': [
|
|
317
|
-
TRIGGERS.
|
|
318
|
-
ACTIONS.
|
|
317
|
+
TRIGGERS.DEXES.ODOS.SWAP.image,
|
|
318
|
+
ACTIONS.CORE.SWAP.SWAP.image,
|
|
319
319
|
],
|
|
320
|
-
createWorkflow:
|
|
321
|
-
}
|
|
320
|
+
createWorkflow: copyTradeVitalikOdos
|
|
321
|
+
},*/
|
|
322
322
|
];
|
|
@@ -59,10 +59,10 @@ class ApiServices {
|
|
|
59
59
|
return yield axiosInstance.delete(url, { headers });
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
generateLoginPayload(address, chainId, referralCode) {
|
|
62
|
+
generateLoginPayload(address, chainId, referralCode, ownerWalletAddress) {
|
|
63
63
|
return __awaiter(this, void 0, void 0, function* () {
|
|
64
64
|
const headers = { 'Content-Type': 'application/json' };
|
|
65
|
-
const response = yield axiosInstance.post('/auth/generate-payload', { address, chainId, referralCode }, { headers });
|
|
65
|
+
const response = yield axiosInstance.post('/auth/generate-payload', { address, chainId, referralCode, ownerWalletAddress }, { headers });
|
|
66
66
|
return response.data;
|
|
67
67
|
});
|
|
68
68
|
}
|
|
@@ -24,8 +24,8 @@ export function getExternalVariableFromParameters(prototype, parameters) {
|
|
|
24
24
|
// 3. Build an array of final values in the same order as blockParams
|
|
25
25
|
const finalValues = blockParams.map((bp) => {
|
|
26
26
|
var _a, _b, _c, _d;
|
|
27
|
-
// 3a.
|
|
28
|
-
const userParam = parameters.find((up) => up.key === bp.key);
|
|
27
|
+
// Step 3a.Find a matching user parameter by exact key or "abiParams.{key}"
|
|
28
|
+
const userParam = parameters.find((up) => up.key === bp.key || `abiParams.${up.key}` === bp.key);
|
|
29
29
|
if (userParam) {
|
|
30
30
|
// Use the user-supplied value
|
|
31
31
|
return (_b = (_a = userParam.value) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : "";
|
|
@@ -39,10 +39,6 @@ export function getExternalVariableFromParameters(prototype, parameters) {
|
|
|
39
39
|
return "";
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
// 4. Remove trailing empty placeholders (e.g., `,,` at the end)
|
|
43
|
-
while (finalValues.length && finalValues[finalValues.length - 1] === "") {
|
|
44
|
-
finalValues.pop();
|
|
45
|
-
}
|
|
46
42
|
// 5. Join with commas to preserve empty slots in the middle
|
|
47
43
|
const paramString = finalValues.join(",");
|
|
48
44
|
return `{{external.functions.${prototype}(${paramString})}}`;
|
|
@@ -8,13 +8,6 @@ export declare const WORKFLOW_TEMPLATES_TAGS: {
|
|
|
8
8
|
NOTIFICATIONS: string;
|
|
9
9
|
};
|
|
10
10
|
export declare const WORKFLOW_TEMPLATES: ({
|
|
11
|
-
name: string;
|
|
12
|
-
description: string;
|
|
13
|
-
tags: string[];
|
|
14
|
-
thumbnail: string;
|
|
15
|
-
image: string[];
|
|
16
|
-
createWorkflow: () => Workflow;
|
|
17
|
-
} | {
|
|
18
11
|
name: string;
|
|
19
12
|
description: string;
|
|
20
13
|
tags: string[];
|
|
@@ -40,4 +33,11 @@ export declare const WORKFLOW_TEMPLATES: ({
|
|
|
40
33
|
image: string;
|
|
41
34
|
})[];
|
|
42
35
|
createWorkflow: () => Promise<Workflow>;
|
|
36
|
+
} | {
|
|
37
|
+
name: string;
|
|
38
|
+
description: string;
|
|
39
|
+
tags: string[];
|
|
40
|
+
thumbnail: string;
|
|
41
|
+
image: string[];
|
|
42
|
+
createWorkflow: () => Workflow;
|
|
43
43
|
})[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.34";
|
|
2
2
|
export declare function compareVersions(v1: string, v2: string): number;
|
|
@@ -7,7 +7,7 @@ declare class ApiServices {
|
|
|
7
7
|
put(url: string, data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
8
8
|
get(url: string): Promise<any>;
|
|
9
9
|
delete(url: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
10
|
-
generateLoginPayload(address: string, chainId: number, referralCode: string): Promise<any>;
|
|
10
|
+
generateLoginPayload(address: string, chainId: number, referralCode: string, ownerWalletAddress: string): Promise<any>;
|
|
11
11
|
getToken(loginPayload: any, signature: string): Promise<{
|
|
12
12
|
token: any;
|
|
13
13
|
}>;
|