@d8x/perpetuals-sdk 0.5.1 → 0.5.2

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.
@@ -0,0 +1,428 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "uint8",
6
+ "name": "_poolId",
7
+ "type": "uint8"
8
+ }
9
+ ],
10
+ "stateMutability": "nonpayable",
11
+ "type": "constructor"
12
+ },
13
+ {
14
+ "anonymous": false,
15
+ "inputs": [
16
+ {
17
+ "indexed": true,
18
+ "internalType": "address",
19
+ "name": "owner",
20
+ "type": "address"
21
+ },
22
+ {
23
+ "indexed": true,
24
+ "internalType": "address",
25
+ "name": "spender",
26
+ "type": "address"
27
+ },
28
+ {
29
+ "indexed": false,
30
+ "internalType": "uint256",
31
+ "name": "value",
32
+ "type": "uint256"
33
+ }
34
+ ],
35
+ "name": "Approval",
36
+ "type": "event"
37
+ },
38
+ {
39
+ "anonymous": false,
40
+ "inputs": [
41
+ {
42
+ "indexed": true,
43
+ "internalType": "address",
44
+ "name": "previousOwner",
45
+ "type": "address"
46
+ },
47
+ {
48
+ "indexed": true,
49
+ "internalType": "address",
50
+ "name": "newOwner",
51
+ "type": "address"
52
+ }
53
+ ],
54
+ "name": "OwnershipTransferred",
55
+ "type": "event"
56
+ },
57
+ {
58
+ "anonymous": false,
59
+ "inputs": [
60
+ {
61
+ "indexed": false,
62
+ "internalType": "address",
63
+ "name": "from",
64
+ "type": "address"
65
+ },
66
+ {
67
+ "indexed": false,
68
+ "internalType": "address",
69
+ "name": "to",
70
+ "type": "address"
71
+ },
72
+ {
73
+ "indexed": false,
74
+ "internalType": "uint256",
75
+ "name": "amountD18",
76
+ "type": "uint256"
77
+ },
78
+ {
79
+ "indexed": false,
80
+ "internalType": "uint256",
81
+ "name": "priceD18",
82
+ "type": "uint256"
83
+ }
84
+ ],
85
+ "name": "P2PTransfer",
86
+ "type": "event"
87
+ },
88
+ {
89
+ "anonymous": false,
90
+ "inputs": [
91
+ {
92
+ "indexed": true,
93
+ "internalType": "address",
94
+ "name": "from",
95
+ "type": "address"
96
+ },
97
+ {
98
+ "indexed": true,
99
+ "internalType": "address",
100
+ "name": "to",
101
+ "type": "address"
102
+ },
103
+ {
104
+ "indexed": false,
105
+ "internalType": "uint256",
106
+ "name": "value",
107
+ "type": "uint256"
108
+ }
109
+ ],
110
+ "name": "Transfer",
111
+ "type": "event"
112
+ },
113
+ {
114
+ "inputs": [
115
+ {
116
+ "internalType": "address",
117
+ "name": "owner",
118
+ "type": "address"
119
+ },
120
+ {
121
+ "internalType": "address",
122
+ "name": "spender",
123
+ "type": "address"
124
+ }
125
+ ],
126
+ "name": "allowance",
127
+ "outputs": [
128
+ {
129
+ "internalType": "uint256",
130
+ "name": "",
131
+ "type": "uint256"
132
+ }
133
+ ],
134
+ "stateMutability": "view",
135
+ "type": "function"
136
+ },
137
+ {
138
+ "inputs": [
139
+ {
140
+ "internalType": "address",
141
+ "name": "spender",
142
+ "type": "address"
143
+ },
144
+ {
145
+ "internalType": "uint256",
146
+ "name": "amount",
147
+ "type": "uint256"
148
+ }
149
+ ],
150
+ "name": "approve",
151
+ "outputs": [
152
+ {
153
+ "internalType": "bool",
154
+ "name": "",
155
+ "type": "bool"
156
+ }
157
+ ],
158
+ "stateMutability": "nonpayable",
159
+ "type": "function"
160
+ },
161
+ {
162
+ "inputs": [
163
+ {
164
+ "internalType": "address",
165
+ "name": "account",
166
+ "type": "address"
167
+ }
168
+ ],
169
+ "name": "balanceOf",
170
+ "outputs": [
171
+ {
172
+ "internalType": "uint256",
173
+ "name": "",
174
+ "type": "uint256"
175
+ }
176
+ ],
177
+ "stateMutability": "view",
178
+ "type": "function"
179
+ },
180
+ {
181
+ "inputs": [
182
+ {
183
+ "internalType": "address",
184
+ "name": "_account",
185
+ "type": "address"
186
+ },
187
+ {
188
+ "internalType": "uint256",
189
+ "name": "_amount",
190
+ "type": "uint256"
191
+ }
192
+ ],
193
+ "name": "burn",
194
+ "outputs": [],
195
+ "stateMutability": "nonpayable",
196
+ "type": "function"
197
+ },
198
+ {
199
+ "inputs": [],
200
+ "name": "decimals",
201
+ "outputs": [
202
+ {
203
+ "internalType": "uint8",
204
+ "name": "",
205
+ "type": "uint8"
206
+ }
207
+ ],
208
+ "stateMutability": "view",
209
+ "type": "function"
210
+ },
211
+ {
212
+ "inputs": [
213
+ {
214
+ "internalType": "address",
215
+ "name": "spender",
216
+ "type": "address"
217
+ },
218
+ {
219
+ "internalType": "uint256",
220
+ "name": "subtractedValue",
221
+ "type": "uint256"
222
+ }
223
+ ],
224
+ "name": "decreaseAllowance",
225
+ "outputs": [
226
+ {
227
+ "internalType": "bool",
228
+ "name": "",
229
+ "type": "bool"
230
+ }
231
+ ],
232
+ "stateMutability": "nonpayable",
233
+ "type": "function"
234
+ },
235
+ {
236
+ "inputs": [
237
+ {
238
+ "internalType": "address",
239
+ "name": "spender",
240
+ "type": "address"
241
+ },
242
+ {
243
+ "internalType": "uint256",
244
+ "name": "addedValue",
245
+ "type": "uint256"
246
+ }
247
+ ],
248
+ "name": "increaseAllowance",
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": "_account",
264
+ "type": "address"
265
+ },
266
+ {
267
+ "internalType": "uint256",
268
+ "name": "_amount",
269
+ "type": "uint256"
270
+ }
271
+ ],
272
+ "name": "mint",
273
+ "outputs": [],
274
+ "stateMutability": "nonpayable",
275
+ "type": "function"
276
+ },
277
+ {
278
+ "inputs": [],
279
+ "name": "name",
280
+ "outputs": [
281
+ {
282
+ "internalType": "string",
283
+ "name": "",
284
+ "type": "string"
285
+ }
286
+ ],
287
+ "stateMutability": "view",
288
+ "type": "function"
289
+ },
290
+ {
291
+ "inputs": [],
292
+ "name": "owner",
293
+ "outputs": [
294
+ {
295
+ "internalType": "address",
296
+ "name": "",
297
+ "type": "address"
298
+ }
299
+ ],
300
+ "stateMutability": "view",
301
+ "type": "function"
302
+ },
303
+ {
304
+ "inputs": [],
305
+ "name": "poolId",
306
+ "outputs": [
307
+ {
308
+ "internalType": "uint8",
309
+ "name": "",
310
+ "type": "uint8"
311
+ }
312
+ ],
313
+ "stateMutability": "view",
314
+ "type": "function"
315
+ },
316
+ {
317
+ "inputs": [],
318
+ "name": "renounceOwnership",
319
+ "outputs": [],
320
+ "stateMutability": "nonpayable",
321
+ "type": "function"
322
+ },
323
+ {
324
+ "inputs": [
325
+ {
326
+ "internalType": "address",
327
+ "name": "_account",
328
+ "type": "address"
329
+ }
330
+ ],
331
+ "name": "setTransferRestricted",
332
+ "outputs": [],
333
+ "stateMutability": "nonpayable",
334
+ "type": "function"
335
+ },
336
+ {
337
+ "inputs": [],
338
+ "name": "symbol",
339
+ "outputs": [
340
+ {
341
+ "internalType": "string",
342
+ "name": "",
343
+ "type": "string"
344
+ }
345
+ ],
346
+ "stateMutability": "view",
347
+ "type": "function"
348
+ },
349
+ {
350
+ "inputs": [],
351
+ "name": "totalSupply",
352
+ "outputs": [
353
+ {
354
+ "internalType": "uint256",
355
+ "name": "",
356
+ "type": "uint256"
357
+ }
358
+ ],
359
+ "stateMutability": "view",
360
+ "type": "function"
361
+ },
362
+ {
363
+ "inputs": [
364
+ {
365
+ "internalType": "address",
366
+ "name": "to",
367
+ "type": "address"
368
+ },
369
+ {
370
+ "internalType": "uint256",
371
+ "name": "amount",
372
+ "type": "uint256"
373
+ }
374
+ ],
375
+ "name": "transfer",
376
+ "outputs": [
377
+ {
378
+ "internalType": "bool",
379
+ "name": "",
380
+ "type": "bool"
381
+ }
382
+ ],
383
+ "stateMutability": "nonpayable",
384
+ "type": "function"
385
+ },
386
+ {
387
+ "inputs": [
388
+ {
389
+ "internalType": "address",
390
+ "name": "from",
391
+ "type": "address"
392
+ },
393
+ {
394
+ "internalType": "address",
395
+ "name": "to",
396
+ "type": "address"
397
+ },
398
+ {
399
+ "internalType": "uint256",
400
+ "name": "amount",
401
+ "type": "uint256"
402
+ }
403
+ ],
404
+ "name": "transferFrom",
405
+ "outputs": [
406
+ {
407
+ "internalType": "bool",
408
+ "name": "",
409
+ "type": "bool"
410
+ }
411
+ ],
412
+ "stateMutability": "nonpayable",
413
+ "type": "function"
414
+ },
415
+ {
416
+ "inputs": [
417
+ {
418
+ "internalType": "address",
419
+ "name": "newOwner",
420
+ "type": "address"
421
+ }
422
+ ],
423
+ "name": "transferOwnership",
424
+ "outputs": [],
425
+ "stateMutability": "nonpayable",
426
+ "type": "function"
427
+ }
428
+ ]
@@ -7,6 +7,7 @@
7
7
  "nodeURL": "https://polygon-mumbai.blockpi.network/v1/rpc/public",
8
8
  "priceFeedConfigNetwork": "testnet",
9
9
  "proxyABILocation": "testnet/IPerpetualManager.json",
10
+ "shareTokenABILocation": "testnet/ShareToken.json",
10
11
  "limitOrderBookFactoryABILocation": "testnet/LimitOrderBookFactory.json",
11
12
  "limitOrderBookABILocation": "testnet/LimitOrderBook.json"
12
13
  },
@@ -30,6 +31,7 @@
30
31
  "nodeURL": "https://rpc.public.zkevm-test.net ",
31
32
  "priceFeedConfigNetwork": "testnet",
32
33
  "proxyABILocation": "zkevmTestnet/IPerpetualManager.json",
34
+ "shareTokenABILocation": "zkevmTestnet/ShareToken.json",
33
35
  "limitOrderBookFactoryABILocation": "zkevmTestnet/LimitOrderBookFactory.json",
34
36
  "limitOrderBookABILocation": "zkevmTestnet/LimitOrderBook.json"
35
37
  }
@@ -34,6 +34,7 @@ export interface NodeSDKConfig {
34
34
  nodeURL: string;
35
35
  proxyAddr: string;
36
36
  proxyABILocation: string;
37
+ shareTokenABILocation: string;
37
38
  limitOrderBookABILocation: string;
38
39
  limitOrderBookFactoryABILocation: string;
39
40
  symbolListLocation: string;
@@ -42,6 +43,7 @@ export interface NodeSDKConfig {
42
43
  proxyABI?: ContractInterface | undefined;
43
44
  lobFactoryABI?: ContractInterface | undefined;
44
45
  lobABI?: ContractInterface | undefined;
46
+ shareTokenABI?: ContractInterface | undefined;
45
47
  }
46
48
  export interface MarginAccount {
47
49
  symbol: string;
@@ -44,6 +44,7 @@ function loadABIs(config) {
44
44
  config.proxyABI = require("./abi/".concat(config.proxyABILocation));
45
45
  config.lobFactoryABI = require("./abi/".concat(config.limitOrderBookFactoryABILocation));
46
46
  config.lobABI = require("./abi/".concat(config.limitOrderBookABILocation));
47
+ config.shareTokenABI = require("./abi/".concat(config.shareTokenABILocation));
47
48
  }
48
49
  }
49
50
  exports.loadABIs = loadABIs;
@@ -1 +1 @@
1
- {"version":3,"file":"nodeSDKTypes.js","sourceRoot":"","sources":["../../src/nodeSDKTypes.ts"],"names":[],"mappings":";;;;;AAAA,sDAAmE;AAEnE,sDAAiE;AAGpD,QAAA,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACxC,QAAA,mBAAmB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAC1D,QAAA,WAAW,GAAG,IAAI,GAAG,CAAiB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;AAC3F,QAAA,yBAAyB,GAAG,CAAC,CAAC;AAC9B,QAAA,wBAAwB,GAAG,CAAC,CAAC;AAC7B,QAAA,0BAA0B,GAAG,CAAC,CAAC;AAC/B,QAAA,cAAc,GAAG,CAAC,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAC/E,QAAA,YAAY,GAAG,uBAAW,CAAC;AAC3B,QAAA,aAAa,GAAG,oBAAQ,CAAC;AAEzB,QAAA,SAAS,GAAG,qBAAS,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;AACnD,QAAA,SAAS,GAAG,qBAAS,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;AACjE,QAAA,YAAY,GAAG,qBAAS,CAAC,IAAI,CAAC,CAAC,CAAC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,oBAAY,KAAZ,oBAAY,QAIvB;AAiPY,QAAA,2BAA2B,GAAG,SAAS,CAAC;AACxC,QAAA,2BAA2B,GAAG,SAAS,CAAC;AAErD,SAAgB,QAAQ,CAAC,MAAqB;IAC5C,IAAI,MAAM,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;QACtC,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,gBAAS,MAAM,CAAC,gBAAgB,CAAE,CAAC,CAAC;QAC9D,MAAM,CAAC,aAAa,GAAG,OAAO,CAAC,gBAAS,MAAM,CAAC,gCAAgC,CAAE,CAAC,CAAC;QACnF,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,gBAAS,MAAM,CAAC,yBAAyB,CAAE,CAAC,CAAC;QACrE,MAAM,CAAC,aAAa,GAAG,OAAO,CAAC,gBAAS,MAAM,CAAC,qBAAqB,CAAE,CAAC,CAAC;KACzE;AACH,CAAC;AAPD,4BAOC;AAED,IAAI,WAAW,GAAG,OAAO,CAAC,6BAA6B,CAAoB,CAAC;;IAC5E,KAAmB,IAAA,gBAAA,iBAAA,WAAW,CAAA,wCAAA,iEAAE;QAA3B,IAAI,MAAM,wBAAA;QACb,QAAQ,CAAC,MAAM,CAAC,CAAC;KAClB;;;;;;;;;AAEY,QAAA,cAAc,GAAoB,WAAW,CAAC"}
@@ -23,6 +23,7 @@ export default class PerpetualDataHandler {
23
23
  protected lobFactoryABI: ContractInterface;
24
24
  protected lobFactoryAddr: string | undefined;
25
25
  protected lobABI: ContractInterface;
26
+ protected shareTokenABI: ContractInterface;
26
27
  protected nodeURL: string;
27
28
  protected provider: Provider | null;
28
29
  private signerOrProvider;
@@ -227,6 +228,11 @@ export default class PerpetualDataHandler {
227
228
  */
228
229
  getPoolStaticInfoIndexFromSymbol(symbol: string): number;
229
230
  getMarginTokenFromSymbol(symbol: string): string | undefined;
231
+ /**
232
+ * Get ABI for LimitOrderBook, Proxy, or Share Pool Token
233
+ * @param contract name of contract: proxy|lob|sharetoken
234
+ * @returns ABI for the requested contract
235
+ */
230
236
  getABI(contract: string): ContractInterface | undefined;
231
237
  /**
232
238
  * Performs basic validity checks on a given order
@@ -33,6 +33,7 @@ var PerpetualDataHandler = /** @class */ (function () {
33
33
  this.proxyABI = config.proxyABI;
34
34
  this.lobFactoryABI = config.lobFactoryABI;
35
35
  this.lobABI = config.lobABI;
36
+ this.shareTokenABI = config.shareTokenABI;
36
37
  this.symbolList = nodeSDKTypes_1.SYMBOL_LIST;
37
38
  this.priceFeedGetter = new priceFeeds_1.default(this, config.priceFeedConfigNetwork);
38
39
  }
@@ -916,7 +917,7 @@ var PerpetualDataHandler = /** @class */ (function () {
916
917
  }
917
918
  else {
918
919
  if (version === undefined) {
919
- configFile = configFile.sort(function (conf) { return conf.version; });
920
+ configFile = configFile.sort(function (conf) { return -conf.version; });
920
921
  return configFile[0];
921
922
  }
922
923
  else {
@@ -953,7 +954,7 @@ var PerpetualDataHandler = /** @class */ (function () {
953
954
  }
954
955
  else {
955
956
  if (version === undefined) {
956
- configFile = configFile.sort(function (conf) { return conf.version; });
957
+ configFile = configFile.sort(function (conf) { return -conf.version; });
957
958
  return configFile[0];
958
959
  }
959
960
  else {
@@ -1001,12 +1002,19 @@ var PerpetualDataHandler = /** @class */ (function () {
1001
1002
  }
1002
1003
  return undefined;
1003
1004
  };
1005
+ /**
1006
+ * Get ABI for LimitOrderBook, Proxy, or Share Pool Token
1007
+ * @param contract name of contract: proxy|lob|sharetoken
1008
+ * @returns ABI for the requested contract
1009
+ */
1004
1010
  PerpetualDataHandler.prototype.getABI = function (contract) {
1005
1011
  switch (contract) {
1006
1012
  case "proxy":
1007
1013
  return this.proxyABI;
1008
1014
  case "lob":
1009
1015
  return this.lobABI;
1016
+ case "sharetoken":
1017
+ return this.shareTokenABI;
1010
1018
  default:
1011
1019
  return undefined;
1012
1020
  }