zo-sdk 0.0.24 → 0.0.27
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/api.cjs +25 -0
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.cts +2 -0
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +2 -0
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +25 -0
- package/dist/api.mjs.map +1 -1
- package/dist/consts/deployments-mainnet.json +32 -174
- package/dist/consts/deployments-testnet.json +24 -23
- package/dist/consts/index.cjs.map +1 -1
- package/dist/consts/index.d.cts +1 -0
- package/dist/consts/index.d.cts.map +1 -1
- package/dist/consts/index.d.mts +1 -0
- package/dist/consts/index.d.mts.map +1 -1
- package/dist/consts/index.mjs.map +1 -1
- package/dist/data.cjs +17 -10
- package/dist/data.cjs.map +1 -1
- package/dist/data.d.cts.map +1 -1
- package/dist/data.d.mts.map +1 -1
- package/dist/data.mjs +17 -10
- package/dist/data.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api.ts +36 -0
- package/src/consts/deployments-mainnet.json +33 -175
- package/src/consts/deployments-testnet.json +24 -23
- package/src/consts/index.ts +1 -0
- package/src/data.ts +16 -10
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -495,6 +495,42 @@ export class API extends DataAPI {
|
|
|
495
495
|
}
|
|
496
496
|
|
|
497
497
|
// admin methods
|
|
498
|
+
adminUpdatePriceFeed = async(collateralToken: string, indexToken: string,) => {
|
|
499
|
+
const tx = await this.initOracleTxb([collateralToken, indexToken])
|
|
500
|
+
return tx
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
adminSettlePosition = async (
|
|
504
|
+
positionId: string,
|
|
505
|
+
owner: string,
|
|
506
|
+
collateralToken: string,
|
|
507
|
+
indexToken: string,
|
|
508
|
+
long: boolean,
|
|
509
|
+
) => {
|
|
510
|
+
const tx = new Transaction()
|
|
511
|
+
|
|
512
|
+
tx.moveCall({
|
|
513
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::force_settle_position`,
|
|
514
|
+
typeArguments: [
|
|
515
|
+
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
516
|
+
this.consts.coins[collateralToken].module,
|
|
517
|
+
this.consts.coins[indexToken].module,
|
|
518
|
+
`${this.consts.zoCore.package}::market::${long ? 'LONG' : 'SHORT'}`,
|
|
519
|
+
],
|
|
520
|
+
arguments: [
|
|
521
|
+
tx.object(this.consts.zoCore.adminCap),
|
|
522
|
+
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
523
|
+
tx.object(this.consts.zoCore.market),
|
|
524
|
+
tx.object(owner),
|
|
525
|
+
tx.object(positionId),
|
|
526
|
+
],
|
|
527
|
+
})
|
|
528
|
+
|
|
529
|
+
this.adminClearClosedPosition(positionId, owner, collateralToken, indexToken, long, tx)
|
|
530
|
+
|
|
531
|
+
return tx
|
|
532
|
+
}
|
|
533
|
+
|
|
498
534
|
adminDecreasePosition = async (
|
|
499
535
|
positionId: string,
|
|
500
536
|
owner: string,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"zo_core": {
|
|
3
3
|
"package": "0xf7fade57462e56e2eff1d7adef32e4fd285b21fd81f983f407bb7110ca766cda",
|
|
4
|
-
"upgraded_package": "
|
|
4
|
+
"upgraded_package": "0x73c8c2c0a506b976ae9c676aebedab1e6500cf682c4c14bddf0a545957129b8b",
|
|
5
5
|
"upgrade_cap": "0xcc96f78abe0b868afaab05954ccc6357afb5d379a21389d6eb88dda8b1f60052",
|
|
6
6
|
"admin_cap": "0xbc10f6481f2b5d6185c73ee680aa90a60fe3854d9f638e00f7e00d3b6a88e2b8",
|
|
7
7
|
"market": "0x35c667bd8c401036103992791a924f31df0d104256a9e2313acee5b1bcf05b7e",
|
|
@@ -36,264 +36,122 @@
|
|
|
36
36
|
},
|
|
37
37
|
"symbols": {
|
|
38
38
|
"long_btc": {
|
|
39
|
-
"supported_collaterals": [
|
|
40
|
-
"sui",
|
|
41
|
-
"deep",
|
|
42
|
-
"nusdc",
|
|
43
|
-
"wal",
|
|
44
|
-
"cetus"
|
|
45
|
-
],
|
|
39
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
46
40
|
"funding_fee_model": "0x116f08a986e360abe00dc936d363f94e32893af75fb1c3d294c97b8e915a7cdc",
|
|
47
41
|
"position_config": "0x9278d5af190ec9df19c2b9783b82cc8686acbf8bd79b3697d5f678d834f6f9cb"
|
|
48
42
|
},
|
|
49
43
|
"short_btc": {
|
|
50
|
-
"supported_collaterals": [
|
|
51
|
-
"sui",
|
|
52
|
-
"deep",
|
|
53
|
-
"nusdc",
|
|
54
|
-
"wal",
|
|
55
|
-
"cetus"
|
|
56
|
-
],
|
|
44
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
57
45
|
"funding_fee_model": "0xc31c0c54cb3611d4c79cd44946bdd3d37f3de56872d859f5af1babc669b70587",
|
|
58
46
|
"position_config": "0x5a50ce2dfc114794977d7543d1f4425082428165a561641ab34bd175e2d5080a"
|
|
59
47
|
},
|
|
60
48
|
"long_eth": {
|
|
61
|
-
"supported_collaterals": [
|
|
62
|
-
"sui",
|
|
63
|
-
"deep",
|
|
64
|
-
"nusdc",
|
|
65
|
-
"wal",
|
|
66
|
-
"cetus"
|
|
67
|
-
],
|
|
49
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
68
50
|
"funding_fee_model": "0x35e4c27e7a15cac296b7be32d3ba1361bd8415e8cf3fdd7bbdc2db349111399d",
|
|
69
51
|
"position_config": "0x27c55e0d778b130ce66d09e091793e78313a2c3133e6c0013dcab924db027bb3"
|
|
70
52
|
},
|
|
71
53
|
"short_eth": {
|
|
72
|
-
"supported_collaterals": [
|
|
73
|
-
"sui",
|
|
74
|
-
"deep",
|
|
75
|
-
"nusdc",
|
|
76
|
-
"wal",
|
|
77
|
-
"cetus"
|
|
78
|
-
],
|
|
54
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
79
55
|
"funding_fee_model": "0x393e3948cf57d15d14028d0c7ae5152d1d4af270f2532d1df92f32de40270cca",
|
|
80
56
|
"position_config": "0x29a12984ee68f250972bc81251ce9c59eba949eb0626421e92e248a4300476de"
|
|
81
57
|
},
|
|
82
58
|
"long_xrp": {
|
|
83
|
-
"supported_collaterals": [
|
|
84
|
-
"sui",
|
|
85
|
-
"deep",
|
|
86
|
-
"nusdc",
|
|
87
|
-
"wal",
|
|
88
|
-
"cetus"
|
|
89
|
-
],
|
|
59
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
90
60
|
"funding_fee_model": "0xa2e7bbc8e1857f6b11c47413c724065ff120cf185552ff263c063e1d4961f971",
|
|
91
61
|
"position_config": "0x7af35bf5e3bf4878913f9b298910bb6e05d5866e15fd82e8d99b78ae59d1fda7"
|
|
92
62
|
},
|
|
93
63
|
"short_xrp": {
|
|
94
|
-
"supported_collaterals": [
|
|
95
|
-
"sui",
|
|
96
|
-
"deep",
|
|
97
|
-
"nusdc",
|
|
98
|
-
"wal",
|
|
99
|
-
"cetus"
|
|
100
|
-
],
|
|
64
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
101
65
|
"funding_fee_model": "0x473c6cb03ed14425bd0efd315158929c340a09f44ec63539d84db49d383ad181",
|
|
102
66
|
"position_config": "0x8e777b8ccb5d9c61591bf36790b467ba65515727e39e08be79552bcc7e414f73"
|
|
103
67
|
},
|
|
104
68
|
"long_sol": {
|
|
105
|
-
"supported_collaterals": [
|
|
106
|
-
"sui",
|
|
107
|
-
"deep",
|
|
108
|
-
"nusdc",
|
|
109
|
-
"wal",
|
|
110
|
-
"cetus"
|
|
111
|
-
],
|
|
69
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
112
70
|
"funding_fee_model": "0x827c0d53e7260a6081c729c8010beb3532771310fcf1cd63b3fb04623da97d01",
|
|
113
71
|
"position_config": "0x1229fa25bafbf7b06d545e7aaf16166099a32b8a52f92da49a5f9faf38815e64"
|
|
114
72
|
},
|
|
115
73
|
"short_sol": {
|
|
116
|
-
"supported_collaterals": [
|
|
117
|
-
"sui",
|
|
118
|
-
"deep",
|
|
119
|
-
"nusdc",
|
|
120
|
-
"wal",
|
|
121
|
-
"cetus"
|
|
122
|
-
],
|
|
74
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
123
75
|
"funding_fee_model": "0x8011208fd49d17b14072f6e821ca185fb34aec3eba703cedaf1c39a96e441b77",
|
|
124
76
|
"position_config": "0x487e5b93dc6be50dd60d727e28924031d254b2426f029eed9d30573f2fb094da"
|
|
125
77
|
},
|
|
126
78
|
"long_doge": {
|
|
127
|
-
"supported_collaterals": [
|
|
128
|
-
"sui",
|
|
129
|
-
"deep",
|
|
130
|
-
"nusdc",
|
|
131
|
-
"wal",
|
|
132
|
-
"cetus"
|
|
133
|
-
],
|
|
79
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
134
80
|
"funding_fee_model": "0xab200af2bdb24d0950d3a3fe2952803a3f015f825a12a4f316cb079ac1c77e33",
|
|
135
81
|
"position_config": "0xa357de8967b287850ab5ebd123ab347065d6dae5eda02c356eb14e226589208c"
|
|
136
82
|
},
|
|
137
83
|
"short_doge": {
|
|
138
|
-
"supported_collaterals": [
|
|
139
|
-
"sui",
|
|
140
|
-
"deep",
|
|
141
|
-
"nusdc",
|
|
142
|
-
"wal",
|
|
143
|
-
"cetus"
|
|
144
|
-
],
|
|
84
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
145
85
|
"funding_fee_model": "0xfe142306e247a07a76dae73cb1b37e8d65be284e6ec7d3ec4926707eb16f7bac",
|
|
146
86
|
"position_config": "0x40a47914d658a2e757caa5b8ee6b2fb4e3bd48178f2f2ecc0f4cfd42ced26cb2"
|
|
147
87
|
},
|
|
148
88
|
"long_sui": {
|
|
149
|
-
"supported_collaterals": [
|
|
150
|
-
"sui",
|
|
151
|
-
"deep",
|
|
152
|
-
"nusdc",
|
|
153
|
-
"wal",
|
|
154
|
-
"cetus"
|
|
155
|
-
],
|
|
89
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
156
90
|
"funding_fee_model": "0xb79f8117573ede4c73be995dee65039ec0b649fa9d19526dedbea10c59a1901a",
|
|
157
91
|
"position_config": "0xc7c1b89b5afc7eb22ac86e24b4fb19821debeba1e9d6b607af25b90b30baf0ee"
|
|
158
92
|
},
|
|
159
93
|
"short_sui": {
|
|
160
|
-
"supported_collaterals": [
|
|
161
|
-
"sui",
|
|
162
|
-
"deep",
|
|
163
|
-
"nusdc",
|
|
164
|
-
"wal",
|
|
165
|
-
"cetus"
|
|
166
|
-
],
|
|
94
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
167
95
|
"funding_fee_model": "0x376cc5b1ae3797ceeda86a27f8ab13213aa38fc25437f634d57e41a3eb0e2467",
|
|
168
96
|
"position_config": "0x02802513d54807dc5c4682dac0c88c91e818e05b9aa8c02cff4ebb8372a09f5e"
|
|
169
97
|
},
|
|
170
98
|
"long_hype": {
|
|
171
|
-
"supported_collaterals": [
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
"nusdc",
|
|
175
|
-
"wal"
|
|
176
|
-
],
|
|
177
|
-
"funding_fee_model": "0x2cf92cb06e1afb37c98095a671e017f1d232d4f41efe10b284a067cec1286d32",
|
|
178
|
-
"position_config": "0x80ef0af78c3ab4c1e9191daa9b63df807c20fb444518c4909ec0045db6ca3b84"
|
|
99
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
100
|
+
"funding_fee_model": "0x9b4739dd61dc4dedbcd3955ec6b1884f0ced71231579fbf413c9e12b7537abc6",
|
|
101
|
+
"position_config": "0x516d25119e72247fcae35c4340fc111b0db0ef8a6b9f375dd1787219f1b4c111"
|
|
179
102
|
},
|
|
180
103
|
"short_hype": {
|
|
181
|
-
"supported_collaterals": [
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
"nusdc",
|
|
185
|
-
"wal"
|
|
186
|
-
],
|
|
187
|
-
"funding_fee_model": "0x94cd2911d839a3366e2f44b35a83c340e16a3bd0327194f39e701f84d5721cf2",
|
|
188
|
-
"position_config": "0x6f7f19f1eca4bf95da4ac043127cfb17b0ef8a4e1ee5dba4dd06bff50d186d47"
|
|
104
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
105
|
+
"funding_fee_model": "0xbd0376733e88e777299fe4b2c88564b02387c61048f786a92d4095247e9f2e0a",
|
|
106
|
+
"position_config": "0x9d6f721e2ba94f7cfaad8cb1d0aa506f39d52832a00d948b391847140be46785"
|
|
189
107
|
},
|
|
190
108
|
"long_ondo": {
|
|
191
|
-
"supported_collaterals": [
|
|
192
|
-
"sui",
|
|
193
|
-
"deep",
|
|
194
|
-
"nusdc",
|
|
195
|
-
"wal",
|
|
196
|
-
"cetus"
|
|
197
|
-
],
|
|
109
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
198
110
|
"funding_fee_model": "0xf6f1811b8ef8aa229f7dcdf141ef3e2c31a76276057d5573e35cd8173dac2f5a",
|
|
199
111
|
"position_config": "0xf14be1634990f37d26399652d0f3924aaa6147033a58c8386b9361634fc0c34a"
|
|
200
112
|
},
|
|
201
113
|
"short_ondo": {
|
|
202
|
-
"supported_collaterals": [
|
|
203
|
-
"sui",
|
|
204
|
-
"deep",
|
|
205
|
-
"nusdc",
|
|
206
|
-
"wal",
|
|
207
|
-
"cetus"
|
|
208
|
-
],
|
|
114
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
209
115
|
"funding_fee_model": "0x444c3fb015608cd5ee5fe92092eb2548bee162ce8171a04d5990ddfc37c6c0e1",
|
|
210
116
|
"position_config": "0x108c724e91712701ef8b74aa0572978c8027580272df865aeaf611450a24d368"
|
|
211
117
|
},
|
|
212
118
|
"long_trump": {
|
|
213
|
-
"supported_collaterals": [
|
|
214
|
-
"sui",
|
|
215
|
-
"deep",
|
|
216
|
-
"nusdc",
|
|
217
|
-
"wal",
|
|
218
|
-
"cetus"
|
|
219
|
-
],
|
|
119
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
220
120
|
"funding_fee_model": "0x505b0fe6918570738df0da62060ed2293ead107ba90eb0d467e7f84549ad95f8",
|
|
221
121
|
"position_config": "0x24f5c833f574a6abda8ec64c0ae0470904b7f213845623e542bf53744f47f924"
|
|
222
122
|
},
|
|
223
123
|
"short_trump": {
|
|
224
|
-
"supported_collaterals": [
|
|
225
|
-
"sui",
|
|
226
|
-
"deep",
|
|
227
|
-
"nusdc",
|
|
228
|
-
"wal",
|
|
229
|
-
"cetus"
|
|
230
|
-
],
|
|
124
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
231
125
|
"funding_fee_model": "0xf272d2d478c994b307638e8ca568d68f3669e6604076edf84666f7e41fa90925",
|
|
232
126
|
"position_config": "0xd41ccfb6f142ed275d49c62c685bd8eebf66ad884d72f3dceefa0fc45582a4f7"
|
|
233
127
|
},
|
|
234
128
|
"long_wal": {
|
|
235
|
-
"supported_collaterals": [
|
|
236
|
-
"sui",
|
|
237
|
-
"deep",
|
|
238
|
-
"nusdc",
|
|
239
|
-
"wal",
|
|
240
|
-
"cetus"
|
|
241
|
-
],
|
|
129
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
242
130
|
"funding_fee_model": "0x79d5c23b66049c5d2eee5000345184a68f161eca3a981107c30271f42d653379",
|
|
243
131
|
"position_config": "0x0f50c1b590ef898c1375a8d37ddeed8ff7b5be84683fb0f0eb56cbe8daf424be"
|
|
244
132
|
},
|
|
245
133
|
"short_wal": {
|
|
246
|
-
"supported_collaterals": [
|
|
247
|
-
"sui",
|
|
248
|
-
"deep",
|
|
249
|
-
"nusdc",
|
|
250
|
-
"wal",
|
|
251
|
-
"cetus"
|
|
252
|
-
],
|
|
134
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
253
135
|
"funding_fee_model": "0xd3f6a1b7a3bf8a1a914af5450ed97749ddd98852635602c376f8cf10f476d77e",
|
|
254
136
|
"position_config": "0x68c9e48a0d70940ee869e179b7fd0844027c5f295db7f91b0af20f12012723ea"
|
|
255
137
|
},
|
|
256
138
|
"long_deep": {
|
|
257
|
-
"supported_collaterals": [
|
|
258
|
-
"sui",
|
|
259
|
-
"deep",
|
|
260
|
-
"nusdc",
|
|
261
|
-
"wal",
|
|
262
|
-
"cetus"
|
|
263
|
-
],
|
|
139
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
264
140
|
"funding_fee_model": "0x2a5109e3623015887da852447fcbe18897a8226988cdc430de939f828e9b832d",
|
|
265
141
|
"position_config": "0xafb27095c591a52f835306e385bfbf9fbb8da0ad2ad5ab6f6b32bf41dc328edb"
|
|
266
142
|
},
|
|
267
143
|
"short_deep": {
|
|
268
|
-
"supported_collaterals": [
|
|
269
|
-
"sui",
|
|
270
|
-
"deep",
|
|
271
|
-
"nusdc",
|
|
272
|
-
"wal",
|
|
273
|
-
"cetus"
|
|
274
|
-
],
|
|
144
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
275
145
|
"funding_fee_model": "0x9685d898cffd81961ca85df6ad958fe4b93032572ce2b10e68e057a2bb6351c6",
|
|
276
146
|
"position_config": "0xc6c481ab3f090b52e672146887239ababc0815a5ec9bfc51bb9175b82e0eab53"
|
|
277
147
|
},
|
|
278
148
|
"long_cetus": {
|
|
279
|
-
"supported_collaterals": [
|
|
280
|
-
"sui",
|
|
281
|
-
"deep",
|
|
282
|
-
"nusdc",
|
|
283
|
-
"wal",
|
|
284
|
-
"cetus"
|
|
285
|
-
],
|
|
149
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
286
150
|
"funding_fee_model": "0x6e7986c5097c25bbf37ef8b1cecb7931197eb178345ca7c331a093f4bcddd3f4",
|
|
287
151
|
"position_config": "0x3c95ea8a01586fc09c569d9b65a501d5ea7dfe77cb407be8a148c1fdddac33e5"
|
|
288
152
|
},
|
|
289
153
|
"short_cetus": {
|
|
290
|
-
"supported_collaterals": [
|
|
291
|
-
"sui",
|
|
292
|
-
"deep",
|
|
293
|
-
"nusdc",
|
|
294
|
-
"wal",
|
|
295
|
-
"cetus"
|
|
296
|
-
],
|
|
154
|
+
"supported_collaterals": ["sui", "deep", "nusdc", "wal", "cetus"],
|
|
297
155
|
"funding_fee_model": "0xc2382a61489000cb30ea947f763479890a6a187f7020e5c903ca43e39036c0cf",
|
|
298
156
|
"position_config": "0x1031e577256fc20f77638f952745455c5da907a58e75b3f9908da54f8608ae21"
|
|
299
157
|
}
|
|
@@ -376,9 +234,9 @@
|
|
|
376
234
|
"metadata": "0xf3da270f549dd26d1d2dd251961d46919d3abb3044a98ef0fd7dd914d3cc9159"
|
|
377
235
|
},
|
|
378
236
|
"hype": {
|
|
379
|
-
"decimals":
|
|
380
|
-
"module": "
|
|
381
|
-
"metadata": "
|
|
237
|
+
"decimals": 8,
|
|
238
|
+
"module": "0xea2748c16bb45cac2d2602d6ad25089d24a814abc9495c0210b8b856617c4e66::hype::HYPE",
|
|
239
|
+
"metadata": "0xc23c06733cab74bd55febf4f7f8a26234385974b048b95a254d2cbd7fde256b2"
|
|
382
240
|
},
|
|
383
241
|
"ondo": {
|
|
384
242
|
"decimals": 8,
|
|
@@ -396,4 +254,4 @@
|
|
|
396
254
|
"metadata": "0x4c0dce55eff2db5419bbd2d239d1aa22b4a400c01bbb648b058a9883989025da"
|
|
397
255
|
}
|
|
398
256
|
}
|
|
399
|
-
}
|
|
257
|
+
}
|
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"zo_core": {
|
|
3
|
-
"package": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
3
|
+
"package": "0x203587d1c87bb40fda19024bce9de1d36748a473740b11ab8f3ef4fc0949892d",
|
|
4
|
+
"upgraded_package": "0x67add15bd8dfa6792ea2e70324dd252a344d58b612c5b9d0b6ad72fe4d53449d",
|
|
5
|
+
"upgrade_cap": "0xc7463331f494d4c64f1f109e9476ea27ce7c21d5280700272f3846834713493f",
|
|
6
|
+
"admin_cap": "0x292a052b7480a9e71fe6633854b536b919cdb3048031b82e0cb942dd39add8e8",
|
|
7
|
+
"market": "0xf04c202403defc662b478c2a4291d106dc886478aa9eae1c09cb7bd1fb03a42c",
|
|
8
|
+
"zlp_metadata": "0xb3474d450ca0fcc75523c2af148898db14f906c5c3a87a42532e12157726f0c9",
|
|
9
|
+
"rebase_fee_model": "0x49fda6793267c7a17a7cf865036b7bc45da3afe9a3b79fa6eb5f3ac7d458b6fe",
|
|
10
|
+
"referrals_parent": "0x88204810fee9abfc551030b8a32ce3b93074158a90a36722b258e262fcca24ea",
|
|
11
|
+
"vaults_parent": "0x33828ff0eaaec06f10f6e9c37f813211dfbd4b9bbdf9c7a6824a8a9df9179784",
|
|
12
|
+
"symbols_parent": "0x0a1efe7612ac17c33f7fc3b7e258a3ad068a71caf1c78668b6f49fbbc5ac103d",
|
|
13
|
+
"positions_parent": "0xc993e1208e4fba867d048e0248376106e5b760f18f88d5b3a4b706725e456d7c",
|
|
14
|
+
"orders_parent": "0xa3205e6464ace271e3b191abd1880f8bc86698fec52ff1a54428a850886e1673",
|
|
14
15
|
"vaults": {
|
|
15
16
|
"usdt": {
|
|
16
|
-
"weight": "
|
|
17
|
-
"reserving_fee_model": "
|
|
17
|
+
"weight": "500000000000000000",
|
|
18
|
+
"reserving_fee_model": "0x5130d5427d1f1ab48c3803e53fb16d34765f9639c5e54a01e41dd354b45bc504"
|
|
18
19
|
},
|
|
19
20
|
"sui": {
|
|
20
|
-
"weight": "
|
|
21
|
-
"reserving_fee_model": "
|
|
21
|
+
"weight": "500000000000000000",
|
|
22
|
+
"reserving_fee_model": "0x3eb7a619e99992b27a33f2d6722e62d281d4b8d52a5e766780f45e3a61ff3ee0"
|
|
22
23
|
}
|
|
23
24
|
},
|
|
24
25
|
"symbols": {
|
|
25
26
|
"long_btc": {
|
|
26
27
|
"supported_collaterals": ["usdt"],
|
|
27
|
-
"funding_fee_model": "
|
|
28
|
-
"position_config": "
|
|
28
|
+
"funding_fee_model": "0x4192cfd1fc0237d19eba385f01f541add2ad805c1206d99dbf7908c7cadbc96c",
|
|
29
|
+
"position_config": "0x1dd314d961e3e90f33e1a4e06f9aa93616ffe655b8a2979a6d8b96b58ab42f70"
|
|
29
30
|
},
|
|
30
31
|
"short_btc": {
|
|
31
32
|
"supported_collaterals": ["usdt"],
|
|
32
|
-
"funding_fee_model": "
|
|
33
|
-
"position_config": "
|
|
33
|
+
"funding_fee_model": "0x32cd821bd9b6a02dbaef9723f7e8c143488a94dd6065ee9701191d27cb7471cf",
|
|
34
|
+
"position_config": "0xe77ee4a795b983ec8cdbd21eb423354f38f48c5e19e87cd50bdcaefdb93068f0"
|
|
34
35
|
},
|
|
35
36
|
"long_eth": {
|
|
36
37
|
"supported_collaterals": ["usdt"],
|
|
37
|
-
"funding_fee_model": "
|
|
38
|
-
"position_config": "
|
|
38
|
+
"funding_fee_model": "0xd7f37f78ba115651410d145126663558aee0bb9730190d9cbaaee38b5dcb941c",
|
|
39
|
+
"position_config": "0x250d233272b2d56974f8d3f4bec1cfe83c7e4af5efacc8cbfead4139ba6847bf"
|
|
39
40
|
},
|
|
40
41
|
"short_eth": {
|
|
41
42
|
"supported_collaterals": ["usdt"],
|
|
42
|
-
"funding_fee_model": "
|
|
43
|
-
"position_config": "
|
|
43
|
+
"funding_fee_model": "0x2289cc0bdef057fbe083f579737fcdf21bba2cba7ab55a6d61ef1e2265e4cc85",
|
|
44
|
+
"position_config": "0x2d06745bfb312e73868cc4763af8b46e82a730f4ee892dfdb04350895a60175f"
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
},
|
package/src/consts/index.ts
CHANGED
package/src/data.ts
CHANGED
|
@@ -710,17 +710,23 @@ export class DataAPI extends OracleAPI {
|
|
|
710
710
|
public async getPositionInfoList(positionCapInfoList: IPositionCapInfo[], owner: string) {
|
|
711
711
|
const positionInfoList: IPositionInfo[] = []
|
|
712
712
|
await Promise.all(positionCapInfoList.map(async (positionCapInfo) => {
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
713
|
+
try {
|
|
714
|
+
const positionRaw = await this.provider.getDynamicFieldObject({
|
|
715
|
+
parentId: this.consts.zoCore.positionsParent,
|
|
716
|
+
name: {
|
|
717
|
+
type: `${this.consts.zoCore.package}::market::PositionName<${positionCapInfo.symbol0}, ${positionCapInfo.symbol1}, ${this.consts.zoCore.package}::market::${positionCapInfo.long ? 'LONG' : 'SHORT'}>`,
|
|
718
|
+
value: {
|
|
719
|
+
owner,
|
|
720
|
+
id: positionCapInfo.positionCapId,
|
|
721
|
+
},
|
|
720
722
|
},
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
|
|
723
|
+
})
|
|
724
|
+
positionInfoList.push(await this.#parsePositionInfo(positionRaw, positionCapInfo.positionCapId))
|
|
725
|
+
} catch (error) {
|
|
726
|
+
// Position might have been deleted after force settlement
|
|
727
|
+
console.warn(`Failed to parse position info for position cap ID ${positionCapInfo.positionCapId}: ${error}`)
|
|
728
|
+
// Continue with next position without adding this one to the list
|
|
729
|
+
}
|
|
724
730
|
}))
|
|
725
731
|
|
|
726
732
|
return positionInfoList.sort((a, b) => a.openTimestamp > b.openTimestamp ? 1 : -1)
|