@percolatorct/sdk 0.4.0 → 0.5.1

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 CHANGED
@@ -1460,7 +1460,10 @@ 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;
1466
+ var V1M2_ENGINE_PARAMS_OFF = 96;
1464
1467
  var V1M_PARAMS_SIZE = 336;
1465
1468
  var V1M_ENGINE_CURRENT_SLOT_OFF = 408;
1466
1469
  var V1M_ENGINE_FUNDING_INDEX_OFF = 416;
@@ -1540,7 +1543,7 @@ for (const [label, n] of [["Micro", 64], ["Small", 256], ["Medium", 1024], ["Lar
1540
1543
  }
1541
1544
  var SLAB_TIERS_V1M2 = {};
1542
1545
  for (const [label, n] of [["Micro", 64], ["Small", 256], ["Medium", 1024], ["Large", 4096]]) {
1543
- const size = computeSlabSize(V1M_ENGINE_OFF, V1M2_ENGINE_BITMAP_OFF, V1M2_ACCOUNT_SIZE, n, 18);
1546
+ const size = computeSlabSize(V1M2_ENGINE_OFF, V1M2_ENGINE_BITMAP_OFF, V1M2_ACCOUNT_SIZE, n, 18);
1544
1547
  SLAB_TIERS_V1M2[label.toLowerCase()] = { maxAccounts: n, dataSize: size, label, description: `${n} slots (V1M2 mainnet upgraded)` };
1545
1548
  }
1546
1549
  var SLAB_TIERS_V_ADL = {};
@@ -1801,7 +1804,7 @@ function buildLayoutV1M(maxAccounts) {
1801
1804
  };
1802
1805
  }
1803
1806
  function buildLayoutV1M2(maxAccounts) {
1804
- const engineOff = V1M_ENGINE_OFF;
1807
+ const engineOff = V1M2_ENGINE_OFF;
1805
1808
  const bitmapOff = V1M2_ENGINE_BITMAP_OFF;
1806
1809
  const accountSize = V1M2_ACCOUNT_SIZE;
1807
1810
  const bitmapWords = Math.ceil(maxAccounts / 64);
@@ -1814,7 +1817,7 @@ function buildLayoutV1M2(maxAccounts) {
1814
1817
  version: 1,
1815
1818
  headerLen: V1_HEADER_LEN,
1816
1819
  configOffset: V1_HEADER_LEN,
1817
- configLen: V1M_CONFIG_LEN,
1820
+ configLen: V1M2_CONFIG_LEN,
1818
1821
  reservedOff: V1_RESERVED_OFF,
1819
1822
  engineOff,
1820
1823
  accountSize,
@@ -1822,8 +1825,8 @@ function buildLayoutV1M2(maxAccounts) {
1822
1825
  bitmapWords,
1823
1826
  accountsOff: engineOff + accountsOffRel,
1824
1827
  engineInsuranceOff: 16,
1825
- engineParamsOff: V1M_ENGINE_PARAMS_OFF,
1826
- // 72same as V1M
1828
+ engineParamsOff: V1M2_ENGINE_PARAMS_OFF,
1829
+ // 96expanded InsuranceFund
1827
1830
  paramsSize: V1M_PARAMS_SIZE,
1828
1831
  // 336 — same as V1M
1829
1832
  // Runtime fields: same as V1M up to fundingRateBps, then +32 shift
@@ -1960,7 +1963,7 @@ function detectSlabLayout(dataLen, data) {
1960
1963
  const vadln = V_ADL_SIZES.get(dataLen);
1961
1964
  if (vadln !== void 0) {
1962
1965
  if (data && data.length >= 752) {
1963
- const maxAcctsV1M2 = readU64LE(data, V1M_ENGINE_OFF + V1M_ENGINE_PARAMS_OFF + 32);
1966
+ const maxAcctsV1M2 = readU64LE(data, V1M2_ENGINE_OFF + V1M2_ENGINE_PARAMS_OFF + 32);
1964
1967
  if (maxAcctsV1M2 === BigInt(vadln)) {
1965
1968
  return buildLayoutV1M2(vadln);
1966
1969
  }