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