@pear-protocol/symmio-client 0.3.15 → 0.3.16

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.mjs CHANGED
@@ -24739,15 +24739,24 @@ function readTimestamp(source) {
24739
24739
  const parsed = Number(timestamp);
24740
24740
  return Number.isFinite(parsed) ? parsed : void 0;
24741
24741
  }
24742
+ function hasAccountDataShape(value) {
24743
+ return isRecord(value) && ("equity" in value || "maintenanceMargin" in value || "availableForOrder" in value || "totalLocked" in value);
24744
+ }
24742
24745
  function getSymmAccountData(response) {
24743
24746
  if (!isRecord(response)) {
24744
24747
  return void 0;
24745
24748
  }
24746
24749
  const data = response.data;
24747
24750
  if (isRecord(data)) {
24748
- return data;
24751
+ if (hasAccountDataShape(data.accountData)) {
24752
+ return data.accountData;
24753
+ }
24754
+ if (hasAccountDataShape(data)) {
24755
+ return data;
24756
+ }
24757
+ return void 0;
24749
24758
  }
24750
- if ("equity" in response || "maintenanceMargin" in response || "availableForOrder" in response || "totalLocked" in response) {
24759
+ if (hasAccountDataShape(response)) {
24751
24760
  return response;
24752
24761
  }
24753
24762
  return void 0;