@percolatorct/sdk 1.0.0-beta.22 → 1.0.0-beta.23

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
@@ -2970,6 +2970,9 @@ function parseEngine(data) {
2970
2970
  emergencyStartSlot: layout.engineEmergencyStartSlotOff >= 0 ? readU64LE(data, base + layout.engineEmergencyStartSlotOff) : 0n,
2971
2971
  lastBreakerSlot: layout.engineLastBreakerSlotOff >= 0 ? readU64LE(data, base + layout.engineLastBreakerSlotOff) : 0n,
2972
2972
  markPriceE6: layout.engineMarkPriceOff >= 0 ? readU64LE(data, base + layout.engineMarkPriceOff) : 0n,
2973
+ // V12_15: last_oracle_price at engine+608 (SBF) / engine+... (native).
2974
+ // Located at bitmapOff - 40 on SBF (648-40=608, verified on-chain).
2975
+ oraclePriceE6: isV12_15 ? readU64LE(data, base + layout.engineBitmapOff - 40) : 0n,
2973
2976
  numUsedAccounts: (() => {
2974
2977
  if (layout.postBitmap < 18) return 0;
2975
2978
  const bw = layout.bitmapWords;
@@ -3421,6 +3424,7 @@ function parseEngineLight(data, layout, maxAccounts = 4096) {
3421
3424
  lastBreakerSlot: 0n,
3422
3425
  markPriceE6: 0n,
3423
3426
  // V0 engine has no mark_price field
3427
+ oraclePriceE6: 0n,
3424
3428
  numUsedAccounts: canReadNumUsed ? readU16LE2(data, base + numUsedOff) : 0,
3425
3429
  nextAccountId: canReadNextId ? readU64LE2(data, base + nextAccountIdOff) : 0n
3426
3430
  };
@@ -3469,6 +3473,7 @@ function parseEngineLight(data, layout, maxAccounts = 4096) {
3469
3473
  lastBreakerSlot: 0n,
3470
3474
  markPriceE6: 0n,
3471
3475
  // V2 has no mark_price
3476
+ oraclePriceE6: 0n,
3472
3477
  numUsedAccounts: canReadNumUsed ? readU16LE2(data, base + numUsedOff) : 0,
3473
3478
  nextAccountId: canReadNextId ? readU64LE2(data, base + nextAccountIdOff) : 0n
3474
3479
  };
@@ -3514,6 +3519,7 @@ function parseEngineLight(data, layout, maxAccounts = 4096) {
3514
3519
  emergencyStartSlot: l.engineEmergencyStartSlotOff >= 0 ? readU64LE2(data, base + l.engineEmergencyStartSlotOff) : 0n,
3515
3520
  lastBreakerSlot: l.engineLastBreakerSlotOff >= 0 ? readU64LE2(data, base + l.engineLastBreakerSlotOff) : 0n,
3516
3521
  markPriceE6: l.engineMarkPriceOff >= 0 ? readU64LE2(data, base + l.engineMarkPriceOff) : 0n,
3522
+ oraclePriceE6: 0n,
3517
3523
  numUsedAccounts: canReadNumUsed ? readU16LE2(data, base + numUsedOff) : 0,
3518
3524
  nextAccountId: canReadNextId ? readU64LE2(data, base + nextAccountIdOff) : 0n
3519
3525
  };
@@ -3558,6 +3564,7 @@ function parseEngineLight(data, layout, maxAccounts = 4096) {
3558
3564
  lastBreakerSlot: readU64LE2(data, base + 624),
3559
3565
  markPriceE6: readU64LE2(data, base + 400),
3560
3566
  // PERC-1094: was 392
3567
+ oraclePriceE6: 0n,
3561
3568
  numUsedAccounts: canReadNumUsed ? readU16LE2(data, base + numUsedOff) : 0,
3562
3569
  nextAccountId: canReadNextId ? readU64LE2(data, base + nextAccountIdOff) : 0n
3563
3570
  };