@zyfai/sdk 0.2.18 → 0.2.19
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 +30 -1
- package/dist/index.mjs +30 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -671,6 +671,35 @@ function convertStrategyToPublic(obj) {
|
|
|
671
671
|
function convertStrategiesToPublic(array) {
|
|
672
672
|
return array.map((item) => convertStrategyToPublic(item));
|
|
673
673
|
}
|
|
674
|
+
function convertStrategyToPublicAndNaming(obj) {
|
|
675
|
+
const result = { ...obj };
|
|
676
|
+
if (result.strategy) {
|
|
677
|
+
try {
|
|
678
|
+
result.strategy = toPublicStrategy(result.strategy);
|
|
679
|
+
} catch {
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
if (result.average_apy_without_fee !== void 0) {
|
|
683
|
+
result.average_apy_with_fee = result.average_apy_without_fee;
|
|
684
|
+
delete result.average_apy_without_fee;
|
|
685
|
+
}
|
|
686
|
+
if (result.average_apy_with_rzfi_without_fee !== void 0) {
|
|
687
|
+
result.average_apy_with_rzfi_with_fee = result.average_apy_with_rzfi_without_fee;
|
|
688
|
+
delete result.average_apy_with_rzfi_without_fee;
|
|
689
|
+
}
|
|
690
|
+
if (result.events_average_apy_without_fee !== void 0) {
|
|
691
|
+
result.events_average_apy_with_fee = result.events_average_apy_without_fee;
|
|
692
|
+
delete result.events_average_apy_without_fee;
|
|
693
|
+
}
|
|
694
|
+
if (result.events_average_apy_with_rzfi_without_fee !== void 0) {
|
|
695
|
+
result.events_average_apy_with_rzfi_with_fee = result.events_average_apy_with_rzfi_without_fee;
|
|
696
|
+
delete result.events_average_apy_with_rzfi_without_fee;
|
|
697
|
+
}
|
|
698
|
+
return result;
|
|
699
|
+
}
|
|
700
|
+
function convertStrategiesToPublicAndNaming(array) {
|
|
701
|
+
return array.map((item) => convertStrategyToPublicAndNaming(item));
|
|
702
|
+
}
|
|
674
703
|
|
|
675
704
|
// src/core/ZyfaiSDK.ts
|
|
676
705
|
var import_siwe = require("siwe");
|
|
@@ -1883,7 +1912,7 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
1883
1912
|
const response = await this.httpClient.dataGet(
|
|
1884
1913
|
DATA_ENDPOINTS.APY_PER_STRATEGY(crossChain, days, internalStrategyShort)
|
|
1885
1914
|
);
|
|
1886
|
-
const convertedData =
|
|
1915
|
+
const convertedData = convertStrategiesToPublicAndNaming(
|
|
1887
1916
|
response.data || []
|
|
1888
1917
|
);
|
|
1889
1918
|
return {
|
package/dist/index.mjs
CHANGED
|
@@ -649,6 +649,35 @@ function convertStrategyToPublic(obj) {
|
|
|
649
649
|
function convertStrategiesToPublic(array) {
|
|
650
650
|
return array.map((item) => convertStrategyToPublic(item));
|
|
651
651
|
}
|
|
652
|
+
function convertStrategyToPublicAndNaming(obj) {
|
|
653
|
+
const result = { ...obj };
|
|
654
|
+
if (result.strategy) {
|
|
655
|
+
try {
|
|
656
|
+
result.strategy = toPublicStrategy(result.strategy);
|
|
657
|
+
} catch {
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
if (result.average_apy_without_fee !== void 0) {
|
|
661
|
+
result.average_apy_with_fee = result.average_apy_without_fee;
|
|
662
|
+
delete result.average_apy_without_fee;
|
|
663
|
+
}
|
|
664
|
+
if (result.average_apy_with_rzfi_without_fee !== void 0) {
|
|
665
|
+
result.average_apy_with_rzfi_with_fee = result.average_apy_with_rzfi_without_fee;
|
|
666
|
+
delete result.average_apy_with_rzfi_without_fee;
|
|
667
|
+
}
|
|
668
|
+
if (result.events_average_apy_without_fee !== void 0) {
|
|
669
|
+
result.events_average_apy_with_fee = result.events_average_apy_without_fee;
|
|
670
|
+
delete result.events_average_apy_without_fee;
|
|
671
|
+
}
|
|
672
|
+
if (result.events_average_apy_with_rzfi_without_fee !== void 0) {
|
|
673
|
+
result.events_average_apy_with_rzfi_with_fee = result.events_average_apy_with_rzfi_without_fee;
|
|
674
|
+
delete result.events_average_apy_with_rzfi_without_fee;
|
|
675
|
+
}
|
|
676
|
+
return result;
|
|
677
|
+
}
|
|
678
|
+
function convertStrategiesToPublicAndNaming(array) {
|
|
679
|
+
return array.map((item) => convertStrategyToPublicAndNaming(item));
|
|
680
|
+
}
|
|
652
681
|
|
|
653
682
|
// src/core/ZyfaiSDK.ts
|
|
654
683
|
import { SiweMessage } from "siwe";
|
|
@@ -1861,7 +1890,7 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
1861
1890
|
const response = await this.httpClient.dataGet(
|
|
1862
1891
|
DATA_ENDPOINTS.APY_PER_STRATEGY(crossChain, days, internalStrategyShort)
|
|
1863
1892
|
);
|
|
1864
|
-
const convertedData =
|
|
1893
|
+
const convertedData = convertStrategiesToPublicAndNaming(
|
|
1865
1894
|
response.data || []
|
|
1866
1895
|
);
|
|
1867
1896
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zyfai/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"description": "TypeScript SDK for Zyfai Yield Optimization Engine - Deploy Safe smart wallets, manage session keys, and interact with DeFi protocols",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|