@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 +11 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.js +57 -17
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +57 -17
- package/dist/react/index.mjs.map +1 -1
- package/dist/react/provider.js +46 -15
- package/dist/react/provider.js.map +1 -1
- package/dist/react/provider.mjs +46 -15
- package/dist/react/provider.mjs.map +1 -1
- package/package.json +2 -2
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
|
-
|
|
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 (
|
|
24761
|
+
if (hasAccountDataShape(response)) {
|
|
24753
24762
|
return response;
|
|
24754
24763
|
}
|
|
24755
24764
|
return void 0;
|