@bouncetech/contracts 1.0.1 → 1.0.3
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/README.md +27 -8
- package/abis/factory-abi.json +156 -6
- package/abis/global-storage-abi.json +1185 -0
- package/abis/global-storage-helper-abi.json +128 -0
- package/abis/hyperliquid-handler-abi.json +151 -0
- package/abis/leveraged-token-abi.json +1311 -1
- package/abis/leveraged-token-helper-abi.json +443 -0
- package/abis/referrals-abi.json +422 -0
- package/addresses.json +1 -1
- package/dist/index.d.ts +267 -3
- package/dist/index.js +12 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,7 +34,15 @@ const leveragedTokenAddress = LEVERAGED_TOKEN_IMPLEMENTATION_ADDRESS;
|
|
|
34
34
|
### Import Contract ABIs
|
|
35
35
|
|
|
36
36
|
```typescript
|
|
37
|
-
import {
|
|
37
|
+
import {
|
|
38
|
+
FACTORY_ABI,
|
|
39
|
+
LEVERAGED_TOKEN_ABI,
|
|
40
|
+
GLOBAL_STORAGE_ABI,
|
|
41
|
+
GLOBAL_STORAGE_HELPER_ABI,
|
|
42
|
+
HYPERLIQUID_HANDLER_ABI,
|
|
43
|
+
LEVERAGED_TOKEN_HELPER_ABI,
|
|
44
|
+
REFERRALS_ABI,
|
|
45
|
+
} from "@bouncetech/contracts";
|
|
38
46
|
|
|
39
47
|
// Use with ethers.js
|
|
40
48
|
import { Contract } from "ethers";
|
|
@@ -55,18 +63,29 @@ const result = await client.readContract({
|
|
|
55
63
|
|
|
56
64
|
### Available Contracts
|
|
57
65
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
- **
|
|
61
|
-
- **
|
|
62
|
-
- **
|
|
63
|
-
- **
|
|
64
|
-
- **
|
|
66
|
+
The following contracts are available through this package:
|
|
67
|
+
|
|
68
|
+
- **Factory**
|
|
69
|
+
- **GlobalStorage**
|
|
70
|
+
- **GlobalStorageHelper**
|
|
71
|
+
- **HyperliquidHandler**
|
|
72
|
+
- **LeveragedTokenHelper**
|
|
73
|
+
- **LeveragedTokenImplementation**
|
|
74
|
+
- **Referrals**
|
|
75
|
+
|
|
76
|
+
For the latest contract addresses, see `addresses.json` in the package or import them programmatically using the exported address constants.
|
|
65
77
|
|
|
66
78
|
### Available ABIs
|
|
67
79
|
|
|
80
|
+
The following ABIs are available:
|
|
81
|
+
|
|
68
82
|
- `FACTORY_ABI` - Factory contract ABI
|
|
83
|
+
- `GLOBAL_STORAGE_ABI` - GlobalStorage contract ABI
|
|
84
|
+
- `GLOBAL_STORAGE_HELPER_ABI` - GlobalStorageHelper contract ABI
|
|
85
|
+
- `HYPERLIQUID_HANDLER_ABI` - HyperliquidHandler contract ABI
|
|
69
86
|
- `LEVERAGED_TOKEN_ABI` - Leveraged Token contract ABI
|
|
87
|
+
- `LEVERAGED_TOKEN_HELPER_ABI` - LeveragedTokenHelper contract ABI
|
|
88
|
+
- `REFERRALS_ABI` - Referrals contract ABI
|
|
70
89
|
|
|
71
90
|
## Updating
|
|
72
91
|
|
package/abis/factory-abi.json
CHANGED
|
@@ -1,17 +1,62 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"type": "constructor",
|
|
4
|
+
"inputs": [
|
|
5
|
+
{
|
|
6
|
+
"name": "globalStorage_",
|
|
7
|
+
"type": "address",
|
|
8
|
+
"internalType": "address"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"stateMutability": "nonpayable"
|
|
12
|
+
},
|
|
2
13
|
{
|
|
3
14
|
"type": "function",
|
|
4
|
-
"name": "
|
|
15
|
+
"name": "createLt",
|
|
5
16
|
"inputs": [
|
|
6
17
|
{
|
|
7
|
-
"name": "
|
|
18
|
+
"name": "marketId_",
|
|
19
|
+
"type": "uint32",
|
|
20
|
+
"internalType": "uint32"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "targetLeverage_",
|
|
24
|
+
"type": "uint256",
|
|
25
|
+
"internalType": "uint256"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "isLong_",
|
|
29
|
+
"type": "bool",
|
|
30
|
+
"internalType": "bool"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"outputs": [
|
|
34
|
+
{
|
|
35
|
+
"name": "",
|
|
8
36
|
"type": "address",
|
|
9
37
|
"internalType": "address"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"stateMutability": "nonpayable"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"type": "function",
|
|
44
|
+
"name": "lt",
|
|
45
|
+
"inputs": [
|
|
46
|
+
{
|
|
47
|
+
"name": "",
|
|
48
|
+
"type": "uint32",
|
|
49
|
+
"internalType": "uint32"
|
|
10
50
|
},
|
|
11
51
|
{
|
|
12
|
-
"name": "
|
|
52
|
+
"name": "",
|
|
13
53
|
"type": "uint256",
|
|
14
54
|
"internalType": "uint256"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "",
|
|
58
|
+
"type": "bool",
|
|
59
|
+
"internalType": "bool"
|
|
15
60
|
}
|
|
16
61
|
],
|
|
17
62
|
"outputs": [
|
|
@@ -21,24 +66,129 @@
|
|
|
21
66
|
"internalType": "address"
|
|
22
67
|
}
|
|
23
68
|
],
|
|
69
|
+
"stateMutability": "view"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"type": "function",
|
|
73
|
+
"name": "ltExists",
|
|
74
|
+
"inputs": [
|
|
75
|
+
{
|
|
76
|
+
"name": "",
|
|
77
|
+
"type": "address",
|
|
78
|
+
"internalType": "address"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"outputs": [
|
|
82
|
+
{
|
|
83
|
+
"name": "",
|
|
84
|
+
"type": "bool",
|
|
85
|
+
"internalType": "bool"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"stateMutability": "view"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"type": "function",
|
|
92
|
+
"name": "lts",
|
|
93
|
+
"inputs": [],
|
|
94
|
+
"outputs": [
|
|
95
|
+
{
|
|
96
|
+
"name": "",
|
|
97
|
+
"type": "address[]",
|
|
98
|
+
"internalType": "address[]"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"stateMutability": "view"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"type": "function",
|
|
105
|
+
"name": "redeployLt",
|
|
106
|
+
"inputs": [
|
|
107
|
+
{
|
|
108
|
+
"name": "ltAddress_",
|
|
109
|
+
"type": "address",
|
|
110
|
+
"internalType": "address"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"outputs": [],
|
|
24
114
|
"stateMutability": "nonpayable"
|
|
25
115
|
},
|
|
26
116
|
{
|
|
27
117
|
"type": "event",
|
|
28
|
-
"name": "
|
|
118
|
+
"name": "CreateLeveragedToken",
|
|
29
119
|
"inputs": [
|
|
30
120
|
{
|
|
31
|
-
"name": "
|
|
121
|
+
"name": "creator",
|
|
32
122
|
"type": "address",
|
|
33
123
|
"indexed": true,
|
|
34
124
|
"internalType": "address"
|
|
35
125
|
},
|
|
36
126
|
{
|
|
37
|
-
"name": "
|
|
127
|
+
"name": "token",
|
|
38
128
|
"type": "address",
|
|
129
|
+
"indexed": true,
|
|
130
|
+
"internalType": "address"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "marketId",
|
|
134
|
+
"type": "uint32",
|
|
135
|
+
"indexed": true,
|
|
136
|
+
"internalType": "uint32"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "targetLeverage",
|
|
140
|
+
"type": "uint256",
|
|
39
141
|
"indexed": false,
|
|
142
|
+
"internalType": "uint256"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "isLong",
|
|
146
|
+
"type": "bool",
|
|
147
|
+
"indexed": false,
|
|
148
|
+
"internalType": "bool"
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"anonymous": false
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"type": "error",
|
|
155
|
+
"name": "AlreadyCreated",
|
|
156
|
+
"inputs": []
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"type": "error",
|
|
160
|
+
"name": "InvalidLeverage",
|
|
161
|
+
"inputs": []
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"type": "error",
|
|
165
|
+
"name": "NotLeveragedToken",
|
|
166
|
+
"inputs": []
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"type": "error",
|
|
170
|
+
"name": "NotOwner",
|
|
171
|
+
"inputs": []
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"type": "error",
|
|
175
|
+
"name": "PrecompileLib__PerpAssetInfoPrecompileFailed",
|
|
176
|
+
"inputs": []
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"type": "error",
|
|
180
|
+
"name": "SafeERC20FailedOperation",
|
|
181
|
+
"inputs": [
|
|
182
|
+
{
|
|
183
|
+
"name": "token",
|
|
184
|
+
"type": "address",
|
|
40
185
|
"internalType": "address"
|
|
41
186
|
}
|
|
42
187
|
]
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"type": "error",
|
|
191
|
+
"name": "StillHasMargin",
|
|
192
|
+
"inputs": []
|
|
43
193
|
}
|
|
44
194
|
]
|