@d8x/perpetuals-sdk 0.6.4 → 0.6.5
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/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +2 -1
- package/src/abi/ERC20.json +288 -0
- package/src/abi/IPerpetualManager.json +5888 -0
- package/src/abi/LimitOrderBook.json +1062 -0
- package/src/abi/LimitOrderBookFactory.json +161 -0
- package/src/abi/MockTokenSwap.json +186 -0
- package/src/abi/ShareToken.json +428 -0
- package/src/accountTrade.ts +428 -0
- package/src/brokerTool.ts +555 -0
- package/src/config/defaultConfig.json +62 -0
- package/src/config/mockSwap.json +6 -0
- package/src/config/priceFeedConfig.json +104 -0
- package/src/config/symbolList.json +13 -0
- package/src/contracts/ERC20.ts +444 -0
- package/src/contracts/IPerpetualManager.ts +7227 -0
- package/src/contracts/LimitOrderBook.ts +1251 -0
- package/src/contracts/LimitOrderBookFactory.ts +348 -0
- package/src/contracts/MockTokenSwap.ts +373 -0
- package/src/contracts/ShareToken.ts +695 -0
- package/src/contracts/common.ts +44 -0
- package/src/contracts/factories/ERC20__factory.ts +306 -0
- package/src/contracts/factories/IPerpetualManager__factory.ts +5912 -0
- package/src/contracts/factories/LimitOrderBookFactory__factory.ts +189 -0
- package/src/contracts/factories/LimitOrderBook__factory.ts +1086 -0
- package/src/contracts/factories/MockTokenSwap__factory.ts +207 -0
- package/src/contracts/factories/ShareToken__factory.ts +449 -0
- package/src/contracts/factories/index.ts +9 -0
- package/src/contracts/index.ts +16 -0
- package/src/d8XMath.ts +376 -0
- package/src/index.ts +29 -0
- package/src/liquidatorTool.ts +270 -0
- package/src/liquidityProviderTool.ts +148 -0
- package/src/marketData.ts +1310 -0
- package/src/nodeSDKTypes.ts +332 -0
- package/src/orderReferrerTool.ts +516 -0
- package/src/perpetualDataHandler.ts +1161 -0
- package/src/perpetualEventHandler.ts +455 -0
- package/src/priceFeeds.ts +382 -0
- package/src/traderDigests.ts +86 -0
- package/src/traderInterface.ts +172 -0
- package/src/triangulator.ts +105 -0
- package/src/utils.ts +134 -0
- package/src/version.ts +1 -0
- package/src/writeAccessHandler.ts +139 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"anonymous": false,
|
|
4
|
+
"inputs": [
|
|
5
|
+
{
|
|
6
|
+
"indexed": true,
|
|
7
|
+
"internalType": "address",
|
|
8
|
+
"name": "previousOwner",
|
|
9
|
+
"type": "address"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"indexed": true,
|
|
13
|
+
"internalType": "address",
|
|
14
|
+
"name": "newOwner",
|
|
15
|
+
"type": "address"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"name": "OwnershipTransferred",
|
|
19
|
+
"type": "event"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"anonymous": false,
|
|
23
|
+
"inputs": [
|
|
24
|
+
{
|
|
25
|
+
"indexed": true,
|
|
26
|
+
"internalType": "uint24",
|
|
27
|
+
"name": "perpetualId",
|
|
28
|
+
"type": "uint24"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"indexed": false,
|
|
32
|
+
"internalType": "address",
|
|
33
|
+
"name": "perpManagerAddress",
|
|
34
|
+
"type": "address"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"indexed": false,
|
|
38
|
+
"internalType": "address",
|
|
39
|
+
"name": "limitOrderBookAddress",
|
|
40
|
+
"type": "address"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"name": "PerpetualLimitOrderBookDeployed",
|
|
44
|
+
"type": "event"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"inputs": [],
|
|
48
|
+
"name": "CANCEL_DELAY_SEC",
|
|
49
|
+
"outputs": [
|
|
50
|
+
{
|
|
51
|
+
"internalType": "uint8",
|
|
52
|
+
"name": "",
|
|
53
|
+
"type": "uint8"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"stateMutability": "view",
|
|
57
|
+
"type": "function"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"inputs": [],
|
|
61
|
+
"name": "POSTING_FEE_TBPS",
|
|
62
|
+
"outputs": [
|
|
63
|
+
{
|
|
64
|
+
"internalType": "uint16",
|
|
65
|
+
"name": "",
|
|
66
|
+
"type": "uint16"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"stateMutability": "view",
|
|
70
|
+
"type": "function"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"inputs": [
|
|
74
|
+
{
|
|
75
|
+
"internalType": "address",
|
|
76
|
+
"name": "_perpetualManagerAddr",
|
|
77
|
+
"type": "address"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"internalType": "uint24",
|
|
81
|
+
"name": "_perpetualId",
|
|
82
|
+
"type": "uint24"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"name": "deployLimitOrderBookProxy",
|
|
86
|
+
"outputs": [],
|
|
87
|
+
"stateMutability": "nonpayable",
|
|
88
|
+
"type": "function"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"inputs": [
|
|
92
|
+
{
|
|
93
|
+
"internalType": "uint24",
|
|
94
|
+
"name": "_perpetualId",
|
|
95
|
+
"type": "uint24"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"name": "getOrderBookAddress",
|
|
99
|
+
"outputs": [
|
|
100
|
+
{
|
|
101
|
+
"internalType": "address",
|
|
102
|
+
"name": "",
|
|
103
|
+
"type": "address"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"stateMutability": "view",
|
|
107
|
+
"type": "function"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"inputs": [
|
|
111
|
+
{
|
|
112
|
+
"internalType": "uint24",
|
|
113
|
+
"name": "",
|
|
114
|
+
"type": "uint24"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"name": "orderBooks",
|
|
118
|
+
"outputs": [
|
|
119
|
+
{
|
|
120
|
+
"internalType": "address",
|
|
121
|
+
"name": "",
|
|
122
|
+
"type": "address"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"stateMutability": "view",
|
|
126
|
+
"type": "function"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"inputs": [],
|
|
130
|
+
"name": "owner",
|
|
131
|
+
"outputs": [
|
|
132
|
+
{
|
|
133
|
+
"internalType": "address",
|
|
134
|
+
"name": "",
|
|
135
|
+
"type": "address"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"stateMutability": "view",
|
|
139
|
+
"type": "function"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"inputs": [],
|
|
143
|
+
"name": "renounceOwnership",
|
|
144
|
+
"outputs": [],
|
|
145
|
+
"stateMutability": "nonpayable",
|
|
146
|
+
"type": "function"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"inputs": [
|
|
150
|
+
{
|
|
151
|
+
"internalType": "address",
|
|
152
|
+
"name": "newOwner",
|
|
153
|
+
"type": "address"
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
"name": "transferOwnership",
|
|
157
|
+
"outputs": [],
|
|
158
|
+
"stateMutability": "nonpayable",
|
|
159
|
+
"type": "function"
|
|
160
|
+
}
|
|
161
|
+
]
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{
|
|
5
|
+
"internalType": "address",
|
|
6
|
+
"name": "_mockTokenAddr",
|
|
7
|
+
"type": "address"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"internalType": "uint256",
|
|
11
|
+
"name": "_d18MaticToMockConversion",
|
|
12
|
+
"type": "uint256"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"stateMutability": "nonpayable",
|
|
16
|
+
"type": "constructor"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"anonymous": false,
|
|
20
|
+
"inputs": [
|
|
21
|
+
{
|
|
22
|
+
"indexed": false,
|
|
23
|
+
"internalType": "uint256",
|
|
24
|
+
"name": "amount",
|
|
25
|
+
"type": "uint256"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"name": "BalanceWithdrawn",
|
|
29
|
+
"type": "event"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"anonymous": false,
|
|
33
|
+
"inputs": [
|
|
34
|
+
{
|
|
35
|
+
"indexed": false,
|
|
36
|
+
"internalType": "uint256",
|
|
37
|
+
"name": "amount",
|
|
38
|
+
"type": "uint256"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"indexed": false,
|
|
42
|
+
"internalType": "address",
|
|
43
|
+
"name": "sender",
|
|
44
|
+
"type": "address"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"name": "MockTokensReceived",
|
|
48
|
+
"type": "event"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"anonymous": false,
|
|
52
|
+
"inputs": [
|
|
53
|
+
{
|
|
54
|
+
"indexed": false,
|
|
55
|
+
"internalType": "uint256",
|
|
56
|
+
"name": "amountIn",
|
|
57
|
+
"type": "uint256"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"indexed": false,
|
|
61
|
+
"internalType": "uint256",
|
|
62
|
+
"name": "amountOut",
|
|
63
|
+
"type": "uint256"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"indexed": false,
|
|
67
|
+
"internalType": "uint256",
|
|
68
|
+
"name": "poolBalance",
|
|
69
|
+
"type": "uint256"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"indexed": false,
|
|
73
|
+
"internalType": "address",
|
|
74
|
+
"name": "sender",
|
|
75
|
+
"type": "address"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"name": "MockTokensSwapped",
|
|
79
|
+
"type": "event"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"anonymous": false,
|
|
83
|
+
"inputs": [
|
|
84
|
+
{
|
|
85
|
+
"indexed": true,
|
|
86
|
+
"internalType": "address",
|
|
87
|
+
"name": "previousOwner",
|
|
88
|
+
"type": "address"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"indexed": true,
|
|
92
|
+
"internalType": "address",
|
|
93
|
+
"name": "newOwner",
|
|
94
|
+
"type": "address"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"name": "OwnershipTransferred",
|
|
98
|
+
"type": "event"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"inputs": [],
|
|
102
|
+
"name": "d18MaticToMockConversion",
|
|
103
|
+
"outputs": [
|
|
104
|
+
{
|
|
105
|
+
"internalType": "uint256",
|
|
106
|
+
"name": "",
|
|
107
|
+
"type": "uint256"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"stateMutability": "view",
|
|
111
|
+
"type": "function"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"inputs": [
|
|
115
|
+
{
|
|
116
|
+
"internalType": "uint256",
|
|
117
|
+
"name": "_amount",
|
|
118
|
+
"type": "uint256"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"name": "depositMockToken",
|
|
122
|
+
"outputs": [],
|
|
123
|
+
"stateMutability": "nonpayable",
|
|
124
|
+
"type": "function"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"inputs": [],
|
|
128
|
+
"name": "mockTokenAddr",
|
|
129
|
+
"outputs": [
|
|
130
|
+
{
|
|
131
|
+
"internalType": "address",
|
|
132
|
+
"name": "",
|
|
133
|
+
"type": "address"
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"stateMutability": "view",
|
|
137
|
+
"type": "function"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"inputs": [],
|
|
141
|
+
"name": "owner",
|
|
142
|
+
"outputs": [
|
|
143
|
+
{
|
|
144
|
+
"internalType": "address",
|
|
145
|
+
"name": "",
|
|
146
|
+
"type": "address"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"stateMutability": "view",
|
|
150
|
+
"type": "function"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"inputs": [],
|
|
154
|
+
"name": "renounceOwnership",
|
|
155
|
+
"outputs": [],
|
|
156
|
+
"stateMutability": "nonpayable",
|
|
157
|
+
"type": "function"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"inputs": [],
|
|
161
|
+
"name": "swapToMockToken",
|
|
162
|
+
"outputs": [],
|
|
163
|
+
"stateMutability": "payable",
|
|
164
|
+
"type": "function"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"inputs": [
|
|
168
|
+
{
|
|
169
|
+
"internalType": "address",
|
|
170
|
+
"name": "newOwner",
|
|
171
|
+
"type": "address"
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"name": "transferOwnership",
|
|
175
|
+
"outputs": [],
|
|
176
|
+
"stateMutability": "nonpayable",
|
|
177
|
+
"type": "function"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"inputs": [],
|
|
181
|
+
"name": "withdraw",
|
|
182
|
+
"outputs": [],
|
|
183
|
+
"stateMutability": "nonpayable",
|
|
184
|
+
"type": "function"
|
|
185
|
+
}
|
|
186
|
+
]
|