@deriverse/kit 1.0.39 → 1.0.42
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/auto_buffer.d.ts +0 -2
- package/dist/auto_data.d.ts +0 -2
- package/dist/constants.d.ts +14 -0
- package/dist/constants.js +28 -0
- package/dist/engine/account-helpers.d.ts +59 -0
- package/dist/engine/account-helpers.js +177 -0
- package/dist/engine/account-helpers.test.d.ts +1 -0
- package/dist/engine/account-helpers.test.js +199 -0
- package/dist/engine/client-queries.d.ts +36 -0
- package/dist/engine/client-queries.js +498 -0
- package/dist/engine/client-queries.test.d.ts +1 -0
- package/dist/engine/client-queries.test.js +341 -0
- package/dist/engine/context-builders.d.ts +16 -0
- package/dist/engine/context-builders.js +158 -0
- package/dist/engine/context-builders.test.d.ts +1 -0
- package/dist/engine/context-builders.test.js +156 -0
- package/dist/engine/index.d.ts +101 -0
- package/dist/engine/index.js +745 -0
- package/dist/engine/index.test.d.ts +1 -0
- package/dist/engine/index.test.js +685 -0
- package/dist/engine/logs-decoder.d.ts +18 -0
- package/dist/engine/logs-decoder.js +525 -0
- package/dist/engine/logs-decoder.test.d.ts +1 -0
- package/dist/engine/logs-decoder.test.js +836 -0
- package/dist/engine/perp-instructions.d.ts +68 -0
- package/dist/engine/perp-instructions.js +497 -0
- package/dist/engine/perp-instructions.test.d.ts +1 -0
- package/dist/engine/perp-instructions.test.js +292 -0
- package/dist/engine/spot-instructions.d.ts +52 -0
- package/dist/engine/spot-instructions.js +399 -0
- package/dist/engine/spot-instructions.test.d.ts +1 -0
- package/dist/engine/spot-instructions.test.js +221 -0
- package/dist/engine/utils.d.ts +23 -0
- package/dist/engine/utils.js +332 -0
- package/dist/engine/utils.test.d.ts +1 -0
- package/dist/engine/utils.test.js +120 -0
- package/dist/index.d.ts +6 -247
- package/dist/index.js +14 -2923
- package/dist/instruction_models.d.ts +10 -9
- package/dist/instruction_models.js +88 -69
- package/dist/logs_models.d.ts +147 -5
- package/dist/logs_models.js +243 -13
- package/dist/structure_models.d.ts +104 -99
- package/dist/structure_models.js +152 -129
- package/dist/types/engine-args.d.ts +32 -0
- package/dist/types/engine-args.js +2 -0
- package/dist/types/enums.d.ts +43 -0
- package/dist/{types.js → types/enums.js} +3 -5
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.js +38 -0
- package/dist/types/log-message.d.ts +2 -0
- package/dist/types/log-message.js +2 -0
- package/dist/types/responses.d.ts +248 -0
- package/dist/types/responses.js +2 -0
- package/dist/types/schemas.d.ts +168 -0
- package/dist/types/schemas.js +239 -0
- package/dist/types/schemas.test.d.ts +1 -0
- package/dist/types/schemas.test.js +93 -0
- package/dist/utils.d.ts +0 -0
- package/dist/utils.js +1 -0
- package/package.json +26 -6
- package/dist/types.d.ts +0 -565
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare function newOperatorData(tag: number): Buffer;
|
|
4
|
-
export declare function newRootAccountData(tag: number, privateMode: number, lutSlot: number): Buffer;
|
|
1
|
+
export declare function newOperatorData(tag: number, version: number): Buffer;
|
|
2
|
+
export declare function newRootAccountData(tag: number, privateMode: number, version: number, lutSlot: number): Buffer;
|
|
5
3
|
export declare function newSpotOrderData(tag: number, ioc: number, orderType: number, side: number, instrId: number, price: number, amount: number, edgePrice: number): Buffer;
|
|
6
4
|
export declare function newPerpOrderData(tag: number, ioc: number, leverage: number, orderType: number, side: number, instrId: number, price: number, amount: number, edgePrice: number): Buffer;
|
|
7
5
|
export declare function perpChangeLeverageData(tag: number, leverage: number, instrId: number): Buffer;
|
|
@@ -17,13 +15,13 @@ export declare function perpDepositData(tag: number, instrId: number, amount: nu
|
|
|
17
15
|
export declare function moveSpotAvailFundsData(tag: number, instrId: number): Buffer;
|
|
18
16
|
export declare function perpWithdrawData(tag: number, instrId: number, amount: number): Buffer;
|
|
19
17
|
export declare function withdrawData(tag: number, tokenId: number, amount: number): Buffer;
|
|
20
|
-
export declare function swapData(tag: number, inputCrncy: number, instrId: number, price: number, amount: number): Buffer;
|
|
21
|
-
export declare function spotQuotesReplaceData(tag: number,
|
|
22
|
-
export declare function perpQuotesReplaceData(tag: number,
|
|
18
|
+
export declare function swapData(tag: number, inputCrncy: number, instrId: number, price: number, amount: number, refFeeRate: number, minAmountOut: number): Buffer;
|
|
19
|
+
export declare function spotQuotesReplaceData(tag: number, mask: number, instrId: number): Buffer;
|
|
20
|
+
export declare function perpQuotesReplaceData(tag: number, mask: number, instrId: number): Buffer;
|
|
23
21
|
export declare function votingData(tag: number, choice: number, votingCounter: number): Buffer;
|
|
24
22
|
export declare function airdropData(tag: number, ratio: number): Buffer;
|
|
25
23
|
export declare function upgradeToPerpData(tag: number, instrId: number): Buffer;
|
|
26
|
-
export declare function setInstrReadyForPerpUpgradeData(tag: number, instrId: number
|
|
24
|
+
export declare function setInstrReadyForPerpUpgradeData(tag: number, instrId: number): Buffer;
|
|
27
25
|
export declare function perpOrderCancelData(tag: number, side: number, instrId: number, orderId: number): Buffer;
|
|
28
26
|
export declare function perpMassCancelData(tag: number, instrId: number): Buffer;
|
|
29
27
|
export declare function changeRefProgramData(tag: number, refProgramDuration: number, refLinkDuration: number, refDiscount: number, refRatio: number): Buffer;
|
|
@@ -31,7 +29,7 @@ export declare function buyMarketSeatData(tag: number, instrId: number, edgePric
|
|
|
31
29
|
export declare function sellMarketSeatData(tag: number, instrId: number, edgePrice: number): Buffer;
|
|
32
30
|
export declare function newPrivateClient(tag: number, expirationTime: number): Buffer;
|
|
33
31
|
export declare function pointsProgramExpiration(tag: number, newExpirationTime: number): Buffer;
|
|
34
|
-
export declare function setVarianceData(tag: number, variance: number): Buffer;
|
|
32
|
+
export declare function setVarianceData(tag: number, instrId: number, variance: number): Buffer;
|
|
35
33
|
export declare function changeDenominatorData(tag: number, baseCrncyId: number, denominator: number): Buffer;
|
|
36
34
|
export declare function newBaseCrncyData(tag: number, denominator: number): Buffer;
|
|
37
35
|
export declare function perpClientsProcessingData(tag: number, instrId: number): Buffer;
|
|
@@ -39,3 +37,6 @@ export declare function setSeatPurchasingFeeData(tag: number, fee: number): Buff
|
|
|
39
37
|
export declare function changeVotingData(tag: number, newChoice: number, votingCounter: number): Buffer;
|
|
40
38
|
export declare function garbageCollectorData(tag: number, instrId: number): Buffer;
|
|
41
39
|
export declare function activateClientRefProgramData(tag: number, refId: number): Buffer;
|
|
40
|
+
export declare function cleanCandlesData(tag: number, instrId: number): Buffer;
|
|
41
|
+
export declare function vmInitWithdrawData(tag: number, tokenId: number, amount: number): Buffer;
|
|
42
|
+
export declare function vmChangeWhitelistData(tag: number, mask: number): Buffer;
|
|
@@ -1,23 +1,64 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
exports.newOperatorData = newOperatorData;
|
|
4
|
+
exports.newRootAccountData = newRootAccountData;
|
|
5
|
+
exports.newSpotOrderData = newSpotOrderData;
|
|
6
|
+
exports.newPerpOrderData = newPerpOrderData;
|
|
7
|
+
exports.perpChangeLeverageData = perpChangeLeverageData;
|
|
8
|
+
exports.perpStatisticsResetData = perpStatisticsResetData;
|
|
9
|
+
exports.spotOrderCancelData = spotOrderCancelData;
|
|
10
|
+
exports.spotMassCancelData = spotMassCancelData;
|
|
11
|
+
exports.spotLpData = spotLpData;
|
|
12
|
+
exports.newInstrumentData = newInstrumentData;
|
|
13
|
+
exports.depositData = depositData;
|
|
14
|
+
exports.feesDepositData = feesDepositData;
|
|
15
|
+
exports.feesWithdrawData = feesWithdrawData;
|
|
16
|
+
exports.perpDepositData = perpDepositData;
|
|
17
|
+
exports.moveSpotAvailFundsData = moveSpotAvailFundsData;
|
|
18
|
+
exports.perpWithdrawData = perpWithdrawData;
|
|
19
|
+
exports.withdrawData = withdrawData;
|
|
20
|
+
exports.swapData = swapData;
|
|
21
|
+
exports.spotQuotesReplaceData = spotQuotesReplaceData;
|
|
22
|
+
exports.perpQuotesReplaceData = perpQuotesReplaceData;
|
|
23
|
+
exports.votingData = votingData;
|
|
24
|
+
exports.airdropData = airdropData;
|
|
25
|
+
exports.upgradeToPerpData = upgradeToPerpData;
|
|
26
|
+
exports.setInstrReadyForPerpUpgradeData = setInstrReadyForPerpUpgradeData;
|
|
27
|
+
exports.perpOrderCancelData = perpOrderCancelData;
|
|
28
|
+
exports.perpMassCancelData = perpMassCancelData;
|
|
29
|
+
exports.changeRefProgramData = changeRefProgramData;
|
|
30
|
+
exports.buyMarketSeatData = buyMarketSeatData;
|
|
31
|
+
exports.sellMarketSeatData = sellMarketSeatData;
|
|
32
|
+
exports.newPrivateClient = newPrivateClient;
|
|
33
|
+
exports.pointsProgramExpiration = pointsProgramExpiration;
|
|
34
|
+
exports.setVarianceData = setVarianceData;
|
|
35
|
+
exports.changeDenominatorData = changeDenominatorData;
|
|
36
|
+
exports.newBaseCrncyData = newBaseCrncyData;
|
|
37
|
+
exports.perpClientsProcessingData = perpClientsProcessingData;
|
|
38
|
+
exports.setSeatPurchasingFeeData = setSeatPurchasingFeeData;
|
|
39
|
+
exports.changeVotingData = changeVotingData;
|
|
40
|
+
exports.garbageCollectorData = garbageCollectorData;
|
|
41
|
+
exports.activateClientRefProgramData = activateClientRefProgramData;
|
|
42
|
+
exports.cleanCandlesData = cleanCandlesData;
|
|
43
|
+
exports.vmInitWithdrawData = vmInitWithdrawData;
|
|
44
|
+
exports.vmChangeWhitelistData = vmChangeWhitelistData;
|
|
45
|
+
function newOperatorData(tag, version) {
|
|
46
|
+
let buf = Buffer.alloc(8);
|
|
6
47
|
buf.writeUint8(tag, 0);
|
|
7
48
|
buf.writeUint8(0, 1);
|
|
8
49
|
buf.writeUint16LE(0, 2);
|
|
50
|
+
buf.writeUint32LE(version, 4);
|
|
9
51
|
return buf;
|
|
10
52
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
let buf = Buffer.alloc(8);
|
|
53
|
+
function newRootAccountData(tag, privateMode, version, lutSlot) {
|
|
54
|
+
let buf = Buffer.alloc(12);
|
|
14
55
|
buf.writeUint8(tag, 0);
|
|
15
56
|
buf.writeUint8(privateMode, 1);
|
|
16
57
|
buf.writeUint16LE(0, 2);
|
|
17
|
-
buf.writeUint32LE(
|
|
58
|
+
buf.writeUint32LE(version, 4);
|
|
59
|
+
buf.writeUint32LE(lutSlot, 8);
|
|
18
60
|
return buf;
|
|
19
61
|
}
|
|
20
|
-
exports.newRootAccountData = newRootAccountData;
|
|
21
62
|
function newSpotOrderData(tag, ioc, orderType, side, instrId, price, amount, edgePrice) {
|
|
22
63
|
let buf = Buffer.alloc(32);
|
|
23
64
|
buf.writeUint8(tag, 0);
|
|
@@ -30,7 +71,6 @@ function newSpotOrderData(tag, ioc, orderType, side, instrId, price, amount, edg
|
|
|
30
71
|
buf.writeBigInt64LE(BigInt(Math.floor(edgePrice)), 24);
|
|
31
72
|
return buf;
|
|
32
73
|
}
|
|
33
|
-
exports.newSpotOrderData = newSpotOrderData;
|
|
34
74
|
function newPerpOrderData(tag, ioc, leverage, orderType, side, instrId, price, amount, edgePrice) {
|
|
35
75
|
let buf = Buffer.alloc(40);
|
|
36
76
|
buf.writeUint8(tag, 0);
|
|
@@ -47,7 +87,6 @@ function newPerpOrderData(tag, ioc, leverage, orderType, side, instrId, price, a
|
|
|
47
87
|
buf.writeBigInt64LE(BigInt(Math.floor(edgePrice)), 32);
|
|
48
88
|
return buf;
|
|
49
89
|
}
|
|
50
|
-
exports.newPerpOrderData = newPerpOrderData;
|
|
51
90
|
function perpChangeLeverageData(tag, leverage, instrId) {
|
|
52
91
|
let buf = Buffer.alloc(8);
|
|
53
92
|
buf.writeUint8(tag, 0);
|
|
@@ -56,7 +95,6 @@ function perpChangeLeverageData(tag, leverage, instrId) {
|
|
|
56
95
|
buf.writeUint32LE(instrId, 4);
|
|
57
96
|
return buf;
|
|
58
97
|
}
|
|
59
|
-
exports.perpChangeLeverageData = perpChangeLeverageData;
|
|
60
98
|
function perpStatisticsResetData(tag, instrId) {
|
|
61
99
|
let buf = Buffer.alloc(8);
|
|
62
100
|
buf.writeUint8(tag, 0);
|
|
@@ -65,7 +103,6 @@ function perpStatisticsResetData(tag, instrId) {
|
|
|
65
103
|
buf.writeUint32LE(instrId, 4);
|
|
66
104
|
return buf;
|
|
67
105
|
}
|
|
68
|
-
exports.perpStatisticsResetData = perpStatisticsResetData;
|
|
69
106
|
function spotOrderCancelData(tag, side, instrId, orderId) {
|
|
70
107
|
let buf = Buffer.alloc(16);
|
|
71
108
|
buf.writeUint8(tag, 0);
|
|
@@ -75,7 +112,6 @@ function spotOrderCancelData(tag, side, instrId, orderId) {
|
|
|
75
112
|
buf.writeBigInt64LE(BigInt(Math.floor(orderId)), 8);
|
|
76
113
|
return buf;
|
|
77
114
|
}
|
|
78
|
-
exports.spotOrderCancelData = spotOrderCancelData;
|
|
79
115
|
function spotMassCancelData(tag, instrId) {
|
|
80
116
|
let buf = Buffer.alloc(8);
|
|
81
117
|
buf.writeUint8(tag, 0);
|
|
@@ -84,7 +120,6 @@ function spotMassCancelData(tag, instrId) {
|
|
|
84
120
|
buf.writeUint32LE(instrId, 4);
|
|
85
121
|
return buf;
|
|
86
122
|
}
|
|
87
|
-
exports.spotMassCancelData = spotMassCancelData;
|
|
88
123
|
function spotLpData(tag, side, instrId, amount, minPrice, maxPrice) {
|
|
89
124
|
let buf = Buffer.alloc(32);
|
|
90
125
|
buf.writeUint8(tag, 0);
|
|
@@ -96,7 +131,6 @@ function spotLpData(tag, side, instrId, amount, minPrice, maxPrice) {
|
|
|
96
131
|
buf.writeBigInt64LE(BigInt(Math.floor(maxPrice)), 24);
|
|
97
132
|
return buf;
|
|
98
133
|
}
|
|
99
|
-
exports.spotLpData = spotLpData;
|
|
100
134
|
function newInstrumentData(tag, crncyTokenId, lutSlot, price) {
|
|
101
135
|
let buf = Buffer.alloc(24);
|
|
102
136
|
buf.writeUint8(tag, 0);
|
|
@@ -108,7 +142,6 @@ function newInstrumentData(tag, crncyTokenId, lutSlot, price) {
|
|
|
108
142
|
buf.writeBigInt64LE(BigInt(Math.floor(price)), 16);
|
|
109
143
|
return buf;
|
|
110
144
|
}
|
|
111
|
-
exports.newInstrumentData = newInstrumentData;
|
|
112
145
|
function depositData(tag, competitionId, depositAll, tokenId, amount, lutSlot, refId) {
|
|
113
146
|
let buf = Buffer.alloc(24);
|
|
114
147
|
buf.writeUint8(tag, 0);
|
|
@@ -121,7 +154,6 @@ function depositData(tag, competitionId, depositAll, tokenId, amount, lutSlot, r
|
|
|
121
154
|
buf.writeUint32LE(refId, 20);
|
|
122
155
|
return buf;
|
|
123
156
|
}
|
|
124
|
-
exports.depositData = depositData;
|
|
125
157
|
function feesDepositData(tag, tokenId, amount) {
|
|
126
158
|
let buf = Buffer.alloc(16);
|
|
127
159
|
buf.writeUint8(tag, 0);
|
|
@@ -131,7 +163,6 @@ function feesDepositData(tag, tokenId, amount) {
|
|
|
131
163
|
buf.writeBigInt64LE(BigInt(Math.floor(amount)), 8);
|
|
132
164
|
return buf;
|
|
133
165
|
}
|
|
134
|
-
exports.feesDepositData = feesDepositData;
|
|
135
166
|
function feesWithdrawData(tag, tokenId, amount) {
|
|
136
167
|
let buf = Buffer.alloc(16);
|
|
137
168
|
buf.writeUint8(tag, 0);
|
|
@@ -141,7 +172,6 @@ function feesWithdrawData(tag, tokenId, amount) {
|
|
|
141
172
|
buf.writeBigInt64LE(BigInt(Math.floor(amount)), 8);
|
|
142
173
|
return buf;
|
|
143
174
|
}
|
|
144
|
-
exports.feesWithdrawData = feesWithdrawData;
|
|
145
175
|
function perpDepositData(tag, instrId, amount) {
|
|
146
176
|
let buf = Buffer.alloc(16);
|
|
147
177
|
buf.writeUint8(tag, 0);
|
|
@@ -151,7 +181,6 @@ function perpDepositData(tag, instrId, amount) {
|
|
|
151
181
|
buf.writeBigInt64LE(BigInt(Math.floor(amount)), 8);
|
|
152
182
|
return buf;
|
|
153
183
|
}
|
|
154
|
-
exports.perpDepositData = perpDepositData;
|
|
155
184
|
function moveSpotAvailFundsData(tag, instrId) {
|
|
156
185
|
let buf = Buffer.alloc(8);
|
|
157
186
|
buf.writeUint8(tag, 0);
|
|
@@ -160,7 +189,6 @@ function moveSpotAvailFundsData(tag, instrId) {
|
|
|
160
189
|
buf.writeUint32LE(instrId, 4);
|
|
161
190
|
return buf;
|
|
162
191
|
}
|
|
163
|
-
exports.moveSpotAvailFundsData = moveSpotAvailFundsData;
|
|
164
192
|
function perpWithdrawData(tag, instrId, amount) {
|
|
165
193
|
let buf = Buffer.alloc(16);
|
|
166
194
|
buf.writeUint8(tag, 0);
|
|
@@ -170,7 +198,6 @@ function perpWithdrawData(tag, instrId, amount) {
|
|
|
170
198
|
buf.writeBigInt64LE(BigInt(Math.floor(amount)), 8);
|
|
171
199
|
return buf;
|
|
172
200
|
}
|
|
173
|
-
exports.perpWithdrawData = perpWithdrawData;
|
|
174
201
|
function withdrawData(tag, tokenId, amount) {
|
|
175
202
|
let buf = Buffer.alloc(16);
|
|
176
203
|
buf.writeUint8(tag, 0);
|
|
@@ -180,48 +207,33 @@ function withdrawData(tag, tokenId, amount) {
|
|
|
180
207
|
buf.writeBigInt64LE(BigInt(Math.floor(amount)), 8);
|
|
181
208
|
return buf;
|
|
182
209
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
let buf = Buffer.alloc(24);
|
|
210
|
+
function swapData(tag, inputCrncy, instrId, price, amount, refFeeRate, minAmountOut) {
|
|
211
|
+
let buf = Buffer.alloc(40);
|
|
186
212
|
buf.writeUint8(tag, 0);
|
|
187
213
|
buf.writeUint8(inputCrncy, 1);
|
|
188
214
|
buf.writeUint16LE(0, 2);
|
|
189
215
|
buf.writeUint32LE(instrId, 4);
|
|
190
216
|
buf.writeBigInt64LE(BigInt(Math.floor(price)), 8);
|
|
191
217
|
buf.writeBigInt64LE(BigInt(Math.floor(amount)), 16);
|
|
218
|
+
buf.writeBigInt64LE(BigInt(Math.floor(minAmountOut)), 24);
|
|
192
219
|
return buf;
|
|
193
220
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
let buf = Buffer.alloc(56);
|
|
221
|
+
function spotQuotesReplaceData(tag, mask, instrId) {
|
|
222
|
+
let buf = Buffer.alloc(8);
|
|
197
223
|
buf.writeUint8(tag, 0);
|
|
198
224
|
buf.writeUint8(0, 1);
|
|
199
|
-
buf.writeUint16LE(
|
|
225
|
+
buf.writeUint16LE(mask, 2);
|
|
200
226
|
buf.writeUint32LE(instrId, 4);
|
|
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);
|
|
207
227
|
return buf;
|
|
208
228
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
let buf = Buffer.alloc(56);
|
|
229
|
+
function perpQuotesReplaceData(tag, mask, instrId) {
|
|
230
|
+
let buf = Buffer.alloc(8);
|
|
212
231
|
buf.writeUint8(tag, 0);
|
|
213
232
|
buf.writeUint8(0, 1);
|
|
214
|
-
buf.writeUint16LE(
|
|
233
|
+
buf.writeUint16LE(mask, 2);
|
|
215
234
|
buf.writeUint32LE(instrId, 4);
|
|
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);
|
|
222
235
|
return buf;
|
|
223
236
|
}
|
|
224
|
-
exports.perpQuotesReplaceData = perpQuotesReplaceData;
|
|
225
237
|
function votingData(tag, choice, votingCounter) {
|
|
226
238
|
let buf = Buffer.alloc(8);
|
|
227
239
|
buf.writeUint8(tag, 0);
|
|
@@ -230,7 +242,6 @@ function votingData(tag, choice, votingCounter) {
|
|
|
230
242
|
buf.writeUint32LE(votingCounter, 4);
|
|
231
243
|
return buf;
|
|
232
244
|
}
|
|
233
|
-
exports.votingData = votingData;
|
|
234
245
|
function airdropData(tag, ratio) {
|
|
235
246
|
let buf = Buffer.alloc(16);
|
|
236
247
|
buf.writeUint8(tag, 0);
|
|
@@ -239,7 +250,6 @@ function airdropData(tag, ratio) {
|
|
|
239
250
|
buf.writeUint32LE(0, 4);
|
|
240
251
|
return buf;
|
|
241
252
|
}
|
|
242
|
-
exports.airdropData = airdropData;
|
|
243
253
|
function upgradeToPerpData(tag, instrId) {
|
|
244
254
|
let buf = Buffer.alloc(8);
|
|
245
255
|
buf.writeUint8(tag, 0);
|
|
@@ -248,16 +258,14 @@ function upgradeToPerpData(tag, instrId) {
|
|
|
248
258
|
buf.writeUint32LE(instrId, 4);
|
|
249
259
|
return buf;
|
|
250
260
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
let buf = Buffer.alloc(16);
|
|
261
|
+
function setInstrReadyForPerpUpgradeData(tag, instrId) {
|
|
262
|
+
let buf = Buffer.alloc(8);
|
|
254
263
|
buf.writeUint8(tag, 0);
|
|
255
264
|
buf.writeUint8(0, 1);
|
|
256
265
|
buf.writeUint16LE(0, 2);
|
|
257
266
|
buf.writeUint32LE(instrId, 4);
|
|
258
267
|
return buf;
|
|
259
268
|
}
|
|
260
|
-
exports.setInstrReadyForPerpUpgradeData = setInstrReadyForPerpUpgradeData;
|
|
261
269
|
function perpOrderCancelData(tag, side, instrId, orderId) {
|
|
262
270
|
let buf = Buffer.alloc(16);
|
|
263
271
|
buf.writeUint8(tag, 0);
|
|
@@ -267,7 +275,6 @@ function perpOrderCancelData(tag, side, instrId, orderId) {
|
|
|
267
275
|
buf.writeBigInt64LE(BigInt(Math.floor(orderId)), 8);
|
|
268
276
|
return buf;
|
|
269
277
|
}
|
|
270
|
-
exports.perpOrderCancelData = perpOrderCancelData;
|
|
271
278
|
function perpMassCancelData(tag, instrId) {
|
|
272
279
|
let buf = Buffer.alloc(8);
|
|
273
280
|
buf.writeUint8(tag, 0);
|
|
@@ -276,7 +283,6 @@ function perpMassCancelData(tag, instrId) {
|
|
|
276
283
|
buf.writeUint32LE(instrId, 4);
|
|
277
284
|
return buf;
|
|
278
285
|
}
|
|
279
|
-
exports.perpMassCancelData = perpMassCancelData;
|
|
280
286
|
function changeRefProgramData(tag, refProgramDuration, refLinkDuration, refDiscount, refRatio) {
|
|
281
287
|
let buf = Buffer.alloc(32);
|
|
282
288
|
buf.writeUint8(tag, 0);
|
|
@@ -287,7 +293,6 @@ function changeRefProgramData(tag, refProgramDuration, refLinkDuration, refDisco
|
|
|
287
293
|
buf.writeUint32LE(refLinkDuration, 12);
|
|
288
294
|
return buf;
|
|
289
295
|
}
|
|
290
|
-
exports.changeRefProgramData = changeRefProgramData;
|
|
291
296
|
function buyMarketSeatData(tag, instrId, edgePrice, amount) {
|
|
292
297
|
let buf = Buffer.alloc(24);
|
|
293
298
|
buf.writeUint8(tag, 0);
|
|
@@ -298,7 +303,6 @@ function buyMarketSeatData(tag, instrId, edgePrice, amount) {
|
|
|
298
303
|
buf.writeBigInt64LE(BigInt(Math.floor(amount)), 16);
|
|
299
304
|
return buf;
|
|
300
305
|
}
|
|
301
|
-
exports.buyMarketSeatData = buyMarketSeatData;
|
|
302
306
|
function sellMarketSeatData(tag, instrId, edgePrice) {
|
|
303
307
|
let buf = Buffer.alloc(16);
|
|
304
308
|
buf.writeUint8(tag, 0);
|
|
@@ -308,7 +312,6 @@ function sellMarketSeatData(tag, instrId, edgePrice) {
|
|
|
308
312
|
buf.writeBigInt64LE(BigInt(Math.floor(edgePrice)), 8);
|
|
309
313
|
return buf;
|
|
310
314
|
}
|
|
311
|
-
exports.sellMarketSeatData = sellMarketSeatData;
|
|
312
315
|
function newPrivateClient(tag, expirationTime) {
|
|
313
316
|
let buf = Buffer.alloc(8);
|
|
314
317
|
buf.writeUint8(tag, 0);
|
|
@@ -317,7 +320,6 @@ function newPrivateClient(tag, expirationTime) {
|
|
|
317
320
|
buf.writeUint32LE(expirationTime, 4);
|
|
318
321
|
return buf;
|
|
319
322
|
}
|
|
320
|
-
exports.newPrivateClient = newPrivateClient;
|
|
321
323
|
function pointsProgramExpiration(tag, newExpirationTime) {
|
|
322
324
|
let buf = Buffer.alloc(8);
|
|
323
325
|
buf.writeUint8(tag, 0);
|
|
@@ -326,15 +328,14 @@ function pointsProgramExpiration(tag, newExpirationTime) {
|
|
|
326
328
|
buf.writeUint32LE(newExpirationTime, 4);
|
|
327
329
|
return buf;
|
|
328
330
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
let buf = Buffer.alloc(12);
|
|
331
|
+
function setVarianceData(tag, instrId, variance) {
|
|
332
|
+
let buf = Buffer.alloc(16);
|
|
332
333
|
buf.writeUint8(tag, 0);
|
|
333
334
|
buf.writeUint8(0, 1);
|
|
334
335
|
buf.writeUint16LE(0, 2);
|
|
336
|
+
buf.writeUint32LE(instrId, 4);
|
|
335
337
|
return buf;
|
|
336
338
|
}
|
|
337
|
-
exports.setVarianceData = setVarianceData;
|
|
338
339
|
function changeDenominatorData(tag, baseCrncyId, denominator) {
|
|
339
340
|
let buf = Buffer.alloc(16);
|
|
340
341
|
buf.writeUint8(tag, 0);
|
|
@@ -343,7 +344,6 @@ function changeDenominatorData(tag, baseCrncyId, denominator) {
|
|
|
343
344
|
buf.writeUint32LE(baseCrncyId, 4);
|
|
344
345
|
return buf;
|
|
345
346
|
}
|
|
346
|
-
exports.changeDenominatorData = changeDenominatorData;
|
|
347
347
|
function newBaseCrncyData(tag, denominator) {
|
|
348
348
|
let buf = Buffer.alloc(16);
|
|
349
349
|
buf.writeUint8(tag, 0);
|
|
@@ -352,7 +352,6 @@ function newBaseCrncyData(tag, denominator) {
|
|
|
352
352
|
buf.writeUint32LE(0, 4);
|
|
353
353
|
return buf;
|
|
354
354
|
}
|
|
355
|
-
exports.newBaseCrncyData = newBaseCrncyData;
|
|
356
355
|
function perpClientsProcessingData(tag, instrId) {
|
|
357
356
|
let buf = Buffer.alloc(8);
|
|
358
357
|
buf.writeUint8(tag, 0);
|
|
@@ -361,7 +360,6 @@ function perpClientsProcessingData(tag, instrId) {
|
|
|
361
360
|
buf.writeUint32LE(instrId, 4);
|
|
362
361
|
return buf;
|
|
363
362
|
}
|
|
364
|
-
exports.perpClientsProcessingData = perpClientsProcessingData;
|
|
365
363
|
function setSeatPurchasingFeeData(tag, fee) {
|
|
366
364
|
let buf = Buffer.alloc(16);
|
|
367
365
|
buf.writeUint8(tag, 0);
|
|
@@ -370,7 +368,6 @@ function setSeatPurchasingFeeData(tag, fee) {
|
|
|
370
368
|
buf.writeUint32LE(0, 4);
|
|
371
369
|
return buf;
|
|
372
370
|
}
|
|
373
|
-
exports.setSeatPurchasingFeeData = setSeatPurchasingFeeData;
|
|
374
371
|
function changeVotingData(tag, newChoice, votingCounter) {
|
|
375
372
|
let buf = Buffer.alloc(8);
|
|
376
373
|
buf.writeUint8(tag, 0);
|
|
@@ -379,7 +376,6 @@ function changeVotingData(tag, newChoice, votingCounter) {
|
|
|
379
376
|
buf.writeUint32LE(votingCounter, 4);
|
|
380
377
|
return buf;
|
|
381
378
|
}
|
|
382
|
-
exports.changeVotingData = changeVotingData;
|
|
383
379
|
function garbageCollectorData(tag, instrId) {
|
|
384
380
|
let buf = Buffer.alloc(8);
|
|
385
381
|
buf.writeUint8(tag, 0);
|
|
@@ -388,7 +384,6 @@ function garbageCollectorData(tag, instrId) {
|
|
|
388
384
|
buf.writeUint32LE(instrId, 4);
|
|
389
385
|
return buf;
|
|
390
386
|
}
|
|
391
|
-
exports.garbageCollectorData = garbageCollectorData;
|
|
392
387
|
function activateClientRefProgramData(tag, refId) {
|
|
393
388
|
let buf = Buffer.alloc(8);
|
|
394
389
|
buf.writeUint8(tag, 0);
|
|
@@ -397,4 +392,28 @@ function activateClientRefProgramData(tag, refId) {
|
|
|
397
392
|
buf.writeUint32LE(refId, 4);
|
|
398
393
|
return buf;
|
|
399
394
|
}
|
|
400
|
-
|
|
395
|
+
function cleanCandlesData(tag, instrId) {
|
|
396
|
+
let buf = Buffer.alloc(8);
|
|
397
|
+
buf.writeUint8(tag, 0);
|
|
398
|
+
buf.writeUint8(0, 1);
|
|
399
|
+
buf.writeUint16LE(0, 2);
|
|
400
|
+
buf.writeUint32LE(instrId, 4);
|
|
401
|
+
return buf;
|
|
402
|
+
}
|
|
403
|
+
function vmInitWithdrawData(tag, tokenId, amount) {
|
|
404
|
+
let buf = Buffer.alloc(16);
|
|
405
|
+
buf.writeUint8(tag, 0);
|
|
406
|
+
buf.writeUint8(0, 1);
|
|
407
|
+
buf.writeUint16LE(0, 2);
|
|
408
|
+
buf.writeUint32LE(tokenId, 4);
|
|
409
|
+
buf.writeBigInt64LE(BigInt(Math.floor(amount)), 8);
|
|
410
|
+
return buf;
|
|
411
|
+
}
|
|
412
|
+
function vmChangeWhitelistData(tag, mask) {
|
|
413
|
+
let buf = Buffer.alloc(8);
|
|
414
|
+
buf.writeUint8(tag, 0);
|
|
415
|
+
buf.writeUint8(0, 1);
|
|
416
|
+
buf.writeUint16LE(0, 2);
|
|
417
|
+
buf.writeUint32LE(mask, 4);
|
|
418
|
+
return buf;
|
|
419
|
+
}
|
package/dist/logs_models.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
export declare enum LogType {
|
|
4
2
|
deposit = 1,
|
|
5
3
|
withdraw = 2,
|
|
@@ -33,7 +31,19 @@ export declare enum LogType {
|
|
|
33
31
|
sellMarketSeat = 30,
|
|
34
32
|
swapOrder = 31,
|
|
35
33
|
moveSpot = 32,
|
|
36
|
-
newPrivateClient = 33
|
|
34
|
+
newPrivateClient = 33,
|
|
35
|
+
changedPoints = 34,
|
|
36
|
+
swapFees = 35,
|
|
37
|
+
vmInitActivate = 36,
|
|
38
|
+
vmInitActivateCancel = 37,
|
|
39
|
+
vmFinalizeActivate = 38,
|
|
40
|
+
vmInitDeactivate = 39,
|
|
41
|
+
vmInitDeactivateCancel = 40,
|
|
42
|
+
vmFinalizeDeactivate = 41,
|
|
43
|
+
vmChangeList = 42,
|
|
44
|
+
vmInitWithdraw = 43,
|
|
45
|
+
vmInitWithdrawCancel = 44,
|
|
46
|
+
vmInitWithdrawFinalize = 45
|
|
37
47
|
}
|
|
38
48
|
export declare class PerpChangeLeverageReportModel {
|
|
39
49
|
static readonly LENGTH: number;
|
|
@@ -301,7 +311,7 @@ export declare class SpotPlaceOrderReportModel {
|
|
|
301
311
|
time: number;
|
|
302
312
|
static fromBuffer(buffer: Buffer, offset?: number): SpotPlaceOrderReportModel;
|
|
303
313
|
}
|
|
304
|
-
export declare class
|
|
314
|
+
export declare class PlaceSwapOrderReportModel {
|
|
305
315
|
static readonly LENGTH: number;
|
|
306
316
|
static readonly OFFSET_TAG = 0;
|
|
307
317
|
static readonly OFFSET_SIDE = 1;
|
|
@@ -311,6 +321,7 @@ export declare class SwapOrderReportModel {
|
|
|
311
321
|
static readonly OFFSET_PRICE = 24;
|
|
312
322
|
static readonly OFFSET_TIME = 32;
|
|
313
323
|
static readonly OFFSET_INSTR_ID = 36;
|
|
324
|
+
static readonly OFFSET_SWAP_REF_RATE = 40;
|
|
314
325
|
tag: number;
|
|
315
326
|
side: number;
|
|
316
327
|
orderType: number;
|
|
@@ -319,7 +330,8 @@ export declare class SwapOrderReportModel {
|
|
|
319
330
|
price: number;
|
|
320
331
|
time: number;
|
|
321
332
|
instrId: number;
|
|
322
|
-
|
|
333
|
+
swapRefRate: number;
|
|
334
|
+
static fromBuffer(buffer: Buffer, offset?: number): PlaceSwapOrderReportModel;
|
|
323
335
|
}
|
|
324
336
|
export declare class PerpPlaceMassCancelReportModel {
|
|
325
337
|
static readonly LENGTH: number;
|
|
@@ -537,3 +549,133 @@ export declare class MoveSpotAvailFundsReportModel {
|
|
|
537
549
|
crncy: number;
|
|
538
550
|
static fromBuffer(buffer: Buffer, offset?: number): MoveSpotAvailFundsReportModel;
|
|
539
551
|
}
|
|
552
|
+
export declare class ChangePointsRecordModel {
|
|
553
|
+
static readonly LENGTH: number;
|
|
554
|
+
static readonly OFFSET_TAG = 0;
|
|
555
|
+
static readonly OFFSET_CLIENT_ID = 4;
|
|
556
|
+
static readonly OFFSET_POINTS = 8;
|
|
557
|
+
static readonly OFFSET_TIME = 12;
|
|
558
|
+
tag: number;
|
|
559
|
+
clientId: number;
|
|
560
|
+
points: number;
|
|
561
|
+
time: number;
|
|
562
|
+
static fromBuffer(buffer: Buffer, offset?: number): ChangePointsRecordModel;
|
|
563
|
+
}
|
|
564
|
+
export declare class SwapRefFeesReportModel {
|
|
565
|
+
static readonly LENGTH: number;
|
|
566
|
+
static readonly OFFSET_TAG = 0;
|
|
567
|
+
static readonly OFFSET_FEES = 8;
|
|
568
|
+
tag: number;
|
|
569
|
+
fees: number;
|
|
570
|
+
static fromBuffer(buffer: Buffer, offset?: number): SwapRefFeesReportModel;
|
|
571
|
+
}
|
|
572
|
+
export declare class VmInitActivateReportModel {
|
|
573
|
+
static readonly LENGTH: number;
|
|
574
|
+
static readonly OFFSET_TAG = 0;
|
|
575
|
+
static readonly OFFSET_CLIENT_ID = 4;
|
|
576
|
+
static readonly OFFSET_TIME = 8;
|
|
577
|
+
tag: number;
|
|
578
|
+
clientId: number;
|
|
579
|
+
time: number;
|
|
580
|
+
static fromBuffer(buffer: Buffer, offset?: number): VmInitActivateReportModel;
|
|
581
|
+
}
|
|
582
|
+
export declare class VmInitActivateCancelReportModel {
|
|
583
|
+
static readonly LENGTH: number;
|
|
584
|
+
static readonly OFFSET_TAG = 0;
|
|
585
|
+
static readonly OFFSET_CLIENT_ID = 4;
|
|
586
|
+
static readonly OFFSET_TIME = 8;
|
|
587
|
+
tag: number;
|
|
588
|
+
clientId: number;
|
|
589
|
+
time: number;
|
|
590
|
+
static fromBuffer(buffer: Buffer, offset?: number): VmInitActivateCancelReportModel;
|
|
591
|
+
}
|
|
592
|
+
export declare class VmFinalizeActivateReportModel {
|
|
593
|
+
static readonly LENGTH: number;
|
|
594
|
+
static readonly OFFSET_TAG = 0;
|
|
595
|
+
static readonly OFFSET_CLIENT_ID = 4;
|
|
596
|
+
static readonly OFFSET_TIME = 8;
|
|
597
|
+
tag: number;
|
|
598
|
+
clientId: number;
|
|
599
|
+
time: number;
|
|
600
|
+
static fromBuffer(buffer: Buffer, offset?: number): VmFinalizeActivateReportModel;
|
|
601
|
+
}
|
|
602
|
+
export declare class VmInitDeactivateReportModel {
|
|
603
|
+
static readonly LENGTH: number;
|
|
604
|
+
static readonly OFFSET_TAG = 0;
|
|
605
|
+
static readonly OFFSET_CLIENT_ID = 4;
|
|
606
|
+
static readonly OFFSET_TIME = 8;
|
|
607
|
+
tag: number;
|
|
608
|
+
clientId: number;
|
|
609
|
+
time: number;
|
|
610
|
+
static fromBuffer(buffer: Buffer, offset?: number): VmInitDeactivateReportModel;
|
|
611
|
+
}
|
|
612
|
+
export declare class VmInitDeactivateCancelReportModel {
|
|
613
|
+
static readonly LENGTH: number;
|
|
614
|
+
static readonly OFFSET_TAG = 0;
|
|
615
|
+
static readonly OFFSET_CLIENT_ID = 4;
|
|
616
|
+
static readonly OFFSET_TIME = 8;
|
|
617
|
+
tag: number;
|
|
618
|
+
clientId: number;
|
|
619
|
+
time: number;
|
|
620
|
+
static fromBuffer(buffer: Buffer, offset?: number): VmInitDeactivateCancelReportModel;
|
|
621
|
+
}
|
|
622
|
+
export declare class VmFinalizeDeactivateReportModel {
|
|
623
|
+
static readonly LENGTH: number;
|
|
624
|
+
static readonly OFFSET_TAG = 0;
|
|
625
|
+
static readonly OFFSET_CLIENT_ID = 4;
|
|
626
|
+
static readonly OFFSET_TIME = 8;
|
|
627
|
+
tag: number;
|
|
628
|
+
clientId: number;
|
|
629
|
+
time: number;
|
|
630
|
+
static fromBuffer(buffer: Buffer, offset?: number): VmFinalizeDeactivateReportModel;
|
|
631
|
+
}
|
|
632
|
+
export declare class VmChangeListReportModel {
|
|
633
|
+
static readonly LENGTH: number;
|
|
634
|
+
static readonly OFFSET_TAG = 0;
|
|
635
|
+
static readonly OFFSET_CLIENT_ID = 4;
|
|
636
|
+
static readonly OFFSET_TIME = 8;
|
|
637
|
+
tag: number;
|
|
638
|
+
clientId: number;
|
|
639
|
+
time: number;
|
|
640
|
+
static fromBuffer(buffer: Buffer, offset?: number): VmChangeListReportModel;
|
|
641
|
+
}
|
|
642
|
+
export declare class VmInitWithdrawReportModel {
|
|
643
|
+
static readonly LENGTH: number;
|
|
644
|
+
static readonly OFFSET_TAG = 0;
|
|
645
|
+
static readonly OFFSET_CLIENT_ID = 4;
|
|
646
|
+
static readonly OFFSET_TOKEN_ID = 8;
|
|
647
|
+
static readonly OFFSET_TIME = 12;
|
|
648
|
+
static readonly OFFSET_AMOUNT = 16;
|
|
649
|
+
tag: number;
|
|
650
|
+
clientId: number;
|
|
651
|
+
tokenId: number;
|
|
652
|
+
time: number;
|
|
653
|
+
amount: number;
|
|
654
|
+
static fromBuffer(buffer: Buffer, offset?: number): VmInitWithdrawReportModel;
|
|
655
|
+
}
|
|
656
|
+
export declare class VmInitWithdrawCancelReportModel {
|
|
657
|
+
static readonly LENGTH: number;
|
|
658
|
+
static readonly OFFSET_TAG = 0;
|
|
659
|
+
static readonly OFFSET_CLIENT_ID = 4;
|
|
660
|
+
static readonly OFFSET_TOKEN_ID = 8;
|
|
661
|
+
static readonly OFFSET_TIME = 12;
|
|
662
|
+
tag: number;
|
|
663
|
+
clientId: number;
|
|
664
|
+
tokenId: number;
|
|
665
|
+
time: number;
|
|
666
|
+
static fromBuffer(buffer: Buffer, offset?: number): VmInitWithdrawCancelReportModel;
|
|
667
|
+
}
|
|
668
|
+
export declare class VmInitWithdrawFinalizeReportModel {
|
|
669
|
+
static readonly LENGTH: number;
|
|
670
|
+
static readonly OFFSET_TAG = 0;
|
|
671
|
+
static readonly OFFSET_CLIENT_ID = 4;
|
|
672
|
+
static readonly OFFSET_TOKEN_ID = 8;
|
|
673
|
+
static readonly OFFSET_TIME = 12;
|
|
674
|
+
static readonly OFFSET_AMOUNT = 16;
|
|
675
|
+
tag: number;
|
|
676
|
+
clientId: number;
|
|
677
|
+
tokenId: number;
|
|
678
|
+
time: number;
|
|
679
|
+
amount: number;
|
|
680
|
+
static fromBuffer(buffer: Buffer, offset?: number): VmInitWithdrawFinalizeReportModel;
|
|
681
|
+
}
|