@percolatorct/sdk 1.0.0-beta.16 → 1.0.0-beta.17

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
@@ -1620,6 +1620,7 @@ var V12_1_ACCT_ENTRY_PRICE_OFF = -1;
1620
1620
  var V12_1_ACCT_FUNDING_INDEX_OFF = 288;
1621
1621
  var V12_15_ENGINE_OFF = 624;
1622
1622
  var V12_15_ACCOUNT_SIZE = 4400;
1623
+ var V12_15_ACCOUNT_SIZE_SMALL = 944;
1623
1624
  var V12_15_ACCT_ACCOUNT_ID_OFF = 0;
1624
1625
  var V12_15_ACCT_CAPITAL_OFF = 8;
1625
1626
  var V12_15_ACCT_KIND_OFF = 24;
@@ -1726,6 +1727,7 @@ for (const n of TIERS) {
1726
1727
  V12_15_SIZES.set(computeSlabSize(V12_15_ENGINE_OFF, V12_15_ENGINE_BITMAP_OFF, V12_15_ACCOUNT_SIZE, n, 18), n);
1727
1728
  }
1728
1729
  V12_15_SIZES.set(computeSlabSize(V12_15_ENGINE_OFF, V12_15_ENGINE_BITMAP_OFF, V12_15_ACCOUNT_SIZE, 2048, 18), 2048);
1730
+ V12_15_SIZES.set(237512, 256);
1729
1731
  var V12_1_SBF_ACCOUNT_SIZE = 280;
1730
1732
  var V12_1_SBF_ENGINE_OFF = 616;
1731
1733
  var V12_1_SBF_BITMAP_OFF = 584;
@@ -2788,7 +2790,7 @@ function parseEngine(data) {
2788
2790
  throw new Error(`Unrecognized slab data length: ${data.length}. Cannot determine layout version.`);
2789
2791
  }
2790
2792
  const base = layout.engineOff;
2791
- const isV12_15 = layout.accountSize === V12_15_ACCOUNT_SIZE && layout.engineOff === V12_15_ENGINE_OFF;
2793
+ const isV12_15 = (layout.accountSize === V12_15_ACCOUNT_SIZE || layout.accountSize === V12_15_ACCOUNT_SIZE_SMALL) && layout.engineOff === V12_15_ENGINE_OFF;
2792
2794
  const fundingRateBpsPerSlotLast = isV12_15 ? readI128LE(data, base + V12_15_ENGINE_FUNDING_RATE_E9_OFF) : readI64LE(data, base + layout.engineFundingRateBpsOff);
2793
2795
  return {
2794
2796
  vault: readU128LE(data, base),
@@ -2889,7 +2891,7 @@ function parseAccount(data, idx) {
2889
2891
  if (data.length < base + layout.accountSize) {
2890
2892
  throw new Error("Slab data too short for account");
2891
2893
  }
2892
- const isV12_15 = layout.accountSize === V12_15_ACCOUNT_SIZE;
2894
+ const isV12_15 = layout.accountSize === V12_15_ACCOUNT_SIZE || layout.accountSize === V12_15_ACCOUNT_SIZE_SMALL;
2893
2895
  const isV12_1 = !isV12_15 && (layout.engineOff === V12_1_ENGINE_OFF || layout.engineOff === V12_1_SBF_ENGINE_OFF) && (layout.accountSize === V12_1_ACCOUNT_SIZE || layout.accountSize === V12_1_ACCOUNT_SIZE_SBF);
2894
2896
  const isAdl = !isV12_15 && (layout.accountSize >= 312 || isV12_1);
2895
2897
  if (isV12_15) {