@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.
@@ -0,0 +1,553 @@
1
+ import { Address, Commitment } from "@solana/kit";
2
+ import { BaseCrncyRecordModel, ClientCommunityAccountHeaderModel, ClientCommunityRecordModel, CommunityAccountHeaderModel, InstrAccountHeaderModel, LineQuotesModel, OrderModel } from "./structure_models";
3
+ import { DepositReportModel, DrvsAirdropReportModel, EarningsReportModel, FeesDepositReportModel, FeesWithdrawReportModel, PerpChangeLeverageReportModel, PerpDepositReportModel, PerpFeesReportModel, PerpFillOrderReportModel, PerpFundingReportModel, PerpMassCancelReportModel, PerpNewOrderReportModel, PerpOrderCancelReportModel, PerpOrderRevokeReportModel, PerpPlaceMassCancelReportModel, PerpPlaceOrderReportModel, PerpSocLossReportModel, PerpWithdrawReportModel, SpotFeesReportModel, SpotFillOrderReportModel, SpotlpTradeReportModel, SpotMassCancelReportModel, SpotNewOrderReportModel, SpotOrderCancelReportModel, SpotOrderRevokeReportModel, SpotPlaceMassCancelReportModel, SpotPlaceOrderReportModel, WithdrawReportModel } from "./logs_models";
4
+ export declare enum InstrMask {
5
+ DRV = 268435456,
6
+ READY_TO_DRV_UPGRADE = 536870912,
7
+ PERP = 1073741824,
8
+ ORACLE = 2147483648,
9
+ READY_TO_PERP_UPGRADE = 16777216
10
+ }
11
+ export declare enum AccountType {
12
+ CLIENT_COMMUNITY = 35,
13
+ CLIENT_DRV = 32,
14
+ CLIENT_PRIMARY = 31,
15
+ COMMUNITY = 34,
16
+ PDF = 33,
17
+ FUTURES_ASK_ORDERS = 29,
18
+ FUTURES_ASKS_TREE = 27,
19
+ FUTURES_BID_ORDERS = 28,
20
+ FUTURES_BIDS_TREE = 26,
21
+ FUTURES_CLIENT_ACCOUNTS = 23,
22
+ FUTURES_CLIENT_INFOS = 24,
23
+ FUTURES_CLIENT_INFOS2 = 25,
24
+ FUTURES_LINES = 30,
25
+ FUTURES_MAPS = 22,
26
+ HOLDER = 1,
27
+ ROOT = 2,
28
+ INSTR = 7,
29
+ INSTR_TRACE = 8,
30
+ SPOT_15M_CANDLES = 20,
31
+ SPOT_1M_CANDLES = 19,
32
+ SPOT_ASK_ORDERS = 17,
33
+ SPOT_ASKS_TREE = 15,
34
+ SPOT_BID_ORDERS = 16,
35
+ SPOT_BIDS_TREE = 14,
36
+ SPOT_CLIENT_ACCOUNTS = 11,
37
+ SPOT_CLIENT_INFOS = 12,
38
+ SPOT_CLIENT_INFOS2 = 13,
39
+ SPOT_DAY_CANDLES = 21,
40
+ SPOT_LINES = 18,
41
+ SPOT_MAPS = 10,
42
+ TOKEN = 4,
43
+ PERP_ASK_ORDERS = 36,
44
+ PERP_ASKS_TREE = 37,
45
+ PERP_BID_ORDERS = 38,
46
+ PERP_BIDS_TREE = 39,
47
+ PERP_CLIENT_ACCOUNTS = 40,
48
+ PERP_CLIENT_INFOS = 41,
49
+ PERP_CLIENT_INFOS2 = 42,
50
+ PERP_CLIENT_INFOS3 = 43,
51
+ PERP_CLIENT_INFOS4 = 44,
52
+ PERP_CLIENT_INFOS5 = 45,
53
+ PERP_LINES = 46,
54
+ PERP_MAPS = 47,
55
+ PERP_LONG_PX_TREE = 48,
56
+ PERP_SHORT_PX_TREE = 49,
57
+ PERP_REBALANCE_TIME_TREE = 50,
58
+ PERP_PRIORITY_TREE = 51
59
+ }
60
+ export declare const VERSION = 8;
61
+ export declare const PROGRAM_ID: Address<"Drvrseg8AQLP8B96DBGmHRjFGviFNYTkHueY9g3k27Gu">;
62
+ export declare const MARKET_DEPTH = 20;
63
+ export interface EngineArgs {
64
+ programId?: Address<any>;
65
+ version?: number;
66
+ commitment?: Commitment;
67
+ }
68
+ /**
69
+ * @property {number} instrId Instrument ID
70
+ */
71
+ export interface InstrId {
72
+ instrId: number;
73
+ }
74
+ /**
75
+ * Contains data about orderbook line
76
+ * @property {number} px Price
77
+ * @property {number} qty Quantity
78
+ */
79
+ export interface LinePx {
80
+ px: number;
81
+ qty: number;
82
+ }
83
+ /**
84
+ * Contains data about instrument
85
+ * @property {Address} address Instrument account address
86
+ * @property {InstrAccountHeaderModel} header Instrument account header
87
+ * @property {LineQuotesModel[]} spotBids Spot bids
88
+ * @property {LineQuotesModel[]} spotAsks Spot asks
89
+ * @property {LineQuotesModel[]} perpBids Perp bids
90
+ * @property {LineQuotesModel[]} perpAsks Perp bids
91
+ */
92
+ export interface Instrument {
93
+ address: Address;
94
+ header: InstrAccountHeaderModel;
95
+ spotBids: LineQuotesModel[];
96
+ spotAsks: LineQuotesModel[];
97
+ perpBids: LineQuotesModel[];
98
+ perpAsks: LineQuotesModel[];
99
+ }
100
+ /**
101
+ * Contains data about Token
102
+ * @property {Address} account Deriverse account that stores data about registered token
103
+ * @property {Address} mint Mint token address
104
+ * @property {Address} programAddress SPL token account in which tokens are stored
105
+ * @property {number} id Token ID
106
+ * @property {number} decimals Decimals
107
+ * @property {boolean} baseCrncy Ff this token is currency - true
108
+ * @property {boolean} pool If this token is options pool token - true
109
+ * @property {boolean} token2022 If this token is token 2022 - true
110
+ * @property {number} mainInstrId If If this token is options pool token refers to main instrument ID
111
+ */
112
+ export interface Token {
113
+ account: Address;
114
+ mint: Address;
115
+ programAddress: Address;
116
+ id: number;
117
+ decimals: number;
118
+ baseCrncy: boolean;
119
+ pool: boolean;
120
+ token2022: boolean;
121
+ mainInstrId?: number;
122
+ }
123
+ /**
124
+ * Contains data for getClientSpotOrdersInfo function
125
+ * @property {number} instrId Instrument ID
126
+ * @property {number} clientId Temporary spot client ID. Use getClientData function to get this value.
127
+ */
128
+ export interface GetClientSpotOrdersInfoArgs {
129
+ instrId: number;
130
+ clientId: number;
131
+ }
132
+ /**
133
+ * Contains data for getClientPerpOrdersInfo function
134
+ * @property {number} instrId Instrument ID
135
+ * @property {number} clientId Temporary perp client ID. Use getClientData function to get this value.
136
+ */
137
+ export interface GetClientPerpOrdersInfoArgs {
138
+ instrId: number;
139
+ clientId: number;
140
+ }
141
+ /**
142
+ * Contains data for addSpotOrderInstruction
143
+ * @property {number} instrId Instrument ID
144
+ * @property {number} price Order price
145
+ * @property {number} qty Order quantity
146
+ * @property {number} ioc - Immediate Or Cancel. If true no new open order after this instruction execution.
147
+ * @property {number} orderType 0 - Limit, 1 - Market
148
+ * @property {number} side 0 - Bid, 1 - Ask
149
+ */
150
+ export interface NewSpotOrderArgs {
151
+ instrId: number;
152
+ price: number;
153
+ qty: number;
154
+ ioc?: number;
155
+ orderType?: number;
156
+ side: number;
157
+ }
158
+ /**
159
+ * Contains data for swapInstruction.
160
+ * @property {number} instrId Instrument ID
161
+ * @property {number} price Indicates limit price for swap instructiom, zero value means market order without limits.
162
+ * @property {number} qty Indicates asset tokens quantity that you want to trade, negative value means selling.
163
+ */
164
+ export interface SwapArgs {
165
+ instrId: number;
166
+ price: number;
167
+ qty: number;
168
+ }
169
+ /**
170
+ * Contains data for spotQuotesReplaceInstruction
171
+ * @property {number} instrId Instrument ID
172
+ * @property {number} bidOrderIdToCancel Order ID that you want to cancel on bid side, zero value means no actions
173
+ * @property {number} askOrderIdToCancel Order ID that you want to cancel on ask side, zero value means no actions
174
+ * @property {number} newBidPrice New order bid price
175
+ * @property {number} newAskPrice New order ask price
176
+ * @property {number} newBidQty New order bid quantity, zero value means no actions
177
+ * @property {number} newAskQty New order ask quantity, zero value means no actions
178
+ */
179
+ export interface SpotQuotesReplaceArgs {
180
+ instrId: number;
181
+ bidOrderIdToCancel: number;
182
+ newBidPrice: number;
183
+ newBidQty: number;
184
+ askOrderIdToCancel: number;
185
+ newAskPrice: number;
186
+ newAskQty: number;
187
+ }
188
+ /**
189
+ * Contains data for perpQuotesReplaceInstruction
190
+ * @property {number} instrId Instrument ID
191
+ * @property {number} bidOrderIdToCancel Order ID that you want to cancel on bid side, zero value means no actions
192
+ * @property {number} askOrderIdToCancel Order ID that you want to cancel on ask side, zero value means no actions
193
+ * @property {number} newBidPrice New order bid price
194
+ * @property {number} newAskPrice New order ask price
195
+ * @property {number} newBidQty New order bid quantity, zero value means no actions
196
+ * @property {number} newAskQty New order ask quantity, zero value means no actions
197
+ */
198
+ export interface PerpQuotesReplaceArgs {
199
+ instrId: number;
200
+ bidOrderIdToCancel: number;
201
+ newBidPrice: number;
202
+ newBidQty: number;
203
+ askOrderIdToCancel: number;
204
+ newAskPrice: number;
205
+ newAskQty: number;
206
+ }
207
+ /**
208
+ * Contains general data about client spot open orders in particular instrument
209
+ * @property {number} bidsCount Open bid orders count
210
+ * @property {number} asksCount Open ask orders count
211
+ * @property {number} bidsEntry Entrypoint in bid orders account
212
+ * @property {number} asksEntry Entrypoint in ask orders account
213
+ * @property {number} contextSlot Context slot of response
214
+ * @property {number} bidSlot Client open bid orders last update slot
215
+ * @property {number} askSlot Client open ask orders last update slot
216
+ * @property {number} tempAssetTokens Asset tokens available to withdraw from client instrument temporary account.
217
+ * It will be automatically transfer to main account during any active transaction with the instrument.
218
+ * @property {number} tempBaseCrncyTokens Base currency tokens available to withdraw from client instrument temporary account
219
+ * It will be automatically transfer to main account during any active transaction with the instrument.
220
+ */
221
+ export interface GetClientSpotOrdersInfoResponse {
222
+ bidsCount: number;
223
+ asksCount: number;
224
+ bidsEntry: number;
225
+ asksEntry: number;
226
+ bidSlot: number;
227
+ askSlot: number;
228
+ contextSlot: number;
229
+ tempAssetTokens: number;
230
+ tempCrncyTokens: number;
231
+ }
232
+ /**
233
+ * Contains general data about client perps in particular instrument
234
+ * @property {number} bidsCount Open bid orders count
235
+ * @property {number} asksCount Open ask orders count
236
+ * @property {number} bidsEntry Entrypoint in bid orders account
237
+ * @property {number} asksEntry Entrypoint in ask orders account
238
+ * @property {number} contextSlot Context slot of response
239
+ * @property {number} bidSlot Client open bid orders last update slot
240
+ * @property {number} askSlot Client open ask orders last update slot
241
+ * @property {number} perps Margin account perps balance
242
+ * @property {number} funds Margin account funds balance
243
+ * @property {number} inOrdersPerps Perps in orders
244
+ * @property {number} inOrdersFunds Funds in orders
245
+ * @property {number} fees Fees statistics
246
+ * @property {number} rebates Rebates statistics
247
+ * @property {number} fundingFunds Funding rate payments statistics
248
+ * @property {number} socLossFunds Socialized losses payments statistics
249
+ * @property {number} result Realized PnL statistics
250
+ * @property {number} cost Position cost
251
+ * @property {number} mask contains some imnformation. First byte - leverage level
252
+ */
253
+ export interface GetClientPerpOrdersInfoResponse {
254
+ bidsCount: number;
255
+ asksCount: number;
256
+ bidsEntry: number;
257
+ asksEntry: number;
258
+ bidSlot: number;
259
+ askSlot: number;
260
+ contextSlot: number;
261
+ perps: number;
262
+ funds: number;
263
+ inOrdersPerps: number;
264
+ inOrdersFunds: number;
265
+ fees: number;
266
+ rebates: number;
267
+ socLossFunds: number;
268
+ fundingFunds: number;
269
+ result: number;
270
+ cost: number;
271
+ mask: number;
272
+ }
273
+ /**
274
+ * Contains data for getClientSpotOrders function
275
+ * @property {number} instrId instrument ID
276
+ * @property {number} bidsCount Client spot bid orders count. Use getClientSpotOrdersInfo function to get this value.
277
+ * @property {number} asksCount Client spot ask orders count. Use getClientSpotOrdersInfo function to get this value.
278
+ * @property {number} bidsEntry Entrypoint in spot bid orders account. Use getClientSpotOrdersInfo function to get this value.
279
+ * @property {number} asksEntry Entrypoint in spot ask orders account. Use getClientSpotOrdersInfo function to get this value.
280
+ */
281
+ export interface GetClientSpotOrdersArgs {
282
+ instrId: number;
283
+ bidsCount: number;
284
+ asksCount: number;
285
+ bidsEntry: number;
286
+ asksEntry: number;
287
+ }
288
+ /**
289
+ * Contains data for getClientPerpOrders function
290
+ * @property {number} instrId instrument ID
291
+ * @property {number} bidsCount Client spot bid orders count. Use getClientPerpOrdersInfo function to get this value.
292
+ * @property {number} asksCount Client spot ask orders count. Use getClientPerpOrdersInfo function to get this value.
293
+ * @property {number} bidsEntry Entrypoint in spot bid orders account. Use getClientPerpOrdersInfo function to get this value.
294
+ * @property {number} asksEntry Entrypoint in spot ask orders account. Use getClientPerpOrdersInfo function to get this value.
295
+ */
296
+ export interface GetClientPerpOrdersArgs {
297
+ instrId: number;
298
+ bidsCount: number;
299
+ asksCount: number;
300
+ bidsEntry: number;
301
+ asksEntry: number;
302
+ }
303
+ /**
304
+ * @property {number} bidContextSlot Client spot bids data context slot
305
+ * @property {number} askContextSlot Client spot asks data context slot
306
+ * @property {OrderModel[]} bids List of client bid spot orders
307
+ * @property {OrderModel[]} asks List of client ask spot orders
308
+ */
309
+ export interface GetClientSpotOrdersResponse {
310
+ bidContextSlot: number;
311
+ askContextSlot: number;
312
+ bids: OrderModel[];
313
+ asks: OrderModel[];
314
+ }
315
+ /**
316
+ * @property {number} bidContextSlot Client perp bids data context slot
317
+ * @property {number} askContextSlot Client perp asks data context slot
318
+ * @property {OrderModel[]} bids List of client bid perp orders
319
+ * @property {OrderModel[]} asks List of client ask perp orders
320
+ */
321
+ export interface GetClientPerpOrdersResponse {
322
+ bidContextSlot: number;
323
+ askContextSlot: number;
324
+ bids: Array<OrderModel>;
325
+ asks: Array<OrderModel>;
326
+ }
327
+ /**
328
+ * Contains data for spotOrderCancelInstruction function
329
+ * @property {number} instrId Instrument ID
330
+ * @property {number} orderId Order ID to cancel
331
+ * @property {number} side Side. 0 - bid side, 1 - ask side
332
+ */
333
+ export interface SpotOrderCancelArgs {
334
+ instrId: number;
335
+ orderId: number;
336
+ side: number;
337
+ }
338
+ /**
339
+ * Contains data for perpOrderCancelInstruction function
340
+ * @property {number} instrId Instrument ID
341
+ * @property {number} orderId Order ID to cancel
342
+ * @property {number} side Side. 0 - bid side, 1 - ask side
343
+ */
344
+ export interface PerpOrderCancelArgs {
345
+ instrId: number;
346
+ orderId: number;
347
+ side: number;
348
+ }
349
+ /**
350
+ * Contains data for deposit function
351
+ * @property {number} tokenId DEXnow.io SPL token registered ID
352
+ * @property {number} amount Amount to deposit
353
+ * @property {number} refId Referal Link ID for new account. Zero means no ref link
354
+ * @property {number} refId Referal Wallet
355
+ */
356
+ export interface DepositArgs {
357
+ tokenId: number;
358
+ amount: number;
359
+ refId?: number;
360
+ refWallet?: Address;
361
+ }
362
+ /**
363
+ * Contains data about SPL tokens on main client account
364
+ * @property {number} tokenId DEXnow.io SPL token registered ID
365
+ * @property {number} amount Amount of SPL tokens on main client account
366
+ */
367
+ export interface ClientTokenData {
368
+ tokenId: number;
369
+ amount: number;
370
+ }
371
+ /**
372
+ * Contains data about Deriverse internal spot LP tokens on main client account
373
+ * @property {number} instrId Instrument ID
374
+ * @property {number} amount Amount of DEXnow.io internal spot LP tokens on main client account
375
+ */
376
+ export interface ClientLpData {
377
+ instrId: number;
378
+ amount: number;
379
+ }
380
+ /**
381
+ * Contains data about temporary instrument spot client account
382
+ * @property {number} instrId Instrument ID
383
+ * @property {number} clientId Temporary client ID
384
+ * @property {number} slot Temporary instrument client last update slot
385
+ */
386
+ export interface ClientSpotData {
387
+ instrId: number;
388
+ clientId: number;
389
+ slot: number;
390
+ }
391
+ /**
392
+ * Contains data about temporary instrument perp client account
393
+ * @property {number} instrId Instrument ID
394
+ * @property {number} clientId Temporary client ID
395
+ * @property {number} slot Temporary instrument client last update slot
396
+ */
397
+ export interface ClientPerpData {
398
+ instrId: number;
399
+ clientId: number;
400
+ slot: number;
401
+ }
402
+ /**
403
+ * Contains information about referal link
404
+ * @property {number} id Referal ID
405
+ * @property {number} expiration Expiration date of referal link
406
+ * @property {number} discount Fees discount
407
+ * @property {number} ratio Referal payments share in fees (minus rebates)
408
+ */
409
+ export interface RefLink {
410
+ id: number;
411
+ expiration: number;
412
+ discount: number;
413
+ ratio: number;
414
+ }
415
+ export interface CommunityData {
416
+ header: CommunityAccountHeaderModel;
417
+ data: Map<number, BaseCrncyRecordModel>;
418
+ }
419
+ export interface ClientCommunityData {
420
+ header: ClientCommunityAccountHeaderModel;
421
+ data: Map<number, ClientCommunityRecordModel>;
422
+ }
423
+ /**
424
+ * Contains information about referal program
425
+ * @property {number} address Refferal Wallet
426
+ * @property {number} expiration Expiration date of referal program
427
+ * @property {number} clientId Referal client ID
428
+ * @property {number} discount Fees discount
429
+ * @property {number} ratio Referal payments share in fees (minus rebates)
430
+ */
431
+ export interface ClientRefProgramData {
432
+ address: Address;
433
+ expiration: number;
434
+ clientId: number;
435
+ disount: number;
436
+ ratio: number;
437
+ }
438
+ /**
439
+ * Contains general client data
440
+ * @property {number} clientId Client ID
441
+ * @property {number} points Points for Drverse tokens airdrop
442
+ * @property {number} mask Contains some additioal data
443
+ * @property {number} slot Last update slot
444
+ * @property {number} spotTrades All-time active spot trades
445
+ * @property {number} lpTrades All-time lp trades
446
+ * @property {number} perpTrades All-time active perp trades
447
+ * @property {ClientTokenData[]} tokens Client tokens data
448
+ * @property {ClientLpData[]} lp Client data about DEXnow.io internal spot LP tokens
449
+ * @property {ClientSpotData[]} spot Client spot trading data
450
+ * @property {ClientPerpData[]} perp Client perp trading data
451
+ */
452
+ export interface GetClientDataResponse {
453
+ clientId: number;
454
+ points: number;
455
+ mask: number;
456
+ slot: number;
457
+ spotTrades: number;
458
+ lpTrades: number;
459
+ perpTrades: number;
460
+ tokens: Map<number, ClientTokenData>;
461
+ lp: Map<number, ClientLpData>;
462
+ spot: Map<number, ClientSpotData>;
463
+ perp: Map<number, ClientPerpData>;
464
+ refProgram: ClientRefProgramData;
465
+ refLinks: RefLink[];
466
+ community: ClientCommunityData;
467
+ }
468
+ /**
469
+ * Contains data for withdrawSplTokenInstruction function
470
+ * @property {number} tokenId DEXnow.io token registered ID
471
+ * @property {number} amount Amount to withdraw
472
+ * @property {instrId[]} spot List of instruments ID to withdraw from client temporary instrument accounts
473
+ * client temporary derivative instrument accounts
474
+ */
475
+ export interface WithdrawArgs {
476
+ tokenId: number;
477
+ amount: number;
478
+ spot?: Array<InstrId>;
479
+ }
480
+ /**
481
+ * Contains data for spotMassCancelInstruction
482
+ * @property {number} instrId Instrument ID
483
+ */
484
+ export interface SpotMassCancelArgs {
485
+ instrId: number;
486
+ }
487
+ export interface PerpMassCancelArgs {
488
+ instrId: number;
489
+ }
490
+ export interface PerpStatisticsResetArgs {
491
+ instrId: number;
492
+ }
493
+ export interface PerpChangeLeverageArgs {
494
+ instrId: number;
495
+ leverage: number;
496
+ }
497
+ export interface PerpForcedCloseArgs {
498
+ instrId: number;
499
+ clientPrimaryAccount: Address;
500
+ }
501
+ /**
502
+ * Contains data for getInstrId function
503
+ * @property {number} assetTokenId Asset DEXnow.io token registered ID
504
+ * @property {number} baseCrncyTokenId Base currency DEXnow.io token registered ID
505
+ */
506
+ export interface GetInstrIdArgs {
507
+ assetTokenId: number;
508
+ crncyTokenId: number;
509
+ }
510
+ export interface GetSpotContextArgs {
511
+ assetTokenId: number;
512
+ crncyTokenId: number;
513
+ }
514
+ export interface getInstrAccountByTagArgs {
515
+ assetTokenId: number;
516
+ crncyTokenId: number;
517
+ tag: number;
518
+ }
519
+ export interface updateInstrDataArgs {
520
+ assetTokenId: number;
521
+ crncyTokenId: number;
522
+ }
523
+ /**
524
+ * Contains data for spotLpInstruction function
525
+ * @property {number} instrId Instrument ID
526
+ * @property {number} amount Amount of tokens to trade. Negative value means selling
527
+ */
528
+ export interface SpotLpArgs {
529
+ instrId: number;
530
+ side: number;
531
+ amount: number;
532
+ }
533
+ /**
534
+ * Contains data for distribFundsInstruction function
535
+ * @property {number[]} instruments Instruments ID
536
+ */
537
+ export interface DistribDividendsArgs {
538
+ instruments: number[];
539
+ }
540
+ export interface PerpDepositArgs {
541
+ instrId: number;
542
+ amount: number;
543
+ }
544
+ export interface NewPerpOrderArgs {
545
+ instrId: number;
546
+ ioc?: number;
547
+ orderType?: number;
548
+ qty: number;
549
+ price: number;
550
+ leverage?: number;
551
+ side: number;
552
+ }
553
+ export type LogMessage = DepositReportModel | WithdrawReportModel | PerpDepositReportModel | PerpWithdrawReportModel | FeesDepositReportModel | FeesWithdrawReportModel | SpotlpTradeReportModel | EarningsReportModel | DrvsAirdropReportModel | SpotPlaceOrderReportModel | SpotFillOrderReportModel | SpotNewOrderReportModel | SpotOrderCancelReportModel | SpotOrderRevokeReportModel | SpotFeesReportModel | SpotPlaceMassCancelReportModel | SpotMassCancelReportModel | PerpPlaceOrderReportModel | PerpFillOrderReportModel | PerpNewOrderReportModel | PerpOrderCancelReportModel | PerpOrderRevokeReportModel | PerpFeesReportModel | PerpPlaceMassCancelReportModel | PerpMassCancelReportModel | PerpFundingReportModel | PerpSocLossReportModel | PerpChangeLeverageReportModel;
package/dist/types.js ADDED
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MARKET_DEPTH = exports.PROGRAM_ID = exports.VERSION = exports.AccountType = exports.InstrMask = void 0;
4
+ const kit_1 = require("@solana/kit");
5
+ var InstrMask;
6
+ (function (InstrMask) {
7
+ InstrMask[InstrMask["DRV"] = 268435456] = "DRV";
8
+ InstrMask[InstrMask["READY_TO_DRV_UPGRADE"] = 536870912] = "READY_TO_DRV_UPGRADE";
9
+ InstrMask[InstrMask["PERP"] = 1073741824] = "PERP";
10
+ InstrMask[InstrMask["ORACLE"] = 2147483648] = "ORACLE";
11
+ InstrMask[InstrMask["READY_TO_PERP_UPGRADE"] = 16777216] = "READY_TO_PERP_UPGRADE";
12
+ })(InstrMask || (exports.InstrMask = InstrMask = {}));
13
+ var AccountType;
14
+ (function (AccountType) {
15
+ AccountType[AccountType["CLIENT_COMMUNITY"] = 35] = "CLIENT_COMMUNITY";
16
+ AccountType[AccountType["CLIENT_DRV"] = 32] = "CLIENT_DRV";
17
+ AccountType[AccountType["CLIENT_PRIMARY"] = 31] = "CLIENT_PRIMARY";
18
+ AccountType[AccountType["COMMUNITY"] = 34] = "COMMUNITY";
19
+ AccountType[AccountType["PDF"] = 33] = "PDF";
20
+ AccountType[AccountType["FUTURES_ASK_ORDERS"] = 29] = "FUTURES_ASK_ORDERS";
21
+ AccountType[AccountType["FUTURES_ASKS_TREE"] = 27] = "FUTURES_ASKS_TREE";
22
+ AccountType[AccountType["FUTURES_BID_ORDERS"] = 28] = "FUTURES_BID_ORDERS";
23
+ AccountType[AccountType["FUTURES_BIDS_TREE"] = 26] = "FUTURES_BIDS_TREE";
24
+ AccountType[AccountType["FUTURES_CLIENT_ACCOUNTS"] = 23] = "FUTURES_CLIENT_ACCOUNTS";
25
+ AccountType[AccountType["FUTURES_CLIENT_INFOS"] = 24] = "FUTURES_CLIENT_INFOS";
26
+ AccountType[AccountType["FUTURES_CLIENT_INFOS2"] = 25] = "FUTURES_CLIENT_INFOS2";
27
+ AccountType[AccountType["FUTURES_LINES"] = 30] = "FUTURES_LINES";
28
+ AccountType[AccountType["FUTURES_MAPS"] = 22] = "FUTURES_MAPS";
29
+ AccountType[AccountType["HOLDER"] = 1] = "HOLDER";
30
+ AccountType[AccountType["ROOT"] = 2] = "ROOT";
31
+ AccountType[AccountType["INSTR"] = 7] = "INSTR";
32
+ AccountType[AccountType["INSTR_TRACE"] = 8] = "INSTR_TRACE";
33
+ AccountType[AccountType["SPOT_15M_CANDLES"] = 20] = "SPOT_15M_CANDLES";
34
+ AccountType[AccountType["SPOT_1M_CANDLES"] = 19] = "SPOT_1M_CANDLES";
35
+ AccountType[AccountType["SPOT_ASK_ORDERS"] = 17] = "SPOT_ASK_ORDERS";
36
+ AccountType[AccountType["SPOT_ASKS_TREE"] = 15] = "SPOT_ASKS_TREE";
37
+ AccountType[AccountType["SPOT_BID_ORDERS"] = 16] = "SPOT_BID_ORDERS";
38
+ AccountType[AccountType["SPOT_BIDS_TREE"] = 14] = "SPOT_BIDS_TREE";
39
+ AccountType[AccountType["SPOT_CLIENT_ACCOUNTS"] = 11] = "SPOT_CLIENT_ACCOUNTS";
40
+ AccountType[AccountType["SPOT_CLIENT_INFOS"] = 12] = "SPOT_CLIENT_INFOS";
41
+ AccountType[AccountType["SPOT_CLIENT_INFOS2"] = 13] = "SPOT_CLIENT_INFOS2";
42
+ AccountType[AccountType["SPOT_DAY_CANDLES"] = 21] = "SPOT_DAY_CANDLES";
43
+ AccountType[AccountType["SPOT_LINES"] = 18] = "SPOT_LINES";
44
+ AccountType[AccountType["SPOT_MAPS"] = 10] = "SPOT_MAPS";
45
+ AccountType[AccountType["TOKEN"] = 4] = "TOKEN";
46
+ AccountType[AccountType["PERP_ASK_ORDERS"] = 36] = "PERP_ASK_ORDERS";
47
+ AccountType[AccountType["PERP_ASKS_TREE"] = 37] = "PERP_ASKS_TREE";
48
+ AccountType[AccountType["PERP_BID_ORDERS"] = 38] = "PERP_BID_ORDERS";
49
+ AccountType[AccountType["PERP_BIDS_TREE"] = 39] = "PERP_BIDS_TREE";
50
+ AccountType[AccountType["PERP_CLIENT_ACCOUNTS"] = 40] = "PERP_CLIENT_ACCOUNTS";
51
+ AccountType[AccountType["PERP_CLIENT_INFOS"] = 41] = "PERP_CLIENT_INFOS";
52
+ AccountType[AccountType["PERP_CLIENT_INFOS2"] = 42] = "PERP_CLIENT_INFOS2";
53
+ AccountType[AccountType["PERP_CLIENT_INFOS3"] = 43] = "PERP_CLIENT_INFOS3";
54
+ AccountType[AccountType["PERP_CLIENT_INFOS4"] = 44] = "PERP_CLIENT_INFOS4";
55
+ AccountType[AccountType["PERP_CLIENT_INFOS5"] = 45] = "PERP_CLIENT_INFOS5";
56
+ AccountType[AccountType["PERP_LINES"] = 46] = "PERP_LINES";
57
+ AccountType[AccountType["PERP_MAPS"] = 47] = "PERP_MAPS";
58
+ AccountType[AccountType["PERP_LONG_PX_TREE"] = 48] = "PERP_LONG_PX_TREE";
59
+ AccountType[AccountType["PERP_SHORT_PX_TREE"] = 49] = "PERP_SHORT_PX_TREE";
60
+ AccountType[AccountType["PERP_REBALANCE_TIME_TREE"] = 50] = "PERP_REBALANCE_TIME_TREE";
61
+ AccountType[AccountType["PERP_PRIORITY_TREE"] = 51] = "PERP_PRIORITY_TREE";
62
+ })(AccountType || (exports.AccountType = AccountType = {}));
63
+ exports.VERSION = 8;
64
+ exports.PROGRAM_ID = (0, kit_1.address)("Drvrseg8AQLP8B96DBGmHRjFGviFNYTkHueY9g3k27Gu");
65
+ exports.MARKET_DEPTH = 20;
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@deriverse/kit",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "test": "echo \"Error: no test specified\" && exit 1",
10
+ "prepack": "npm run build"
11
+ },
12
+ "author": "Deriverse",
13
+ "license": "Apache-2.0",
14
+ "devDependencies": {
15
+ "typedoc": "^0.25.13",
16
+ "typescript": "^5.4.3"
17
+ },
18
+ "dependencies": {
19
+ "@solana/spl-token": "^0.4.6",
20
+ "@solana/kit": "^2.1.0",
21
+ "@solana-program/system": "^0.7.0",
22
+ "bigint-buffer": "^1.1.5",
23
+ "bs58": "^5.0.0",
24
+ "base64-arraybuffer": "^1.0.2"
25
+ }
26
+ }