afp-sdk 0.2.0__py3-none-any.whl → 0.2.1__py3-none-any.whl
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.
- afp/bindings/system_viewer.py +1235 -0
- afp/bindings/trading_protocol.py +0 -97
- afp/schemas.py +2 -1
- {afp_sdk-0.2.0.dist-info → afp_sdk-0.2.1.dist-info}/METADATA +1 -1
- {afp_sdk-0.2.0.dist-info → afp_sdk-0.2.1.dist-info}/RECORD +7 -6
- {afp_sdk-0.2.0.dist-info → afp_sdk-0.2.1.dist-info}/WHEEL +0 -0
- {afp_sdk-0.2.0.dist-info → afp_sdk-0.2.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,1235 @@
|
|
|
1
|
+
"""SystemViewer contract binding and data structures."""
|
|
2
|
+
|
|
3
|
+
# This module has been generated using pyabigen v0.2.16
|
|
4
|
+
|
|
5
|
+
import enum
|
|
6
|
+
import typing
|
|
7
|
+
from dataclasses import dataclass
|
|
8
|
+
|
|
9
|
+
import eth_typing
|
|
10
|
+
import hexbytes
|
|
11
|
+
import web3
|
|
12
|
+
from web3.contract import contract
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ProductState(enum.IntEnum):
|
|
16
|
+
"""Port of `enum ProductState` on the SystemViewer contract."""
|
|
17
|
+
|
|
18
|
+
NOT_EXIST = 0
|
|
19
|
+
PENDING = 1
|
|
20
|
+
LIVE = 2
|
|
21
|
+
TRADEOUT = 3
|
|
22
|
+
FINAL_SETTLEMENT = 4
|
|
23
|
+
EXPIRED = 5
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dataclass
|
|
27
|
+
class Settlement:
|
|
28
|
+
"""Port of `struct Settlement` on the IMarginAccount contract."""
|
|
29
|
+
|
|
30
|
+
position_id: hexbytes.HexBytes
|
|
31
|
+
quantity: int
|
|
32
|
+
price: int
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@dataclass
|
|
36
|
+
class PositionData:
|
|
37
|
+
"""Port of `struct PositionData` on the IMarginAccount contract."""
|
|
38
|
+
|
|
39
|
+
position_id: hexbytes.HexBytes
|
|
40
|
+
quantity: int
|
|
41
|
+
cost_basis: int
|
|
42
|
+
maintenance_margin: int
|
|
43
|
+
pnl: int
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@dataclass
|
|
47
|
+
class ProductMetadata:
|
|
48
|
+
"""Port of `struct ProductMetadata` on the IProductRegistry contract."""
|
|
49
|
+
|
|
50
|
+
builder: eth_typing.ChecksumAddress
|
|
51
|
+
symbol: str
|
|
52
|
+
description: str
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@dataclass
|
|
56
|
+
class OracleSpecification:
|
|
57
|
+
"""Port of `struct OracleSpecification` on the IProductRegistry contract."""
|
|
58
|
+
|
|
59
|
+
oracle_address: eth_typing.ChecksumAddress
|
|
60
|
+
fsv_decimals: int
|
|
61
|
+
fsp_alpha: int
|
|
62
|
+
fsp_beta: int
|
|
63
|
+
fsv_calldata: hexbytes.HexBytes
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@dataclass
|
|
67
|
+
class Product:
|
|
68
|
+
"""Port of `struct Product` on the IProductRegistry contract."""
|
|
69
|
+
|
|
70
|
+
metadata: ProductMetadata
|
|
71
|
+
oracle_spec: OracleSpecification
|
|
72
|
+
price_quotation: str
|
|
73
|
+
collateral_asset: eth_typing.ChecksumAddress
|
|
74
|
+
start_time: int
|
|
75
|
+
earliest_fsp_submission_time: int
|
|
76
|
+
unit_value: int
|
|
77
|
+
initial_margin_requirement: int
|
|
78
|
+
maintenance_margin_requirement: int
|
|
79
|
+
offer_price_buffer: int
|
|
80
|
+
auction_bounty: int
|
|
81
|
+
tradeout_interval: int
|
|
82
|
+
tick_size: int
|
|
83
|
+
extended_metadata: str
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
@dataclass
|
|
87
|
+
class UserMarginAccountData:
|
|
88
|
+
"""Port of `struct UserMarginAccountData` on the ISystemViewer contract."""
|
|
89
|
+
|
|
90
|
+
collateral_asset: eth_typing.ChecksumAddress
|
|
91
|
+
margin_account_id: eth_typing.ChecksumAddress
|
|
92
|
+
mae: int
|
|
93
|
+
mmu: int
|
|
94
|
+
positions: typing.List[PositionData]
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class SystemViewer:
|
|
98
|
+
"""SystemViewer contract binding.
|
|
99
|
+
|
|
100
|
+
Parameters
|
|
101
|
+
----------
|
|
102
|
+
w3 : web3.Web3
|
|
103
|
+
address : eth_typing.ChecksumAddress
|
|
104
|
+
The address of a deployed SystemViewer contract.
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
_contract: contract.Contract
|
|
108
|
+
|
|
109
|
+
def __init__(
|
|
110
|
+
self,
|
|
111
|
+
w3: web3.Web3,
|
|
112
|
+
address: eth_typing.ChecksumAddress,
|
|
113
|
+
):
|
|
114
|
+
self._contract = w3.eth.contract(
|
|
115
|
+
address=address,
|
|
116
|
+
abi=ABI,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
@property
|
|
120
|
+
def Initialized(self) -> contract.ContractEvent:
|
|
121
|
+
"""Binding for `event Initialized` on the SystemViewer contract."""
|
|
122
|
+
return self._contract.events.Initialized
|
|
123
|
+
|
|
124
|
+
@property
|
|
125
|
+
def OwnershipTransferred(self) -> contract.ContractEvent:
|
|
126
|
+
"""Binding for `event OwnershipTransferred` on the SystemViewer contract."""
|
|
127
|
+
return self._contract.events.OwnershipTransferred
|
|
128
|
+
|
|
129
|
+
@property
|
|
130
|
+
def Upgraded(self) -> contract.ContractEvent:
|
|
131
|
+
"""Binding for `event Upgraded` on the SystemViewer contract."""
|
|
132
|
+
return self._contract.events.Upgraded
|
|
133
|
+
|
|
134
|
+
def upgrade_interface_version(
|
|
135
|
+
self,
|
|
136
|
+
) -> str:
|
|
137
|
+
"""Binding for `UPGRADE_INTERFACE_VERSION` on the SystemViewer contract.
|
|
138
|
+
|
|
139
|
+
Returns
|
|
140
|
+
-------
|
|
141
|
+
str
|
|
142
|
+
"""
|
|
143
|
+
return_value = self._contract.functions.UPGRADE_INTERFACE_VERSION().call()
|
|
144
|
+
return str(return_value)
|
|
145
|
+
|
|
146
|
+
def clearing(
|
|
147
|
+
self,
|
|
148
|
+
) -> eth_typing.ChecksumAddress:
|
|
149
|
+
"""Binding for `clearing` on the SystemViewer contract.
|
|
150
|
+
|
|
151
|
+
Returns
|
|
152
|
+
-------
|
|
153
|
+
eth_typing.ChecksumAddress
|
|
154
|
+
"""
|
|
155
|
+
return_value = self._contract.functions.clearing().call()
|
|
156
|
+
return eth_typing.ChecksumAddress(return_value)
|
|
157
|
+
|
|
158
|
+
def initialize(
|
|
159
|
+
self,
|
|
160
|
+
_clearing: eth_typing.ChecksumAddress,
|
|
161
|
+
_product_registry: eth_typing.ChecksumAddress,
|
|
162
|
+
_margin_account_registry: eth_typing.ChecksumAddress,
|
|
163
|
+
) -> contract.ContractFunction:
|
|
164
|
+
"""Binding for `initialize` on the SystemViewer contract.
|
|
165
|
+
|
|
166
|
+
Parameters
|
|
167
|
+
----------
|
|
168
|
+
_clearing : eth_typing.ChecksumAddress
|
|
169
|
+
_product_registry : eth_typing.ChecksumAddress
|
|
170
|
+
_margin_account_registry : eth_typing.ChecksumAddress
|
|
171
|
+
|
|
172
|
+
Returns
|
|
173
|
+
-------
|
|
174
|
+
web3.contract.contract.ContractFunction
|
|
175
|
+
A contract function instance to be sent in a transaction.
|
|
176
|
+
"""
|
|
177
|
+
return self._contract.functions.initialize(
|
|
178
|
+
_clearing,
|
|
179
|
+
_product_registry,
|
|
180
|
+
_margin_account_registry,
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
def mae_by_collateral_asset(
|
|
184
|
+
self,
|
|
185
|
+
collateral_asset: eth_typing.ChecksumAddress,
|
|
186
|
+
accounts: typing.List[eth_typing.ChecksumAddress],
|
|
187
|
+
) -> typing.List[int]:
|
|
188
|
+
"""Binding for `maeByCollateralAsset` on the SystemViewer contract.
|
|
189
|
+
|
|
190
|
+
Parameters
|
|
191
|
+
----------
|
|
192
|
+
collateral_asset : eth_typing.ChecksumAddress
|
|
193
|
+
accounts : typing.List[eth_typing.ChecksumAddress]
|
|
194
|
+
|
|
195
|
+
Returns
|
|
196
|
+
-------
|
|
197
|
+
typing.List[int]
|
|
198
|
+
"""
|
|
199
|
+
return_value = self._contract.functions.maeByCollateralAsset(
|
|
200
|
+
collateral_asset,
|
|
201
|
+
accounts,
|
|
202
|
+
).call()
|
|
203
|
+
return [int(return_value_elem) for return_value_elem in return_value]
|
|
204
|
+
|
|
205
|
+
def mae_by_collateral_assets(
|
|
206
|
+
self,
|
|
207
|
+
collateral_assets: typing.List[eth_typing.ChecksumAddress],
|
|
208
|
+
accounts: typing.List[eth_typing.ChecksumAddress],
|
|
209
|
+
) -> typing.List[int]:
|
|
210
|
+
"""Binding for `maeByCollateralAssets` on the SystemViewer contract.
|
|
211
|
+
|
|
212
|
+
Parameters
|
|
213
|
+
----------
|
|
214
|
+
collateral_assets : typing.List[eth_typing.ChecksumAddress]
|
|
215
|
+
accounts : typing.List[eth_typing.ChecksumAddress]
|
|
216
|
+
|
|
217
|
+
Returns
|
|
218
|
+
-------
|
|
219
|
+
typing.List[int]
|
|
220
|
+
"""
|
|
221
|
+
return_value = self._contract.functions.maeByCollateralAssets(
|
|
222
|
+
collateral_assets,
|
|
223
|
+
accounts,
|
|
224
|
+
).call()
|
|
225
|
+
return [int(return_value_elem) for return_value_elem in return_value]
|
|
226
|
+
|
|
227
|
+
def mae_checks_by_collateral_asset(
|
|
228
|
+
self,
|
|
229
|
+
collateral_asset: eth_typing.ChecksumAddress,
|
|
230
|
+
accounts: typing.List[eth_typing.ChecksumAddress],
|
|
231
|
+
settlements: typing.List[Settlement],
|
|
232
|
+
) -> typing.Tuple[typing.List[bool], typing.List[int], typing.List[int]]:
|
|
233
|
+
"""Binding for `maeChecksByCollateralAsset` on the SystemViewer contract.
|
|
234
|
+
|
|
235
|
+
Parameters
|
|
236
|
+
----------
|
|
237
|
+
collateral_asset : eth_typing.ChecksumAddress
|
|
238
|
+
accounts : typing.List[eth_typing.ChecksumAddress]
|
|
239
|
+
settlements : typing.List[Settlement]
|
|
240
|
+
|
|
241
|
+
Returns
|
|
242
|
+
-------
|
|
243
|
+
typing.List[bool]
|
|
244
|
+
typing.List[int]
|
|
245
|
+
typing.List[int]
|
|
246
|
+
"""
|
|
247
|
+
return_value = self._contract.functions.maeChecksByCollateralAsset(
|
|
248
|
+
collateral_asset,
|
|
249
|
+
accounts,
|
|
250
|
+
[(item.position_id, item.quantity, item.price) for item in settlements],
|
|
251
|
+
).call()
|
|
252
|
+
return (
|
|
253
|
+
[bool(return_value0_elem) for return_value0_elem in return_value[0]],
|
|
254
|
+
[int(return_value1_elem) for return_value1_elem in return_value[1]],
|
|
255
|
+
[int(return_value2_elem) for return_value2_elem in return_value[2]],
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
def margin_account_registry(
|
|
259
|
+
self,
|
|
260
|
+
) -> eth_typing.ChecksumAddress:
|
|
261
|
+
"""Binding for `marginAccountRegistry` on the SystemViewer contract.
|
|
262
|
+
|
|
263
|
+
Returns
|
|
264
|
+
-------
|
|
265
|
+
eth_typing.ChecksumAddress
|
|
266
|
+
"""
|
|
267
|
+
return_value = self._contract.functions.marginAccountRegistry().call()
|
|
268
|
+
return eth_typing.ChecksumAddress(return_value)
|
|
269
|
+
|
|
270
|
+
def owner(
|
|
271
|
+
self,
|
|
272
|
+
) -> eth_typing.ChecksumAddress:
|
|
273
|
+
"""Binding for `owner` on the SystemViewer contract.
|
|
274
|
+
|
|
275
|
+
Returns
|
|
276
|
+
-------
|
|
277
|
+
eth_typing.ChecksumAddress
|
|
278
|
+
"""
|
|
279
|
+
return_value = self._contract.functions.owner().call()
|
|
280
|
+
return eth_typing.ChecksumAddress(return_value)
|
|
281
|
+
|
|
282
|
+
def positions_by_collateral_asset(
|
|
283
|
+
self,
|
|
284
|
+
collateral_asset: eth_typing.ChecksumAddress,
|
|
285
|
+
accounts: typing.List[eth_typing.ChecksumAddress],
|
|
286
|
+
) -> typing.List[typing.List[PositionData]]:
|
|
287
|
+
"""Binding for `positionsByCollateralAsset` on the SystemViewer contract.
|
|
288
|
+
|
|
289
|
+
Parameters
|
|
290
|
+
----------
|
|
291
|
+
collateral_asset : eth_typing.ChecksumAddress
|
|
292
|
+
accounts : typing.List[eth_typing.ChecksumAddress]
|
|
293
|
+
|
|
294
|
+
Returns
|
|
295
|
+
-------
|
|
296
|
+
typing.List[typing.List[PositionData]]
|
|
297
|
+
"""
|
|
298
|
+
return_value = self._contract.functions.positionsByCollateralAsset(
|
|
299
|
+
collateral_asset,
|
|
300
|
+
accounts,
|
|
301
|
+
).call()
|
|
302
|
+
return [
|
|
303
|
+
[
|
|
304
|
+
PositionData(
|
|
305
|
+
hexbytes.HexBytes(return_value_elem[0]),
|
|
306
|
+
int(return_value_elem[1]),
|
|
307
|
+
int(return_value_elem[2]),
|
|
308
|
+
int(return_value_elem[3]),
|
|
309
|
+
int(return_value_elem[4]),
|
|
310
|
+
)
|
|
311
|
+
for return_value_elem in return_value_list0
|
|
312
|
+
]
|
|
313
|
+
for return_value_list0 in return_value
|
|
314
|
+
]
|
|
315
|
+
|
|
316
|
+
def positions_by_collateral_assets(
|
|
317
|
+
self,
|
|
318
|
+
collateral_assets: typing.List[eth_typing.ChecksumAddress],
|
|
319
|
+
accounts: typing.List[eth_typing.ChecksumAddress],
|
|
320
|
+
) -> typing.List[typing.List[PositionData]]:
|
|
321
|
+
"""Binding for `positionsByCollateralAssets` on the SystemViewer contract.
|
|
322
|
+
|
|
323
|
+
Parameters
|
|
324
|
+
----------
|
|
325
|
+
collateral_assets : typing.List[eth_typing.ChecksumAddress]
|
|
326
|
+
accounts : typing.List[eth_typing.ChecksumAddress]
|
|
327
|
+
|
|
328
|
+
Returns
|
|
329
|
+
-------
|
|
330
|
+
typing.List[typing.List[PositionData]]
|
|
331
|
+
"""
|
|
332
|
+
return_value = self._contract.functions.positionsByCollateralAssets(
|
|
333
|
+
collateral_assets,
|
|
334
|
+
accounts,
|
|
335
|
+
).call()
|
|
336
|
+
return [
|
|
337
|
+
[
|
|
338
|
+
PositionData(
|
|
339
|
+
hexbytes.HexBytes(return_value_elem[0]),
|
|
340
|
+
int(return_value_elem[1]),
|
|
341
|
+
int(return_value_elem[2]),
|
|
342
|
+
int(return_value_elem[3]),
|
|
343
|
+
int(return_value_elem[4]),
|
|
344
|
+
)
|
|
345
|
+
for return_value_elem in return_value_list0
|
|
346
|
+
]
|
|
347
|
+
for return_value_list0 in return_value
|
|
348
|
+
]
|
|
349
|
+
|
|
350
|
+
def product_details(
|
|
351
|
+
self,
|
|
352
|
+
product_ids: typing.List[hexbytes.HexBytes],
|
|
353
|
+
) -> typing.List[Product]:
|
|
354
|
+
"""Binding for `productDetails` on the SystemViewer contract.
|
|
355
|
+
|
|
356
|
+
Parameters
|
|
357
|
+
----------
|
|
358
|
+
product_ids : typing.List[hexbytes.HexBytes]
|
|
359
|
+
|
|
360
|
+
Returns
|
|
361
|
+
-------
|
|
362
|
+
typing.List[Product]
|
|
363
|
+
"""
|
|
364
|
+
return_value = self._contract.functions.productDetails(
|
|
365
|
+
product_ids,
|
|
366
|
+
).call()
|
|
367
|
+
return [
|
|
368
|
+
Product(
|
|
369
|
+
ProductMetadata(
|
|
370
|
+
eth_typing.ChecksumAddress(return_value_elem[0][0]),
|
|
371
|
+
str(return_value_elem[0][1]),
|
|
372
|
+
str(return_value_elem[0][2]),
|
|
373
|
+
),
|
|
374
|
+
OracleSpecification(
|
|
375
|
+
eth_typing.ChecksumAddress(return_value_elem[1][0]),
|
|
376
|
+
int(return_value_elem[1][1]),
|
|
377
|
+
int(return_value_elem[1][2]),
|
|
378
|
+
int(return_value_elem[1][3]),
|
|
379
|
+
hexbytes.HexBytes(return_value_elem[1][4]),
|
|
380
|
+
),
|
|
381
|
+
str(return_value_elem[2]),
|
|
382
|
+
eth_typing.ChecksumAddress(return_value_elem[3]),
|
|
383
|
+
int(return_value_elem[4]),
|
|
384
|
+
int(return_value_elem[5]),
|
|
385
|
+
int(return_value_elem[6]),
|
|
386
|
+
int(return_value_elem[7]),
|
|
387
|
+
int(return_value_elem[8]),
|
|
388
|
+
int(return_value_elem[9]),
|
|
389
|
+
int(return_value_elem[10]),
|
|
390
|
+
int(return_value_elem[11]),
|
|
391
|
+
int(return_value_elem[12]),
|
|
392
|
+
str(return_value_elem[13]),
|
|
393
|
+
)
|
|
394
|
+
for return_value_elem in return_value
|
|
395
|
+
]
|
|
396
|
+
|
|
397
|
+
def product_registry(
|
|
398
|
+
self,
|
|
399
|
+
) -> eth_typing.ChecksumAddress:
|
|
400
|
+
"""Binding for `productRegistry` on the SystemViewer contract.
|
|
401
|
+
|
|
402
|
+
Returns
|
|
403
|
+
-------
|
|
404
|
+
eth_typing.ChecksumAddress
|
|
405
|
+
"""
|
|
406
|
+
return_value = self._contract.functions.productRegistry().call()
|
|
407
|
+
return eth_typing.ChecksumAddress(return_value)
|
|
408
|
+
|
|
409
|
+
def product_states(
|
|
410
|
+
self,
|
|
411
|
+
product_ids: typing.List[hexbytes.HexBytes],
|
|
412
|
+
) -> typing.List[ProductState]:
|
|
413
|
+
"""Binding for `productStates` on the SystemViewer contract.
|
|
414
|
+
|
|
415
|
+
Parameters
|
|
416
|
+
----------
|
|
417
|
+
product_ids : typing.List[hexbytes.HexBytes]
|
|
418
|
+
|
|
419
|
+
Returns
|
|
420
|
+
-------
|
|
421
|
+
typing.List[ProductState]
|
|
422
|
+
"""
|
|
423
|
+
return_value = self._contract.functions.productStates(
|
|
424
|
+
product_ids,
|
|
425
|
+
).call()
|
|
426
|
+
return [ProductState(return_value_elem) for return_value_elem in return_value]
|
|
427
|
+
|
|
428
|
+
def proxiable_uuid(
|
|
429
|
+
self,
|
|
430
|
+
) -> hexbytes.HexBytes:
|
|
431
|
+
"""Binding for `proxiableUUID` on the SystemViewer contract.
|
|
432
|
+
|
|
433
|
+
Returns
|
|
434
|
+
-------
|
|
435
|
+
hexbytes.HexBytes
|
|
436
|
+
"""
|
|
437
|
+
return_value = self._contract.functions.proxiableUUID().call()
|
|
438
|
+
return hexbytes.HexBytes(return_value)
|
|
439
|
+
|
|
440
|
+
def renounce_ownership(
|
|
441
|
+
self,
|
|
442
|
+
) -> contract.ContractFunction:
|
|
443
|
+
"""Binding for `renounceOwnership` on the SystemViewer contract.
|
|
444
|
+
|
|
445
|
+
Returns
|
|
446
|
+
-------
|
|
447
|
+
web3.contract.contract.ContractFunction
|
|
448
|
+
A contract function instance to be sent in a transaction.
|
|
449
|
+
"""
|
|
450
|
+
return self._contract.functions.renounceOwnership()
|
|
451
|
+
|
|
452
|
+
def transfer_ownership(
|
|
453
|
+
self,
|
|
454
|
+
new_owner: eth_typing.ChecksumAddress,
|
|
455
|
+
) -> contract.ContractFunction:
|
|
456
|
+
"""Binding for `transferOwnership` on the SystemViewer contract.
|
|
457
|
+
|
|
458
|
+
Parameters
|
|
459
|
+
----------
|
|
460
|
+
new_owner : eth_typing.ChecksumAddress
|
|
461
|
+
|
|
462
|
+
Returns
|
|
463
|
+
-------
|
|
464
|
+
web3.contract.contract.ContractFunction
|
|
465
|
+
A contract function instance to be sent in a transaction.
|
|
466
|
+
"""
|
|
467
|
+
return self._contract.functions.transferOwnership(
|
|
468
|
+
new_owner,
|
|
469
|
+
)
|
|
470
|
+
|
|
471
|
+
def upgrade_to_and_call(
|
|
472
|
+
self,
|
|
473
|
+
new_implementation: eth_typing.ChecksumAddress,
|
|
474
|
+
data: hexbytes.HexBytes,
|
|
475
|
+
) -> contract.ContractFunction:
|
|
476
|
+
"""Binding for `upgradeToAndCall` on the SystemViewer contract.
|
|
477
|
+
|
|
478
|
+
Parameters
|
|
479
|
+
----------
|
|
480
|
+
new_implementation : eth_typing.ChecksumAddress
|
|
481
|
+
data : hexbytes.HexBytes
|
|
482
|
+
|
|
483
|
+
Returns
|
|
484
|
+
-------
|
|
485
|
+
web3.contract.contract.ContractFunction
|
|
486
|
+
A contract function instance to be sent in a transaction.
|
|
487
|
+
"""
|
|
488
|
+
return self._contract.functions.upgradeToAndCall(
|
|
489
|
+
new_implementation,
|
|
490
|
+
data,
|
|
491
|
+
)
|
|
492
|
+
|
|
493
|
+
def user_margin_data_by_collateral_asset(
|
|
494
|
+
self,
|
|
495
|
+
collateral_asset: eth_typing.ChecksumAddress,
|
|
496
|
+
accounts: typing.List[eth_typing.ChecksumAddress],
|
|
497
|
+
) -> typing.List[UserMarginAccountData]:
|
|
498
|
+
"""Binding for `userMarginDataByCollateralAsset` on the SystemViewer contract.
|
|
499
|
+
|
|
500
|
+
Parameters
|
|
501
|
+
----------
|
|
502
|
+
collateral_asset : eth_typing.ChecksumAddress
|
|
503
|
+
accounts : typing.List[eth_typing.ChecksumAddress]
|
|
504
|
+
|
|
505
|
+
Returns
|
|
506
|
+
-------
|
|
507
|
+
typing.List[UserMarginAccountData]
|
|
508
|
+
"""
|
|
509
|
+
return_value = self._contract.functions.userMarginDataByCollateralAsset(
|
|
510
|
+
collateral_asset,
|
|
511
|
+
accounts,
|
|
512
|
+
).call()
|
|
513
|
+
return [
|
|
514
|
+
UserMarginAccountData(
|
|
515
|
+
eth_typing.ChecksumAddress(return_value_elem[0]),
|
|
516
|
+
eth_typing.ChecksumAddress(return_value_elem[1]),
|
|
517
|
+
int(return_value_elem[2]),
|
|
518
|
+
int(return_value_elem[3]),
|
|
519
|
+
[
|
|
520
|
+
PositionData(
|
|
521
|
+
hexbytes.HexBytes(return_value_elem4_elem[0]),
|
|
522
|
+
int(return_value_elem4_elem[1]),
|
|
523
|
+
int(return_value_elem4_elem[2]),
|
|
524
|
+
int(return_value_elem4_elem[3]),
|
|
525
|
+
int(return_value_elem4_elem[4]),
|
|
526
|
+
)
|
|
527
|
+
for return_value_elem4_elem in return_value_elem[4]
|
|
528
|
+
],
|
|
529
|
+
)
|
|
530
|
+
for return_value_elem in return_value
|
|
531
|
+
]
|
|
532
|
+
|
|
533
|
+
def user_margin_data_by_collateral_assets(
|
|
534
|
+
self,
|
|
535
|
+
collateral_assets: typing.List[eth_typing.ChecksumAddress],
|
|
536
|
+
accounts: typing.List[eth_typing.ChecksumAddress],
|
|
537
|
+
) -> typing.List[UserMarginAccountData]:
|
|
538
|
+
"""Binding for `userMarginDataByCollateralAssets` on the SystemViewer contract.
|
|
539
|
+
|
|
540
|
+
Parameters
|
|
541
|
+
----------
|
|
542
|
+
collateral_assets : typing.List[eth_typing.ChecksumAddress]
|
|
543
|
+
accounts : typing.List[eth_typing.ChecksumAddress]
|
|
544
|
+
|
|
545
|
+
Returns
|
|
546
|
+
-------
|
|
547
|
+
typing.List[UserMarginAccountData]
|
|
548
|
+
"""
|
|
549
|
+
return_value = self._contract.functions.userMarginDataByCollateralAssets(
|
|
550
|
+
collateral_assets,
|
|
551
|
+
accounts,
|
|
552
|
+
).call()
|
|
553
|
+
return [
|
|
554
|
+
UserMarginAccountData(
|
|
555
|
+
eth_typing.ChecksumAddress(return_value_elem[0]),
|
|
556
|
+
eth_typing.ChecksumAddress(return_value_elem[1]),
|
|
557
|
+
int(return_value_elem[2]),
|
|
558
|
+
int(return_value_elem[3]),
|
|
559
|
+
[
|
|
560
|
+
PositionData(
|
|
561
|
+
hexbytes.HexBytes(return_value_elem4_elem[0]),
|
|
562
|
+
int(return_value_elem4_elem[1]),
|
|
563
|
+
int(return_value_elem4_elem[2]),
|
|
564
|
+
int(return_value_elem4_elem[3]),
|
|
565
|
+
int(return_value_elem4_elem[4]),
|
|
566
|
+
)
|
|
567
|
+
for return_value_elem4_elem in return_value_elem[4]
|
|
568
|
+
],
|
|
569
|
+
)
|
|
570
|
+
for return_value_elem in return_value
|
|
571
|
+
]
|
|
572
|
+
|
|
573
|
+
def valuations(
|
|
574
|
+
self,
|
|
575
|
+
product_ids: typing.List[hexbytes.HexBytes],
|
|
576
|
+
) -> typing.List[int]:
|
|
577
|
+
"""Binding for `valuations` on the SystemViewer contract.
|
|
578
|
+
|
|
579
|
+
Parameters
|
|
580
|
+
----------
|
|
581
|
+
product_ids : typing.List[hexbytes.HexBytes]
|
|
582
|
+
|
|
583
|
+
Returns
|
|
584
|
+
-------
|
|
585
|
+
typing.List[int]
|
|
586
|
+
"""
|
|
587
|
+
return_value = self._contract.functions.valuations(
|
|
588
|
+
product_ids,
|
|
589
|
+
).call()
|
|
590
|
+
return [int(return_value_elem) for return_value_elem in return_value]
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
ABI = typing.cast(
|
|
594
|
+
eth_typing.ABI,
|
|
595
|
+
[
|
|
596
|
+
{
|
|
597
|
+
"inputs": [
|
|
598
|
+
{"internalType": "address", "name": "target", "type": "address"}
|
|
599
|
+
],
|
|
600
|
+
"name": "AddressEmptyCode",
|
|
601
|
+
"type": "error",
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"inputs": [
|
|
605
|
+
{"internalType": "address", "name": "implementation", "type": "address"}
|
|
606
|
+
],
|
|
607
|
+
"name": "ERC1967InvalidImplementation",
|
|
608
|
+
"type": "error",
|
|
609
|
+
},
|
|
610
|
+
{"inputs": [], "name": "ERC1967NonPayable", "type": "error"},
|
|
611
|
+
{"inputs": [], "name": "FailedCall", "type": "error"},
|
|
612
|
+
{"inputs": [], "name": "InvalidInitialization", "type": "error"},
|
|
613
|
+
{
|
|
614
|
+
"inputs": [{"internalType": "string", "name": "reason", "type": "string"}],
|
|
615
|
+
"name": "InvalidParameters",
|
|
616
|
+
"type": "error",
|
|
617
|
+
},
|
|
618
|
+
{"inputs": [], "name": "NotInitializing", "type": "error"},
|
|
619
|
+
{
|
|
620
|
+
"inputs": [{"internalType": "address", "name": "owner", "type": "address"}],
|
|
621
|
+
"name": "OwnableInvalidOwner",
|
|
622
|
+
"type": "error",
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
"inputs": [
|
|
626
|
+
{"internalType": "address", "name": "account", "type": "address"}
|
|
627
|
+
],
|
|
628
|
+
"name": "OwnableUnauthorizedAccount",
|
|
629
|
+
"type": "error",
|
|
630
|
+
},
|
|
631
|
+
{"inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error"},
|
|
632
|
+
{
|
|
633
|
+
"inputs": [{"internalType": "bytes32", "name": "slot", "type": "bytes32"}],
|
|
634
|
+
"name": "UUPSUnsupportedProxiableUUID",
|
|
635
|
+
"type": "error",
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"anonymous": False,
|
|
639
|
+
"inputs": [
|
|
640
|
+
{
|
|
641
|
+
"indexed": False,
|
|
642
|
+
"internalType": "uint64",
|
|
643
|
+
"name": "version",
|
|
644
|
+
"type": "uint64",
|
|
645
|
+
}
|
|
646
|
+
],
|
|
647
|
+
"name": "Initialized",
|
|
648
|
+
"type": "event",
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
"anonymous": False,
|
|
652
|
+
"inputs": [
|
|
653
|
+
{
|
|
654
|
+
"indexed": True,
|
|
655
|
+
"internalType": "address",
|
|
656
|
+
"name": "previousOwner",
|
|
657
|
+
"type": "address",
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"indexed": True,
|
|
661
|
+
"internalType": "address",
|
|
662
|
+
"name": "newOwner",
|
|
663
|
+
"type": "address",
|
|
664
|
+
},
|
|
665
|
+
],
|
|
666
|
+
"name": "OwnershipTransferred",
|
|
667
|
+
"type": "event",
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"anonymous": False,
|
|
671
|
+
"inputs": [
|
|
672
|
+
{
|
|
673
|
+
"indexed": True,
|
|
674
|
+
"internalType": "address",
|
|
675
|
+
"name": "implementation",
|
|
676
|
+
"type": "address",
|
|
677
|
+
}
|
|
678
|
+
],
|
|
679
|
+
"name": "Upgraded",
|
|
680
|
+
"type": "event",
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
"inputs": [],
|
|
684
|
+
"name": "UPGRADE_INTERFACE_VERSION",
|
|
685
|
+
"outputs": [{"internalType": "string", "name": "", "type": "string"}],
|
|
686
|
+
"stateMutability": "view",
|
|
687
|
+
"type": "function",
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"inputs": [],
|
|
691
|
+
"name": "clearing",
|
|
692
|
+
"outputs": [
|
|
693
|
+
{
|
|
694
|
+
"internalType": "contract IClearingDiamond",
|
|
695
|
+
"name": "",
|
|
696
|
+
"type": "address",
|
|
697
|
+
}
|
|
698
|
+
],
|
|
699
|
+
"stateMutability": "view",
|
|
700
|
+
"type": "function",
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
"inputs": [
|
|
704
|
+
{
|
|
705
|
+
"internalType": "contract IClearingDiamond",
|
|
706
|
+
"name": "_clearing",
|
|
707
|
+
"type": "address",
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
"internalType": "contract IProductRegistry",
|
|
711
|
+
"name": "_productRegistry",
|
|
712
|
+
"type": "address",
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
"internalType": "contract IMarginAccountRegistry",
|
|
716
|
+
"name": "_marginAccountRegistry",
|
|
717
|
+
"type": "address",
|
|
718
|
+
},
|
|
719
|
+
],
|
|
720
|
+
"name": "initialize",
|
|
721
|
+
"outputs": [],
|
|
722
|
+
"stateMutability": "nonpayable",
|
|
723
|
+
"type": "function",
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"inputs": [
|
|
727
|
+
{
|
|
728
|
+
"internalType": "address",
|
|
729
|
+
"name": "collateralAsset",
|
|
730
|
+
"type": "address",
|
|
731
|
+
},
|
|
732
|
+
{"internalType": "address[]", "name": "accounts", "type": "address[]"},
|
|
733
|
+
],
|
|
734
|
+
"name": "maeByCollateralAsset",
|
|
735
|
+
"outputs": [
|
|
736
|
+
{"internalType": "int256[]", "name": "results", "type": "int256[]"}
|
|
737
|
+
],
|
|
738
|
+
"stateMutability": "view",
|
|
739
|
+
"type": "function",
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"inputs": [
|
|
743
|
+
{
|
|
744
|
+
"internalType": "address[]",
|
|
745
|
+
"name": "collateralAssets",
|
|
746
|
+
"type": "address[]",
|
|
747
|
+
},
|
|
748
|
+
{"internalType": "address[]", "name": "accounts", "type": "address[]"},
|
|
749
|
+
],
|
|
750
|
+
"name": "maeByCollateralAssets",
|
|
751
|
+
"outputs": [
|
|
752
|
+
{"internalType": "int256[]", "name": "results", "type": "int256[]"}
|
|
753
|
+
],
|
|
754
|
+
"stateMutability": "view",
|
|
755
|
+
"type": "function",
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"inputs": [
|
|
759
|
+
{
|
|
760
|
+
"internalType": "address",
|
|
761
|
+
"name": "collateralAsset",
|
|
762
|
+
"type": "address",
|
|
763
|
+
},
|
|
764
|
+
{"internalType": "address[]", "name": "accounts", "type": "address[]"},
|
|
765
|
+
{
|
|
766
|
+
"components": [
|
|
767
|
+
{
|
|
768
|
+
"internalType": "bytes32",
|
|
769
|
+
"name": "positionId",
|
|
770
|
+
"type": "bytes32",
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
"internalType": "int256",
|
|
774
|
+
"name": "quantity",
|
|
775
|
+
"type": "int256",
|
|
776
|
+
},
|
|
777
|
+
{"internalType": "uint256", "name": "price", "type": "uint256"},
|
|
778
|
+
],
|
|
779
|
+
"internalType": "struct IMarginAccount.Settlement[]",
|
|
780
|
+
"name": "settlements",
|
|
781
|
+
"type": "tuple[]",
|
|
782
|
+
},
|
|
783
|
+
],
|
|
784
|
+
"name": "maeChecksByCollateralAsset",
|
|
785
|
+
"outputs": [
|
|
786
|
+
{"internalType": "bool[]", "name": "results", "type": "bool[]"},
|
|
787
|
+
{"internalType": "int256[]", "name": "maeAfter", "type": "int256[]"},
|
|
788
|
+
{"internalType": "uint256[]", "name": "mmuAfter", "type": "uint256[]"},
|
|
789
|
+
],
|
|
790
|
+
"stateMutability": "view",
|
|
791
|
+
"type": "function",
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
"inputs": [],
|
|
795
|
+
"name": "marginAccountRegistry",
|
|
796
|
+
"outputs": [
|
|
797
|
+
{
|
|
798
|
+
"internalType": "contract IMarginAccountRegistry",
|
|
799
|
+
"name": "",
|
|
800
|
+
"type": "address",
|
|
801
|
+
}
|
|
802
|
+
],
|
|
803
|
+
"stateMutability": "view",
|
|
804
|
+
"type": "function",
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
"inputs": [],
|
|
808
|
+
"name": "owner",
|
|
809
|
+
"outputs": [{"internalType": "address", "name": "", "type": "address"}],
|
|
810
|
+
"stateMutability": "view",
|
|
811
|
+
"type": "function",
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
"inputs": [
|
|
815
|
+
{
|
|
816
|
+
"internalType": "address",
|
|
817
|
+
"name": "collateralAsset",
|
|
818
|
+
"type": "address",
|
|
819
|
+
},
|
|
820
|
+
{"internalType": "address[]", "name": "accounts", "type": "address[]"},
|
|
821
|
+
],
|
|
822
|
+
"name": "positionsByCollateralAsset",
|
|
823
|
+
"outputs": [
|
|
824
|
+
{
|
|
825
|
+
"components": [
|
|
826
|
+
{
|
|
827
|
+
"internalType": "bytes32",
|
|
828
|
+
"name": "positionId",
|
|
829
|
+
"type": "bytes32",
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
"internalType": "int256",
|
|
833
|
+
"name": "quantity",
|
|
834
|
+
"type": "int256",
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
"internalType": "int256",
|
|
838
|
+
"name": "costBasis",
|
|
839
|
+
"type": "int256",
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
"internalType": "uint256",
|
|
843
|
+
"name": "maintenanceMargin",
|
|
844
|
+
"type": "uint256",
|
|
845
|
+
},
|
|
846
|
+
{"internalType": "int256", "name": "pnl", "type": "int256"},
|
|
847
|
+
],
|
|
848
|
+
"internalType": "struct IMarginAccount.PositionData[][]",
|
|
849
|
+
"name": "results",
|
|
850
|
+
"type": "tuple[][]",
|
|
851
|
+
}
|
|
852
|
+
],
|
|
853
|
+
"stateMutability": "view",
|
|
854
|
+
"type": "function",
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
"inputs": [
|
|
858
|
+
{
|
|
859
|
+
"internalType": "address[]",
|
|
860
|
+
"name": "collateralAssets",
|
|
861
|
+
"type": "address[]",
|
|
862
|
+
},
|
|
863
|
+
{"internalType": "address[]", "name": "accounts", "type": "address[]"},
|
|
864
|
+
],
|
|
865
|
+
"name": "positionsByCollateralAssets",
|
|
866
|
+
"outputs": [
|
|
867
|
+
{
|
|
868
|
+
"components": [
|
|
869
|
+
{
|
|
870
|
+
"internalType": "bytes32",
|
|
871
|
+
"name": "positionId",
|
|
872
|
+
"type": "bytes32",
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
"internalType": "int256",
|
|
876
|
+
"name": "quantity",
|
|
877
|
+
"type": "int256",
|
|
878
|
+
},
|
|
879
|
+
{
|
|
880
|
+
"internalType": "int256",
|
|
881
|
+
"name": "costBasis",
|
|
882
|
+
"type": "int256",
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
"internalType": "uint256",
|
|
886
|
+
"name": "maintenanceMargin",
|
|
887
|
+
"type": "uint256",
|
|
888
|
+
},
|
|
889
|
+
{"internalType": "int256", "name": "pnl", "type": "int256"},
|
|
890
|
+
],
|
|
891
|
+
"internalType": "struct IMarginAccount.PositionData[][]",
|
|
892
|
+
"name": "results",
|
|
893
|
+
"type": "tuple[][]",
|
|
894
|
+
}
|
|
895
|
+
],
|
|
896
|
+
"stateMutability": "view",
|
|
897
|
+
"type": "function",
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
"inputs": [
|
|
901
|
+
{"internalType": "bytes32[]", "name": "productIds", "type": "bytes32[]"}
|
|
902
|
+
],
|
|
903
|
+
"name": "productDetails",
|
|
904
|
+
"outputs": [
|
|
905
|
+
{
|
|
906
|
+
"components": [
|
|
907
|
+
{
|
|
908
|
+
"components": [
|
|
909
|
+
{
|
|
910
|
+
"internalType": "address",
|
|
911
|
+
"name": "builder",
|
|
912
|
+
"type": "address",
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
"internalType": "string",
|
|
916
|
+
"name": "symbol",
|
|
917
|
+
"type": "string",
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
"internalType": "string",
|
|
921
|
+
"name": "description",
|
|
922
|
+
"type": "string",
|
|
923
|
+
},
|
|
924
|
+
],
|
|
925
|
+
"internalType": "struct IProductRegistry.ProductMetadata",
|
|
926
|
+
"name": "metadata",
|
|
927
|
+
"type": "tuple",
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
"components": [
|
|
931
|
+
{
|
|
932
|
+
"internalType": "address",
|
|
933
|
+
"name": "oracleAddress",
|
|
934
|
+
"type": "address",
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
"internalType": "uint8",
|
|
938
|
+
"name": "fsvDecimals",
|
|
939
|
+
"type": "uint8",
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
"internalType": "int256",
|
|
943
|
+
"name": "fspAlpha",
|
|
944
|
+
"type": "int256",
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
"internalType": "int256",
|
|
948
|
+
"name": "fspBeta",
|
|
949
|
+
"type": "int256",
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
"internalType": "bytes",
|
|
953
|
+
"name": "fsvCalldata",
|
|
954
|
+
"type": "bytes",
|
|
955
|
+
},
|
|
956
|
+
],
|
|
957
|
+
"internalType": "struct IProductRegistry.OracleSpecification",
|
|
958
|
+
"name": "oracleSpec",
|
|
959
|
+
"type": "tuple",
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
"internalType": "string",
|
|
963
|
+
"name": "priceQuotation",
|
|
964
|
+
"type": "string",
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
"internalType": "address",
|
|
968
|
+
"name": "collateralAsset",
|
|
969
|
+
"type": "address",
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
"internalType": "uint256",
|
|
973
|
+
"name": "startTime",
|
|
974
|
+
"type": "uint256",
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
"internalType": "uint256",
|
|
978
|
+
"name": "earliestFSPSubmissionTime",
|
|
979
|
+
"type": "uint256",
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
"internalType": "uint256",
|
|
983
|
+
"name": "unitValue",
|
|
984
|
+
"type": "uint256",
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
"internalType": "uint16",
|
|
988
|
+
"name": "initialMarginRequirement",
|
|
989
|
+
"type": "uint16",
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
"internalType": "uint16",
|
|
993
|
+
"name": "maintenanceMarginRequirement",
|
|
994
|
+
"type": "uint16",
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
"internalType": "uint64",
|
|
998
|
+
"name": "offerPriceBuffer",
|
|
999
|
+
"type": "uint64",
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
"internalType": "uint64",
|
|
1003
|
+
"name": "auctionBounty",
|
|
1004
|
+
"type": "uint64",
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
"internalType": "uint32",
|
|
1008
|
+
"name": "tradeoutInterval",
|
|
1009
|
+
"type": "uint32",
|
|
1010
|
+
},
|
|
1011
|
+
{"internalType": "uint8", "name": "tickSize", "type": "uint8"},
|
|
1012
|
+
{
|
|
1013
|
+
"internalType": "string",
|
|
1014
|
+
"name": "extendedMetadata",
|
|
1015
|
+
"type": "string",
|
|
1016
|
+
},
|
|
1017
|
+
],
|
|
1018
|
+
"internalType": "struct IProductRegistry.Product[]",
|
|
1019
|
+
"name": "details",
|
|
1020
|
+
"type": "tuple[]",
|
|
1021
|
+
}
|
|
1022
|
+
],
|
|
1023
|
+
"stateMutability": "view",
|
|
1024
|
+
"type": "function",
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
"inputs": [],
|
|
1028
|
+
"name": "productRegistry",
|
|
1029
|
+
"outputs": [
|
|
1030
|
+
{
|
|
1031
|
+
"internalType": "contract IProductRegistry",
|
|
1032
|
+
"name": "",
|
|
1033
|
+
"type": "address",
|
|
1034
|
+
}
|
|
1035
|
+
],
|
|
1036
|
+
"stateMutability": "view",
|
|
1037
|
+
"type": "function",
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
"inputs": [
|
|
1041
|
+
{"internalType": "bytes32[]", "name": "productIds", "type": "bytes32[]"}
|
|
1042
|
+
],
|
|
1043
|
+
"name": "productStates",
|
|
1044
|
+
"outputs": [
|
|
1045
|
+
{
|
|
1046
|
+
"internalType": "enum ProductState[]",
|
|
1047
|
+
"name": "states",
|
|
1048
|
+
"type": "uint8[]",
|
|
1049
|
+
}
|
|
1050
|
+
],
|
|
1051
|
+
"stateMutability": "view",
|
|
1052
|
+
"type": "function",
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
"inputs": [],
|
|
1056
|
+
"name": "proxiableUUID",
|
|
1057
|
+
"outputs": [{"internalType": "bytes32", "name": "", "type": "bytes32"}],
|
|
1058
|
+
"stateMutability": "view",
|
|
1059
|
+
"type": "function",
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
"inputs": [],
|
|
1063
|
+
"name": "renounceOwnership",
|
|
1064
|
+
"outputs": [],
|
|
1065
|
+
"stateMutability": "nonpayable",
|
|
1066
|
+
"type": "function",
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
"inputs": [
|
|
1070
|
+
{"internalType": "address", "name": "newOwner", "type": "address"}
|
|
1071
|
+
],
|
|
1072
|
+
"name": "transferOwnership",
|
|
1073
|
+
"outputs": [],
|
|
1074
|
+
"stateMutability": "nonpayable",
|
|
1075
|
+
"type": "function",
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
"inputs": [
|
|
1079
|
+
{
|
|
1080
|
+
"internalType": "address",
|
|
1081
|
+
"name": "newImplementation",
|
|
1082
|
+
"type": "address",
|
|
1083
|
+
},
|
|
1084
|
+
{"internalType": "bytes", "name": "data", "type": "bytes"},
|
|
1085
|
+
],
|
|
1086
|
+
"name": "upgradeToAndCall",
|
|
1087
|
+
"outputs": [],
|
|
1088
|
+
"stateMutability": "payable",
|
|
1089
|
+
"type": "function",
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
"inputs": [
|
|
1093
|
+
{
|
|
1094
|
+
"internalType": "address",
|
|
1095
|
+
"name": "collateralAsset",
|
|
1096
|
+
"type": "address",
|
|
1097
|
+
},
|
|
1098
|
+
{"internalType": "address[]", "name": "accounts", "type": "address[]"},
|
|
1099
|
+
],
|
|
1100
|
+
"name": "userMarginDataByCollateralAsset",
|
|
1101
|
+
"outputs": [
|
|
1102
|
+
{
|
|
1103
|
+
"components": [
|
|
1104
|
+
{
|
|
1105
|
+
"internalType": "address",
|
|
1106
|
+
"name": "collateralAsset",
|
|
1107
|
+
"type": "address",
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
"internalType": "address",
|
|
1111
|
+
"name": "marginAccountId",
|
|
1112
|
+
"type": "address",
|
|
1113
|
+
},
|
|
1114
|
+
{"internalType": "int256", "name": "mae", "type": "int256"},
|
|
1115
|
+
{"internalType": "uint256", "name": "mmu", "type": "uint256"},
|
|
1116
|
+
{
|
|
1117
|
+
"components": [
|
|
1118
|
+
{
|
|
1119
|
+
"internalType": "bytes32",
|
|
1120
|
+
"name": "positionId",
|
|
1121
|
+
"type": "bytes32",
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
"internalType": "int256",
|
|
1125
|
+
"name": "quantity",
|
|
1126
|
+
"type": "int256",
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
"internalType": "int256",
|
|
1130
|
+
"name": "costBasis",
|
|
1131
|
+
"type": "int256",
|
|
1132
|
+
},
|
|
1133
|
+
{
|
|
1134
|
+
"internalType": "uint256",
|
|
1135
|
+
"name": "maintenanceMargin",
|
|
1136
|
+
"type": "uint256",
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
"internalType": "int256",
|
|
1140
|
+
"name": "pnl",
|
|
1141
|
+
"type": "int256",
|
|
1142
|
+
},
|
|
1143
|
+
],
|
|
1144
|
+
"internalType": "struct IMarginAccount.PositionData[]",
|
|
1145
|
+
"name": "positions",
|
|
1146
|
+
"type": "tuple[]",
|
|
1147
|
+
},
|
|
1148
|
+
],
|
|
1149
|
+
"internalType": "struct ISystemViewer.UserMarginAccountData[]",
|
|
1150
|
+
"name": "data",
|
|
1151
|
+
"type": "tuple[]",
|
|
1152
|
+
}
|
|
1153
|
+
],
|
|
1154
|
+
"stateMutability": "view",
|
|
1155
|
+
"type": "function",
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
"inputs": [
|
|
1159
|
+
{
|
|
1160
|
+
"internalType": "address[]",
|
|
1161
|
+
"name": "collateralAssets",
|
|
1162
|
+
"type": "address[]",
|
|
1163
|
+
},
|
|
1164
|
+
{"internalType": "address[]", "name": "accounts", "type": "address[]"},
|
|
1165
|
+
],
|
|
1166
|
+
"name": "userMarginDataByCollateralAssets",
|
|
1167
|
+
"outputs": [
|
|
1168
|
+
{
|
|
1169
|
+
"components": [
|
|
1170
|
+
{
|
|
1171
|
+
"internalType": "address",
|
|
1172
|
+
"name": "collateralAsset",
|
|
1173
|
+
"type": "address",
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
"internalType": "address",
|
|
1177
|
+
"name": "marginAccountId",
|
|
1178
|
+
"type": "address",
|
|
1179
|
+
},
|
|
1180
|
+
{"internalType": "int256", "name": "mae", "type": "int256"},
|
|
1181
|
+
{"internalType": "uint256", "name": "mmu", "type": "uint256"},
|
|
1182
|
+
{
|
|
1183
|
+
"components": [
|
|
1184
|
+
{
|
|
1185
|
+
"internalType": "bytes32",
|
|
1186
|
+
"name": "positionId",
|
|
1187
|
+
"type": "bytes32",
|
|
1188
|
+
},
|
|
1189
|
+
{
|
|
1190
|
+
"internalType": "int256",
|
|
1191
|
+
"name": "quantity",
|
|
1192
|
+
"type": "int256",
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
"internalType": "int256",
|
|
1196
|
+
"name": "costBasis",
|
|
1197
|
+
"type": "int256",
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
"internalType": "uint256",
|
|
1201
|
+
"name": "maintenanceMargin",
|
|
1202
|
+
"type": "uint256",
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
"internalType": "int256",
|
|
1206
|
+
"name": "pnl",
|
|
1207
|
+
"type": "int256",
|
|
1208
|
+
},
|
|
1209
|
+
],
|
|
1210
|
+
"internalType": "struct IMarginAccount.PositionData[]",
|
|
1211
|
+
"name": "positions",
|
|
1212
|
+
"type": "tuple[]",
|
|
1213
|
+
},
|
|
1214
|
+
],
|
|
1215
|
+
"internalType": "struct ISystemViewer.UserMarginAccountData[]",
|
|
1216
|
+
"name": "data",
|
|
1217
|
+
"type": "tuple[]",
|
|
1218
|
+
}
|
|
1219
|
+
],
|
|
1220
|
+
"stateMutability": "view",
|
|
1221
|
+
"type": "function",
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
"inputs": [
|
|
1225
|
+
{"internalType": "bytes32[]", "name": "productIds", "type": "bytes32[]"}
|
|
1226
|
+
],
|
|
1227
|
+
"name": "valuations",
|
|
1228
|
+
"outputs": [
|
|
1229
|
+
{"internalType": "uint256[]", "name": "prices", "type": "uint256[]"}
|
|
1230
|
+
],
|
|
1231
|
+
"stateMutability": "view",
|
|
1232
|
+
"type": "function",
|
|
1233
|
+
},
|
|
1234
|
+
],
|
|
1235
|
+
)
|