@percolatorct/sdk 0.4.0 → 0.5.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/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1460,6 +1460,8 @@ var V_ADL_ACCT_LAST_FEE_SLOT_OFF = 240;
|
|
|
1460
1460
|
var V1M_ENGINE_OFF = 640;
|
|
1461
1461
|
var V1M_CONFIG_LEN = 536;
|
|
1462
1462
|
var V1M_ACCOUNT_SIZE = 248;
|
|
1463
|
+
var V1M2_ENGINE_OFF = 616;
|
|
1464
|
+
var V1M2_CONFIG_LEN = 512;
|
|
1463
1465
|
var V1M_ENGINE_PARAMS_OFF = 72;
|
|
1464
1466
|
var V1M_PARAMS_SIZE = 336;
|
|
1465
1467
|
var V1M_ENGINE_CURRENT_SLOT_OFF = 408;
|
|
@@ -1540,7 +1542,7 @@ for (const [label, n] of [["Micro", 64], ["Small", 256], ["Medium", 1024], ["Lar
|
|
|
1540
1542
|
}
|
|
1541
1543
|
var SLAB_TIERS_V1M2 = {};
|
|
1542
1544
|
for (const [label, n] of [["Micro", 64], ["Small", 256], ["Medium", 1024], ["Large", 4096]]) {
|
|
1543
|
-
const size = computeSlabSize(
|
|
1545
|
+
const size = computeSlabSize(V1M2_ENGINE_OFF, V1M2_ENGINE_BITMAP_OFF, V1M2_ACCOUNT_SIZE, n, 18);
|
|
1544
1546
|
SLAB_TIERS_V1M2[label.toLowerCase()] = { maxAccounts: n, dataSize: size, label, description: `${n} slots (V1M2 mainnet upgraded)` };
|
|
1545
1547
|
}
|
|
1546
1548
|
var SLAB_TIERS_V_ADL = {};
|
|
@@ -1801,7 +1803,7 @@ function buildLayoutV1M(maxAccounts) {
|
|
|
1801
1803
|
};
|
|
1802
1804
|
}
|
|
1803
1805
|
function buildLayoutV1M2(maxAccounts) {
|
|
1804
|
-
const engineOff =
|
|
1806
|
+
const engineOff = V1M2_ENGINE_OFF;
|
|
1805
1807
|
const bitmapOff = V1M2_ENGINE_BITMAP_OFF;
|
|
1806
1808
|
const accountSize = V1M2_ACCOUNT_SIZE;
|
|
1807
1809
|
const bitmapWords = Math.ceil(maxAccounts / 64);
|
|
@@ -1814,7 +1816,7 @@ function buildLayoutV1M2(maxAccounts) {
|
|
|
1814
1816
|
version: 1,
|
|
1815
1817
|
headerLen: V1_HEADER_LEN,
|
|
1816
1818
|
configOffset: V1_HEADER_LEN,
|
|
1817
|
-
configLen:
|
|
1819
|
+
configLen: V1M2_CONFIG_LEN,
|
|
1818
1820
|
reservedOff: V1_RESERVED_OFF,
|
|
1819
1821
|
engineOff,
|
|
1820
1822
|
accountSize,
|
|
@@ -1960,7 +1962,7 @@ function detectSlabLayout(dataLen, data) {
|
|
|
1960
1962
|
const vadln = V_ADL_SIZES.get(dataLen);
|
|
1961
1963
|
if (vadln !== void 0) {
|
|
1962
1964
|
if (data && data.length >= 752) {
|
|
1963
|
-
const maxAcctsV1M2 = readU64LE(data,
|
|
1965
|
+
const maxAcctsV1M2 = readU64LE(data, V1M2_ENGINE_OFF + V1M_ENGINE_PARAMS_OFF + 32);
|
|
1964
1966
|
if (maxAcctsV1M2 === BigInt(vadln)) {
|
|
1965
1967
|
return buildLayoutV1M2(vadln);
|
|
1966
1968
|
}
|