perps-sdk-ts 1.0.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/.claude/settings.local.json +11 -0
- package/CONTRACT_METHOD_FIXES.md +189 -0
- package/INTEGRATION_SUMMARY.md +219 -0
- package/OPTIMIZATION_GUIDE.md +238 -0
- package/README.md +384 -0
- package/SNAPSHOT_FIX_SUMMARY.md +161 -0
- package/SNAPSHOT_OPTIMIZATION_SUMMARY.md +199 -0
- package/dist/abis/Referral.d.ts +36 -0
- package/dist/abis/Referral.js +4 -0
- package/dist/abis/Trading.d.ts +57 -0
- package/dist/abis/Trading.js +742 -0
- package/dist/abis/erc20.d.ts +51 -0
- package/dist/abis/erc20.js +4 -0
- package/dist/abis/index.d.ts +8 -0
- package/dist/abis/index.js +24 -0
- package/dist/abis/multicall.d.ts +85 -0
- package/dist/abis/multicall.js +4 -0
- package/dist/abis/pairInfos.d.ts +77 -0
- package/dist/abis/pairInfos.js +4 -0
- package/dist/abis/pairStorage.d.ts +124 -0
- package/dist/abis/pairStorage.js +4 -0
- package/dist/abis/priceAggregator.d.ts +77 -0
- package/dist/abis/priceAggregator.js +4 -0
- package/dist/abis/tardingStorage.d.ts +97 -0
- package/dist/abis/tardingStorage.js +1295 -0
- package/dist/abis.d.ts +623 -0
- package/dist/abis.js +49 -0
- package/dist/client.d.ts +118 -0
- package/dist/client.js +224 -0
- package/dist/config.d.ts +43 -0
- package/dist/config.js +42 -0
- package/dist/crypto/spki.d.ts +55 -0
- package/dist/crypto/spki.js +160 -0
- package/dist/feed/feed_client.d.ts +68 -0
- package/dist/feed/feed_client.js +239 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +87 -0
- package/dist/rpc/asset_parameters.d.ts +62 -0
- package/dist/rpc/asset_parameters.js +169 -0
- package/dist/rpc/blended.d.ts +23 -0
- package/dist/rpc/blended.js +55 -0
- package/dist/rpc/category_parameters.d.ts +34 -0
- package/dist/rpc/category_parameters.js +105 -0
- package/dist/rpc/delegation.d.ts +81 -0
- package/dist/rpc/delegation.js +180 -0
- package/dist/rpc/fee_parameters.d.ts +46 -0
- package/dist/rpc/fee_parameters.js +113 -0
- package/dist/rpc/multicall.d.ts +83 -0
- package/dist/rpc/multicall.js +117 -0
- package/dist/rpc/pair_info_queries.d.ts +101 -0
- package/dist/rpc/pair_info_queries.js +161 -0
- package/dist/rpc/pairs_cache.d.ts +62 -0
- package/dist/rpc/pairs_cache.js +240 -0
- package/dist/rpc/referral_operations.d.ts +67 -0
- package/dist/rpc/referral_operations.js +143 -0
- package/dist/rpc/snapshot.d.ts +49 -0
- package/dist/rpc/snapshot.js +162 -0
- package/dist/rpc/trade.d.ts +84 -0
- package/dist/rpc/trade.js +249 -0
- package/dist/rpc/trading_operations.d.ts +103 -0
- package/dist/rpc/trading_operations.js +295 -0
- package/dist/rpc/trading_parameters.d.ts +49 -0
- package/dist/rpc/trading_parameters.js +94 -0
- package/dist/signers/base.d.ts +24 -0
- package/dist/signers/base.js +10 -0
- package/dist/signers/kms.d.ts +47 -0
- package/dist/signers/kms.js +172 -0
- package/dist/signers/local.d.ts +43 -0
- package/dist/signers/local.js +64 -0
- package/dist/types.d.ts +1419 -0
- package/dist/types.js +245 -0
- package/dist/utils.d.ts +52 -0
- package/dist/utils.js +134 -0
- package/examples/advanced-queries.ts +181 -0
- package/examples/basic-usage.ts +78 -0
- package/examples/delegation-and-referrals.ts +130 -0
- package/examples/get-pyth-ids.ts +61 -0
- package/examples/kms-signer.ts +31 -0
- package/examples/optimized-snapshot.ts +153 -0
- package/examples/price-feed-with-sdk-ids.ts +97 -0
- package/examples/price-feed.ts +36 -0
- package/examples/trading-operations.ts +149 -0
- package/package.json +41 -0
- package/src/abis/Referral.ts +3 -0
- package/src/abis/Trading.ts +741 -0
- package/src/abis/erc20.ts +3 -0
- package/src/abis/index.ts +8 -0
- package/src/abis/multicall.ts +3 -0
- package/src/abis/pairInfos.ts +3 -0
- package/src/abis/pairStorage.ts +3 -0
- package/src/abis/priceAggregator.ts +3 -0
- package/src/abis/tardingStorage.ts +1294 -0
- package/src/abis.ts +56 -0
- package/src/client.ts +373 -0
- package/src/config.ts +62 -0
- package/src/crypto/spki.ts +197 -0
- package/src/feed/feed_client.ts +288 -0
- package/src/index.ts +114 -0
- package/src/rpc/asset_parameters.ts +217 -0
- package/src/rpc/blended.ts +77 -0
- package/src/rpc/category_parameters.ts +128 -0
- package/src/rpc/delegation.ts +225 -0
- package/src/rpc/fee_parameters.ts +150 -0
- package/src/rpc/multicall.ts +164 -0
- package/src/rpc/pair_info_queries.ts +208 -0
- package/src/rpc/pairs_cache.ts +268 -0
- package/src/rpc/referral_operations.ts +164 -0
- package/src/rpc/snapshot.ts +210 -0
- package/src/rpc/trade.ts +306 -0
- package/src/rpc/trading_operations.ts +378 -0
- package/src/rpc/trading_parameters.ts +127 -0
- package/src/signers/base.ts +27 -0
- package/src/signers/kms.ts +212 -0
- package/src/signers/local.ts +70 -0
- package/src/types.ts +410 -0
- package/src/utils.ts +155 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,742 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const abi = [
|
|
4
|
+
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
5
|
+
{
|
|
6
|
+
anonymous: false,
|
|
7
|
+
inputs: [
|
|
8
|
+
{ indexed: false, internalType: "uint8", name: "version", type: "uint8" },
|
|
9
|
+
],
|
|
10
|
+
name: "Initialized",
|
|
11
|
+
type: "event",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
anonymous: false,
|
|
15
|
+
inputs: [
|
|
16
|
+
{
|
|
17
|
+
indexed: true,
|
|
18
|
+
internalType: "address",
|
|
19
|
+
name: "trader",
|
|
20
|
+
type: "address",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
indexed: false,
|
|
24
|
+
internalType: "uint256",
|
|
25
|
+
name: "pairIndex",
|
|
26
|
+
type: "uint256",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
indexed: false,
|
|
30
|
+
internalType: "uint256",
|
|
31
|
+
name: "orderId",
|
|
32
|
+
type: "uint256",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
indexed: false,
|
|
36
|
+
internalType: "uint256",
|
|
37
|
+
name: "timestamp",
|
|
38
|
+
type: "uint256",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
name: "LimitOrderInitiated",
|
|
42
|
+
type: "event",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
anonymous: false,
|
|
46
|
+
inputs: [
|
|
47
|
+
{
|
|
48
|
+
indexed: true,
|
|
49
|
+
internalType: "address",
|
|
50
|
+
name: "trader",
|
|
51
|
+
type: "address",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
indexed: false,
|
|
55
|
+
internalType: "uint256",
|
|
56
|
+
name: "pairIndex",
|
|
57
|
+
type: "uint256",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
indexed: false,
|
|
61
|
+
internalType: "uint256",
|
|
62
|
+
name: "index",
|
|
63
|
+
type: "uint256",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
indexed: false,
|
|
67
|
+
internalType: "enum ITradingStorage.updateType",
|
|
68
|
+
name: "_type",
|
|
69
|
+
type: "uint8",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
components: [
|
|
73
|
+
{ internalType: "address", name: "trader", type: "address" },
|
|
74
|
+
{ internalType: "uint256", name: "pairIndex", type: "uint256" },
|
|
75
|
+
{ internalType: "uint256", name: "index", type: "uint256" },
|
|
76
|
+
{ internalType: "uint256", name: "initialPosToken", type: "uint256" },
|
|
77
|
+
{
|
|
78
|
+
internalType: "uint256",
|
|
79
|
+
name: "positionSizeUSDC",
|
|
80
|
+
type: "uint256",
|
|
81
|
+
},
|
|
82
|
+
{ internalType: "uint256", name: "openPrice", type: "uint256" },
|
|
83
|
+
{ internalType: "bool", name: "buy", type: "bool" },
|
|
84
|
+
{ internalType: "uint256", name: "leverage", type: "uint256" },
|
|
85
|
+
{ internalType: "uint256", name: "tp", type: "uint256" },
|
|
86
|
+
{ internalType: "uint256", name: "sl", type: "uint256" },
|
|
87
|
+
{ internalType: "uint256", name: "timestamp", type: "uint256" },
|
|
88
|
+
],
|
|
89
|
+
indexed: false,
|
|
90
|
+
internalType: "struct ITradingStorage.Trade",
|
|
91
|
+
name: "newTrade",
|
|
92
|
+
type: "tuple",
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
indexed: false,
|
|
96
|
+
internalType: "uint256",
|
|
97
|
+
name: "marginFees",
|
|
98
|
+
type: "uint256",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
indexed: false,
|
|
102
|
+
internalType: "uint256",
|
|
103
|
+
name: "lossProtectionTier",
|
|
104
|
+
type: "uint256",
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
indexed: false,
|
|
108
|
+
internalType: "uint256",
|
|
109
|
+
name: "timestamp",
|
|
110
|
+
type: "uint256",
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
name: "MarginUpdated",
|
|
114
|
+
type: "event",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
anonymous: false,
|
|
118
|
+
inputs: [
|
|
119
|
+
{
|
|
120
|
+
indexed: true,
|
|
121
|
+
internalType: "address",
|
|
122
|
+
name: "trader",
|
|
123
|
+
type: "address",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
indexed: false,
|
|
127
|
+
internalType: "uint256",
|
|
128
|
+
name: "pairIndex",
|
|
129
|
+
type: "uint256",
|
|
130
|
+
},
|
|
131
|
+
{ indexed: false, internalType: "bool", name: "open", type: "bool" },
|
|
132
|
+
{
|
|
133
|
+
indexed: false,
|
|
134
|
+
internalType: "uint256",
|
|
135
|
+
name: "orderId",
|
|
136
|
+
type: "uint256",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
indexed: false,
|
|
140
|
+
internalType: "uint256",
|
|
141
|
+
name: "timestamp",
|
|
142
|
+
type: "uint256",
|
|
143
|
+
},
|
|
144
|
+
{ indexed: false, internalType: "bool", name: "isBuy", type: "bool" },
|
|
145
|
+
],
|
|
146
|
+
name: "MarketOrderInitiated",
|
|
147
|
+
type: "event",
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
anonymous: false,
|
|
151
|
+
inputs: [
|
|
152
|
+
{ indexed: false, internalType: "string", name: "name", type: "string" },
|
|
153
|
+
{
|
|
154
|
+
indexed: false,
|
|
155
|
+
internalType: "uint256",
|
|
156
|
+
name: "value",
|
|
157
|
+
type: "uint256",
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
name: "NumberUpdated",
|
|
161
|
+
type: "event",
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
anonymous: false,
|
|
165
|
+
inputs: [
|
|
166
|
+
{
|
|
167
|
+
indexed: true,
|
|
168
|
+
internalType: "address",
|
|
169
|
+
name: "trader",
|
|
170
|
+
type: "address",
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
indexed: false,
|
|
174
|
+
internalType: "uint256",
|
|
175
|
+
name: "pairIndex",
|
|
176
|
+
type: "uint256",
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
indexed: false,
|
|
180
|
+
internalType: "uint256",
|
|
181
|
+
name: "index",
|
|
182
|
+
type: "uint256",
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
indexed: false,
|
|
186
|
+
internalType: "uint256",
|
|
187
|
+
name: "timestamp",
|
|
188
|
+
type: "uint256",
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
indexed: false,
|
|
192
|
+
internalType: "uint256",
|
|
193
|
+
name: "collateral",
|
|
194
|
+
type: "uint256",
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
name: "OpenLimitCanceled",
|
|
198
|
+
type: "event",
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
anonymous: false,
|
|
202
|
+
inputs: [
|
|
203
|
+
{
|
|
204
|
+
indexed: true,
|
|
205
|
+
internalType: "address",
|
|
206
|
+
name: "trader",
|
|
207
|
+
type: "address",
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
indexed: false,
|
|
211
|
+
internalType: "uint256",
|
|
212
|
+
name: "pairIndex",
|
|
213
|
+
type: "uint256",
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
indexed: false,
|
|
217
|
+
internalType: "uint256",
|
|
218
|
+
name: "index",
|
|
219
|
+
type: "uint256",
|
|
220
|
+
},
|
|
221
|
+
{ indexed: false, internalType: "bool", name: "isBuy", type: "bool" },
|
|
222
|
+
{
|
|
223
|
+
indexed: false,
|
|
224
|
+
internalType: "uint256",
|
|
225
|
+
name: "openPrice",
|
|
226
|
+
type: "uint256",
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
indexed: false,
|
|
230
|
+
internalType: "uint256",
|
|
231
|
+
name: "executionFee",
|
|
232
|
+
type: "uint256",
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
indexed: false,
|
|
236
|
+
internalType: "enum IExecute.OpenLimitOrderType",
|
|
237
|
+
name: "orderType",
|
|
238
|
+
type: "uint8",
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
indexed: false,
|
|
242
|
+
internalType: "uint256",
|
|
243
|
+
name: "slippageP",
|
|
244
|
+
type: "uint256",
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
indexed: false,
|
|
248
|
+
internalType: "uint256",
|
|
249
|
+
name: "collateral",
|
|
250
|
+
type: "uint256",
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
name: "OpenLimitPlaced",
|
|
254
|
+
type: "event",
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
anonymous: false,
|
|
258
|
+
inputs: [
|
|
259
|
+
{
|
|
260
|
+
indexed: true,
|
|
261
|
+
internalType: "address",
|
|
262
|
+
name: "trader",
|
|
263
|
+
type: "address",
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
indexed: false,
|
|
267
|
+
internalType: "uint256",
|
|
268
|
+
name: "pairIndex",
|
|
269
|
+
type: "uint256",
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
indexed: false,
|
|
273
|
+
internalType: "uint256",
|
|
274
|
+
name: "index",
|
|
275
|
+
type: "uint256",
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
indexed: false,
|
|
279
|
+
internalType: "uint256",
|
|
280
|
+
name: "newPrice",
|
|
281
|
+
type: "uint256",
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
indexed: false,
|
|
285
|
+
internalType: "uint256",
|
|
286
|
+
name: "newTp",
|
|
287
|
+
type: "uint256",
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
indexed: false,
|
|
291
|
+
internalType: "uint256",
|
|
292
|
+
name: "newSl",
|
|
293
|
+
type: "uint256",
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
indexed: false,
|
|
297
|
+
internalType: "uint256",
|
|
298
|
+
name: "timestamp",
|
|
299
|
+
type: "uint256",
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
name: "OpenLimitUpdated",
|
|
303
|
+
type: "event",
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
anonymous: false,
|
|
307
|
+
inputs: [
|
|
308
|
+
{
|
|
309
|
+
indexed: false,
|
|
310
|
+
internalType: "address",
|
|
311
|
+
name: "operator",
|
|
312
|
+
type: "address",
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
indexed: false,
|
|
316
|
+
internalType: "bool",
|
|
317
|
+
name: "isOperator",
|
|
318
|
+
type: "bool",
|
|
319
|
+
},
|
|
320
|
+
],
|
|
321
|
+
name: "OperatorUpdated",
|
|
322
|
+
type: "event",
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
anonymous: false,
|
|
326
|
+
inputs: [
|
|
327
|
+
{
|
|
328
|
+
indexed: false,
|
|
329
|
+
internalType: "address",
|
|
330
|
+
name: "account",
|
|
331
|
+
type: "address",
|
|
332
|
+
},
|
|
333
|
+
],
|
|
334
|
+
name: "Paused",
|
|
335
|
+
type: "event",
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
anonymous: false,
|
|
339
|
+
inputs: [
|
|
340
|
+
{
|
|
341
|
+
indexed: true,
|
|
342
|
+
internalType: "address",
|
|
343
|
+
name: "trader",
|
|
344
|
+
type: "address",
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
indexed: false,
|
|
348
|
+
internalType: "uint256",
|
|
349
|
+
name: "pairIndex",
|
|
350
|
+
type: "uint256",
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
indexed: false,
|
|
354
|
+
internalType: "uint256",
|
|
355
|
+
name: "index",
|
|
356
|
+
type: "uint256",
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
indexed: false,
|
|
360
|
+
internalType: "uint256",
|
|
361
|
+
name: "newSl",
|
|
362
|
+
type: "uint256",
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
indexed: false,
|
|
366
|
+
internalType: "uint256",
|
|
367
|
+
name: "orderId",
|
|
368
|
+
type: "uint256",
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
indexed: false,
|
|
372
|
+
internalType: "uint256",
|
|
373
|
+
name: "timestamp",
|
|
374
|
+
type: "uint256",
|
|
375
|
+
},
|
|
376
|
+
],
|
|
377
|
+
name: "SlUpdateInitiated",
|
|
378
|
+
type: "event",
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
anonymous: false,
|
|
382
|
+
inputs: [
|
|
383
|
+
{
|
|
384
|
+
indexed: true,
|
|
385
|
+
internalType: "address",
|
|
386
|
+
name: "trader",
|
|
387
|
+
type: "address",
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
indexed: false,
|
|
391
|
+
internalType: "uint256",
|
|
392
|
+
name: "pairIndex",
|
|
393
|
+
type: "uint256",
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
indexed: false,
|
|
397
|
+
internalType: "uint256",
|
|
398
|
+
name: "index",
|
|
399
|
+
type: "uint256",
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
indexed: false,
|
|
403
|
+
internalType: "uint256",
|
|
404
|
+
name: "newSl",
|
|
405
|
+
type: "uint256",
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
indexed: false,
|
|
409
|
+
internalType: "uint256",
|
|
410
|
+
name: "timestamp",
|
|
411
|
+
type: "uint256",
|
|
412
|
+
},
|
|
413
|
+
],
|
|
414
|
+
name: "SlUpdated",
|
|
415
|
+
type: "event",
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
anonymous: false,
|
|
419
|
+
inputs: [
|
|
420
|
+
{
|
|
421
|
+
indexed: true,
|
|
422
|
+
internalType: "address",
|
|
423
|
+
name: "trader",
|
|
424
|
+
type: "address",
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
indexed: false,
|
|
428
|
+
internalType: "uint256",
|
|
429
|
+
name: "pairIndex",
|
|
430
|
+
type: "uint256",
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
indexed: false,
|
|
434
|
+
internalType: "uint256",
|
|
435
|
+
name: "index",
|
|
436
|
+
type: "uint256",
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
indexed: false,
|
|
440
|
+
internalType: "uint256",
|
|
441
|
+
name: "newTp",
|
|
442
|
+
type: "uint256",
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
indexed: false,
|
|
446
|
+
internalType: "uint256",
|
|
447
|
+
name: "timestamp",
|
|
448
|
+
type: "uint256",
|
|
449
|
+
},
|
|
450
|
+
],
|
|
451
|
+
name: "TpUpdated",
|
|
452
|
+
type: "event",
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
anonymous: false,
|
|
456
|
+
inputs: [
|
|
457
|
+
{
|
|
458
|
+
indexed: false,
|
|
459
|
+
internalType: "address",
|
|
460
|
+
name: "account",
|
|
461
|
+
type: "address",
|
|
462
|
+
},
|
|
463
|
+
],
|
|
464
|
+
name: "Unpaused",
|
|
465
|
+
type: "event",
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
inputs: [],
|
|
469
|
+
name: "_MAX_SLIPPAGE",
|
|
470
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
471
|
+
stateMutability: "view",
|
|
472
|
+
type: "function",
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
inputs: [],
|
|
476
|
+
name: "__msgSender",
|
|
477
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
478
|
+
stateMutability: "view",
|
|
479
|
+
type: "function",
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
inputs: [
|
|
483
|
+
{ internalType: "uint256", name: "_pairIndex", type: "uint256" },
|
|
484
|
+
{ internalType: "uint256", name: "_index", type: "uint256" },
|
|
485
|
+
],
|
|
486
|
+
name: "cancelOpenLimitOrder",
|
|
487
|
+
outputs: [],
|
|
488
|
+
stateMutability: "nonpayable",
|
|
489
|
+
type: "function",
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
inputs: [{ internalType: "uint256", name: "_id", type: "uint256" }],
|
|
493
|
+
name: "cancelPendingMarketOrder",
|
|
494
|
+
outputs: [],
|
|
495
|
+
stateMutability: "nonpayable",
|
|
496
|
+
type: "function",
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
inputs: [
|
|
500
|
+
{ internalType: "uint256", name: "_pairIndex", type: "uint256" },
|
|
501
|
+
{ internalType: "uint256", name: "_index", type: "uint256" },
|
|
502
|
+
{ internalType: "uint256", name: "_amount", type: "uint256" },
|
|
503
|
+
],
|
|
504
|
+
name: "closeTradeMarket",
|
|
505
|
+
outputs: [{ internalType: "uint256", name: "orderId", type: "uint256" }],
|
|
506
|
+
stateMutability: "payable",
|
|
507
|
+
type: "function",
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
inputs: [
|
|
511
|
+
{ internalType: "address", name: "trader", type: "address" },
|
|
512
|
+
{ internalType: "bytes", name: "call_data", type: "bytes" },
|
|
513
|
+
],
|
|
514
|
+
name: "delegatedAction",
|
|
515
|
+
outputs: [{ internalType: "bytes", name: "", type: "bytes" }],
|
|
516
|
+
stateMutability: "payable",
|
|
517
|
+
type: "function",
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
inputs: [{ internalType: "address", name: "", type: "address" }],
|
|
521
|
+
name: "delegations",
|
|
522
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
523
|
+
stateMutability: "view",
|
|
524
|
+
type: "function",
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
inputs: [
|
|
528
|
+
{
|
|
529
|
+
internalType: "enum ITradingStorage.LimitOrder",
|
|
530
|
+
name: "_orderType",
|
|
531
|
+
type: "uint8",
|
|
532
|
+
},
|
|
533
|
+
{ internalType: "address", name: "_trader", type: "address" },
|
|
534
|
+
{ internalType: "uint256", name: "_pairIndex", type: "uint256" },
|
|
535
|
+
{ internalType: "uint256", name: "_index", type: "uint256" },
|
|
536
|
+
{ internalType: "bytes[]", name: "priceUpdateData", type: "bytes[]" },
|
|
537
|
+
],
|
|
538
|
+
name: "executeLimitOrder",
|
|
539
|
+
outputs: [],
|
|
540
|
+
stateMutability: "payable",
|
|
541
|
+
type: "function",
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
inputs: [
|
|
545
|
+
{ internalType: "uint256[]", name: "orderId", type: "uint256[]" },
|
|
546
|
+
{ internalType: "bytes[]", name: "priceUpdateData", type: "bytes[]" },
|
|
547
|
+
],
|
|
548
|
+
name: "executeMarketOrders",
|
|
549
|
+
outputs: [],
|
|
550
|
+
stateMutability: "payable",
|
|
551
|
+
type: "function",
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
inputs: [
|
|
555
|
+
{ internalType: "address", name: "_storageT", type: "address" },
|
|
556
|
+
{ internalType: "address", name: "_pairInfos", type: "address" },
|
|
557
|
+
],
|
|
558
|
+
name: "initialize",
|
|
559
|
+
outputs: [],
|
|
560
|
+
stateMutability: "nonpayable",
|
|
561
|
+
type: "function",
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
inputs: [{ internalType: "address", name: "", type: "address" }],
|
|
565
|
+
name: "isOperator",
|
|
566
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
567
|
+
stateMutability: "view",
|
|
568
|
+
type: "function",
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
inputs: [],
|
|
572
|
+
name: "limitOrdersTimelock",
|
|
573
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
574
|
+
stateMutability: "view",
|
|
575
|
+
type: "function",
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
inputs: [
|
|
579
|
+
{
|
|
580
|
+
components: [
|
|
581
|
+
{ internalType: "address", name: "trader", type: "address" },
|
|
582
|
+
{ internalType: "uint256", name: "pairIndex", type: "uint256" },
|
|
583
|
+
{ internalType: "uint256", name: "index", type: "uint256" },
|
|
584
|
+
{ internalType: "uint256", name: "initialPosToken", type: "uint256" },
|
|
585
|
+
{
|
|
586
|
+
internalType: "uint256",
|
|
587
|
+
name: "positionSizeUSDC",
|
|
588
|
+
type: "uint256",
|
|
589
|
+
},
|
|
590
|
+
{ internalType: "uint256", name: "openPrice", type: "uint256" },
|
|
591
|
+
{ internalType: "bool", name: "buy", type: "bool" },
|
|
592
|
+
{ internalType: "uint256", name: "leverage", type: "uint256" },
|
|
593
|
+
{ internalType: "uint256", name: "tp", type: "uint256" },
|
|
594
|
+
{ internalType: "uint256", name: "sl", type: "uint256" },
|
|
595
|
+
{ internalType: "uint256", name: "timestamp", type: "uint256" },
|
|
596
|
+
],
|
|
597
|
+
internalType: "struct ITradingStorage.Trade",
|
|
598
|
+
name: "t",
|
|
599
|
+
type: "tuple",
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
internalType: "enum IExecute.OpenLimitOrderType",
|
|
603
|
+
name: "_type",
|
|
604
|
+
type: "uint8",
|
|
605
|
+
},
|
|
606
|
+
{ internalType: "uint256", name: "_slippageP", type: "uint256" },
|
|
607
|
+
],
|
|
608
|
+
name: "openTrade",
|
|
609
|
+
outputs: [{ internalType: "uint256", name: "orderId", type: "uint256" }],
|
|
610
|
+
stateMutability: "payable",
|
|
611
|
+
type: "function",
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
inputs: [],
|
|
615
|
+
name: "operator",
|
|
616
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
617
|
+
stateMutability: "view",
|
|
618
|
+
type: "function",
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
inputs: [],
|
|
622
|
+
name: "pairInfos",
|
|
623
|
+
outputs: [
|
|
624
|
+
{ internalType: "contract IPairInfos", name: "", type: "address" },
|
|
625
|
+
],
|
|
626
|
+
stateMutability: "view",
|
|
627
|
+
type: "function",
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
inputs: [],
|
|
631
|
+
name: "pause",
|
|
632
|
+
outputs: [],
|
|
633
|
+
stateMutability: "nonpayable",
|
|
634
|
+
type: "function",
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
inputs: [],
|
|
638
|
+
name: "paused",
|
|
639
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
640
|
+
stateMutability: "view",
|
|
641
|
+
type: "function",
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
inputs: [],
|
|
645
|
+
name: "removeDelegate",
|
|
646
|
+
outputs: [],
|
|
647
|
+
stateMutability: "nonpayable",
|
|
648
|
+
type: "function",
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
inputs: [{ internalType: "address", name: "delegate", type: "address" }],
|
|
652
|
+
name: "setDelegate",
|
|
653
|
+
outputs: [],
|
|
654
|
+
stateMutability: "nonpayable",
|
|
655
|
+
type: "function",
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
inputs: [{ internalType: "uint256", name: "_blocks", type: "uint256" }],
|
|
659
|
+
name: "setLimitOrdersTimelock",
|
|
660
|
+
outputs: [],
|
|
661
|
+
stateMutability: "nonpayable",
|
|
662
|
+
type: "function",
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
inputs: [{ internalType: "address", name: "_reciever", type: "address" }],
|
|
666
|
+
name: "setMarketExecFeeReciever",
|
|
667
|
+
outputs: [],
|
|
668
|
+
stateMutability: "nonpayable",
|
|
669
|
+
type: "function",
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
inputs: [],
|
|
673
|
+
name: "storageT",
|
|
674
|
+
outputs: [
|
|
675
|
+
{ internalType: "contract ITradingStorage", name: "", type: "address" },
|
|
676
|
+
],
|
|
677
|
+
stateMutability: "view",
|
|
678
|
+
type: "function",
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
inputs: [],
|
|
682
|
+
name: "unpause",
|
|
683
|
+
outputs: [],
|
|
684
|
+
stateMutability: "nonpayable",
|
|
685
|
+
type: "function",
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
inputs: [
|
|
689
|
+
{ internalType: "uint256", name: "_pairIndex", type: "uint256" },
|
|
690
|
+
{ internalType: "uint256", name: "_index", type: "uint256" },
|
|
691
|
+
{
|
|
692
|
+
internalType: "enum ITradingStorage.updateType",
|
|
693
|
+
name: "_type",
|
|
694
|
+
type: "uint8",
|
|
695
|
+
},
|
|
696
|
+
{ internalType: "uint256", name: "_amount", type: "uint256" },
|
|
697
|
+
{ internalType: "bytes[]", name: "priceUpdateData", type: "bytes[]" },
|
|
698
|
+
],
|
|
699
|
+
name: "updateMargin",
|
|
700
|
+
outputs: [{ internalType: "uint256", name: "orderId", type: "uint256" }],
|
|
701
|
+
stateMutability: "payable",
|
|
702
|
+
type: "function",
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
inputs: [
|
|
706
|
+
{ internalType: "uint256", name: "_pairIndex", type: "uint256" },
|
|
707
|
+
{ internalType: "uint256", name: "_index", type: "uint256" },
|
|
708
|
+
{ internalType: "uint256", name: "_price", type: "uint256" },
|
|
709
|
+
{ internalType: "uint256", name: "_slippageP", type: "uint256" },
|
|
710
|
+
{ internalType: "uint256", name: "_tp", type: "uint256" },
|
|
711
|
+
{ internalType: "uint256", name: "_sl", type: "uint256" },
|
|
712
|
+
],
|
|
713
|
+
name: "updateOpenLimitOrder",
|
|
714
|
+
outputs: [],
|
|
715
|
+
stateMutability: "nonpayable",
|
|
716
|
+
type: "function",
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
inputs: [
|
|
720
|
+
{ internalType: "address", name: "_operator", type: "address" },
|
|
721
|
+
{ internalType: "bool", name: "_isOperator", type: "bool" },
|
|
722
|
+
],
|
|
723
|
+
name: "updateOperator",
|
|
724
|
+
outputs: [],
|
|
725
|
+
stateMutability: "nonpayable",
|
|
726
|
+
type: "function",
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
inputs: [
|
|
730
|
+
{ internalType: "uint256", name: "_pairIndex", type: "uint256" },
|
|
731
|
+
{ internalType: "uint256", name: "_index", type: "uint256" },
|
|
732
|
+
{ internalType: "uint256", name: "_newSl", type: "uint256" },
|
|
733
|
+
{ internalType: "uint256", name: "_newTP", type: "uint256" },
|
|
734
|
+
{ internalType: "bytes[]", name: "priceUpdateData", type: "bytes[]" },
|
|
735
|
+
],
|
|
736
|
+
name: "updateTpAndSl",
|
|
737
|
+
outputs: [],
|
|
738
|
+
stateMutability: "payable",
|
|
739
|
+
type: "function",
|
|
740
|
+
},
|
|
741
|
+
];
|
|
742
|
+
exports.default = abi;
|