@deriverse/kit 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +12 -15
- package/dist/index.js +70 -27
- package/dist/types.d.ts +9 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { Address, Base64EncodedDataResponse, Rpc, IAccountMeta, IInstruction, Commitment } from "@solana/kit";
|
|
2
|
-
import { Instrument, GetClientSpotOrdersInfoResponse, GetClientSpotOrdersArgs, GetClientSpotOrdersResponse, SpotOrderCancelArgs, GetClientDataResponse, GetClientSpotOrdersInfoArgs, SpotLpArgs, getInstrAccountByTagArgs, GetInstrIdArgs, NewSpotOrderArgs, DepositArgs,
|
|
2
|
+
import { Instrument, GetClientSpotOrdersInfoResponse, GetClientSpotOrdersArgs, GetClientSpotOrdersResponse, SpotOrderCancelArgs, GetClientDataResponse, GetClientSpotOrdersInfoArgs, SpotLpArgs, getInstrAccountByTagArgs, GetInstrIdArgs, NewSpotOrderArgs, DepositArgs, WithdrawArgs, SpotQuotesReplaceArgs, SpotMassCancelArgs, InstrId, GetClientPerpOrdersInfoArgs, GetClientPerpOrdersInfoResponse, GetClientPerpOrdersArgs, GetClientPerpOrdersResponse, PerpDepositArgs, NewPerpOrderArgs, PerpQuotesReplaceArgs, PerpOrderCancelArgs, PerpMassCancelArgs, PerpForcedCloseArgs, CommunityData, LogMessage, PerpChangeLeverageArgs, PerpStatisticsResetArgs, EngineArgs } from './types';
|
|
3
3
|
import { InstrAccountHeaderModel, RootStateModel, TokenStateModel } from "./structure_models";
|
|
4
4
|
export * from './types';
|
|
5
|
-
export
|
|
6
|
-
export declare const TOKEN_PROGRAM_ID: Address<"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA">;
|
|
7
|
-
export declare const TOKEN_2022_PROGRAM_ID: Address<"TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb">;
|
|
8
|
-
export declare const ASSOCIATED_TOKEN_PROGRAM_ID: Address<"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL">;
|
|
5
|
+
export * from './logs_models';
|
|
9
6
|
/**
|
|
10
7
|
* Get price step between orderbook lines depending on curent price
|
|
11
8
|
* @param price Current market price
|
|
@@ -13,8 +10,8 @@ export declare const ASSOCIATED_TOKEN_PROGRAM_ID: Address<"ATokenGPvbdGVxr1b2hvZ
|
|
|
13
10
|
*/
|
|
14
11
|
export declare function getPriceStep(price: number): number;
|
|
15
12
|
/**
|
|
16
|
-
* Main class to operate with
|
|
17
|
-
* @property {number} originalClientId
|
|
13
|
+
* Main class to operate with Deriverse
|
|
14
|
+
* @property {number} originalClientId Deriverse main client ID
|
|
18
15
|
* @property {AddressLookupTableAccount} lut Root address lookup table account
|
|
19
16
|
* @property {AddressLookupTableAccount} clientLut Client address lookup table account
|
|
20
17
|
* @property {Map<number, Token>} tokens Tokens data
|
|
@@ -62,20 +59,20 @@ export declare class Engine {
|
|
|
62
59
|
getSpotCandles(instrAccountHeaderModel: InstrAccountHeaderModel): Promise<IAccountMeta[]>;
|
|
63
60
|
getTokenAccount(mint: Address): Promise<Address>;
|
|
64
61
|
/**
|
|
65
|
-
* Get Token ID from mint public key if this token registered on
|
|
62
|
+
* Get Token ID from mint public key if this token registered on Deriverse
|
|
66
63
|
* @param mint Public key
|
|
67
64
|
* @returns Token ID
|
|
68
65
|
*/
|
|
69
66
|
getTokenId(mint: Address): Promise<number | null>;
|
|
70
67
|
/**
|
|
71
|
-
* Get intrument ID if this instrument registered on
|
|
68
|
+
* Get intrument ID if this instrument registered on Deriverse
|
|
72
69
|
* @param args Base crncy Token ID and asset token ID
|
|
73
70
|
* @returns Instrument ID
|
|
74
71
|
*/
|
|
75
72
|
getInstrId(args: GetInstrIdArgs): Promise<number | null>;
|
|
76
73
|
/**
|
|
77
74
|
* Assignes client public key to Engine
|
|
78
|
-
* @param
|
|
75
|
+
* @param signer Client public key
|
|
79
76
|
*/
|
|
80
77
|
setSigner(signer: Address<any>): Promise<void>;
|
|
81
78
|
private findClientPrimaryAccount;
|
|
@@ -107,10 +104,10 @@ export declare class Engine {
|
|
|
107
104
|
*/
|
|
108
105
|
getClientSpotOrders(args: GetClientSpotOrdersArgs): Promise<GetClientSpotOrdersResponse>;
|
|
109
106
|
/**
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
* Get list of open orders (perp) in particular instrument
|
|
108
|
+
* @param args Contains data from getClientSpotOrdersInfo
|
|
109
|
+
* @returns List of open orders
|
|
110
|
+
*/
|
|
114
111
|
getClientPerpOrders(args: GetClientPerpOrdersArgs): Promise<GetClientPerpOrdersResponse>;
|
|
115
112
|
/**
|
|
116
113
|
* Unpack market data to Engine fields, you can use this function to subscribe to Solana account
|
|
@@ -127,7 +124,7 @@ export declare class Engine {
|
|
|
127
124
|
* Update market data on Engine fields
|
|
128
125
|
* @param args Instrument ID
|
|
129
126
|
*/
|
|
130
|
-
updateInstrData(args:
|
|
127
|
+
updateInstrData(args: InstrId): Promise<void>;
|
|
131
128
|
/**
|
|
132
129
|
* Build instruction to deposit SPL tokens
|
|
133
130
|
* @param args Order data
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Engine = exports.getPriceStep =
|
|
26
|
+
exports.Engine = exports.getPriceStep = void 0;
|
|
27
27
|
const kit_1 = require("@solana/kit");
|
|
28
28
|
const system_1 = require("@solana-program/system");
|
|
29
29
|
const bs58_1 = require("bs58");
|
|
@@ -33,13 +33,12 @@ const instruction_models_1 = require("./instruction_models");
|
|
|
33
33
|
const base64_arraybuffer_1 = require("base64-arraybuffer");
|
|
34
34
|
const logs_models_1 = require("./logs_models");
|
|
35
35
|
__exportStar(require("./types"), exports);
|
|
36
|
-
|
|
37
|
-
Object.defineProperty(exports, "LogType", { enumerable: true, get: function () { return logs_models_2.LogType; } });
|
|
36
|
+
__exportStar(require("./logs_models"), exports);
|
|
38
37
|
const ADDRESS_LOOKUP_TABLE_PROGRAM_ID = (0, kit_1.address)("AddressLookupTab1e1111111111111111111111111");
|
|
39
38
|
const SYSTEM_PROGRAM_ID = (0, kit_1.address)("11111111111111111111111111111111");
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
const TOKEN_PROGRAM_ID = (0, kit_1.address)('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA');
|
|
40
|
+
const TOKEN_2022_PROGRAM_ID = (0, kit_1.address)('TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb');
|
|
41
|
+
const ASSOCIATED_TOKEN_PROGRAM_ID = (0, kit_1.address)('ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL');
|
|
43
42
|
const dec = 1000000000;
|
|
44
43
|
const nullOrder = 0xFFFF;
|
|
45
44
|
/**
|
|
@@ -164,7 +163,7 @@ exports.getPriceStep = getPriceStep;
|
|
|
164
163
|
function findAssociatedTokenAddress(owner, tokenProgramId, mint) {
|
|
165
164
|
return __awaiter(this, void 0, void 0, function* () {
|
|
166
165
|
const address = (yield (0, kit_1.getProgramDerivedAddress)({
|
|
167
|
-
programAddress:
|
|
166
|
+
programAddress: ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
168
167
|
seeds: [
|
|
169
168
|
(0, kit_1.getAddressEncoder)().encode(owner),
|
|
170
169
|
(0, kit_1.getAddressEncoder)().encode(tokenProgramId),
|
|
@@ -208,8 +207,8 @@ function getLookupTableAddress(authority, slot) {
|
|
|
208
207
|
});
|
|
209
208
|
}
|
|
210
209
|
/**
|
|
211
|
-
* Main class to operate with
|
|
212
|
-
* @property {number} originalClientId
|
|
210
|
+
* Main class to operate with Deriverse
|
|
211
|
+
* @property {number} originalClientId Deriverse main client ID
|
|
213
212
|
* @property {AddressLookupTableAccount} lut Root address lookup table account
|
|
214
213
|
* @property {AddressLookupTableAccount} clientLut Client address lookup table account
|
|
215
214
|
* @property {Map<number, Token>} tokens Tokens data
|
|
@@ -957,7 +956,7 @@ class Engine {
|
|
|
957
956
|
});
|
|
958
957
|
}
|
|
959
958
|
/**
|
|
960
|
-
* Get Token ID from mint public key if this token registered on
|
|
959
|
+
* Get Token ID from mint public key if this token registered on Deriverse
|
|
961
960
|
* @param mint Public key
|
|
962
961
|
* @returns Token ID
|
|
963
962
|
*/
|
|
@@ -975,7 +974,7 @@ class Engine {
|
|
|
975
974
|
});
|
|
976
975
|
}
|
|
977
976
|
/**
|
|
978
|
-
* Get intrument ID if this instrument registered on
|
|
977
|
+
* Get intrument ID if this instrument registered on Deriverse
|
|
979
978
|
* @param args Base crncy Token ID and asset token ID
|
|
980
979
|
* @returns Instrument ID
|
|
981
980
|
*/
|
|
@@ -1003,7 +1002,7 @@ class Engine {
|
|
|
1003
1002
|
}
|
|
1004
1003
|
/**
|
|
1005
1004
|
* Assignes client public key to Engine
|
|
1006
|
-
* @param
|
|
1005
|
+
* @param signer Client public key
|
|
1007
1006
|
*/
|
|
1008
1007
|
setSigner(signer) {
|
|
1009
1008
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1280,6 +1279,10 @@ class Engine {
|
|
|
1280
1279
|
this.tokenDec(instr.header.assetTokenId),
|
|
1281
1280
|
tempCrncyTokens: Number(data.readBigInt64LE(structure_models_1.SpotClientInfoModel.OFFSET_AVAIL_CRNCY_TOKENS)) /
|
|
1282
1281
|
this.tokenDec(instr.header.crncyTokenId),
|
|
1282
|
+
inOrdersAssetTokens: Number(data1.readBigInt64LE(structure_models_1.SpotClientInfo2Model.OFFSET_IN_ORDERS_ASSET_TOKENS)) /
|
|
1283
|
+
this.tokenDec(instr.header.assetTokenId),
|
|
1284
|
+
inOrdersCrncyTokens: Number(data1.readBigInt64LE(structure_models_1.SpotClientInfo2Model.OFFSET_IN_ORDERS_CRNCY_TOKENS)) /
|
|
1285
|
+
this.tokenDec(instr.header.crncyTokenId),
|
|
1283
1286
|
};
|
|
1284
1287
|
});
|
|
1285
1288
|
}
|
|
@@ -1376,13 +1379,25 @@ class Engine {
|
|
|
1376
1379
|
crncyTokenId: instr.header.crncyTokenId,
|
|
1377
1380
|
tag: types_1.AccountType.SPOT_ASK_ORDERS
|
|
1378
1381
|
});
|
|
1382
|
+
const assetTokenDec = this.tokenDec(instr.header.assetTokenId);
|
|
1383
|
+
const crncyTokenDec = this.tokenDec(instr.header.crncyTokenId);
|
|
1379
1384
|
if (args.bidsCount > 1 && args.asksCount > 1) {
|
|
1380
1385
|
let infos = yield this.rpc.getMultipleAccounts([bidOrdersAccount, askOrdersAccount], { commitment: this.commitment, encoding: 'base64' }).send();
|
|
1386
|
+
let bids = getMultipleSpotOrders(infos.value[0].data, args.bidsEntry);
|
|
1387
|
+
for (let i = 0; i < bids.length; ++i) {
|
|
1388
|
+
bids[i].qty /= assetTokenDec;
|
|
1389
|
+
bids[i].sum /= crncyTokenDec;
|
|
1390
|
+
}
|
|
1391
|
+
let asks = getMultipleSpotOrders(infos.value[1].data, args.asksEntry);
|
|
1392
|
+
for (let i = 0; i < asks.length; ++i) {
|
|
1393
|
+
asks[i].qty /= assetTokenDec;
|
|
1394
|
+
asks[i].sum /= crncyTokenDec;
|
|
1395
|
+
}
|
|
1381
1396
|
return {
|
|
1382
1397
|
bidContextSlot: Number(infos.context.slot),
|
|
1383
1398
|
askContextSlot: Number(infos.context.slot),
|
|
1384
|
-
bids:
|
|
1385
|
-
asks:
|
|
1399
|
+
bids: bids,
|
|
1400
|
+
asks: asks
|
|
1386
1401
|
};
|
|
1387
1402
|
}
|
|
1388
1403
|
let bids = [];
|
|
@@ -1429,6 +1444,14 @@ class Engine {
|
|
|
1429
1444
|
asks = [structure_models_1.OrderModel.fromBuffer(info.value.data)];
|
|
1430
1445
|
askContextSlot = Number(info.context.slot);
|
|
1431
1446
|
}
|
|
1447
|
+
for (let i = 0; i < bids.length; ++i) {
|
|
1448
|
+
bids[i].qty /= assetTokenDec;
|
|
1449
|
+
bids[i].sum /= crncyTokenDec;
|
|
1450
|
+
}
|
|
1451
|
+
for (let i = 0; i < asks.length; ++i) {
|
|
1452
|
+
asks[i].qty /= assetTokenDec;
|
|
1453
|
+
asks[i].sum /= crncyTokenDec;
|
|
1454
|
+
}
|
|
1432
1455
|
return {
|
|
1433
1456
|
bidContextSlot: bidContextSlot,
|
|
1434
1457
|
askContextSlot: askContextSlot,
|
|
@@ -1438,10 +1461,10 @@ class Engine {
|
|
|
1438
1461
|
});
|
|
1439
1462
|
}
|
|
1440
1463
|
/**
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1464
|
+
* Get list of open orders (perp) in particular instrument
|
|
1465
|
+
* @param args Contains data from getClientSpotOrdersInfo
|
|
1466
|
+
* @returns List of open orders
|
|
1467
|
+
*/
|
|
1445
1468
|
getClientPerpOrders(args) {
|
|
1446
1469
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1447
1470
|
const instr = this.instruments.get(args.instrId);
|
|
@@ -1455,13 +1478,25 @@ class Engine {
|
|
|
1455
1478
|
crncyTokenId: instr.header.crncyTokenId,
|
|
1456
1479
|
tag: types_1.AccountType.PERP_ASK_ORDERS
|
|
1457
1480
|
});
|
|
1481
|
+
const assetTokenDec = this.tokenDec(instr.header.assetTokenId);
|
|
1482
|
+
const crncyTokenDec = this.tokenDec(instr.header.crncyTokenId);
|
|
1458
1483
|
if (args.bidsCount > 1 && args.asksCount > 1) {
|
|
1459
1484
|
let infos = yield this.rpc.getMultipleAccounts([bidOrdersAccount, askOrdersAccount], { commitment: this.commitment, encoding: 'base64' }).send();
|
|
1485
|
+
let bids = getMultiplePerpOrders(infos.value[0].data, args.bidsEntry);
|
|
1486
|
+
for (let i = 0; i < bids.length; ++i) {
|
|
1487
|
+
bids[i].qty /= assetTokenDec;
|
|
1488
|
+
bids[i].sum /= crncyTokenDec;
|
|
1489
|
+
}
|
|
1490
|
+
let asks = getMultiplePerpOrders(infos.value[1].data, args.asksEntry);
|
|
1491
|
+
for (let i = 0; i < asks.length; ++i) {
|
|
1492
|
+
asks[i].qty /= assetTokenDec;
|
|
1493
|
+
asks[i].sum /= crncyTokenDec;
|
|
1494
|
+
}
|
|
1460
1495
|
return {
|
|
1461
1496
|
bidContextSlot: Number(infos.context.slot),
|
|
1462
1497
|
askContextSlot: Number(infos.context.slot),
|
|
1463
|
-
bids:
|
|
1464
|
-
asks:
|
|
1498
|
+
bids: bids,
|
|
1499
|
+
asks: asks
|
|
1465
1500
|
};
|
|
1466
1501
|
}
|
|
1467
1502
|
let bids = [];
|
|
@@ -1502,6 +1537,14 @@ class Engine {
|
|
|
1502
1537
|
asks = [structure_models_1.OrderModel.fromBuffer(info.value.data)];
|
|
1503
1538
|
askContextSlot = Number(info.context.slot);
|
|
1504
1539
|
}
|
|
1540
|
+
for (let i = 0; i < bids.length; ++i) {
|
|
1541
|
+
bids[i].qty /= assetTokenDec;
|
|
1542
|
+
bids[i].sum /= crncyTokenDec;
|
|
1543
|
+
}
|
|
1544
|
+
for (let i = 0; i < asks.length; ++i) {
|
|
1545
|
+
asks[i].qty /= assetTokenDec;
|
|
1546
|
+
asks[i].sum /= crncyTokenDec;
|
|
1547
|
+
}
|
|
1505
1548
|
return {
|
|
1506
1549
|
bidContextSlot: bidContextSlot,
|
|
1507
1550
|
askContextSlot: askContextSlot,
|
|
@@ -1635,9 +1678,10 @@ class Engine {
|
|
|
1635
1678
|
*/
|
|
1636
1679
|
updateInstrData(args) {
|
|
1637
1680
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1681
|
+
const instr = this.instruments.get(args.instrId);
|
|
1638
1682
|
let instrAccount = yield this.getInstrAccountByTag({
|
|
1639
|
-
assetTokenId:
|
|
1640
|
-
crncyTokenId:
|
|
1683
|
+
assetTokenId: instr.header.assetTokenId,
|
|
1684
|
+
crncyTokenId: instr.header.crncyTokenId,
|
|
1641
1685
|
tag: types_1.AccountType.INSTR
|
|
1642
1686
|
});
|
|
1643
1687
|
const info = yield this.rpc.getAccountInfo(instrAccount, { commitment: this.commitment, encoding: 'base64' }).send();
|
|
@@ -1656,7 +1700,7 @@ class Engine {
|
|
|
1656
1700
|
throw new Error("Wallet is not connected");
|
|
1657
1701
|
}
|
|
1658
1702
|
const token = this.tokens.get(args.tokenId);
|
|
1659
|
-
const tokenProgramId = (token.mask & 0x80000000) != 0 ?
|
|
1703
|
+
const tokenProgramId = (token.mask & 0x80000000) != 0 ? TOKEN_2022_PROGRAM_ID : TOKEN_PROGRAM_ID;
|
|
1660
1704
|
const clientTokenAccount = yield findAssociatedTokenAddress(this.signer, tokenProgramId, token.address);
|
|
1661
1705
|
let keys = [
|
|
1662
1706
|
{ address: this.signer, role: kit_1.AccountRole.READONLY_SIGNER },
|
|
@@ -1723,7 +1767,7 @@ class Engine {
|
|
|
1723
1767
|
throw new Error("Client account not found");
|
|
1724
1768
|
}
|
|
1725
1769
|
const token = this.tokens.get(args.tokenId);
|
|
1726
|
-
const tokenProgramId = (token.mask & 0x80000000) != 0 ?
|
|
1770
|
+
const tokenProgramId = (token.mask & 0x80000000) != 0 ? TOKEN_2022_PROGRAM_ID : TOKEN_PROGRAM_ID;
|
|
1727
1771
|
const clientTokenAccount = yield findAssociatedTokenAddress(this.signer, tokenProgramId, token.address);
|
|
1728
1772
|
let keys = [
|
|
1729
1773
|
{ address: this.signer, role: kit_1.AccountRole.READONLY_SIGNER },
|
|
@@ -1736,7 +1780,7 @@ class Engine {
|
|
|
1736
1780
|
{ address: SYSTEM_PROGRAM_ID, role: kit_1.AccountRole.READONLY },
|
|
1737
1781
|
{ address: tokenProgramId, role: kit_1.AccountRole.READONLY },
|
|
1738
1782
|
{ address: this.drvsAuthority, role: kit_1.AccountRole.READONLY },
|
|
1739
|
-
{ address:
|
|
1783
|
+
{ address: ASSOCIATED_TOKEN_PROGRAM_ID, role: kit_1.AccountRole.WRITABLE },
|
|
1740
1784
|
];
|
|
1741
1785
|
if (args.spot != undefined) {
|
|
1742
1786
|
keys.push({ address: yield this.findClientDrvAccount(), role: kit_1.AccountRole.READONLY });
|
|
@@ -1952,8 +1996,7 @@ class Engine {
|
|
|
1952
1996
|
throw new Error("Invalid Instr ID");
|
|
1953
1997
|
}
|
|
1954
1998
|
yield this.updateInstrData({
|
|
1955
|
-
|
|
1956
|
-
crncyTokenId: instr.header.crncyTokenId
|
|
1999
|
+
instrId: args.instrId
|
|
1957
2000
|
});
|
|
1958
2001
|
instr = this.instruments.get(args.instrId);
|
|
1959
2002
|
if ((instr.header.mask & types_1.InstrMask.READY_TO_PERP_UPGRADE) == 0) {
|
package/dist/types.d.ts
CHANGED
|
@@ -228,6 +228,8 @@ export interface GetClientSpotOrdersInfoResponse {
|
|
|
228
228
|
contextSlot: number;
|
|
229
229
|
tempAssetTokens: number;
|
|
230
230
|
tempCrncyTokens: number;
|
|
231
|
+
inOrdersAssetTokens: number;
|
|
232
|
+
inOrdersCrncyTokens: number;
|
|
231
233
|
}
|
|
232
234
|
/**
|
|
233
235
|
* Contains general data about client perps in particular instrument
|
|
@@ -348,7 +350,7 @@ export interface PerpOrderCancelArgs {
|
|
|
348
350
|
}
|
|
349
351
|
/**
|
|
350
352
|
* Contains data for deposit function
|
|
351
|
-
* @property {number} tokenId
|
|
353
|
+
* @property {number} tokenId Deriverse SPL token registered ID
|
|
352
354
|
* @property {number} amount Amount to deposit
|
|
353
355
|
* @property {number} refId Referal Link ID for new account. Zero means no ref link
|
|
354
356
|
* @property {number} refId Referal Wallet
|
|
@@ -361,7 +363,7 @@ export interface DepositArgs {
|
|
|
361
363
|
}
|
|
362
364
|
/**
|
|
363
365
|
* Contains data about SPL tokens on main client account
|
|
364
|
-
* @property {number} tokenId
|
|
366
|
+
* @property {number} tokenId Deriverse SPL token registered ID
|
|
365
367
|
* @property {number} amount Amount of SPL tokens on main client account
|
|
366
368
|
*/
|
|
367
369
|
export interface ClientTokenData {
|
|
@@ -371,7 +373,7 @@ export interface ClientTokenData {
|
|
|
371
373
|
/**
|
|
372
374
|
* Contains data about Deriverse internal spot LP tokens on main client account
|
|
373
375
|
* @property {number} instrId Instrument ID
|
|
374
|
-
* @property {number} amount Amount of
|
|
376
|
+
* @property {number} amount Amount of Deriverse internal spot LP tokens on main client account
|
|
375
377
|
*/
|
|
376
378
|
export interface ClientLpData {
|
|
377
379
|
instrId: number;
|
|
@@ -445,7 +447,7 @@ export interface ClientRefProgramData {
|
|
|
445
447
|
* @property {number} lpTrades All-time lp trades
|
|
446
448
|
* @property {number} perpTrades All-time active perp trades
|
|
447
449
|
* @property {ClientTokenData[]} tokens Client tokens data
|
|
448
|
-
* @property {ClientLpData[]} lp Client data about
|
|
450
|
+
* @property {ClientLpData[]} lp Client data about Deriverse internal spot LP tokens
|
|
449
451
|
* @property {ClientSpotData[]} spot Client spot trading data
|
|
450
452
|
* @property {ClientPerpData[]} perp Client perp trading data
|
|
451
453
|
*/
|
|
@@ -467,7 +469,7 @@ export interface GetClientDataResponse {
|
|
|
467
469
|
}
|
|
468
470
|
/**
|
|
469
471
|
* Contains data for withdrawSplTokenInstruction function
|
|
470
|
-
* @property {number} tokenId
|
|
472
|
+
* @property {number} tokenId Deriverse token registered ID
|
|
471
473
|
* @property {number} amount Amount to withdraw
|
|
472
474
|
* @property {instrId[]} spot List of instruments ID to withdraw from client temporary instrument accounts
|
|
473
475
|
* client temporary derivative instrument accounts
|
|
@@ -500,8 +502,8 @@ export interface PerpForcedCloseArgs {
|
|
|
500
502
|
}
|
|
501
503
|
/**
|
|
502
504
|
* Contains data for getInstrId function
|
|
503
|
-
* @property {number} assetTokenId Asset
|
|
504
|
-
* @property {number} baseCrncyTokenId Base currency
|
|
505
|
+
* @property {number} assetTokenId Asset Deriverse token registered ID
|
|
506
|
+
* @property {number} baseCrncyTokenId Base currency Deriverse token registered ID
|
|
505
507
|
*/
|
|
506
508
|
export interface GetInstrIdArgs {
|
|
507
509
|
assetTokenId: number;
|