@deriverse/kit 1.0.3 → 1.0.5
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 +1 -0
- package/dist/index.js +22 -3
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -40,7 +40,7 @@ const SYSTEM_PROGRAM_ID = (0, kit_1.address)("11111111111111111111111111111111")
|
|
|
40
40
|
const TOKEN_PROGRAM_ID = (0, kit_1.address)('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA');
|
|
41
41
|
const TOKEN_2022_PROGRAM_ID = (0, kit_1.address)('TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb');
|
|
42
42
|
const ASSOCIATED_TOKEN_PROGRAM_ID = (0, kit_1.address)('ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL');
|
|
43
|
-
|
|
43
|
+
let dec = 1000000000;
|
|
44
44
|
const nullOrder = 0xFFFF;
|
|
45
45
|
/**
|
|
46
46
|
* Get price step between orderbook lines depending on curent price
|
|
@@ -239,6 +239,15 @@ class Engine {
|
|
|
239
239
|
else {
|
|
240
240
|
this.commitment = args.commitment;
|
|
241
241
|
}
|
|
242
|
+
if (args == undefined || args.uiNumbers == null || args.uiNumbers == undefined) {
|
|
243
|
+
this.uiNumbers = true;
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
this.uiNumbers = args.uiNumbers;
|
|
247
|
+
}
|
|
248
|
+
if (!this.uiNumbers) {
|
|
249
|
+
dec = 1;
|
|
250
|
+
}
|
|
242
251
|
}
|
|
243
252
|
logsDecode(data) {
|
|
244
253
|
let assetTokenDec = null;
|
|
@@ -1231,8 +1240,18 @@ class Engine {
|
|
|
1231
1240
|
});
|
|
1232
1241
|
}
|
|
1233
1242
|
tokenDec(tokenId) {
|
|
1234
|
-
|
|
1235
|
-
|
|
1243
|
+
if (this.uiNumbers) {
|
|
1244
|
+
const token = this.tokens.get(tokenId);
|
|
1245
|
+
if (token) {
|
|
1246
|
+
return Math.pow(10, token.mask & 0xFF);
|
|
1247
|
+
}
|
|
1248
|
+
else {
|
|
1249
|
+
return 1;
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
else {
|
|
1253
|
+
return 1;
|
|
1254
|
+
}
|
|
1236
1255
|
}
|
|
1237
1256
|
/**
|
|
1238
1257
|
* Get general information about open orders in particular instrument (spot)
|
package/dist/types.d.ts
CHANGED