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