@deriverse/kit 1.0.32 → 1.0.38

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newPrivateClient = exports.sellMarketSeatData = exports.buyMarketSeatData = exports.changeRefProgramData = exports.perpForcedCloseData = exports.perpMassCancelData = exports.perpOrderCancelData = exports.newTokenData = exports.setInstrReadyForPerpUpgradeData = exports.setInstrOracleFeedData = exports.upgradeToPerpData = exports.airdropData = exports.votingData = exports.perpQuotesReplaceData = exports.spotQuotesReplaceData = exports.swapData = exports.withdrawData = exports.perpWithdrawData = exports.moveSpotAvailFundsData = exports.perpDepositData = exports.feesWithdrawData = exports.feesDepositData = exports.depositData = exports.newInstrumentData = exports.spotLpData = exports.spotMassCancelData = exports.spotOrderCancelData = exports.perpStatisticsResetData = exports.perpChangeLeverageData = exports.newPerpOrderData = exports.newSpotOrderData = exports.newRootAccountData = exports.newOperatorData = void 0;
3
+ exports.activateClientRefProgramData = exports.garbageCollectorData = exports.changeVotingData = exports.setSeatPurchasingFeeData = exports.perpClientsProcessingData = exports.newBaseCrncyData = exports.changeDenominatorData = exports.setVarianceData = exports.pointsProgramExpiration = exports.newPrivateClient = exports.sellMarketSeatData = exports.buyMarketSeatData = exports.changeRefProgramData = exports.perpMassCancelData = exports.perpOrderCancelData = exports.setInstrReadyForPerpUpgradeData = exports.upgradeToPerpData = exports.airdropData = exports.votingData = exports.perpQuotesReplaceData = exports.spotQuotesReplaceData = exports.swapData = exports.withdrawData = exports.perpWithdrawData = exports.moveSpotAvailFundsData = exports.perpDepositData = exports.feesWithdrawData = exports.feesDepositData = exports.depositData = exports.newInstrumentData = exports.spotLpData = exports.spotMassCancelData = exports.spotOrderCancelData = exports.perpStatisticsResetData = exports.perpChangeLeverageData = exports.newPerpOrderData = exports.newSpotOrderData = exports.newRootAccountData = exports.newOperatorData = void 0;
4
4
  function newOperatorData(tag) {
5
5
  let buf = Buffer.alloc(4);
6
6
  buf.writeUint8(tag, 0);
@@ -18,20 +18,21 @@ function newRootAccountData(tag, privateMode, lutSlot) {
18
18
  return buf;
19
19
  }
20
20
  exports.newRootAccountData = newRootAccountData;
21
- function newSpotOrderData(tag, ioc, orderType, side, instrId, price, amount) {
22
- let buf = Buffer.alloc(24);
21
+ function newSpotOrderData(tag, ioc, orderType, side, instrId, price, amount, edgePrice) {
22
+ let buf = Buffer.alloc(32);
23
23
  buf.writeUint8(tag, 0);
24
24
  buf.writeUint8(ioc, 1);
25
25
  buf.writeUint8(orderType, 2);
26
26
  buf.writeUint8(side, 3);
27
27
  buf.writeUint32LE(instrId, 4);
28
- buf.writeBigInt64LE(BigInt(price), 8);
29
- buf.writeBigInt64LE(BigInt(amount), 16);
28
+ buf.writeBigInt64LE(BigInt(Math.floor(price)), 8);
29
+ buf.writeBigInt64LE(BigInt(Math.floor(amount)), 16);
30
+ buf.writeBigInt64LE(BigInt(Math.floor(edgePrice)), 24);
30
31
  return buf;
31
32
  }
32
33
  exports.newSpotOrderData = newSpotOrderData;
33
- function newPerpOrderData(tag, ioc, leverage, orderType, side, instrId, price, amount) {
34
- let buf = Buffer.alloc(32);
34
+ function newPerpOrderData(tag, ioc, leverage, orderType, side, instrId, price, amount, edgePrice) {
35
+ let buf = Buffer.alloc(40);
35
36
  buf.writeUint8(tag, 0);
36
37
  buf.writeUint8(ioc, 1);
37
38
  buf.writeUint8(leverage, 2);
@@ -41,8 +42,9 @@ function newPerpOrderData(tag, ioc, leverage, orderType, side, instrId, price, a
41
42
  buf.writeUint16LE(0, 6);
42
43
  buf.writeUint32LE(0, 8);
43
44
  buf.writeUint32LE(instrId, 12);
44
- buf.writeBigInt64LE(BigInt(price), 16);
45
- buf.writeBigInt64LE(BigInt(amount), 24);
45
+ buf.writeBigInt64LE(BigInt(Math.floor(price)), 16);
46
+ buf.writeBigInt64LE(BigInt(Math.floor(amount)), 24);
47
+ buf.writeBigInt64LE(BigInt(Math.floor(edgePrice)), 32);
46
48
  return buf;
47
49
  }
48
50
  exports.newPerpOrderData = newPerpOrderData;
@@ -70,7 +72,7 @@ function spotOrderCancelData(tag, side, instrId, orderId) {
70
72
  buf.writeUint8(side, 1);
71
73
  buf.writeUint16LE(0, 2);
72
74
  buf.writeUint32LE(instrId, 4);
73
- buf.writeBigInt64LE(BigInt(orderId), 8);
75
+ buf.writeBigInt64LE(BigInt(Math.floor(orderId)), 8);
74
76
  return buf;
75
77
  }
76
78
  exports.spotOrderCancelData = spotOrderCancelData;
@@ -83,13 +85,15 @@ function spotMassCancelData(tag, instrId) {
83
85
  return buf;
84
86
  }
85
87
  exports.spotMassCancelData = spotMassCancelData;
86
- function spotLpData(tag, side, instrId, amount) {
87
- let buf = Buffer.alloc(16);
88
+ function spotLpData(tag, side, instrId, amount, minPrice, maxPrice) {
89
+ let buf = Buffer.alloc(32);
88
90
  buf.writeUint8(tag, 0);
89
91
  buf.writeUint8(side, 1);
90
92
  buf.writeUint16LE(0, 2);
91
93
  buf.writeUint32LE(instrId, 4);
92
- buf.writeBigInt64LE(BigInt(amount), 8);
94
+ buf.writeBigInt64LE(BigInt(Math.floor(amount)), 8);
95
+ buf.writeBigInt64LE(BigInt(Math.floor(minPrice)), 16);
96
+ buf.writeBigInt64LE(BigInt(Math.floor(maxPrice)), 24);
93
97
  return buf;
94
98
  }
95
99
  exports.spotLpData = spotLpData;
@@ -101,7 +105,7 @@ function newInstrumentData(tag, crncyTokenId, lutSlot, price) {
101
105
  buf.writeUint32LE(0, 4);
102
106
  buf.writeUint32LE(crncyTokenId, 8);
103
107
  buf.writeUint32LE(lutSlot, 12);
104
- buf.writeBigInt64LE(BigInt(price), 16);
108
+ buf.writeBigInt64LE(BigInt(Math.floor(price)), 16);
105
109
  return buf;
106
110
  }
107
111
  exports.newInstrumentData = newInstrumentData;
@@ -112,7 +116,7 @@ function depositData(tag, competitionId, depositAll, tokenId, amount, lutSlot, r
112
116
  buf.writeUint8(depositAll, 2);
113
117
  buf.writeUint8(0, 3);
114
118
  buf.writeUint32LE(tokenId, 4);
115
- buf.writeBigInt64LE(BigInt(amount), 8);
119
+ buf.writeBigInt64LE(BigInt(Math.floor(amount)), 8);
116
120
  buf.writeUint32LE(lutSlot, 16);
117
121
  buf.writeUint32LE(refId, 20);
118
122
  return buf;
@@ -124,7 +128,7 @@ function feesDepositData(tag, tokenId, amount) {
124
128
  buf.writeUint8(0, 1);
125
129
  buf.writeUint16LE(0, 2);
126
130
  buf.writeUint32LE(tokenId, 4);
127
- buf.writeBigInt64LE(BigInt(amount), 8);
131
+ buf.writeBigInt64LE(BigInt(Math.floor(amount)), 8);
128
132
  return buf;
129
133
  }
130
134
  exports.feesDepositData = feesDepositData;
@@ -134,7 +138,7 @@ function feesWithdrawData(tag, tokenId, amount) {
134
138
  buf.writeUint8(0, 1);
135
139
  buf.writeUint16LE(0, 2);
136
140
  buf.writeUint32LE(tokenId, 4);
137
- buf.writeBigInt64LE(BigInt(amount), 8);
141
+ buf.writeBigInt64LE(BigInt(Math.floor(amount)), 8);
138
142
  return buf;
139
143
  }
140
144
  exports.feesWithdrawData = feesWithdrawData;
@@ -144,7 +148,7 @@ function perpDepositData(tag, instrId, amount) {
144
148
  buf.writeUint8(0, 1);
145
149
  buf.writeUint16LE(0, 2);
146
150
  buf.writeUint32LE(instrId, 4);
147
- buf.writeBigInt64LE(BigInt(amount), 8);
151
+ buf.writeBigInt64LE(BigInt(Math.floor(amount)), 8);
148
152
  return buf;
149
153
  }
150
154
  exports.perpDepositData = perpDepositData;
@@ -163,7 +167,7 @@ function perpWithdrawData(tag, instrId, amount) {
163
167
  buf.writeUint8(0, 1);
164
168
  buf.writeUint16LE(0, 2);
165
169
  buf.writeUint32LE(instrId, 4);
166
- buf.writeBigInt64LE(BigInt(amount), 8);
170
+ buf.writeBigInt64LE(BigInt(Math.floor(amount)), 8);
167
171
  return buf;
168
172
  }
169
173
  exports.perpWithdrawData = perpWithdrawData;
@@ -173,18 +177,18 @@ function withdrawData(tag, tokenId, amount) {
173
177
  buf.writeUint8(0, 1);
174
178
  buf.writeUint16LE(0, 2);
175
179
  buf.writeUint32LE(tokenId, 4);
176
- buf.writeBigInt64LE(BigInt(amount), 8);
180
+ buf.writeBigInt64LE(BigInt(Math.floor(amount)), 8);
177
181
  return buf;
178
182
  }
179
183
  exports.withdrawData = withdrawData;
180
- function swapData(tag, side, instrId, price, amount) {
184
+ function swapData(tag, inputCrncy, instrId, price, amount) {
181
185
  let buf = Buffer.alloc(24);
182
186
  buf.writeUint8(tag, 0);
183
- buf.writeUint8(side, 1);
187
+ buf.writeUint8(inputCrncy, 1);
184
188
  buf.writeUint16LE(0, 2);
185
189
  buf.writeUint32LE(instrId, 4);
186
- buf.writeBigInt64LE(BigInt(price), 8);
187
- buf.writeBigInt64LE(BigInt(amount), 16);
190
+ buf.writeBigInt64LE(BigInt(Math.floor(price)), 8);
191
+ buf.writeBigInt64LE(BigInt(Math.floor(amount)), 16);
188
192
  return buf;
189
193
  }
190
194
  exports.swapData = swapData;
@@ -194,12 +198,12 @@ function spotQuotesReplaceData(tag, instrId, newBidPrice, newBidQty, oldBidOrder
194
198
  buf.writeUint8(0, 1);
195
199
  buf.writeUint16LE(0, 2);
196
200
  buf.writeUint32LE(instrId, 4);
197
- buf.writeBigInt64LE(BigInt(newBidPrice), 8);
198
- buf.writeBigInt64LE(BigInt(newBidQty), 16);
199
- buf.writeBigInt64LE(BigInt(oldBidOrderId), 24);
200
- buf.writeBigInt64LE(BigInt(newAskPrice), 32);
201
- buf.writeBigInt64LE(BigInt(newAskQty), 40);
202
- buf.writeBigInt64LE(BigInt(oldAskOrderId), 48);
201
+ buf.writeBigInt64LE(BigInt(Math.floor(newBidPrice)), 8);
202
+ buf.writeBigInt64LE(BigInt(Math.floor(newBidQty)), 16);
203
+ buf.writeBigInt64LE(BigInt(Math.floor(oldBidOrderId)), 24);
204
+ buf.writeBigInt64LE(BigInt(Math.floor(newAskPrice)), 32);
205
+ buf.writeBigInt64LE(BigInt(Math.floor(newAskQty)), 40);
206
+ buf.writeBigInt64LE(BigInt(Math.floor(oldAskOrderId)), 48);
203
207
  return buf;
204
208
  }
205
209
  exports.spotQuotesReplaceData = spotQuotesReplaceData;
@@ -209,12 +213,12 @@ function perpQuotesReplaceData(tag, instrId, newBidPrice, newBidQty, oldBidOrder
209
213
  buf.writeUint8(0, 1);
210
214
  buf.writeUint16LE(0, 2);
211
215
  buf.writeUint32LE(instrId, 4);
212
- buf.writeBigInt64LE(BigInt(newBidPrice), 8);
213
- buf.writeBigInt64LE(BigInt(newBidQty), 16);
214
- buf.writeBigInt64LE(BigInt(oldBidOrderId), 24);
215
- buf.writeBigInt64LE(BigInt(newAskPrice), 32);
216
- buf.writeBigInt64LE(BigInt(newAskQty), 40);
217
- buf.writeBigInt64LE(BigInt(oldAskOrderId), 48);
216
+ buf.writeBigInt64LE(BigInt(Math.floor(newBidPrice)), 8);
217
+ buf.writeBigInt64LE(BigInt(Math.floor(newBidQty)), 16);
218
+ buf.writeBigInt64LE(BigInt(Math.floor(oldBidOrderId)), 24);
219
+ buf.writeBigInt64LE(BigInt(Math.floor(newAskPrice)), 32);
220
+ buf.writeBigInt64LE(BigInt(Math.floor(newAskQty)), 40);
221
+ buf.writeBigInt64LE(BigInt(Math.floor(oldAskOrderId)), 48);
218
222
  return buf;
219
223
  }
220
224
  exports.perpQuotesReplaceData = perpQuotesReplaceData;
@@ -245,15 +249,6 @@ function upgradeToPerpData(tag, instrId) {
245
249
  return buf;
246
250
  }
247
251
  exports.upgradeToPerpData = upgradeToPerpData;
248
- function setInstrOracleFeedData(tag, instrId) {
249
- let buf = Buffer.alloc(8);
250
- buf.writeUint8(tag, 0);
251
- buf.writeUint8(0, 1);
252
- buf.writeUint16LE(0, 2);
253
- buf.writeUint32LE(instrId, 4);
254
- return buf;
255
- }
256
- exports.setInstrOracleFeedData = setInstrOracleFeedData;
257
252
  function setInstrReadyForPerpUpgradeData(tag, instrId, variance) {
258
253
  let buf = Buffer.alloc(16);
259
254
  buf.writeUint8(tag, 0);
@@ -263,23 +258,13 @@ function setInstrReadyForPerpUpgradeData(tag, instrId, variance) {
263
258
  return buf;
264
259
  }
265
260
  exports.setInstrReadyForPerpUpgradeData = setInstrReadyForPerpUpgradeData;
266
- function newTokenData(tag, crncy, needInitialization) {
267
- let buf = Buffer.alloc(8);
268
- buf.writeUint8(tag, 0);
269
- buf.writeUint8(crncy, 1);
270
- buf.writeUint8(needInitialization, 2);
271
- buf.writeUint8(0, 3);
272
- buf.writeUint32LE(0, 4);
273
- return buf;
274
- }
275
- exports.newTokenData = newTokenData;
276
261
  function perpOrderCancelData(tag, side, instrId, orderId) {
277
262
  let buf = Buffer.alloc(16);
278
263
  buf.writeUint8(tag, 0);
279
264
  buf.writeUint8(side, 1);
280
265
  buf.writeUint16LE(0, 2);
281
266
  buf.writeUint32LE(instrId, 4);
282
- buf.writeBigInt64LE(BigInt(orderId), 8);
267
+ buf.writeBigInt64LE(BigInt(Math.floor(orderId)), 8);
283
268
  return buf;
284
269
  }
285
270
  exports.perpOrderCancelData = perpOrderCancelData;
@@ -292,15 +277,6 @@ function perpMassCancelData(tag, instrId) {
292
277
  return buf;
293
278
  }
294
279
  exports.perpMassCancelData = perpMassCancelData;
295
- function perpForcedCloseData(tag, instrId) {
296
- let buf = Buffer.alloc(8);
297
- buf.writeUint8(tag, 0);
298
- buf.writeUint8(0, 1);
299
- buf.writeUint16LE(0, 2);
300
- buf.writeUint32LE(instrId, 4);
301
- return buf;
302
- }
303
- exports.perpForcedCloseData = perpForcedCloseData;
304
280
  function changeRefProgramData(tag, refProgramDuration, refLinkDuration, refDiscount, refRatio) {
305
281
  let buf = Buffer.alloc(32);
306
282
  buf.writeUint8(tag, 0);
@@ -312,22 +288,24 @@ function changeRefProgramData(tag, refProgramDuration, refLinkDuration, refDisco
312
288
  return buf;
313
289
  }
314
290
  exports.changeRefProgramData = changeRefProgramData;
315
- function buyMarketSeatData(tag, instrId, amount) {
316
- let buf = Buffer.alloc(16);
291
+ function buyMarketSeatData(tag, instrId, edgePrice, amount) {
292
+ let buf = Buffer.alloc(24);
317
293
  buf.writeUint8(tag, 0);
318
294
  buf.writeUint8(0, 1);
319
295
  buf.writeUint16LE(0, 2);
320
296
  buf.writeUint32LE(instrId, 4);
321
- buf.writeBigInt64LE(BigInt(amount), 8);
297
+ buf.writeBigInt64LE(BigInt(Math.floor(edgePrice)), 8);
298
+ buf.writeBigInt64LE(BigInt(Math.floor(amount)), 16);
322
299
  return buf;
323
300
  }
324
301
  exports.buyMarketSeatData = buyMarketSeatData;
325
- function sellMarketSeatData(tag, instrId) {
326
- let buf = Buffer.alloc(8);
302
+ function sellMarketSeatData(tag, instrId, edgePrice) {
303
+ let buf = Buffer.alloc(16);
327
304
  buf.writeUint8(tag, 0);
328
305
  buf.writeUint8(0, 1);
329
306
  buf.writeUint16LE(0, 2);
330
307
  buf.writeUint32LE(instrId, 4);
308
+ buf.writeBigInt64LE(BigInt(Math.floor(edgePrice)), 8);
331
309
  return buf;
332
310
  }
333
311
  exports.sellMarketSeatData = sellMarketSeatData;
@@ -340,3 +318,83 @@ function newPrivateClient(tag, expirationTime) {
340
318
  return buf;
341
319
  }
342
320
  exports.newPrivateClient = newPrivateClient;
321
+ function pointsProgramExpiration(tag, newExpirationTime) {
322
+ let buf = Buffer.alloc(8);
323
+ buf.writeUint8(tag, 0);
324
+ buf.writeUint8(0, 1);
325
+ buf.writeUint16LE(0, 2);
326
+ buf.writeUint32LE(newExpirationTime, 4);
327
+ return buf;
328
+ }
329
+ exports.pointsProgramExpiration = pointsProgramExpiration;
330
+ function setVarianceData(tag, variance) {
331
+ let buf = Buffer.alloc(12);
332
+ buf.writeUint8(tag, 0);
333
+ buf.writeUint8(0, 1);
334
+ buf.writeUint16LE(0, 2);
335
+ return buf;
336
+ }
337
+ exports.setVarianceData = setVarianceData;
338
+ function changeDenominatorData(tag, baseCrncyId, denominator) {
339
+ let buf = Buffer.alloc(16);
340
+ buf.writeUint8(tag, 0);
341
+ buf.writeUint8(0, 1);
342
+ buf.writeUint16LE(0, 2);
343
+ buf.writeUint32LE(baseCrncyId, 4);
344
+ return buf;
345
+ }
346
+ exports.changeDenominatorData = changeDenominatorData;
347
+ function newBaseCrncyData(tag, denominator) {
348
+ let buf = Buffer.alloc(16);
349
+ buf.writeUint8(tag, 0);
350
+ buf.writeUint8(0, 1);
351
+ buf.writeUint16LE(0, 2);
352
+ buf.writeUint32LE(0, 4);
353
+ return buf;
354
+ }
355
+ exports.newBaseCrncyData = newBaseCrncyData;
356
+ function perpClientsProcessingData(tag, instrId) {
357
+ let buf = Buffer.alloc(8);
358
+ buf.writeUint8(tag, 0);
359
+ buf.writeUint8(0, 1);
360
+ buf.writeUint16LE(0, 2);
361
+ buf.writeUint32LE(instrId, 4);
362
+ return buf;
363
+ }
364
+ exports.perpClientsProcessingData = perpClientsProcessingData;
365
+ function setSeatPurchasingFeeData(tag, fee) {
366
+ let buf = Buffer.alloc(16);
367
+ buf.writeUint8(tag, 0);
368
+ buf.writeUint8(0, 1);
369
+ buf.writeUint16LE(0, 2);
370
+ buf.writeUint32LE(0, 4);
371
+ return buf;
372
+ }
373
+ exports.setSeatPurchasingFeeData = setSeatPurchasingFeeData;
374
+ function changeVotingData(tag, newChoice, votingCounter) {
375
+ let buf = Buffer.alloc(8);
376
+ buf.writeUint8(tag, 0);
377
+ buf.writeUint8(newChoice, 1);
378
+ buf.writeUint16LE(0, 2);
379
+ buf.writeUint32LE(votingCounter, 4);
380
+ return buf;
381
+ }
382
+ exports.changeVotingData = changeVotingData;
383
+ function garbageCollectorData(tag, instrId) {
384
+ let buf = Buffer.alloc(8);
385
+ buf.writeUint8(tag, 0);
386
+ buf.writeUint8(0, 1);
387
+ buf.writeUint16LE(0, 2);
388
+ buf.writeUint32LE(instrId, 4);
389
+ return buf;
390
+ }
391
+ exports.garbageCollectorData = garbageCollectorData;
392
+ function activateClientRefProgramData(tag, refId) {
393
+ let buf = Buffer.alloc(8);
394
+ buf.writeUint8(tag, 0);
395
+ buf.writeUint8(0, 1);
396
+ buf.writeUint16LE(0, 2);
397
+ buf.writeUint32LE(refId, 4);
398
+ return buf;
399
+ }
400
+ exports.activateClientRefProgramData = activateClientRefProgramData;