@d8x/perpetuals-sdk 0.6.4 → 0.6.6

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 (50) hide show
  1. package/dist/cjs/version.d.ts +1 -1
  2. package/dist/cjs/version.js +2 -2
  3. package/dist/cjs/version.js.map +1 -1
  4. package/dist/esm/version.d.ts +1 -1
  5. package/dist/esm/version.js +1 -1
  6. package/dist/esm/version.js.map +1 -1
  7. package/package.json +3 -2
  8. package/src/abi/ERC20.json +288 -0
  9. package/src/abi/IPerpetualManager.json +5888 -0
  10. package/src/abi/LimitOrderBook.json +1062 -0
  11. package/src/abi/LimitOrderBookFactory.json +161 -0
  12. package/src/abi/MockTokenSwap.json +186 -0
  13. package/src/abi/ShareToken.json +428 -0
  14. package/src/accountTrade.ts +428 -0
  15. package/src/brokerTool.ts +555 -0
  16. package/src/config/defaultConfig.json +62 -0
  17. package/src/config/mockSwap.json +6 -0
  18. package/src/config/priceFeedConfig.json +104 -0
  19. package/src/config/symbolList.json +13 -0
  20. package/src/contracts/ERC20.ts +444 -0
  21. package/src/contracts/IPerpetualManager.ts +7227 -0
  22. package/src/contracts/LimitOrderBook.ts +1251 -0
  23. package/src/contracts/LimitOrderBookFactory.ts +348 -0
  24. package/src/contracts/MockTokenSwap.ts +373 -0
  25. package/src/contracts/ShareToken.ts +695 -0
  26. package/src/contracts/common.ts +44 -0
  27. package/src/contracts/factories/ERC20__factory.ts +306 -0
  28. package/src/contracts/factories/IPerpetualManager__factory.ts +5912 -0
  29. package/src/contracts/factories/LimitOrderBookFactory__factory.ts +189 -0
  30. package/src/contracts/factories/LimitOrderBook__factory.ts +1086 -0
  31. package/src/contracts/factories/MockTokenSwap__factory.ts +207 -0
  32. package/src/contracts/factories/ShareToken__factory.ts +449 -0
  33. package/src/contracts/factories/index.ts +9 -0
  34. package/src/contracts/index.ts +16 -0
  35. package/src/d8XMath.ts +376 -0
  36. package/src/index.ts +29 -0
  37. package/src/liquidatorTool.ts +270 -0
  38. package/src/liquidityProviderTool.ts +148 -0
  39. package/src/marketData.ts +1310 -0
  40. package/src/nodeSDKTypes.ts +332 -0
  41. package/src/orderReferrerTool.ts +516 -0
  42. package/src/perpetualDataHandler.ts +1161 -0
  43. package/src/perpetualEventHandler.ts +455 -0
  44. package/src/priceFeeds.ts +382 -0
  45. package/src/traderDigests.ts +86 -0
  46. package/src/traderInterface.ts +172 -0
  47. package/src/triangulator.ts +105 -0
  48. package/src/utils.ts +134 -0
  49. package/src/version.ts +1 -0
  50. package/src/writeAccessHandler.ts +139 -0
@@ -1 +1 @@
1
- export declare const sD8X_SDK_VERSION = "0.6.4";
1
+ export declare const D8X_SDK_VERSION = "0.6.6";
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sD8X_SDK_VERSION = void 0;
4
- exports.sD8X_SDK_VERSION = "0.6.4";
3
+ exports.D8X_SDK_VERSION = void 0;
4
+ exports.D8X_SDK_VERSION = "0.6.6";
5
5
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,OAAO,CAAC"}
@@ -1 +1 @@
1
- export declare const sD8X_SDK_VERSION = "0.6.4";
1
+ export declare const D8X_SDK_VERSION = "0.6.6";
@@ -1,2 +1,2 @@
1
- export var sD8X_SDK_VERSION = "0.6.4";
1
+ export var D8X_SDK_VERSION = "0.6.6";
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,gBAAgB,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,eAAe,GAAG,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d8x/perpetuals-sdk",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
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",
@@ -26,7 +26,7 @@
26
26
  "build:doc": "jsdoc2md --files ./src/accountTrade.ts --configure ./jsdoc2md.json > ./doc/accountTrade.md && jsdoc2md --files ./src/marketData.ts --configure ./jsdoc2md.json > ./doc/marketData.md && jsdoc2md --files ./src/liquidatorTool.ts --configure ./jsdoc2md.json > ./doc/liquidatorTool.md && jsdoc2md --files ./src/liquidityProviderTool.ts --configure ./jsdoc2md.json > ./doc/liquidityProviderTool.md && jsdoc2md --files ./src/brokerTool.ts --configure ./jsdoc2md.json > ./doc/brokerTool.md && jsdoc2md --files ./src/orderReferrerTool.ts --configure ./jsdoc2md.json > ./doc/orderReferrerTool.md && jsdoc2md --files ./src/*.ts --configure ./jsdoc2md.json > ./doc/d8x-perpetuals-sdk.md",
27
27
  "test": "yarn jest",
28
28
  "coverage": "nyc -r lcov -e .ts -x \"*.test.ts\" npm run test",
29
- "prebuild": "node -p \"'export const sD8X_SDK_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
29
+ "prebuild": "node -p \"'export const D8X_SDK_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
30
30
  "prepublish": "yarn build",
31
31
  "prepare": "npm run build",
32
32
  "postinstall": "typechain --target ethers-v5 --out-dir ./src/contracts './src/abi/**/*.json'"
@@ -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
  ],
@@ -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
+ ]