@d8x/perpetuals-sdk 0.6.3 → 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.
Files changed (48) hide show
  1. package/dist/cjs/version.d.ts +1 -1
  2. package/dist/cjs/version.js +1 -1
  3. package/dist/esm/version.d.ts +1 -1
  4. package/dist/esm/version.js +1 -1
  5. package/package.json +5 -4
  6. package/src/abi/ERC20.json +288 -0
  7. package/src/abi/IPerpetualManager.json +5888 -0
  8. package/src/abi/LimitOrderBook.json +1062 -0
  9. package/src/abi/LimitOrderBookFactory.json +161 -0
  10. package/src/abi/MockTokenSwap.json +186 -0
  11. package/src/abi/ShareToken.json +428 -0
  12. package/src/accountTrade.ts +428 -0
  13. package/src/brokerTool.ts +555 -0
  14. package/src/config/defaultConfig.json +62 -0
  15. package/src/config/mockSwap.json +6 -0
  16. package/src/config/priceFeedConfig.json +104 -0
  17. package/src/config/symbolList.json +13 -0
  18. package/src/contracts/ERC20.ts +444 -0
  19. package/src/contracts/IPerpetualManager.ts +7227 -0
  20. package/src/contracts/LimitOrderBook.ts +1251 -0
  21. package/src/contracts/LimitOrderBookFactory.ts +348 -0
  22. package/src/contracts/MockTokenSwap.ts +373 -0
  23. package/src/contracts/ShareToken.ts +695 -0
  24. package/src/contracts/common.ts +44 -0
  25. package/src/contracts/factories/ERC20__factory.ts +306 -0
  26. package/src/contracts/factories/IPerpetualManager__factory.ts +5912 -0
  27. package/src/contracts/factories/LimitOrderBookFactory__factory.ts +189 -0
  28. package/src/contracts/factories/LimitOrderBook__factory.ts +1086 -0
  29. package/src/contracts/factories/MockTokenSwap__factory.ts +207 -0
  30. package/src/contracts/factories/ShareToken__factory.ts +449 -0
  31. package/src/contracts/factories/index.ts +9 -0
  32. package/src/contracts/index.ts +16 -0
  33. package/src/d8XMath.ts +376 -0
  34. package/src/index.ts +29 -0
  35. package/src/liquidatorTool.ts +270 -0
  36. package/src/liquidityProviderTool.ts +148 -0
  37. package/src/marketData.ts +1310 -0
  38. package/src/nodeSDKTypes.ts +332 -0
  39. package/src/orderReferrerTool.ts +516 -0
  40. package/src/perpetualDataHandler.ts +1161 -0
  41. package/src/perpetualEventHandler.ts +455 -0
  42. package/src/priceFeeds.ts +382 -0
  43. package/src/traderDigests.ts +86 -0
  44. package/src/traderInterface.ts +172 -0
  45. package/src/triangulator.ts +105 -0
  46. package/src/utils.ts +134 -0
  47. package/src/version.ts +1 -0
  48. package/src/writeAccessHandler.ts +139 -0
@@ -1 +1 @@
1
- export declare const sD8X_SDK_VERSION = "0.6.3";
1
+ export declare const sD8X_SDK_VERSION = "0.6.5";
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sD8X_SDK_VERSION = void 0;
4
- exports.sD8X_SDK_VERSION = "0.6.3";
4
+ exports.sD8X_SDK_VERSION = "0.6.5";
5
5
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- export declare const sD8X_SDK_VERSION = "0.6.3";
1
+ export declare const sD8X_SDK_VERSION = "0.6.5";
@@ -1,2 +1,2 @@
1
- export var sD8X_SDK_VERSION = "0.6.3";
1
+ export var sD8X_SDK_VERSION = "0.6.5";
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d8x/perpetuals-sdk",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "description": "Node TypeScript SDK for D8X Perpetual Futures",
5
5
  "author": "D8X",
6
6
  "homepage": "https://github.com/D8-X/d8x-futures-node-sdk#readme",
@@ -35,6 +35,7 @@
35
35
  "module": "./dist/esm/index.js",
36
36
  "types": "./dist/esm/index.d.ts",
37
37
  "files": [
38
+ "src",
38
39
  "dist",
39
40
  "doc"
40
41
  ],
@@ -49,8 +50,10 @@
49
50
  "@ethersproject/strings": "^5.7.0",
50
51
  "@ethersproject/units": "^5.7.0",
51
52
  "@ethersproject/wallet": "^5.7.0",
53
+ "@typechain/ethers-v5": "^11.0.0",
52
54
  "buffer": "^6.0.3",
53
- "process": "^0.11.10"
55
+ "process": "^0.11.10",
56
+ "typechain": "^8.2.0"
54
57
  },
55
58
  "devDependencies": {
56
59
  "@babel/core": "^7.20.2",
@@ -58,7 +61,6 @@
58
61
  "@babel/plugin-proposal-object-rest-spread": "^7.20.2",
59
62
  "@babel/preset-env": "^7.20.2",
60
63
  "@babel/preset-typescript": "^7.18.6",
61
- "@typechain/ethers-v5": "^11.0.0",
62
64
  "@types/jest": "^29.2.3",
63
65
  "@types/node": "^18.11.9",
64
66
  "babel-jest": "^29.3.1",
@@ -72,7 +74,6 @@
72
74
  "ts-jest": "^29.0.3",
73
75
  "ts-node": "^10.9.1",
74
76
  "tslib": "^2.5.0",
75
- "typechain": "^8.2.0",
76
77
  "typescript": "^4.9.3"
77
78
  }
78
79
  }
@@ -0,0 +1,288 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "string",
6
+ "name": "name_",
7
+ "type": "string"
8
+ },
9
+ {
10
+ "internalType": "string",
11
+ "name": "symbol_",
12
+ "type": "string"
13
+ }
14
+ ],
15
+ "stateMutability": "nonpayable",
16
+ "type": "constructor"
17
+ },
18
+ {
19
+ "anonymous": false,
20
+ "inputs": [
21
+ {
22
+ "indexed": true,
23
+ "internalType": "address",
24
+ "name": "owner",
25
+ "type": "address"
26
+ },
27
+ {
28
+ "indexed": true,
29
+ "internalType": "address",
30
+ "name": "spender",
31
+ "type": "address"
32
+ },
33
+ {
34
+ "indexed": false,
35
+ "internalType": "uint256",
36
+ "name": "value",
37
+ "type": "uint256"
38
+ }
39
+ ],
40
+ "name": "Approval",
41
+ "type": "event"
42
+ },
43
+ {
44
+ "anonymous": false,
45
+ "inputs": [
46
+ {
47
+ "indexed": true,
48
+ "internalType": "address",
49
+ "name": "from",
50
+ "type": "address"
51
+ },
52
+ {
53
+ "indexed": true,
54
+ "internalType": "address",
55
+ "name": "to",
56
+ "type": "address"
57
+ },
58
+ {
59
+ "indexed": false,
60
+ "internalType": "uint256",
61
+ "name": "value",
62
+ "type": "uint256"
63
+ }
64
+ ],
65
+ "name": "Transfer",
66
+ "type": "event"
67
+ },
68
+ {
69
+ "inputs": [
70
+ {
71
+ "internalType": "address",
72
+ "name": "owner",
73
+ "type": "address"
74
+ },
75
+ {
76
+ "internalType": "address",
77
+ "name": "spender",
78
+ "type": "address"
79
+ }
80
+ ],
81
+ "name": "allowance",
82
+ "outputs": [
83
+ {
84
+ "internalType": "uint256",
85
+ "name": "",
86
+ "type": "uint256"
87
+ }
88
+ ],
89
+ "stateMutability": "view",
90
+ "type": "function"
91
+ },
92
+ {
93
+ "inputs": [
94
+ {
95
+ "internalType": "address",
96
+ "name": "spender",
97
+ "type": "address"
98
+ },
99
+ {
100
+ "internalType": "uint256",
101
+ "name": "amount",
102
+ "type": "uint256"
103
+ }
104
+ ],
105
+ "name": "approve",
106
+ "outputs": [
107
+ {
108
+ "internalType": "bool",
109
+ "name": "",
110
+ "type": "bool"
111
+ }
112
+ ],
113
+ "stateMutability": "nonpayable",
114
+ "type": "function"
115
+ },
116
+ {
117
+ "inputs": [
118
+ {
119
+ "internalType": "address",
120
+ "name": "account",
121
+ "type": "address"
122
+ }
123
+ ],
124
+ "name": "balanceOf",
125
+ "outputs": [
126
+ {
127
+ "internalType": "uint256",
128
+ "name": "",
129
+ "type": "uint256"
130
+ }
131
+ ],
132
+ "stateMutability": "view",
133
+ "type": "function"
134
+ },
135
+ {
136
+ "inputs": [],
137
+ "name": "decimals",
138
+ "outputs": [
139
+ {
140
+ "internalType": "uint8",
141
+ "name": "",
142
+ "type": "uint8"
143
+ }
144
+ ],
145
+ "stateMutability": "view",
146
+ "type": "function"
147
+ },
148
+ {
149
+ "inputs": [
150
+ {
151
+ "internalType": "address",
152
+ "name": "spender",
153
+ "type": "address"
154
+ },
155
+ {
156
+ "internalType": "uint256",
157
+ "name": "subtractedValue",
158
+ "type": "uint256"
159
+ }
160
+ ],
161
+ "name": "decreaseAllowance",
162
+ "outputs": [
163
+ {
164
+ "internalType": "bool",
165
+ "name": "",
166
+ "type": "bool"
167
+ }
168
+ ],
169
+ "stateMutability": "nonpayable",
170
+ "type": "function"
171
+ },
172
+ {
173
+ "inputs": [
174
+ {
175
+ "internalType": "address",
176
+ "name": "spender",
177
+ "type": "address"
178
+ },
179
+ {
180
+ "internalType": "uint256",
181
+ "name": "addedValue",
182
+ "type": "uint256"
183
+ }
184
+ ],
185
+ "name": "increaseAllowance",
186
+ "outputs": [
187
+ {
188
+ "internalType": "bool",
189
+ "name": "",
190
+ "type": "bool"
191
+ }
192
+ ],
193
+ "stateMutability": "nonpayable",
194
+ "type": "function"
195
+ },
196
+ {
197
+ "inputs": [],
198
+ "name": "name",
199
+ "outputs": [
200
+ {
201
+ "internalType": "string",
202
+ "name": "",
203
+ "type": "string"
204
+ }
205
+ ],
206
+ "stateMutability": "view",
207
+ "type": "function"
208
+ },
209
+ {
210
+ "inputs": [],
211
+ "name": "symbol",
212
+ "outputs": [
213
+ {
214
+ "internalType": "string",
215
+ "name": "",
216
+ "type": "string"
217
+ }
218
+ ],
219
+ "stateMutability": "view",
220
+ "type": "function"
221
+ },
222
+ {
223
+ "inputs": [],
224
+ "name": "totalSupply",
225
+ "outputs": [
226
+ {
227
+ "internalType": "uint256",
228
+ "name": "",
229
+ "type": "uint256"
230
+ }
231
+ ],
232
+ "stateMutability": "view",
233
+ "type": "function"
234
+ },
235
+ {
236
+ "inputs": [
237
+ {
238
+ "internalType": "address",
239
+ "name": "to",
240
+ "type": "address"
241
+ },
242
+ {
243
+ "internalType": "uint256",
244
+ "name": "amount",
245
+ "type": "uint256"
246
+ }
247
+ ],
248
+ "name": "transfer",
249
+ "outputs": [
250
+ {
251
+ "internalType": "bool",
252
+ "name": "",
253
+ "type": "bool"
254
+ }
255
+ ],
256
+ "stateMutability": "nonpayable",
257
+ "type": "function"
258
+ },
259
+ {
260
+ "inputs": [
261
+ {
262
+ "internalType": "address",
263
+ "name": "from",
264
+ "type": "address"
265
+ },
266
+ {
267
+ "internalType": "address",
268
+ "name": "to",
269
+ "type": "address"
270
+ },
271
+ {
272
+ "internalType": "uint256",
273
+ "name": "amount",
274
+ "type": "uint256"
275
+ }
276
+ ],
277
+ "name": "transferFrom",
278
+ "outputs": [
279
+ {
280
+ "internalType": "bool",
281
+ "name": "",
282
+ "type": "bool"
283
+ }
284
+ ],
285
+ "stateMutability": "nonpayable",
286
+ "type": "function"
287
+ }
288
+ ]