@deriverse/kit 1.0.0
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/.github/workflows/publish.yaml +25 -0
- package/LICENSE +201 -0
- package/README.md +74 -0
- package/dist/auto_buffer.d.ts +13 -0
- package/dist/auto_buffer.js +41 -0
- package/dist/auto_data.d.ts +15 -0
- package/dist/auto_data.js +47 -0
- package/dist/index.d.ts +232 -0
- package/dist/index.js +2361 -0
- package/dist/instruction_models.d.ts +31 -0
- package/dist/instruction_models.js +313 -0
- package/dist/logs_models.d.ts +459 -0
- package/dist/logs_models.js +649 -0
- package/dist/structure_models.d.ts +874 -0
- package/dist/structure_models.js +1029 -0
- package/dist/types.d.ts +553 -0
- package/dist/types.js +65 -0
- package/package.json +26 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare function newOperatorData(tag: number, version: number): Buffer;
|
|
3
|
+
export declare function newRootAccountData(tag: number, lutSlot: number): Buffer;
|
|
4
|
+
export declare function newSpotOrderData(tag: number, ioc: number, orderType: number, side: number, instrId: number, price: number, amount: number): Buffer;
|
|
5
|
+
export declare function newPerpOrderData(tag: number, ioc: number, leverage: number, orderType: number, side: number, instrId: number, price: number, amount: number): Buffer;
|
|
6
|
+
export declare function perpChangeLeverageData(tag: number, leverage: number, instrId: number): Buffer;
|
|
7
|
+
export declare function perpStatisticsResetData(tag: number, instrId: number): Buffer;
|
|
8
|
+
export declare function spotOrderCancelData(tag: number, side: number, instrId: number, orderId: number): Buffer;
|
|
9
|
+
export declare function spotMassCancelData(tag: number, instrId: number): Buffer;
|
|
10
|
+
export declare function spotLpData(tag: number, side: number, instrId: number, amount: number): Buffer;
|
|
11
|
+
export declare function newInstrumentData(tag: number, crncyTokenId: number, lutSlot: number, price: number): Buffer;
|
|
12
|
+
export declare function depositData(tag: number, tokenId: number, amount: number, lutSlot: number, refId: number): Buffer;
|
|
13
|
+
export declare function feesDepositData(tag: number, tokenId: number, amount: number): Buffer;
|
|
14
|
+
export declare function feesWithdrawData(tag: number, tokenId: number, amount: number): Buffer;
|
|
15
|
+
export declare function perpDepositData(tag: number, instrId: number, amount: number): Buffer;
|
|
16
|
+
export declare function moveSpotAvailFundsData(tag: number, instrId: number): Buffer;
|
|
17
|
+
export declare function perpWithdrawData(tag: number, instrId: number, amount: number): Buffer;
|
|
18
|
+
export declare function withdrawData(tag: number, tokenId: number, amount: number): Buffer;
|
|
19
|
+
export declare function swapData(tag: number, instrId: number, price: number, amount: number): Buffer;
|
|
20
|
+
export declare function spotQuotesReplaceData(tag: number, instrId: number, newBidPrice: number, newBidQty: number, oldBidOrderId: number, newAskPrice: number, newAskQty: number, oldAskOrderId: number): Buffer;
|
|
21
|
+
export declare function perpQuotesReplaceData(tag: number, instrId: number, newBidPrice: number, newBidQty: number, oldBidOrderId: number, newAskPrice: number, newAskQty: number, oldAskOrderId: number): Buffer;
|
|
22
|
+
export declare function votingData(tag: number, choice: number, votingCounter: number): Buffer;
|
|
23
|
+
export declare function airdropData(tag: number, ratio: number): Buffer;
|
|
24
|
+
export declare function upgradeToPerpData(tag: number, instrId: number): Buffer;
|
|
25
|
+
export declare function setInstrOracleFeedData(tag: number, instrId: number): Buffer;
|
|
26
|
+
export declare function setInstrReadyForPerpUpgradeData(tag: number, instrId: number): Buffer;
|
|
27
|
+
export declare function newTokenData(tag: number, crncy: number): Buffer;
|
|
28
|
+
export declare function perpOrderCancelData(tag: number, side: number, instrId: number, orderId: number): Buffer;
|
|
29
|
+
export declare function perpMassCancelData(tag: number, instrId: number): Buffer;
|
|
30
|
+
export declare function perpForcedCloseData(tag: number, instrId: number): Buffer;
|
|
31
|
+
export declare function changeRefProgramData(tag: number, refProgramDuration: number, refLinkDuration: number, refDiscount: number, refRatio: number): Buffer;
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
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;
|
|
4
|
+
function newOperatorData(tag, version) {
|
|
5
|
+
let buf = Buffer.alloc(8);
|
|
6
|
+
buf.writeUint8(tag, 0);
|
|
7
|
+
buf.writeUint8(0, 1);
|
|
8
|
+
buf.writeUint16LE(0, 2);
|
|
9
|
+
buf.writeUint32LE(version, 4);
|
|
10
|
+
return buf;
|
|
11
|
+
}
|
|
12
|
+
exports.newOperatorData = newOperatorData;
|
|
13
|
+
function newRootAccountData(tag, lutSlot) {
|
|
14
|
+
let buf = Buffer.alloc(8);
|
|
15
|
+
buf.writeUint8(tag, 0);
|
|
16
|
+
buf.writeUint8(0, 1);
|
|
17
|
+
buf.writeUint16LE(0, 2);
|
|
18
|
+
buf.writeUint32LE(lutSlot, 4);
|
|
19
|
+
return buf;
|
|
20
|
+
}
|
|
21
|
+
exports.newRootAccountData = newRootAccountData;
|
|
22
|
+
function newSpotOrderData(tag, ioc, orderType, side, instrId, price, amount) {
|
|
23
|
+
let buf = Buffer.alloc(24);
|
|
24
|
+
buf.writeUint8(tag, 0);
|
|
25
|
+
buf.writeUint8(ioc, 1);
|
|
26
|
+
buf.writeUint8(orderType, 2);
|
|
27
|
+
buf.writeUint8(side, 3);
|
|
28
|
+
buf.writeUint32LE(instrId, 4);
|
|
29
|
+
buf.writeBigInt64LE(BigInt(price), 8);
|
|
30
|
+
buf.writeBigInt64LE(BigInt(amount), 16);
|
|
31
|
+
return buf;
|
|
32
|
+
}
|
|
33
|
+
exports.newSpotOrderData = newSpotOrderData;
|
|
34
|
+
function newPerpOrderData(tag, ioc, leverage, orderType, side, instrId, price, amount) {
|
|
35
|
+
let buf = Buffer.alloc(32);
|
|
36
|
+
buf.writeUint8(tag, 0);
|
|
37
|
+
buf.writeUint8(ioc, 1);
|
|
38
|
+
buf.writeUint8(leverage, 2);
|
|
39
|
+
buf.writeUint8(orderType, 3);
|
|
40
|
+
buf.writeUint8(side, 4);
|
|
41
|
+
buf.writeUint8(0, 5);
|
|
42
|
+
buf.writeUint16LE(0, 6);
|
|
43
|
+
buf.writeUint32LE(0, 8);
|
|
44
|
+
buf.writeUint32LE(instrId, 12);
|
|
45
|
+
buf.writeBigInt64LE(BigInt(price), 16);
|
|
46
|
+
buf.writeBigInt64LE(BigInt(amount), 24);
|
|
47
|
+
return buf;
|
|
48
|
+
}
|
|
49
|
+
exports.newPerpOrderData = newPerpOrderData;
|
|
50
|
+
function perpChangeLeverageData(tag, leverage, instrId) {
|
|
51
|
+
let buf = Buffer.alloc(8);
|
|
52
|
+
buf.writeUint8(tag, 0);
|
|
53
|
+
buf.writeUint8(leverage, 1);
|
|
54
|
+
buf.writeUint16LE(0, 2);
|
|
55
|
+
buf.writeUint32LE(instrId, 4);
|
|
56
|
+
return buf;
|
|
57
|
+
}
|
|
58
|
+
exports.perpChangeLeverageData = perpChangeLeverageData;
|
|
59
|
+
function perpStatisticsResetData(tag, instrId) {
|
|
60
|
+
let buf = Buffer.alloc(8);
|
|
61
|
+
buf.writeUint8(tag, 0);
|
|
62
|
+
buf.writeUint8(0, 1);
|
|
63
|
+
buf.writeUint16LE(0, 2);
|
|
64
|
+
buf.writeUint32LE(instrId, 4);
|
|
65
|
+
return buf;
|
|
66
|
+
}
|
|
67
|
+
exports.perpStatisticsResetData = perpStatisticsResetData;
|
|
68
|
+
function spotOrderCancelData(tag, side, instrId, orderId) {
|
|
69
|
+
let buf = Buffer.alloc(16);
|
|
70
|
+
buf.writeUint8(tag, 0);
|
|
71
|
+
buf.writeUint8(side, 1);
|
|
72
|
+
buf.writeUint16LE(0, 2);
|
|
73
|
+
buf.writeUint32LE(instrId, 4);
|
|
74
|
+
buf.writeBigInt64LE(BigInt(orderId), 8);
|
|
75
|
+
return buf;
|
|
76
|
+
}
|
|
77
|
+
exports.spotOrderCancelData = spotOrderCancelData;
|
|
78
|
+
function spotMassCancelData(tag, instrId) {
|
|
79
|
+
let buf = Buffer.alloc(8);
|
|
80
|
+
buf.writeUint8(tag, 0);
|
|
81
|
+
buf.writeUint8(0, 1);
|
|
82
|
+
buf.writeUint16LE(0, 2);
|
|
83
|
+
buf.writeUint32LE(instrId, 4);
|
|
84
|
+
return buf;
|
|
85
|
+
}
|
|
86
|
+
exports.spotMassCancelData = spotMassCancelData;
|
|
87
|
+
function spotLpData(tag, side, instrId, amount) {
|
|
88
|
+
let buf = Buffer.alloc(16);
|
|
89
|
+
buf.writeUint8(tag, 0);
|
|
90
|
+
buf.writeUint8(side, 1);
|
|
91
|
+
buf.writeUint16LE(0, 2);
|
|
92
|
+
buf.writeUint32LE(instrId, 4);
|
|
93
|
+
buf.writeBigInt64LE(BigInt(amount), 8);
|
|
94
|
+
return buf;
|
|
95
|
+
}
|
|
96
|
+
exports.spotLpData = spotLpData;
|
|
97
|
+
function newInstrumentData(tag, crncyTokenId, lutSlot, price) {
|
|
98
|
+
let buf = Buffer.alloc(24);
|
|
99
|
+
buf.writeUint8(tag, 0);
|
|
100
|
+
buf.writeUint8(0, 1);
|
|
101
|
+
buf.writeUint16LE(0, 2);
|
|
102
|
+
buf.writeUint32LE(0, 4);
|
|
103
|
+
buf.writeUint32LE(crncyTokenId, 8);
|
|
104
|
+
buf.writeUint32LE(lutSlot, 12);
|
|
105
|
+
buf.writeBigInt64LE(BigInt(price), 16);
|
|
106
|
+
return buf;
|
|
107
|
+
}
|
|
108
|
+
exports.newInstrumentData = newInstrumentData;
|
|
109
|
+
function depositData(tag, tokenId, amount, lutSlot, refId) {
|
|
110
|
+
let buf = Buffer.alloc(24);
|
|
111
|
+
buf.writeUint8(tag, 0);
|
|
112
|
+
buf.writeUint8(0, 1);
|
|
113
|
+
buf.writeUint16LE(0, 2);
|
|
114
|
+
buf.writeUint32LE(tokenId, 4);
|
|
115
|
+
buf.writeBigInt64LE(BigInt(amount), 8);
|
|
116
|
+
buf.writeUint32LE(lutSlot, 16);
|
|
117
|
+
buf.writeUint32LE(refId, 20);
|
|
118
|
+
return buf;
|
|
119
|
+
}
|
|
120
|
+
exports.depositData = depositData;
|
|
121
|
+
function feesDepositData(tag, tokenId, amount) {
|
|
122
|
+
let buf = Buffer.alloc(16);
|
|
123
|
+
buf.writeUint8(tag, 0);
|
|
124
|
+
buf.writeUint8(0, 1);
|
|
125
|
+
buf.writeUint16LE(0, 2);
|
|
126
|
+
buf.writeUint32LE(tokenId, 4);
|
|
127
|
+
buf.writeBigInt64LE(BigInt(amount), 8);
|
|
128
|
+
return buf;
|
|
129
|
+
}
|
|
130
|
+
exports.feesDepositData = feesDepositData;
|
|
131
|
+
function feesWithdrawData(tag, tokenId, amount) {
|
|
132
|
+
let buf = Buffer.alloc(16);
|
|
133
|
+
buf.writeUint8(tag, 0);
|
|
134
|
+
buf.writeUint8(0, 1);
|
|
135
|
+
buf.writeUint16LE(0, 2);
|
|
136
|
+
buf.writeUint32LE(tokenId, 4);
|
|
137
|
+
buf.writeBigInt64LE(BigInt(amount), 8);
|
|
138
|
+
return buf;
|
|
139
|
+
}
|
|
140
|
+
exports.feesWithdrawData = feesWithdrawData;
|
|
141
|
+
function perpDepositData(tag, instrId, amount) {
|
|
142
|
+
let buf = Buffer.alloc(16);
|
|
143
|
+
buf.writeUint8(tag, 0);
|
|
144
|
+
buf.writeUint8(0, 1);
|
|
145
|
+
buf.writeUint16LE(0, 2);
|
|
146
|
+
buf.writeUint32LE(instrId, 4);
|
|
147
|
+
buf.writeBigInt64LE(BigInt(amount), 8);
|
|
148
|
+
return buf;
|
|
149
|
+
}
|
|
150
|
+
exports.perpDepositData = perpDepositData;
|
|
151
|
+
function moveSpotAvailFundsData(tag, instrId) {
|
|
152
|
+
let buf = Buffer.alloc(8);
|
|
153
|
+
buf.writeUint8(tag, 0);
|
|
154
|
+
buf.writeUint8(0, 1);
|
|
155
|
+
buf.writeUint16LE(0, 2);
|
|
156
|
+
buf.writeUint32LE(instrId, 4);
|
|
157
|
+
return buf;
|
|
158
|
+
}
|
|
159
|
+
exports.moveSpotAvailFundsData = moveSpotAvailFundsData;
|
|
160
|
+
function perpWithdrawData(tag, instrId, amount) {
|
|
161
|
+
let buf = Buffer.alloc(16);
|
|
162
|
+
buf.writeUint8(tag, 0);
|
|
163
|
+
buf.writeUint8(0, 1);
|
|
164
|
+
buf.writeUint16LE(0, 2);
|
|
165
|
+
buf.writeUint32LE(instrId, 4);
|
|
166
|
+
buf.writeBigInt64LE(BigInt(amount), 8);
|
|
167
|
+
return buf;
|
|
168
|
+
}
|
|
169
|
+
exports.perpWithdrawData = perpWithdrawData;
|
|
170
|
+
function withdrawData(tag, tokenId, amount) {
|
|
171
|
+
let buf = Buffer.alloc(16);
|
|
172
|
+
buf.writeUint8(tag, 0);
|
|
173
|
+
buf.writeUint8(0, 1);
|
|
174
|
+
buf.writeUint16LE(0, 2);
|
|
175
|
+
buf.writeUint32LE(tokenId, 4);
|
|
176
|
+
buf.writeBigInt64LE(BigInt(amount), 8);
|
|
177
|
+
return buf;
|
|
178
|
+
}
|
|
179
|
+
exports.withdrawData = withdrawData;
|
|
180
|
+
function swapData(tag, instrId, price, amount) {
|
|
181
|
+
let buf = Buffer.alloc(24);
|
|
182
|
+
buf.writeUint8(tag, 0);
|
|
183
|
+
buf.writeUint8(0, 1);
|
|
184
|
+
buf.writeUint16LE(0, 2);
|
|
185
|
+
buf.writeUint32LE(instrId, 4);
|
|
186
|
+
buf.writeBigInt64LE(BigInt(price), 8);
|
|
187
|
+
buf.writeBigInt64LE(BigInt(amount), 16);
|
|
188
|
+
return buf;
|
|
189
|
+
}
|
|
190
|
+
exports.swapData = swapData;
|
|
191
|
+
function spotQuotesReplaceData(tag, instrId, newBidPrice, newBidQty, oldBidOrderId, newAskPrice, newAskQty, oldAskOrderId) {
|
|
192
|
+
let buf = Buffer.alloc(56);
|
|
193
|
+
buf.writeUint8(tag, 0);
|
|
194
|
+
buf.writeUint8(0, 1);
|
|
195
|
+
buf.writeUint16LE(0, 2);
|
|
196
|
+
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);
|
|
203
|
+
return buf;
|
|
204
|
+
}
|
|
205
|
+
exports.spotQuotesReplaceData = spotQuotesReplaceData;
|
|
206
|
+
function perpQuotesReplaceData(tag, instrId, newBidPrice, newBidQty, oldBidOrderId, newAskPrice, newAskQty, oldAskOrderId) {
|
|
207
|
+
let buf = Buffer.alloc(56);
|
|
208
|
+
buf.writeUint8(tag, 0);
|
|
209
|
+
buf.writeUint8(0, 1);
|
|
210
|
+
buf.writeUint16LE(0, 2);
|
|
211
|
+
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);
|
|
218
|
+
return buf;
|
|
219
|
+
}
|
|
220
|
+
exports.perpQuotesReplaceData = perpQuotesReplaceData;
|
|
221
|
+
function votingData(tag, choice, votingCounter) {
|
|
222
|
+
let buf = Buffer.alloc(8);
|
|
223
|
+
buf.writeUint8(tag, 0);
|
|
224
|
+
buf.writeUint8(choice, 1);
|
|
225
|
+
buf.writeUint16LE(0, 2);
|
|
226
|
+
buf.writeUint32LE(votingCounter, 4);
|
|
227
|
+
return buf;
|
|
228
|
+
}
|
|
229
|
+
exports.votingData = votingData;
|
|
230
|
+
function airdropData(tag, ratio) {
|
|
231
|
+
let buf = Buffer.alloc(16);
|
|
232
|
+
buf.writeUint8(tag, 0);
|
|
233
|
+
buf.writeUint8(0, 1);
|
|
234
|
+
buf.writeUint16LE(0, 2);
|
|
235
|
+
buf.writeUint32LE(0, 4);
|
|
236
|
+
return buf;
|
|
237
|
+
}
|
|
238
|
+
exports.airdropData = airdropData;
|
|
239
|
+
function upgradeToPerpData(tag, instrId) {
|
|
240
|
+
let buf = Buffer.alloc(8);
|
|
241
|
+
buf.writeUint8(tag, 0);
|
|
242
|
+
buf.writeUint8(0, 1);
|
|
243
|
+
buf.writeUint16LE(0, 2);
|
|
244
|
+
buf.writeUint32LE(instrId, 4);
|
|
245
|
+
return buf;
|
|
246
|
+
}
|
|
247
|
+
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
|
+
function setInstrReadyForPerpUpgradeData(tag, instrId) {
|
|
258
|
+
let buf = Buffer.alloc(8);
|
|
259
|
+
buf.writeUint8(tag, 0);
|
|
260
|
+
buf.writeUint8(0, 1);
|
|
261
|
+
buf.writeUint16LE(0, 2);
|
|
262
|
+
buf.writeUint32LE(instrId, 4);
|
|
263
|
+
return buf;
|
|
264
|
+
}
|
|
265
|
+
exports.setInstrReadyForPerpUpgradeData = setInstrReadyForPerpUpgradeData;
|
|
266
|
+
function newTokenData(tag, crncy) {
|
|
267
|
+
let buf = Buffer.alloc(8);
|
|
268
|
+
buf.writeUint8(tag, 0);
|
|
269
|
+
buf.writeUint8(crncy, 1);
|
|
270
|
+
buf.writeUint16LE(0, 2);
|
|
271
|
+
buf.writeUint32LE(0, 4);
|
|
272
|
+
return buf;
|
|
273
|
+
}
|
|
274
|
+
exports.newTokenData = newTokenData;
|
|
275
|
+
function perpOrderCancelData(tag, side, instrId, orderId) {
|
|
276
|
+
let buf = Buffer.alloc(16);
|
|
277
|
+
buf.writeUint8(tag, 0);
|
|
278
|
+
buf.writeUint8(side, 1);
|
|
279
|
+
buf.writeUint16LE(0, 2);
|
|
280
|
+
buf.writeUint32LE(instrId, 4);
|
|
281
|
+
buf.writeBigInt64LE(BigInt(orderId), 8);
|
|
282
|
+
return buf;
|
|
283
|
+
}
|
|
284
|
+
exports.perpOrderCancelData = perpOrderCancelData;
|
|
285
|
+
function perpMassCancelData(tag, instrId) {
|
|
286
|
+
let buf = Buffer.alloc(8);
|
|
287
|
+
buf.writeUint8(tag, 0);
|
|
288
|
+
buf.writeUint8(0, 1);
|
|
289
|
+
buf.writeUint16LE(0, 2);
|
|
290
|
+
buf.writeUint32LE(instrId, 4);
|
|
291
|
+
return buf;
|
|
292
|
+
}
|
|
293
|
+
exports.perpMassCancelData = perpMassCancelData;
|
|
294
|
+
function perpForcedCloseData(tag, instrId) {
|
|
295
|
+
let buf = Buffer.alloc(8);
|
|
296
|
+
buf.writeUint8(tag, 0);
|
|
297
|
+
buf.writeUint8(0, 1);
|
|
298
|
+
buf.writeUint16LE(0, 2);
|
|
299
|
+
buf.writeUint32LE(instrId, 4);
|
|
300
|
+
return buf;
|
|
301
|
+
}
|
|
302
|
+
exports.perpForcedCloseData = perpForcedCloseData;
|
|
303
|
+
function changeRefProgramData(tag, refProgramDuration, refLinkDuration, refDiscount, refRatio) {
|
|
304
|
+
let buf = Buffer.alloc(32);
|
|
305
|
+
buf.writeUint8(tag, 0);
|
|
306
|
+
buf.writeUint8(0, 1);
|
|
307
|
+
buf.writeUint16LE(0, 2);
|
|
308
|
+
buf.writeUint32LE(0, 4);
|
|
309
|
+
buf.writeUint32LE(refProgramDuration, 8);
|
|
310
|
+
buf.writeUint32LE(refLinkDuration, 12);
|
|
311
|
+
return buf;
|
|
312
|
+
}
|
|
313
|
+
exports.changeRefProgramData = changeRefProgramData;
|