@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.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
|
-
|
|
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 (
|
|
24759
|
+
if (hasAccountDataShape(response)) {
|
|
24751
24760
|
return response;
|
|
24752
24761
|
}
|
|
24753
24762
|
return void 0;
|