otomato-sdk 1.2.0 → 1.2.1
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/dist/examples/create-action.js +2 -2
- package/dist/examples/create-automation.js +2 -8
- package/dist/examples/create-trigger.js +2 -2
- package/dist/examples/sandbox.js +9 -0
- package/dist/src/constants/Blocks.js +379 -284
- package/dist/src/models/Node.js +11 -4
- package/dist/src/models/Trigger.js +6 -3
- package/dist/src/utils/typeValidator.js +2 -1
- package/dist/test/action.spec.js +19 -16
- package/dist/test/automation.spec.js +7 -6
- package/dist/test/node.spec.js +8 -12
- package/dist/test/trigger.spec.js +7 -2
- package/dist/test/typeValidator.spec.js +2 -1
- package/dist/types/examples/sandbox.d.ts +1 -0
- package/dist/types/src/constants/Blocks.d.ts +52 -14
- package/dist/types/src/models/Parameter.d.ts +1 -1
- package/dist/types/src/models/Trigger.d.ts +1 -0
- package/examples/create-action.ts +2 -2
- package/examples/create-automation.ts +2 -8
- package/examples/create-trigger.ts +2 -2
- package/examples/sandbox.ts +12 -0
- package/package.json +1 -1
- package/src/constants/Blocks.ts +379 -283
- package/src/models/Node.ts +10 -4
- package/src/models/Parameter.ts +1 -1
- package/src/models/Trigger.ts +8 -4
- package/src/utils/typeValidator.ts +2 -1
- package/test/action.spec.ts +10 -8
- package/test/automation.spec.ts +7 -6
- package/test/node.spec.ts +8 -12
- package/test/trigger.spec.ts +7 -2
- package/test/typeValidator.spec.ts +2 -1
- package/src/constants/json.json +0 -16
package/src/constants/Blocks.ts
CHANGED
|
@@ -7,316 +7,382 @@ const TRIGGER_TYPE = {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export const TRIGGERS = {
|
|
10
|
-
TOKENS: {
|
|
11
|
-
ERC20: {
|
|
12
|
-
CHAINS: [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
"TOKENS": {
|
|
11
|
+
"ERC20": {
|
|
12
|
+
"CHAINS": [
|
|
13
|
+
0
|
|
14
|
+
],
|
|
15
|
+
"TRANSFER": {
|
|
16
|
+
"id": 1,
|
|
17
|
+
"name": "Transfer token",
|
|
18
|
+
"description": "This block gets triggered when someone transfers the ERC20 configured in the params",
|
|
19
|
+
"type": 0,
|
|
20
|
+
"parameters": [
|
|
19
21
|
{
|
|
20
|
-
key: "chainId",
|
|
21
|
-
type: "chainId",
|
|
22
|
-
description: "Chain ID of the ETH blockchain"
|
|
22
|
+
"key": "chainId",
|
|
23
|
+
"type": "chainId",
|
|
24
|
+
"description": "Chain ID of the ETH blockchain",
|
|
25
|
+
"mandatory": true
|
|
23
26
|
},
|
|
24
27
|
{
|
|
25
|
-
key: "abiParams.
|
|
26
|
-
type: "
|
|
27
|
-
description: "
|
|
28
|
+
"key": "abiParams.from",
|
|
29
|
+
"type": "address",
|
|
30
|
+
"description": "Address that transfers the funds"
|
|
28
31
|
},
|
|
29
32
|
{
|
|
30
|
-
key: "abiParams.
|
|
31
|
-
type: "
|
|
32
|
-
description: "
|
|
33
|
+
"key": "abiParams.value",
|
|
34
|
+
"type": "uint256",
|
|
35
|
+
"description": "Amount of crypto to transfer"
|
|
33
36
|
},
|
|
34
37
|
{
|
|
35
|
-
key: "
|
|
36
|
-
type: "address",
|
|
37
|
-
description: "
|
|
38
|
-
}
|
|
38
|
+
"key": "abiParams.to",
|
|
39
|
+
"type": "address",
|
|
40
|
+
"description": "Address that receives the funds"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"key": "contractAddress",
|
|
44
|
+
"type": "erc20",
|
|
45
|
+
"description": "The contract address of the ERC20",
|
|
46
|
+
"mandatory": true
|
|
47
|
+
},
|
|
39
48
|
] as Parameter[]
|
|
40
49
|
},
|
|
41
|
-
BALANCE: {
|
|
42
|
-
id:
|
|
43
|
-
name: "ERC20 balance check",
|
|
44
|
-
description: "Fetches the balance of an ERC20 and checks it against the specified condition.",
|
|
45
|
-
type:
|
|
46
|
-
|
|
50
|
+
"BALANCE": {
|
|
51
|
+
"id": 5,
|
|
52
|
+
"name": "ERC20 balance check",
|
|
53
|
+
"description": "Fetches the balance of an ERC20 and checks it against the specified condition.",
|
|
54
|
+
"type": 1,
|
|
55
|
+
"method": "function balanceOf(address account) view returns (uint256)",
|
|
56
|
+
"handler": "output => { const params=JSON.parse(output);const balance = BigInt(params)/1000000n; return Number(balance); }",
|
|
57
|
+
"parameters": [
|
|
47
58
|
{
|
|
48
|
-
key: "chainId",
|
|
49
|
-
type: "chainId",
|
|
50
|
-
description: "Chain ID of the ETH blockchain"
|
|
59
|
+
"key": "chainId",
|
|
60
|
+
"type": "chainId",
|
|
61
|
+
"description": "Chain ID of the ETH blockchain"
|
|
51
62
|
},
|
|
52
63
|
{
|
|
53
|
-
key: "abiParams.account",
|
|
54
|
-
type: "address",
|
|
55
|
-
description: "Amount of crypto to transfer"
|
|
64
|
+
"key": "abiParams.account",
|
|
65
|
+
"type": "address",
|
|
66
|
+
"description": "Amount of crypto to transfer"
|
|
56
67
|
},
|
|
57
68
|
{
|
|
58
|
-
key: "contractAddress",
|
|
59
|
-
type: "address",
|
|
60
|
-
description: "The contract address of the ERC20"
|
|
69
|
+
"key": "contractAddress",
|
|
70
|
+
"type": "address",
|
|
71
|
+
"description": "The contract address of the ERC20"
|
|
61
72
|
},
|
|
62
73
|
{
|
|
63
|
-
key: "condition",
|
|
64
|
-
type: "logic_operator",
|
|
65
|
-
description: "Logic operator used for the comparison: <, >, <=, >=, ==, ..."
|
|
74
|
+
"key": "condition",
|
|
75
|
+
"type": "logic_operator",
|
|
76
|
+
"description": "Logic operator used for the comparison: <, >, <=, >=, ==, ..."
|
|
66
77
|
},
|
|
67
|
-
// todo: it should be in the same type as the output of the function
|
|
68
78
|
{
|
|
69
|
-
key: "comparisonValue",
|
|
70
|
-
type: "any",
|
|
71
|
-
description: "The value to compare to"
|
|
79
|
+
"key": "comparisonValue",
|
|
80
|
+
"type": "any",
|
|
81
|
+
"description": "The value to compare to"
|
|
72
82
|
},
|
|
73
83
|
{
|
|
74
|
-
key: "interval",
|
|
75
|
-
type: "integer",
|
|
76
|
-
description: "The waiting time between each polling"
|
|
84
|
+
"key": "interval",
|
|
85
|
+
"type": "integer",
|
|
86
|
+
"description": "The waiting time between each polling"
|
|
77
87
|
},
|
|
78
|
-
] as Parameter[]
|
|
88
|
+
] as Parameter[]
|
|
79
89
|
}
|
|
80
|
-
}
|
|
90
|
+
}
|
|
81
91
|
},
|
|
82
|
-
YIELD: {
|
|
83
|
-
SPLICE_FI: {
|
|
84
|
-
CHAINS: [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
"YIELD": {
|
|
93
|
+
"SPLICE_FI": {
|
|
94
|
+
"CHAINS": [
|
|
95
|
+
43334
|
|
96
|
+
],
|
|
97
|
+
"SWAP": {
|
|
98
|
+
"id": 2,
|
|
99
|
+
"name": "Splice Finance Swap",
|
|
100
|
+
"description": "Swap in Splice Finance",
|
|
101
|
+
"type": 0,
|
|
102
|
+
"contractAddress": "0x7A3a94AE0fC1421A3eac23eA6371036ac8d8f448",
|
|
103
|
+
"parameters": [
|
|
91
104
|
{
|
|
92
|
-
key: "abiParams.caller",
|
|
93
|
-
type: "address",
|
|
94
|
-
description: "Caller address"
|
|
105
|
+
"key": "abiParams.caller",
|
|
106
|
+
"type": "address",
|
|
107
|
+
"description": "Caller address"
|
|
95
108
|
},
|
|
96
109
|
{
|
|
97
|
-
key: "abiParams.market",
|
|
98
|
-
type: "address",
|
|
99
|
-
description: "Market address"
|
|
110
|
+
"key": "abiParams.market",
|
|
111
|
+
"type": "address",
|
|
112
|
+
"description": "Market address"
|
|
100
113
|
},
|
|
101
114
|
{
|
|
102
|
-
key: "abiParams.receiver",
|
|
103
|
-
type: "address",
|
|
104
|
-
description: "Receiver address"
|
|
115
|
+
"key": "abiParams.receiver",
|
|
116
|
+
"type": "address",
|
|
117
|
+
"description": "Receiver address"
|
|
105
118
|
},
|
|
106
119
|
{
|
|
107
|
-
key: "abiParams.netPtToAccount",
|
|
108
|
-
type: "int256",
|
|
109
|
-
description: "Net PT to account"
|
|
120
|
+
"key": "abiParams.netPtToAccount",
|
|
121
|
+
"type": "int256",
|
|
122
|
+
"description": "Net PT to account"
|
|
110
123
|
},
|
|
111
124
|
{
|
|
112
|
-
key: "abiParams.netSyToAccount",
|
|
113
|
-
type: "int256",
|
|
114
|
-
description: "Net SY to account"
|
|
115
|
-
}
|
|
125
|
+
"key": "abiParams.netSyToAccount",
|
|
126
|
+
"type": "int256",
|
|
127
|
+
"description": "Net SY to account"
|
|
128
|
+
},
|
|
116
129
|
] as Parameter[]
|
|
117
130
|
},
|
|
118
|
-
LIQUIDITY_REMOVED: {
|
|
119
|
-
id: 6,
|
|
120
|
-
name: "Liquidity Removed",
|
|
121
|
-
description: "Liquidity removed in Splice Finance",
|
|
122
|
-
type:
|
|
123
|
-
|
|
131
|
+
"LIQUIDITY_REMOVED": {
|
|
132
|
+
"id": 6,
|
|
133
|
+
"name": "Liquidity Removed",
|
|
134
|
+
"description": "Liquidity removed in Splice Finance",
|
|
135
|
+
"type": 0,
|
|
136
|
+
"contractAddress": "0x7A3a94AE0fC1421A3eac23eA6371036ac8d8f448",
|
|
137
|
+
"parameters": [
|
|
124
138
|
{
|
|
125
|
-
key: "abiParams.caller",
|
|
126
|
-
type: "address",
|
|
127
|
-
description: "Caller address"
|
|
139
|
+
"key": "abiParams.caller",
|
|
140
|
+
"type": "address",
|
|
141
|
+
"description": "Caller address"
|
|
128
142
|
},
|
|
129
143
|
{
|
|
130
|
-
key: "abiParams.market",
|
|
131
|
-
type: "address",
|
|
132
|
-
description: "Market address"
|
|
144
|
+
"key": "abiParams.market",
|
|
145
|
+
"type": "address",
|
|
146
|
+
"description": "Market address"
|
|
133
147
|
},
|
|
134
148
|
{
|
|
135
|
-
key: "abiParams.receiver",
|
|
136
|
-
type: "address",
|
|
137
|
-
description: "Receiver address"
|
|
149
|
+
"key": "abiParams.receiver",
|
|
150
|
+
"type": "address",
|
|
151
|
+
"description": "Receiver address"
|
|
138
152
|
},
|
|
139
153
|
{
|
|
140
|
-
key: "abiParams.netLpToRemove",
|
|
141
|
-
type: "uint256",
|
|
142
|
-
description: "Net LP to remove"
|
|
154
|
+
"key": "abiParams.netLpToRemove",
|
|
155
|
+
"type": "uint256",
|
|
156
|
+
"description": "Net LP to remove"
|
|
143
157
|
},
|
|
144
158
|
{
|
|
145
|
-
key: "abiParams.netPtOut",
|
|
146
|
-
type: "uint256",
|
|
147
|
-
description: "Net PT out"
|
|
159
|
+
"key": "abiParams.netPtOut",
|
|
160
|
+
"type": "uint256",
|
|
161
|
+
"description": "Net PT out"
|
|
148
162
|
},
|
|
149
163
|
{
|
|
150
|
-
key: "abiParams.netSyOut",
|
|
151
|
-
type: "uint256",
|
|
152
|
-
description: "Net SY out"
|
|
153
|
-
}
|
|
164
|
+
"key": "abiParams.netSyOut",
|
|
165
|
+
"type": "uint256",
|
|
166
|
+
"description": "Net SY out"
|
|
167
|
+
},
|
|
154
168
|
] as Parameter[]
|
|
155
169
|
},
|
|
156
|
-
MARKET_CREATION: {
|
|
157
|
-
id: 7,
|
|
158
|
-
name: "Market Creation",
|
|
159
|
-
description: "Market creation in Splice Finance",
|
|
160
|
-
type:
|
|
161
|
-
|
|
170
|
+
"MARKET_CREATION": {
|
|
171
|
+
"id": 7,
|
|
172
|
+
"name": "Market Creation",
|
|
173
|
+
"description": "Market creation in Splice Finance",
|
|
174
|
+
"type": 0,
|
|
175
|
+
"contractAddress": "0x7A3a94AE0fC1421A3eac23eA6371036ac8d8f448",
|
|
176
|
+
"parameters": [
|
|
162
177
|
{
|
|
163
|
-
key: "abiParams.market",
|
|
164
|
-
type: "address",
|
|
165
|
-
description: "Market address"
|
|
178
|
+
"key": "abiParams.market",
|
|
179
|
+
"type": "address",
|
|
180
|
+
"description": "Market address"
|
|
166
181
|
},
|
|
167
182
|
{
|
|
168
|
-
key: "abiParams.PT",
|
|
169
|
-
type: "address",
|
|
170
|
-
description: "PT address"
|
|
183
|
+
"key": "abiParams.PT",
|
|
184
|
+
"type": "address",
|
|
185
|
+
"description": "PT address"
|
|
171
186
|
},
|
|
172
187
|
{
|
|
173
|
-
key: "abiParams.scalarRoot",
|
|
174
|
-
type: "int256",
|
|
175
|
-
description: "Scalar root"
|
|
188
|
+
"key": "abiParams.scalarRoot",
|
|
189
|
+
"type": "int256",
|
|
190
|
+
"description": "Scalar root"
|
|
176
191
|
},
|
|
177
192
|
{
|
|
178
|
-
key: "abiParams.initialAnchor",
|
|
179
|
-
type: "int256",
|
|
180
|
-
description: "Initial anchor"
|
|
193
|
+
"key": "abiParams.initialAnchor",
|
|
194
|
+
"type": "int256",
|
|
195
|
+
"description": "Initial anchor"
|
|
181
196
|
},
|
|
182
197
|
{
|
|
183
|
-
key: "abiParams.lnFeeRateRoot",
|
|
184
|
-
type: "uint256",
|
|
185
|
-
description: "LN fee rate root"
|
|
186
|
-
}
|
|
198
|
+
"key": "abiParams.lnFeeRateRoot",
|
|
199
|
+
"type": "uint256",
|
|
200
|
+
"description": "LN fee rate root"
|
|
201
|
+
},
|
|
187
202
|
] as Parameter[]
|
|
188
203
|
},
|
|
189
|
-
INTEREST_RATE_UPDATE: {
|
|
190
|
-
id: 9,
|
|
191
|
-
name: "Interest Rate Update",
|
|
192
|
-
description: "Interest rate update in Splice Finance",
|
|
193
|
-
type:
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
"
|
|
213
|
-
"
|
|
204
|
+
"INTEREST_RATE_UPDATE": {
|
|
205
|
+
"id": 9,
|
|
206
|
+
"name": "Interest Rate Update",
|
|
207
|
+
"description": "Interest rate update in Splice Finance",
|
|
208
|
+
"type": 0,
|
|
209
|
+
"contractAddress": "0x7A3a94AE0fC1421A3eac23eA6371036ac8d8f448",
|
|
210
|
+
"parameters": [
|
|
211
|
+
{
|
|
212
|
+
"key": "abiParams.timestamp",
|
|
213
|
+
"type": "uint256",
|
|
214
|
+
"description": "Timestamp"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"key": "abiParams.lastLnImpliedRate",
|
|
218
|
+
"type": "int256",
|
|
219
|
+
"description": "Last LN implied rate"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"key": "contractAddress",
|
|
223
|
+
"type": "address",
|
|
224
|
+
"description": "Contract address to monitor",
|
|
225
|
+
"mandatory": true,
|
|
226
|
+
"enum": [
|
|
227
|
+
"0xDE95511418EBD8Bd36294B11C86314DdFA50e212",
|
|
228
|
+
"0x34cf9BF641bd5f34197060A3f3478a1f97f78f0a",
|
|
229
|
+
"0xb950A73Ea0842B0Cd06D0e369aE974799BB346f1",
|
|
230
|
+
"0xbF14932e1A7962C77D0b31be80075936bE1A43D4"
|
|
214
231
|
]
|
|
215
|
-
}
|
|
232
|
+
},
|
|
216
233
|
] as Parameter[]
|
|
217
234
|
}
|
|
218
235
|
}
|
|
219
236
|
},
|
|
220
|
-
LENDING: {
|
|
221
|
-
ASTARIA: {
|
|
222
|
-
CHAINS: [
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
237
|
+
"LENDING": {
|
|
238
|
+
"ASTARIA": {
|
|
239
|
+
"CHAINS": [
|
|
240
|
+
43334
|
|
241
|
+
],
|
|
242
|
+
"LEND_RECALLED": {
|
|
243
|
+
"id": 8,
|
|
244
|
+
"name": "Lend Recalled",
|
|
245
|
+
"description": "Lend recalled in Astaria",
|
|
246
|
+
"type": 0,
|
|
247
|
+
"contractAddress": "0x34cf9BF641bd5f34197060A3f3478a1f97f78f0a",
|
|
248
|
+
"parameters": [
|
|
249
|
+
{
|
|
250
|
+
"key": "abiParams.loanId",
|
|
251
|
+
"type": "uint256",
|
|
252
|
+
"description": "Loan ID"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"key": "abiParams.recaller",
|
|
256
|
+
"type": "address",
|
|
257
|
+
"description": "Recaller address"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"key": "abiParams.end",
|
|
261
|
+
"type": "uint256",
|
|
262
|
+
"description": "End time"
|
|
263
|
+
},
|
|
244
264
|
] as Parameter[]
|
|
245
265
|
}
|
|
246
266
|
}
|
|
247
267
|
},
|
|
248
|
-
DEXES: {
|
|
249
|
-
ODOS: {
|
|
250
|
-
CHAINS: [
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
268
|
+
"DEXES": {
|
|
269
|
+
"ODOS": {
|
|
270
|
+
"CHAINS": [
|
|
271
|
+
43334,
|
|
272
|
+
1
|
|
273
|
+
],
|
|
274
|
+
"SWAP": {
|
|
275
|
+
"id": 4,
|
|
276
|
+
"name": "Odos Swap",
|
|
277
|
+
"description": "Swap on Odos",
|
|
278
|
+
"type": 0,
|
|
279
|
+
"contractAddress": "0x7E15EB462cdc67Cf92Af1f7102465a8F8c784874",
|
|
280
|
+
"parameters": [
|
|
281
|
+
{
|
|
282
|
+
"key": "chainId",
|
|
283
|
+
"type": "chainId",
|
|
284
|
+
"description": "Chain ID of the ETH blockchain",
|
|
285
|
+
"mandatory": true
|
|
286
|
+
},
|
|
257
287
|
{
|
|
258
|
-
key: "
|
|
259
|
-
type: "
|
|
260
|
-
description: "
|
|
288
|
+
"key": "abiParams.sender",
|
|
289
|
+
"type": "address",
|
|
290
|
+
"description": "Sender address"
|
|
261
291
|
},
|
|
262
292
|
{
|
|
263
|
-
key: "abiParams.
|
|
264
|
-
type: "
|
|
265
|
-
description: "
|
|
293
|
+
"key": "abiParams.inputAmount",
|
|
294
|
+
"type": "uint256",
|
|
295
|
+
"description": "Input amount"
|
|
266
296
|
},
|
|
267
297
|
{
|
|
268
|
-
key: "abiParams.
|
|
269
|
-
type: "
|
|
270
|
-
description: "Input
|
|
298
|
+
"key": "abiParams.inputToken",
|
|
299
|
+
"type": "address",
|
|
300
|
+
"description": "Input token address"
|
|
271
301
|
},
|
|
272
302
|
{
|
|
273
|
-
key: "abiParams.
|
|
274
|
-
type: "
|
|
275
|
-
description: "
|
|
303
|
+
"key": "abiParams.amountOut",
|
|
304
|
+
"type": "uint256",
|
|
305
|
+
"description": "Output amount"
|
|
276
306
|
},
|
|
277
307
|
{
|
|
278
|
-
key: "abiParams.
|
|
279
|
-
type: "
|
|
280
|
-
description: "Output
|
|
308
|
+
"key": "abiParams.outputToken",
|
|
309
|
+
"type": "address",
|
|
310
|
+
"description": "Output token address"
|
|
311
|
+
},
|
|
312
|
+
] as Parameter[]
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
"SOCIALS": {
|
|
317
|
+
"MODE_NAME_SERVICE": {
|
|
318
|
+
"CHAINS": [
|
|
319
|
+
43334
|
|
320
|
+
],
|
|
321
|
+
"NAME_REGISTERED": {
|
|
322
|
+
"id": 3,
|
|
323
|
+
"name": "Name Registered",
|
|
324
|
+
"description": "Name registered in Mode Name Service",
|
|
325
|
+
"type": 0,
|
|
326
|
+
"contractAddress": "0x2aD86eeEC513AC16804bb05310214C3Fd496835B",
|
|
327
|
+
"parameters": [
|
|
328
|
+
{
|
|
329
|
+
"key": "abiParams.id",
|
|
330
|
+
"type": "uint256",
|
|
331
|
+
"description": "ID of the name registered"
|
|
281
332
|
},
|
|
282
333
|
{
|
|
283
|
-
key: "abiParams.
|
|
284
|
-
type: "address",
|
|
285
|
-
description: "
|
|
334
|
+
"key": "abiParams.owner",
|
|
335
|
+
"type": "address",
|
|
336
|
+
"description": "Owner address"
|
|
286
337
|
},
|
|
287
338
|
{
|
|
288
|
-
key: "abiParams.
|
|
289
|
-
type: "
|
|
290
|
-
description: "
|
|
291
|
-
}
|
|
339
|
+
"key": "abiParams.expires",
|
|
340
|
+
"type": "uint256",
|
|
341
|
+
"description": "Expiration time"
|
|
342
|
+
},
|
|
292
343
|
] as Parameter[]
|
|
293
344
|
}
|
|
294
345
|
}
|
|
295
346
|
},
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
CHAINS: [
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
347
|
+
"PRICE_ACTION": {
|
|
348
|
+
"ON_CHAIN_PRICE_MOVEMENT": {
|
|
349
|
+
"CHAINS": [
|
|
350
|
+
0
|
|
351
|
+
],
|
|
352
|
+
"PRICE_MOVEMENT_AGAINST_CURRENCY": {
|
|
353
|
+
"id": 10,
|
|
354
|
+
"name": "On-Chain Price Movement Against Fiat Currency",
|
|
355
|
+
"description": "This trigger activates when the on-chain price of an asset moves against a specified currency based on the given condition.",
|
|
356
|
+
"type": 2,
|
|
357
|
+
"parameters": [
|
|
358
|
+
{
|
|
359
|
+
"key": "chainId",
|
|
360
|
+
"type": "chainId",
|
|
361
|
+
"description": "Chain ID of the blockchain to monitor"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"key": "comparisonValue",
|
|
365
|
+
"type": "float",
|
|
366
|
+
"description": "The price to compare against"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"key": "currency",
|
|
370
|
+
"type": "string",
|
|
371
|
+
"description": "The currency in which the comparison price is denominated",
|
|
372
|
+
"enum": [
|
|
373
|
+
"USD"
|
|
374
|
+
]
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"key": "condition",
|
|
378
|
+
"type": "logic_operator",
|
|
379
|
+
"description": "The logic operator used for the comparison (e.g., >, <, >=, <=, ==, !=)"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"key": "contractAddress",
|
|
383
|
+
"type": "erc20",
|
|
384
|
+
"description": "The asset that you want to track"
|
|
385
|
+
},
|
|
320
386
|
] as Parameter[]
|
|
321
387
|
}
|
|
322
388
|
}
|
|
@@ -324,72 +390,102 @@ export const TRIGGERS = {
|
|
|
324
390
|
};
|
|
325
391
|
|
|
326
392
|
export const ACTIONS = {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
description: "
|
|
334
|
-
parameters: [
|
|
393
|
+
"NOTIFICATIONS": {
|
|
394
|
+
"SLACK": {
|
|
395
|
+
"SEND_MESSAGE": {
|
|
396
|
+
"id": 100002,
|
|
397
|
+
"name": "Send message",
|
|
398
|
+
"type": 0,
|
|
399
|
+
"description": "Notifies you by sending a Slack message to the channel of your choice",
|
|
400
|
+
"parameters": [
|
|
335
401
|
{
|
|
336
|
-
key: "
|
|
337
|
-
type: "
|
|
338
|
-
description: "
|
|
402
|
+
"key": "webhook",
|
|
403
|
+
"type": "url",
|
|
404
|
+
"description": "The webhook URL for the Slack channel"
|
|
339
405
|
},
|
|
340
406
|
{
|
|
341
|
-
key: "
|
|
342
|
-
type: "
|
|
343
|
-
description: "
|
|
407
|
+
"key": "message",
|
|
408
|
+
"type": "paragraph",
|
|
409
|
+
"description": "The text content to send"
|
|
344
410
|
},
|
|
411
|
+
] as Parameter[]
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"DISCORD": {
|
|
415
|
+
"SEND_MESSAGE": {
|
|
416
|
+
"id": 100003,
|
|
417
|
+
"name": "Send message",
|
|
418
|
+
"type": 0,
|
|
419
|
+
"description": "Notifies you by sending a Discord message to the channel of your choice",
|
|
420
|
+
"parameters": [
|
|
345
421
|
{
|
|
346
|
-
key: "
|
|
347
|
-
type: "
|
|
348
|
-
description: "
|
|
422
|
+
"key": "webhook",
|
|
423
|
+
"type": "url",
|
|
424
|
+
"description": "The webhook URL for the Discord channel"
|
|
349
425
|
},
|
|
350
426
|
{
|
|
351
|
-
key: "
|
|
352
|
-
type: "
|
|
353
|
-
description: "The
|
|
354
|
-
}
|
|
427
|
+
"key": "message",
|
|
428
|
+
"type": "paragraph",
|
|
429
|
+
"description": "The text content to send"
|
|
430
|
+
},
|
|
355
431
|
] as Parameter[]
|
|
356
|
-
}
|
|
432
|
+
}
|
|
357
433
|
},
|
|
434
|
+
"TELEGRAM": {
|
|
435
|
+
"SEND_MESSAGE": {
|
|
436
|
+
"id": 100001,
|
|
437
|
+
"name": "Send message",
|
|
438
|
+
"type": 0,
|
|
439
|
+
"description": "Notifies you by sending a Telegram message to the chat of your choice",
|
|
440
|
+
"parameters": [
|
|
441
|
+
{
|
|
442
|
+
"key": "webhook",
|
|
443
|
+
"type": "url",
|
|
444
|
+
"description": "The webhook URL for the Telegram bot"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"key": "message",
|
|
448
|
+
"type": "paragraph",
|
|
449
|
+
"description": "The text content to send"
|
|
450
|
+
},
|
|
451
|
+
] as Parameter[]
|
|
452
|
+
}
|
|
453
|
+
}
|
|
358
454
|
},
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}
|
|
455
|
+
"TOKENS": {
|
|
456
|
+
"ERC20": {
|
|
457
|
+
"CHAINS": [
|
|
458
|
+
0
|
|
459
|
+
],
|
|
460
|
+
"TRANSFER": {
|
|
461
|
+
"id": 100004,
|
|
462
|
+
"name": "Transfer token",
|
|
463
|
+
"description": "Transfers an ERC20 token",
|
|
464
|
+
"type": 1,
|
|
465
|
+
"method": "Transfer(address from, address to, uint256 value)",
|
|
466
|
+
"parameters": [
|
|
467
|
+
{
|
|
468
|
+
"key": "chainId",
|
|
469
|
+
"type": "chainId",
|
|
470
|
+
"description": "Chain ID of the network"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"key": "abiParams.value",
|
|
474
|
+
"type": "uint256",
|
|
475
|
+
"description": "Amount of crypto to transfer"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"key": "abiParams.to",
|
|
479
|
+
"type": "address",
|
|
480
|
+
"description": "Address to transfer crypto to"
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
"key": "contractAddress",
|
|
484
|
+
"type": "erc20",
|
|
485
|
+
"description": "The contract address of the ERC20"
|
|
486
|
+
},
|
|
487
|
+
] as Parameter[]
|
|
488
|
+
}
|
|
489
|
+
}
|
|
394
490
|
}
|
|
395
491
|
};
|