@bouncetech/contracts 1.1.0 → 1.2.0

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.
@@ -8,93 +8,353 @@ export declare const globalStorageHelperAbi: readonly [{
8
8
  readonly stateMutability: "nonpayable";
9
9
  }, {
10
10
  readonly type: "function";
11
- readonly name: "getGlobalStorageData";
12
- readonly inputs: readonly [];
11
+ readonly name: "getLeveragedTokenPositionData";
12
+ readonly inputs: readonly [{
13
+ readonly name: "leveragedTokenAddress_";
14
+ readonly type: "address";
15
+ readonly internalType: "address";
16
+ }];
13
17
  readonly outputs: readonly [{
14
18
  readonly name: "";
15
19
  readonly type: "tuple";
16
- readonly internalType: "struct IGlobalStorageHelper.GlobalStorageData";
20
+ readonly internalType: "struct ILeveragedTokenHelper.LeveragedTokenPositionData";
17
21
  readonly components: readonly [{
18
- readonly name: "owner";
22
+ readonly name: "leveragedToken";
19
23
  readonly type: "address";
20
24
  readonly internalType: "address";
21
25
  }, {
22
- readonly name: "ltImplementation";
23
- readonly type: "address";
24
- readonly internalType: "address";
26
+ readonly name: "baseAssetContractBalance";
27
+ readonly type: "uint256";
28
+ readonly internalType: "uint256";
25
29
  }, {
26
- readonly name: "baseAsset";
27
- readonly type: "address";
28
- readonly internalType: "address";
30
+ readonly name: "baseAssetUserCredit";
31
+ readonly type: "uint256";
32
+ readonly internalType: "uint256";
29
33
  }, {
30
- readonly name: "treasury";
31
- readonly type: "address";
32
- readonly internalType: "address";
34
+ readonly name: "usdcSpotBalance";
35
+ readonly type: "uint256";
36
+ readonly internalType: "uint256";
33
37
  }, {
34
- readonly name: "factory";
35
- readonly type: "address";
36
- readonly internalType: "address";
38
+ readonly name: "usdcPerpBalance";
39
+ readonly type: "uint256";
40
+ readonly internalType: "uint256";
37
41
  }, {
38
- readonly name: "hyperliquidHandler";
39
- readonly type: "address";
40
- readonly internalType: "address";
42
+ readonly name: "usdcMargin";
43
+ readonly type: "uint256";
44
+ readonly internalType: "uint256";
41
45
  }, {
42
- readonly name: "feeHandler";
43
- readonly type: "address";
44
- readonly internalType: "address";
46
+ readonly name: "notionalValue";
47
+ readonly type: "uint256";
48
+ readonly internalType: "uint256";
45
49
  }, {
46
- readonly name: "bounce";
50
+ readonly name: "effectiveLeverage";
51
+ readonly type: "uint256";
52
+ readonly internalType: "uint256";
53
+ }, {
54
+ readonly name: "targetLeverage";
55
+ readonly type: "uint256";
56
+ readonly internalType: "uint256";
57
+ }];
58
+ }];
59
+ readonly stateMutability: "view";
60
+ }, {
61
+ readonly type: "function";
62
+ readonly name: "getLeveragedTokens";
63
+ readonly inputs: readonly [];
64
+ readonly outputs: readonly [{
65
+ readonly name: "";
66
+ readonly type: "tuple[]";
67
+ readonly internalType: "struct ILeveragedTokenHelper.LeveragedTokenData[]";
68
+ readonly components: readonly [{
69
+ readonly name: "leveragedToken";
47
70
  readonly type: "address";
48
71
  readonly internalType: "address";
49
72
  }, {
50
- readonly name: "allMintsPaused";
73
+ readonly name: "marketId";
74
+ readonly type: "uint32";
75
+ readonly internalType: "uint32";
76
+ }, {
77
+ readonly name: "targetAsset";
78
+ readonly type: "string";
79
+ readonly internalType: "string";
80
+ }, {
81
+ readonly name: "targetLeverage";
82
+ readonly type: "uint256";
83
+ readonly internalType: "uint256";
84
+ }, {
85
+ readonly name: "isLong";
51
86
  readonly type: "bool";
52
87
  readonly internalType: "bool";
53
88
  }, {
54
- readonly name: "vesting";
55
- readonly type: "address";
56
- readonly internalType: "address";
89
+ readonly name: "exchangeRate";
90
+ readonly type: "uint256";
91
+ readonly internalType: "uint256";
57
92
  }, {
58
- readonly name: "airdrop";
59
- readonly type: "address";
60
- readonly internalType: "address";
93
+ readonly name: "baseAssetBalance";
94
+ readonly type: "uint256";
95
+ readonly internalType: "uint256";
61
96
  }, {
62
- readonly name: "referrals";
97
+ readonly name: "totalAssets";
98
+ readonly type: "uint256";
99
+ readonly internalType: "uint256";
100
+ }, {
101
+ readonly name: "userCredit";
102
+ readonly type: "uint256";
103
+ readonly internalType: "uint256";
104
+ }, {
105
+ readonly name: "credit";
106
+ readonly type: "uint256";
107
+ readonly internalType: "uint256";
108
+ }, {
109
+ readonly name: "agentData";
110
+ readonly type: "tuple[3]";
111
+ readonly internalType: "struct ILeveragedTokenHelper.AgentData[3]";
112
+ readonly components: readonly [{
113
+ readonly name: "slot";
114
+ readonly type: "uint8";
115
+ readonly internalType: "uint8";
116
+ }, {
117
+ readonly name: "agent";
118
+ readonly type: "address";
119
+ readonly internalType: "address";
120
+ }, {
121
+ readonly name: "createdAt";
122
+ readonly type: "uint256";
123
+ readonly internalType: "uint256";
124
+ }];
125
+ }, {
126
+ readonly name: "balanceOf";
127
+ readonly type: "uint256";
128
+ readonly internalType: "uint256";
129
+ }, {
130
+ readonly name: "mintPaused";
131
+ readonly type: "bool";
132
+ readonly internalType: "bool";
133
+ }, {
134
+ readonly name: "isStandbyMode";
135
+ readonly type: "bool";
136
+ readonly internalType: "bool";
137
+ }];
138
+ }];
139
+ readonly stateMutability: "view";
140
+ }, {
141
+ readonly type: "function";
142
+ readonly name: "getLeveragedTokens";
143
+ readonly inputs: readonly [{
144
+ readonly name: "user_";
145
+ readonly type: "address";
146
+ readonly internalType: "address";
147
+ }, {
148
+ readonly name: "onlyHeld_";
149
+ readonly type: "bool";
150
+ readonly internalType: "bool";
151
+ }];
152
+ readonly outputs: readonly [{
153
+ readonly name: "";
154
+ readonly type: "tuple[]";
155
+ readonly internalType: "struct ILeveragedTokenHelper.LeveragedTokenData[]";
156
+ readonly components: readonly [{
157
+ readonly name: "leveragedToken";
63
158
  readonly type: "address";
64
159
  readonly internalType: "address";
65
160
  }, {
66
- readonly name: "minTransactionSize";
161
+ readonly name: "marketId";
162
+ readonly type: "uint32";
163
+ readonly internalType: "uint32";
164
+ }, {
165
+ readonly name: "targetAsset";
166
+ readonly type: "string";
167
+ readonly internalType: "string";
168
+ }, {
169
+ readonly name: "targetLeverage";
67
170
  readonly type: "uint256";
68
171
  readonly internalType: "uint256";
69
172
  }, {
70
- readonly name: "minLockAmount";
173
+ readonly name: "isLong";
174
+ readonly type: "bool";
175
+ readonly internalType: "bool";
176
+ }, {
177
+ readonly name: "exchangeRate";
71
178
  readonly type: "uint256";
72
179
  readonly internalType: "uint256";
73
180
  }, {
74
- readonly name: "redemptionFee";
181
+ readonly name: "baseAssetBalance";
75
182
  readonly type: "uint256";
76
183
  readonly internalType: "uint256";
77
184
  }, {
78
- readonly name: "streamingFee";
185
+ readonly name: "totalAssets";
79
186
  readonly type: "uint256";
80
187
  readonly internalType: "uint256";
81
188
  }, {
82
- readonly name: "executeRedemptionFee";
189
+ readonly name: "userCredit";
83
190
  readonly type: "uint256";
84
191
  readonly internalType: "uint256";
85
192
  }, {
86
- readonly name: "treasuryFeeShare";
193
+ readonly name: "credit";
87
194
  readonly type: "uint256";
88
195
  readonly internalType: "uint256";
89
196
  }, {
90
- readonly name: "referrerRebate";
197
+ readonly name: "agentData";
198
+ readonly type: "tuple[3]";
199
+ readonly internalType: "struct ILeveragedTokenHelper.AgentData[3]";
200
+ readonly components: readonly [{
201
+ readonly name: "slot";
202
+ readonly type: "uint8";
203
+ readonly internalType: "uint8";
204
+ }, {
205
+ readonly name: "agent";
206
+ readonly type: "address";
207
+ readonly internalType: "address";
208
+ }, {
209
+ readonly name: "createdAt";
210
+ readonly type: "uint256";
211
+ readonly internalType: "uint256";
212
+ }];
213
+ }, {
214
+ readonly name: "balanceOf";
91
215
  readonly type: "uint256";
92
216
  readonly internalType: "uint256";
93
217
  }, {
94
- readonly name: "refereeRebate";
218
+ readonly name: "mintPaused";
219
+ readonly type: "bool";
220
+ readonly internalType: "bool";
221
+ }, {
222
+ readonly name: "isStandbyMode";
223
+ readonly type: "bool";
224
+ readonly internalType: "bool";
225
+ }];
226
+ }];
227
+ readonly stateMutability: "view";
228
+ }, {
229
+ readonly type: "function";
230
+ readonly name: "getLeveragedTokensCoreData";
231
+ readonly inputs: readonly [];
232
+ readonly outputs: readonly [{
233
+ readonly name: "";
234
+ readonly type: "tuple[]";
235
+ readonly internalType: "struct ILeveragedTokenHelper.LeveragedTokenCoreData[]";
236
+ readonly components: readonly [{
237
+ readonly name: "leveragedToken";
238
+ readonly type: "address";
239
+ readonly internalType: "address";
240
+ }, {
241
+ readonly name: "marketId";
242
+ readonly type: "uint32";
243
+ readonly internalType: "uint32";
244
+ }, {
245
+ readonly name: "targetAsset";
246
+ readonly type: "string";
247
+ readonly internalType: "string";
248
+ }, {
249
+ readonly name: "targetLeverage";
95
250
  readonly type: "uint256";
96
251
  readonly internalType: "uint256";
252
+ }, {
253
+ readonly name: "isLong";
254
+ readonly type: "bool";
255
+ readonly internalType: "bool";
256
+ }, {
257
+ readonly name: "baseAssetBalance";
258
+ readonly type: "uint256";
259
+ readonly internalType: "uint256";
260
+ }, {
261
+ readonly name: "credit";
262
+ readonly type: "uint256";
263
+ readonly internalType: "uint256";
264
+ }, {
265
+ readonly name: "agentData";
266
+ readonly type: "tuple[3]";
267
+ readonly internalType: "struct ILeveragedTokenHelper.AgentData[3]";
268
+ readonly components: readonly [{
269
+ readonly name: "slot";
270
+ readonly type: "uint8";
271
+ readonly internalType: "uint8";
272
+ }, {
273
+ readonly name: "agent";
274
+ readonly type: "address";
275
+ readonly internalType: "address";
276
+ }, {
277
+ readonly name: "createdAt";
278
+ readonly type: "uint256";
279
+ readonly internalType: "uint256";
280
+ }];
281
+ }, {
282
+ readonly name: "mintPaused";
283
+ readonly type: "bool";
284
+ readonly internalType: "bool";
285
+ }];
286
+ }];
287
+ readonly stateMutability: "view";
288
+ }, {
289
+ readonly type: "function";
290
+ readonly name: "getLeveragedTokensSnapshot";
291
+ readonly inputs: readonly [];
292
+ readonly outputs: readonly [{
293
+ readonly name: "";
294
+ readonly type: "tuple";
295
+ readonly internalType: "struct ILeveragedTokenHelper.LeveragedTokensSnapshot";
296
+ readonly components: readonly [{
297
+ readonly name: "blockNumber";
298
+ readonly type: "uint256";
299
+ readonly internalType: "uint256";
300
+ }, {
301
+ readonly name: "blockTimestamp";
302
+ readonly type: "uint256";
303
+ readonly internalType: "uint256";
304
+ }, {
305
+ readonly name: "l1BlockNumber";
306
+ readonly type: "uint256";
307
+ readonly internalType: "uint256";
308
+ }, {
309
+ readonly name: "tokens";
310
+ readonly type: "tuple[]";
311
+ readonly internalType: "struct ILeveragedTokenHelper.LeveragedTokenSnapshotData[]";
312
+ readonly components: readonly [{
313
+ readonly name: "leveragedToken";
314
+ readonly type: "address";
315
+ readonly internalType: "address";
316
+ }, {
317
+ readonly name: "exchangeRate";
318
+ readonly type: "uint256";
319
+ readonly internalType: "uint256";
320
+ }, {
321
+ readonly name: "baseAssetContractBalance";
322
+ readonly type: "uint256";
323
+ readonly internalType: "uint256";
324
+ }, {
325
+ readonly name: "baseAssetUserCredit";
326
+ readonly type: "uint256";
327
+ readonly internalType: "uint256";
328
+ }, {
329
+ readonly name: "usdcSpotBalance";
330
+ readonly type: "uint256";
331
+ readonly internalType: "uint256";
332
+ }, {
333
+ readonly name: "usdcPerpBalance";
334
+ readonly type: "uint256";
335
+ readonly internalType: "uint256";
336
+ }, {
337
+ readonly name: "usdcMargin";
338
+ readonly type: "uint256";
339
+ readonly internalType: "uint256";
340
+ }, {
341
+ readonly name: "totalAssets";
342
+ readonly type: "uint256";
343
+ readonly internalType: "uint256";
344
+ }, {
345
+ readonly name: "notionalValue";
346
+ readonly type: "uint256";
347
+ readonly internalType: "uint256";
348
+ }];
97
349
  }];
98
350
  }];
99
351
  readonly stateMutability: "view";
352
+ }, {
353
+ readonly type: "error";
354
+ readonly name: "DivisionByZero";
355
+ readonly inputs: readonly [];
356
+ }, {
357
+ readonly type: "error";
358
+ readonly name: "PrecompileLib__L1BlockNumberPrecompileFailed";
359
+ readonly inputs: readonly [];
100
360
  }];
@@ -15,117 +15,452 @@ exports.globalStorageHelperAbi = [
15
15
  },
16
16
  {
17
17
  type: "function",
18
- name: "getGlobalStorageData",
19
- inputs: [],
18
+ name: "getLeveragedTokenPositionData",
19
+ inputs: [
20
+ {
21
+ name: "leveragedTokenAddress_",
22
+ type: "address",
23
+ internalType: "address",
24
+ },
25
+ ],
20
26
  outputs: [
21
27
  {
22
28
  name: "",
23
29
  type: "tuple",
24
- internalType: "struct IGlobalStorageHelper.GlobalStorageData",
30
+ internalType: "struct ILeveragedTokenHelper.LeveragedTokenPositionData",
25
31
  components: [
26
32
  {
27
- name: "owner",
33
+ name: "leveragedToken",
28
34
  type: "address",
29
35
  internalType: "address",
30
36
  },
31
37
  {
32
- name: "ltImplementation",
33
- type: "address",
34
- internalType: "address",
38
+ name: "baseAssetContractBalance",
39
+ type: "uint256",
40
+ internalType: "uint256",
35
41
  },
36
42
  {
37
- name: "baseAsset",
38
- type: "address",
39
- internalType: "address",
43
+ name: "baseAssetUserCredit",
44
+ type: "uint256",
45
+ internalType: "uint256",
40
46
  },
41
47
  {
42
- name: "treasury",
43
- type: "address",
44
- internalType: "address",
48
+ name: "usdcSpotBalance",
49
+ type: "uint256",
50
+ internalType: "uint256",
45
51
  },
46
52
  {
47
- name: "factory",
48
- type: "address",
49
- internalType: "address",
53
+ name: "usdcPerpBalance",
54
+ type: "uint256",
55
+ internalType: "uint256",
50
56
  },
51
57
  {
52
- name: "hyperliquidHandler",
53
- type: "address",
54
- internalType: "address",
58
+ name: "usdcMargin",
59
+ type: "uint256",
60
+ internalType: "uint256",
55
61
  },
56
62
  {
57
- name: "feeHandler",
58
- type: "address",
59
- internalType: "address",
63
+ name: "notionalValue",
64
+ type: "uint256",
65
+ internalType: "uint256",
66
+ },
67
+ {
68
+ name: "effectiveLeverage",
69
+ type: "uint256",
70
+ internalType: "uint256",
71
+ },
72
+ {
73
+ name: "targetLeverage",
74
+ type: "uint256",
75
+ internalType: "uint256",
60
76
  },
77
+ ],
78
+ },
79
+ ],
80
+ stateMutability: "view",
81
+ },
82
+ {
83
+ type: "function",
84
+ name: "getLeveragedTokens",
85
+ inputs: [],
86
+ outputs: [
87
+ {
88
+ name: "",
89
+ type: "tuple[]",
90
+ internalType: "struct ILeveragedTokenHelper.LeveragedTokenData[]",
91
+ components: [
61
92
  {
62
- name: "bounce",
93
+ name: "leveragedToken",
63
94
  type: "address",
64
95
  internalType: "address",
65
96
  },
66
97
  {
67
- name: "allMintsPaused",
98
+ name: "marketId",
99
+ type: "uint32",
100
+ internalType: "uint32",
101
+ },
102
+ {
103
+ name: "targetAsset",
104
+ type: "string",
105
+ internalType: "string",
106
+ },
107
+ {
108
+ name: "targetLeverage",
109
+ type: "uint256",
110
+ internalType: "uint256",
111
+ },
112
+ {
113
+ name: "isLong",
68
114
  type: "bool",
69
115
  internalType: "bool",
70
116
  },
71
117
  {
72
- name: "vesting",
73
- type: "address",
74
- internalType: "address",
118
+ name: "exchangeRate",
119
+ type: "uint256",
120
+ internalType: "uint256",
75
121
  },
76
122
  {
77
- name: "airdrop",
78
- type: "address",
79
- internalType: "address",
123
+ name: "baseAssetBalance",
124
+ type: "uint256",
125
+ internalType: "uint256",
126
+ },
127
+ {
128
+ name: "totalAssets",
129
+ type: "uint256",
130
+ internalType: "uint256",
131
+ },
132
+ {
133
+ name: "userCredit",
134
+ type: "uint256",
135
+ internalType: "uint256",
136
+ },
137
+ {
138
+ name: "credit",
139
+ type: "uint256",
140
+ internalType: "uint256",
141
+ },
142
+ {
143
+ name: "agentData",
144
+ type: "tuple[3]",
145
+ internalType: "struct ILeveragedTokenHelper.AgentData[3]",
146
+ components: [
147
+ {
148
+ name: "slot",
149
+ type: "uint8",
150
+ internalType: "uint8",
151
+ },
152
+ {
153
+ name: "agent",
154
+ type: "address",
155
+ internalType: "address",
156
+ },
157
+ {
158
+ name: "createdAt",
159
+ type: "uint256",
160
+ internalType: "uint256",
161
+ },
162
+ ],
163
+ },
164
+ {
165
+ name: "balanceOf",
166
+ type: "uint256",
167
+ internalType: "uint256",
168
+ },
169
+ {
170
+ name: "mintPaused",
171
+ type: "bool",
172
+ internalType: "bool",
80
173
  },
81
174
  {
82
- name: "referrals",
175
+ name: "isStandbyMode",
176
+ type: "bool",
177
+ internalType: "bool",
178
+ },
179
+ ],
180
+ },
181
+ ],
182
+ stateMutability: "view",
183
+ },
184
+ {
185
+ type: "function",
186
+ name: "getLeveragedTokens",
187
+ inputs: [
188
+ {
189
+ name: "user_",
190
+ type: "address",
191
+ internalType: "address",
192
+ },
193
+ {
194
+ name: "onlyHeld_",
195
+ type: "bool",
196
+ internalType: "bool",
197
+ },
198
+ ],
199
+ outputs: [
200
+ {
201
+ name: "",
202
+ type: "tuple[]",
203
+ internalType: "struct ILeveragedTokenHelper.LeveragedTokenData[]",
204
+ components: [
205
+ {
206
+ name: "leveragedToken",
83
207
  type: "address",
84
208
  internalType: "address",
85
209
  },
86
210
  {
87
- name: "minTransactionSize",
211
+ name: "marketId",
212
+ type: "uint32",
213
+ internalType: "uint32",
214
+ },
215
+ {
216
+ name: "targetAsset",
217
+ type: "string",
218
+ internalType: "string",
219
+ },
220
+ {
221
+ name: "targetLeverage",
222
+ type: "uint256",
223
+ internalType: "uint256",
224
+ },
225
+ {
226
+ name: "isLong",
227
+ type: "bool",
228
+ internalType: "bool",
229
+ },
230
+ {
231
+ name: "exchangeRate",
232
+ type: "uint256",
233
+ internalType: "uint256",
234
+ },
235
+ {
236
+ name: "baseAssetBalance",
88
237
  type: "uint256",
89
238
  internalType: "uint256",
90
239
  },
91
240
  {
92
- name: "minLockAmount",
241
+ name: "totalAssets",
93
242
  type: "uint256",
94
243
  internalType: "uint256",
95
244
  },
96
245
  {
97
- name: "redemptionFee",
246
+ name: "userCredit",
247
+ type: "uint256",
248
+ internalType: "uint256",
249
+ },
250
+ {
251
+ name: "credit",
252
+ type: "uint256",
253
+ internalType: "uint256",
254
+ },
255
+ {
256
+ name: "agentData",
257
+ type: "tuple[3]",
258
+ internalType: "struct ILeveragedTokenHelper.AgentData[3]",
259
+ components: [
260
+ {
261
+ name: "slot",
262
+ type: "uint8",
263
+ internalType: "uint8",
264
+ },
265
+ {
266
+ name: "agent",
267
+ type: "address",
268
+ internalType: "address",
269
+ },
270
+ {
271
+ name: "createdAt",
272
+ type: "uint256",
273
+ internalType: "uint256",
274
+ },
275
+ ],
276
+ },
277
+ {
278
+ name: "balanceOf",
279
+ type: "uint256",
280
+ internalType: "uint256",
281
+ },
282
+ {
283
+ name: "mintPaused",
284
+ type: "bool",
285
+ internalType: "bool",
286
+ },
287
+ {
288
+ name: "isStandbyMode",
289
+ type: "bool",
290
+ internalType: "bool",
291
+ },
292
+ ],
293
+ },
294
+ ],
295
+ stateMutability: "view",
296
+ },
297
+ {
298
+ type: "function",
299
+ name: "getLeveragedTokensCoreData",
300
+ inputs: [],
301
+ outputs: [
302
+ {
303
+ name: "",
304
+ type: "tuple[]",
305
+ internalType: "struct ILeveragedTokenHelper.LeveragedTokenCoreData[]",
306
+ components: [
307
+ {
308
+ name: "leveragedToken",
309
+ type: "address",
310
+ internalType: "address",
311
+ },
312
+ {
313
+ name: "marketId",
314
+ type: "uint32",
315
+ internalType: "uint32",
316
+ },
317
+ {
318
+ name: "targetAsset",
319
+ type: "string",
320
+ internalType: "string",
321
+ },
322
+ {
323
+ name: "targetLeverage",
98
324
  type: "uint256",
99
325
  internalType: "uint256",
100
326
  },
101
327
  {
102
- name: "streamingFee",
328
+ name: "isLong",
329
+ type: "bool",
330
+ internalType: "bool",
331
+ },
332
+ {
333
+ name: "baseAssetBalance",
103
334
  type: "uint256",
104
335
  internalType: "uint256",
105
336
  },
106
337
  {
107
- name: "executeRedemptionFee",
338
+ name: "credit",
108
339
  type: "uint256",
109
340
  internalType: "uint256",
110
341
  },
111
342
  {
112
- name: "treasuryFeeShare",
343
+ name: "agentData",
344
+ type: "tuple[3]",
345
+ internalType: "struct ILeveragedTokenHelper.AgentData[3]",
346
+ components: [
347
+ {
348
+ name: "slot",
349
+ type: "uint8",
350
+ internalType: "uint8",
351
+ },
352
+ {
353
+ name: "agent",
354
+ type: "address",
355
+ internalType: "address",
356
+ },
357
+ {
358
+ name: "createdAt",
359
+ type: "uint256",
360
+ internalType: "uint256",
361
+ },
362
+ ],
363
+ },
364
+ {
365
+ name: "mintPaused",
366
+ type: "bool",
367
+ internalType: "bool",
368
+ },
369
+ ],
370
+ },
371
+ ],
372
+ stateMutability: "view",
373
+ },
374
+ {
375
+ type: "function",
376
+ name: "getLeveragedTokensSnapshot",
377
+ inputs: [],
378
+ outputs: [
379
+ {
380
+ name: "",
381
+ type: "tuple",
382
+ internalType: "struct ILeveragedTokenHelper.LeveragedTokensSnapshot",
383
+ components: [
384
+ {
385
+ name: "blockNumber",
113
386
  type: "uint256",
114
387
  internalType: "uint256",
115
388
  },
116
389
  {
117
- name: "referrerRebate",
390
+ name: "blockTimestamp",
118
391
  type: "uint256",
119
392
  internalType: "uint256",
120
393
  },
121
394
  {
122
- name: "refereeRebate",
395
+ name: "l1BlockNumber",
123
396
  type: "uint256",
124
397
  internalType: "uint256",
125
398
  },
399
+ {
400
+ name: "tokens",
401
+ type: "tuple[]",
402
+ internalType: "struct ILeveragedTokenHelper.LeveragedTokenSnapshotData[]",
403
+ components: [
404
+ {
405
+ name: "leveragedToken",
406
+ type: "address",
407
+ internalType: "address",
408
+ },
409
+ {
410
+ name: "exchangeRate",
411
+ type: "uint256",
412
+ internalType: "uint256",
413
+ },
414
+ {
415
+ name: "baseAssetContractBalance",
416
+ type: "uint256",
417
+ internalType: "uint256",
418
+ },
419
+ {
420
+ name: "baseAssetUserCredit",
421
+ type: "uint256",
422
+ internalType: "uint256",
423
+ },
424
+ {
425
+ name: "usdcSpotBalance",
426
+ type: "uint256",
427
+ internalType: "uint256",
428
+ },
429
+ {
430
+ name: "usdcPerpBalance",
431
+ type: "uint256",
432
+ internalType: "uint256",
433
+ },
434
+ {
435
+ name: "usdcMargin",
436
+ type: "uint256",
437
+ internalType: "uint256",
438
+ },
439
+ {
440
+ name: "totalAssets",
441
+ type: "uint256",
442
+ internalType: "uint256",
443
+ },
444
+ {
445
+ name: "notionalValue",
446
+ type: "uint256",
447
+ internalType: "uint256",
448
+ },
449
+ ],
450
+ },
126
451
  ],
127
452
  },
128
453
  ],
129
454
  stateMutability: "view",
130
455
  },
456
+ {
457
+ type: "error",
458
+ name: "DivisionByZero",
459
+ inputs: [],
460
+ },
461
+ {
462
+ type: "error",
463
+ name: "PrecompileLib__L1BlockNumberPrecompileFailed",
464
+ inputs: [],
465
+ },
131
466
  ];
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export declare const FACTORY_ADDRESS = "0xeD8bCDe433EB7c4B69DB1235483bf0Edb726Fc
3
3
  export declare const GLOBAL_STORAGE_ADDRESS = "0xa07d06383c1863c8A54d427aC890643d76cc03ff";
4
4
  export declare const GLOBAL_STORAGE_HELPER_ADDRESS = "0x99836aCBD207d5BCa57E3Fe0448bD1AB0A4BDf5C";
5
5
  export declare const HYPERLIQUID_HANDLER_ADDRESS = "0xE57F983f3F317b2feF5585E660ed24980Ba7C3dA";
6
- export declare const LEVERAGED_TOKEN_HELPER_ADDRESS = "0x9F53b119025733d174d514b13B6a061f1C482f8C";
6
+ export declare const LEVERAGED_TOKEN_HELPER_ADDRESS = "0x16cd3D707E0D32794889A530fEbF6bC4232711e5";
7
7
  export declare const LEVERAGED_TOKEN_IMPLEMENTATION_ADDRESS = "0x20132f1804Df40Acc9b5115F47191016a5258721";
8
8
  export declare const REFERRALS_ADDRESS = "0xfD3A6323878Fc991447CcDd4c644ab419afC6f76";
9
9
  export declare const USDC_ADDRESS = "0xb88339CB7199b77E23DB6E890353E22632Ba630f";
@@ -1087,95 +1087,355 @@ export declare const GLOBAL_STORAGE_HELPER_ABI: readonly [{
1087
1087
  readonly stateMutability: "nonpayable";
1088
1088
  }, {
1089
1089
  readonly type: "function";
1090
- readonly name: "getGlobalStorageData";
1091
- readonly inputs: readonly [];
1090
+ readonly name: "getLeveragedTokenPositionData";
1091
+ readonly inputs: readonly [{
1092
+ readonly name: "leveragedTokenAddress_";
1093
+ readonly type: "address";
1094
+ readonly internalType: "address";
1095
+ }];
1092
1096
  readonly outputs: readonly [{
1093
1097
  readonly name: "";
1094
1098
  readonly type: "tuple";
1095
- readonly internalType: "struct IGlobalStorageHelper.GlobalStorageData";
1099
+ readonly internalType: "struct ILeveragedTokenHelper.LeveragedTokenPositionData";
1096
1100
  readonly components: readonly [{
1097
- readonly name: "owner";
1101
+ readonly name: "leveragedToken";
1098
1102
  readonly type: "address";
1099
1103
  readonly internalType: "address";
1100
1104
  }, {
1101
- readonly name: "ltImplementation";
1102
- readonly type: "address";
1103
- readonly internalType: "address";
1105
+ readonly name: "baseAssetContractBalance";
1106
+ readonly type: "uint256";
1107
+ readonly internalType: "uint256";
1104
1108
  }, {
1105
- readonly name: "baseAsset";
1106
- readonly type: "address";
1107
- readonly internalType: "address";
1109
+ readonly name: "baseAssetUserCredit";
1110
+ readonly type: "uint256";
1111
+ readonly internalType: "uint256";
1108
1112
  }, {
1109
- readonly name: "treasury";
1110
- readonly type: "address";
1111
- readonly internalType: "address";
1113
+ readonly name: "usdcSpotBalance";
1114
+ readonly type: "uint256";
1115
+ readonly internalType: "uint256";
1112
1116
  }, {
1113
- readonly name: "factory";
1114
- readonly type: "address";
1115
- readonly internalType: "address";
1117
+ readonly name: "usdcPerpBalance";
1118
+ readonly type: "uint256";
1119
+ readonly internalType: "uint256";
1116
1120
  }, {
1117
- readonly name: "hyperliquidHandler";
1118
- readonly type: "address";
1119
- readonly internalType: "address";
1121
+ readonly name: "usdcMargin";
1122
+ readonly type: "uint256";
1123
+ readonly internalType: "uint256";
1120
1124
  }, {
1121
- readonly name: "feeHandler";
1122
- readonly type: "address";
1123
- readonly internalType: "address";
1125
+ readonly name: "notionalValue";
1126
+ readonly type: "uint256";
1127
+ readonly internalType: "uint256";
1124
1128
  }, {
1125
- readonly name: "bounce";
1129
+ readonly name: "effectiveLeverage";
1130
+ readonly type: "uint256";
1131
+ readonly internalType: "uint256";
1132
+ }, {
1133
+ readonly name: "targetLeverage";
1134
+ readonly type: "uint256";
1135
+ readonly internalType: "uint256";
1136
+ }];
1137
+ }];
1138
+ readonly stateMutability: "view";
1139
+ }, {
1140
+ readonly type: "function";
1141
+ readonly name: "getLeveragedTokens";
1142
+ readonly inputs: readonly [];
1143
+ readonly outputs: readonly [{
1144
+ readonly name: "";
1145
+ readonly type: "tuple[]";
1146
+ readonly internalType: "struct ILeveragedTokenHelper.LeveragedTokenData[]";
1147
+ readonly components: readonly [{
1148
+ readonly name: "leveragedToken";
1126
1149
  readonly type: "address";
1127
1150
  readonly internalType: "address";
1128
1151
  }, {
1129
- readonly name: "allMintsPaused";
1152
+ readonly name: "marketId";
1153
+ readonly type: "uint32";
1154
+ readonly internalType: "uint32";
1155
+ }, {
1156
+ readonly name: "targetAsset";
1157
+ readonly type: "string";
1158
+ readonly internalType: "string";
1159
+ }, {
1160
+ readonly name: "targetLeverage";
1161
+ readonly type: "uint256";
1162
+ readonly internalType: "uint256";
1163
+ }, {
1164
+ readonly name: "isLong";
1130
1165
  readonly type: "bool";
1131
1166
  readonly internalType: "bool";
1132
1167
  }, {
1133
- readonly name: "vesting";
1134
- readonly type: "address";
1135
- readonly internalType: "address";
1168
+ readonly name: "exchangeRate";
1169
+ readonly type: "uint256";
1170
+ readonly internalType: "uint256";
1136
1171
  }, {
1137
- readonly name: "airdrop";
1138
- readonly type: "address";
1139
- readonly internalType: "address";
1172
+ readonly name: "baseAssetBalance";
1173
+ readonly type: "uint256";
1174
+ readonly internalType: "uint256";
1175
+ }, {
1176
+ readonly name: "totalAssets";
1177
+ readonly type: "uint256";
1178
+ readonly internalType: "uint256";
1179
+ }, {
1180
+ readonly name: "userCredit";
1181
+ readonly type: "uint256";
1182
+ readonly internalType: "uint256";
1183
+ }, {
1184
+ readonly name: "credit";
1185
+ readonly type: "uint256";
1186
+ readonly internalType: "uint256";
1187
+ }, {
1188
+ readonly name: "agentData";
1189
+ readonly type: "tuple[3]";
1190
+ readonly internalType: "struct ILeveragedTokenHelper.AgentData[3]";
1191
+ readonly components: readonly [{
1192
+ readonly name: "slot";
1193
+ readonly type: "uint8";
1194
+ readonly internalType: "uint8";
1195
+ }, {
1196
+ readonly name: "agent";
1197
+ readonly type: "address";
1198
+ readonly internalType: "address";
1199
+ }, {
1200
+ readonly name: "createdAt";
1201
+ readonly type: "uint256";
1202
+ readonly internalType: "uint256";
1203
+ }];
1204
+ }, {
1205
+ readonly name: "balanceOf";
1206
+ readonly type: "uint256";
1207
+ readonly internalType: "uint256";
1208
+ }, {
1209
+ readonly name: "mintPaused";
1210
+ readonly type: "bool";
1211
+ readonly internalType: "bool";
1140
1212
  }, {
1141
- readonly name: "referrals";
1213
+ readonly name: "isStandbyMode";
1214
+ readonly type: "bool";
1215
+ readonly internalType: "bool";
1216
+ }];
1217
+ }];
1218
+ readonly stateMutability: "view";
1219
+ }, {
1220
+ readonly type: "function";
1221
+ readonly name: "getLeveragedTokens";
1222
+ readonly inputs: readonly [{
1223
+ readonly name: "user_";
1224
+ readonly type: "address";
1225
+ readonly internalType: "address";
1226
+ }, {
1227
+ readonly name: "onlyHeld_";
1228
+ readonly type: "bool";
1229
+ readonly internalType: "bool";
1230
+ }];
1231
+ readonly outputs: readonly [{
1232
+ readonly name: "";
1233
+ readonly type: "tuple[]";
1234
+ readonly internalType: "struct ILeveragedTokenHelper.LeveragedTokenData[]";
1235
+ readonly components: readonly [{
1236
+ readonly name: "leveragedToken";
1142
1237
  readonly type: "address";
1143
1238
  readonly internalType: "address";
1144
1239
  }, {
1145
- readonly name: "minTransactionSize";
1240
+ readonly name: "marketId";
1241
+ readonly type: "uint32";
1242
+ readonly internalType: "uint32";
1243
+ }, {
1244
+ readonly name: "targetAsset";
1245
+ readonly type: "string";
1246
+ readonly internalType: "string";
1247
+ }, {
1248
+ readonly name: "targetLeverage";
1249
+ readonly type: "uint256";
1250
+ readonly internalType: "uint256";
1251
+ }, {
1252
+ readonly name: "isLong";
1253
+ readonly type: "bool";
1254
+ readonly internalType: "bool";
1255
+ }, {
1256
+ readonly name: "exchangeRate";
1257
+ readonly type: "uint256";
1258
+ readonly internalType: "uint256";
1259
+ }, {
1260
+ readonly name: "baseAssetBalance";
1261
+ readonly type: "uint256";
1262
+ readonly internalType: "uint256";
1263
+ }, {
1264
+ readonly name: "totalAssets";
1265
+ readonly type: "uint256";
1266
+ readonly internalType: "uint256";
1267
+ }, {
1268
+ readonly name: "userCredit";
1146
1269
  readonly type: "uint256";
1147
1270
  readonly internalType: "uint256";
1148
1271
  }, {
1149
- readonly name: "minLockAmount";
1272
+ readonly name: "credit";
1150
1273
  readonly type: "uint256";
1151
1274
  readonly internalType: "uint256";
1152
1275
  }, {
1153
- readonly name: "redemptionFee";
1276
+ readonly name: "agentData";
1277
+ readonly type: "tuple[3]";
1278
+ readonly internalType: "struct ILeveragedTokenHelper.AgentData[3]";
1279
+ readonly components: readonly [{
1280
+ readonly name: "slot";
1281
+ readonly type: "uint8";
1282
+ readonly internalType: "uint8";
1283
+ }, {
1284
+ readonly name: "agent";
1285
+ readonly type: "address";
1286
+ readonly internalType: "address";
1287
+ }, {
1288
+ readonly name: "createdAt";
1289
+ readonly type: "uint256";
1290
+ readonly internalType: "uint256";
1291
+ }];
1292
+ }, {
1293
+ readonly name: "balanceOf";
1294
+ readonly type: "uint256";
1295
+ readonly internalType: "uint256";
1296
+ }, {
1297
+ readonly name: "mintPaused";
1298
+ readonly type: "bool";
1299
+ readonly internalType: "bool";
1300
+ }, {
1301
+ readonly name: "isStandbyMode";
1302
+ readonly type: "bool";
1303
+ readonly internalType: "bool";
1304
+ }];
1305
+ }];
1306
+ readonly stateMutability: "view";
1307
+ }, {
1308
+ readonly type: "function";
1309
+ readonly name: "getLeveragedTokensCoreData";
1310
+ readonly inputs: readonly [];
1311
+ readonly outputs: readonly [{
1312
+ readonly name: "";
1313
+ readonly type: "tuple[]";
1314
+ readonly internalType: "struct ILeveragedTokenHelper.LeveragedTokenCoreData[]";
1315
+ readonly components: readonly [{
1316
+ readonly name: "leveragedToken";
1317
+ readonly type: "address";
1318
+ readonly internalType: "address";
1319
+ }, {
1320
+ readonly name: "marketId";
1321
+ readonly type: "uint32";
1322
+ readonly internalType: "uint32";
1323
+ }, {
1324
+ readonly name: "targetAsset";
1325
+ readonly type: "string";
1326
+ readonly internalType: "string";
1327
+ }, {
1328
+ readonly name: "targetLeverage";
1154
1329
  readonly type: "uint256";
1155
1330
  readonly internalType: "uint256";
1156
1331
  }, {
1157
- readonly name: "streamingFee";
1332
+ readonly name: "isLong";
1333
+ readonly type: "bool";
1334
+ readonly internalType: "bool";
1335
+ }, {
1336
+ readonly name: "baseAssetBalance";
1158
1337
  readonly type: "uint256";
1159
1338
  readonly internalType: "uint256";
1160
1339
  }, {
1161
- readonly name: "executeRedemptionFee";
1340
+ readonly name: "credit";
1162
1341
  readonly type: "uint256";
1163
1342
  readonly internalType: "uint256";
1164
1343
  }, {
1165
- readonly name: "treasuryFeeShare";
1344
+ readonly name: "agentData";
1345
+ readonly type: "tuple[3]";
1346
+ readonly internalType: "struct ILeveragedTokenHelper.AgentData[3]";
1347
+ readonly components: readonly [{
1348
+ readonly name: "slot";
1349
+ readonly type: "uint8";
1350
+ readonly internalType: "uint8";
1351
+ }, {
1352
+ readonly name: "agent";
1353
+ readonly type: "address";
1354
+ readonly internalType: "address";
1355
+ }, {
1356
+ readonly name: "createdAt";
1357
+ readonly type: "uint256";
1358
+ readonly internalType: "uint256";
1359
+ }];
1360
+ }, {
1361
+ readonly name: "mintPaused";
1362
+ readonly type: "bool";
1363
+ readonly internalType: "bool";
1364
+ }];
1365
+ }];
1366
+ readonly stateMutability: "view";
1367
+ }, {
1368
+ readonly type: "function";
1369
+ readonly name: "getLeveragedTokensSnapshot";
1370
+ readonly inputs: readonly [];
1371
+ readonly outputs: readonly [{
1372
+ readonly name: "";
1373
+ readonly type: "tuple";
1374
+ readonly internalType: "struct ILeveragedTokenHelper.LeveragedTokensSnapshot";
1375
+ readonly components: readonly [{
1376
+ readonly name: "blockNumber";
1166
1377
  readonly type: "uint256";
1167
1378
  readonly internalType: "uint256";
1168
1379
  }, {
1169
- readonly name: "referrerRebate";
1380
+ readonly name: "blockTimestamp";
1170
1381
  readonly type: "uint256";
1171
1382
  readonly internalType: "uint256";
1172
1383
  }, {
1173
- readonly name: "refereeRebate";
1384
+ readonly name: "l1BlockNumber";
1174
1385
  readonly type: "uint256";
1175
1386
  readonly internalType: "uint256";
1387
+ }, {
1388
+ readonly name: "tokens";
1389
+ readonly type: "tuple[]";
1390
+ readonly internalType: "struct ILeveragedTokenHelper.LeveragedTokenSnapshotData[]";
1391
+ readonly components: readonly [{
1392
+ readonly name: "leveragedToken";
1393
+ readonly type: "address";
1394
+ readonly internalType: "address";
1395
+ }, {
1396
+ readonly name: "exchangeRate";
1397
+ readonly type: "uint256";
1398
+ readonly internalType: "uint256";
1399
+ }, {
1400
+ readonly name: "baseAssetContractBalance";
1401
+ readonly type: "uint256";
1402
+ readonly internalType: "uint256";
1403
+ }, {
1404
+ readonly name: "baseAssetUserCredit";
1405
+ readonly type: "uint256";
1406
+ readonly internalType: "uint256";
1407
+ }, {
1408
+ readonly name: "usdcSpotBalance";
1409
+ readonly type: "uint256";
1410
+ readonly internalType: "uint256";
1411
+ }, {
1412
+ readonly name: "usdcPerpBalance";
1413
+ readonly type: "uint256";
1414
+ readonly internalType: "uint256";
1415
+ }, {
1416
+ readonly name: "usdcMargin";
1417
+ readonly type: "uint256";
1418
+ readonly internalType: "uint256";
1419
+ }, {
1420
+ readonly name: "totalAssets";
1421
+ readonly type: "uint256";
1422
+ readonly internalType: "uint256";
1423
+ }, {
1424
+ readonly name: "notionalValue";
1425
+ readonly type: "uint256";
1426
+ readonly internalType: "uint256";
1427
+ }];
1176
1428
  }];
1177
1429
  }];
1178
1430
  readonly stateMutability: "view";
1431
+ }, {
1432
+ readonly type: "error";
1433
+ readonly name: "DivisionByZero";
1434
+ readonly inputs: readonly [];
1435
+ }, {
1436
+ readonly type: "error";
1437
+ readonly name: "PrecompileLib__L1BlockNumberPrecompileFailed";
1438
+ readonly inputs: readonly [];
1179
1439
  }];
1180
1440
  export declare const HYPERLIQUID_HANDLER_ABI: readonly [{
1181
1441
  readonly type: "function";
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ exports.FACTORY_ADDRESS = "0xeD8bCDe433EB7c4B69DB1235483bf0Edb726Fc1B";
14
14
  exports.GLOBAL_STORAGE_ADDRESS = "0xa07d06383c1863c8A54d427aC890643d76cc03ff";
15
15
  exports.GLOBAL_STORAGE_HELPER_ADDRESS = "0x99836aCBD207d5BCa57E3Fe0448bD1AB0A4BDf5C";
16
16
  exports.HYPERLIQUID_HANDLER_ADDRESS = "0xE57F983f3F317b2feF5585E660ed24980Ba7C3dA";
17
- exports.LEVERAGED_TOKEN_HELPER_ADDRESS = "0x9F53b119025733d174d514b13B6a061f1C482f8C";
17
+ exports.LEVERAGED_TOKEN_HELPER_ADDRESS = "0x16cd3D707E0D32794889A530fEbF6bC4232711e5";
18
18
  exports.LEVERAGED_TOKEN_IMPLEMENTATION_ADDRESS = "0x20132f1804Df40Acc9b5115F47191016a5258721";
19
19
  exports.REFERRALS_ADDRESS = "0xfD3A6323878Fc991447CcDd4c644ab419afC6f76";
20
20
  exports.USDC_ADDRESS = "0xb88339CB7199b77E23DB6E890353E22632Ba630f";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bouncetech/contracts",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Smart contract addresses and ABIs for Bounce Tech - DeFi Leveraged Token Protocol on HyperEVM",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",