@zyfai/sdk 0.2.32 → 0.2.34
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/README.md +5 -0
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +5 -12
- package/dist/index.mjs +5 -12
- package/package.json +1 -1
- package/dist/cli/index.js +0 -3981
package/README.md
CHANGED
|
@@ -722,6 +722,11 @@ Returns per-position APY breakdowns with per-token weighted averages.
|
|
|
722
722
|
const apyHistory = await sdk.getDailyApyHistory(walletAddress, "30D");
|
|
723
723
|
// Per-token weighted APY: { "USDC": 4.64, "WETH": 1.94 }
|
|
724
724
|
console.log("Weighted APY after fee:", apyHistory.weightedApyAfterFee);
|
|
725
|
+
console.log("Weighted APY (with rZFI Merkl):", apyHistory.weightedApyWithRzfiAfterFee);
|
|
726
|
+
console.log("Avg rZFI Merkl APR:", apyHistory.averageRzfiMerklApr);
|
|
727
|
+
// Per-chain breakdowns: { "8453": { "USDC": 4.59 }, "42161": { "WETH": 1.82 } }
|
|
728
|
+
console.log("By chain:", apyHistory.weightedApyAfterFeeByChain);
|
|
729
|
+
console.log("By chain (with rZFI):", apyHistory.weightedApyWithRzfiAfterFeeByChain);
|
|
725
730
|
// Each date entry has positions (with tokenSymbol), and per-token weighted_apy, fee, etc.
|
|
726
731
|
```
|
|
727
732
|
|
package/dist/index.d.mts
CHANGED
|
@@ -345,6 +345,7 @@ interface ApyPosition {
|
|
|
345
345
|
tokenSymbol?: string;
|
|
346
346
|
}
|
|
347
347
|
type TokenApy = Record<string, number>;
|
|
348
|
+
type ChainTokenApy = Record<string, TokenApy>;
|
|
348
349
|
interface DailyApyEntry {
|
|
349
350
|
positions: ApyPosition[];
|
|
350
351
|
weighted_apy: TokenApy;
|
|
@@ -361,6 +362,9 @@ interface DailyApyHistoryResponse {
|
|
|
361
362
|
requestedDays?: number;
|
|
362
363
|
weightedApyWithRzfiAfterFee?: TokenApy;
|
|
363
364
|
weightedApyAfterFee?: TokenApy;
|
|
365
|
+
averageRzfiMerklApr?: TokenApy;
|
|
366
|
+
weightedApyAfterFeeByChain?: ChainTokenApy;
|
|
367
|
+
weightedApyWithRzfiAfterFeeByChain?: ChainTokenApy;
|
|
364
368
|
}
|
|
365
369
|
interface RebalanceFrequencyResponse {
|
|
366
370
|
success: boolean;
|
|
@@ -403,8 +407,9 @@ interface SdkKeyTVLResponse {
|
|
|
403
407
|
success: boolean;
|
|
404
408
|
allowedWallets: Address[];
|
|
405
409
|
totalTvl: number;
|
|
410
|
+
totalVolume: number;
|
|
406
411
|
tvlByWallet: WalletTVL[];
|
|
407
|
-
metadata
|
|
412
|
+
metadata: {
|
|
408
413
|
sdkKeyId: string;
|
|
409
414
|
clientName: string;
|
|
410
415
|
walletsCount: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -345,6 +345,7 @@ interface ApyPosition {
|
|
|
345
345
|
tokenSymbol?: string;
|
|
346
346
|
}
|
|
347
347
|
type TokenApy = Record<string, number>;
|
|
348
|
+
type ChainTokenApy = Record<string, TokenApy>;
|
|
348
349
|
interface DailyApyEntry {
|
|
349
350
|
positions: ApyPosition[];
|
|
350
351
|
weighted_apy: TokenApy;
|
|
@@ -361,6 +362,9 @@ interface DailyApyHistoryResponse {
|
|
|
361
362
|
requestedDays?: number;
|
|
362
363
|
weightedApyWithRzfiAfterFee?: TokenApy;
|
|
363
364
|
weightedApyAfterFee?: TokenApy;
|
|
365
|
+
averageRzfiMerklApr?: TokenApy;
|
|
366
|
+
weightedApyAfterFeeByChain?: ChainTokenApy;
|
|
367
|
+
weightedApyWithRzfiAfterFeeByChain?: ChainTokenApy;
|
|
364
368
|
}
|
|
365
369
|
interface RebalanceFrequencyResponse {
|
|
366
370
|
success: boolean;
|
|
@@ -403,8 +407,9 @@ interface SdkKeyTVLResponse {
|
|
|
403
407
|
success: boolean;
|
|
404
408
|
allowedWallets: Address[];
|
|
405
409
|
totalTvl: number;
|
|
410
|
+
totalVolume: number;
|
|
406
411
|
tvlByWallet: WalletTVL[];
|
|
407
|
-
metadata
|
|
412
|
+
metadata: {
|
|
408
413
|
sdkKeyId: string;
|
|
409
414
|
clientName: string;
|
|
410
415
|
walletsCount: number;
|
package/dist/index.js
CHANGED
|
@@ -1531,17 +1531,6 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
1531
1531
|
safeAddress,
|
|
1532
1532
|
chainConfig.publicClient
|
|
1533
1533
|
);
|
|
1534
|
-
if (!alreadyDeployed) {
|
|
1535
|
-
const accountType = await getAccountType(
|
|
1536
|
-
userAddress,
|
|
1537
|
-
chainConfig.publicClient
|
|
1538
|
-
);
|
|
1539
|
-
if (accountType !== "EOA") {
|
|
1540
|
-
throw new Error(
|
|
1541
|
-
`Address ${userAddress} is not an EOA. Only EOA addresses can deploy Safe smart wallets.`
|
|
1542
|
-
);
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
1534
|
if (alreadyDeployed) {
|
|
1546
1535
|
let sessionKeyCreated2 = false;
|
|
1547
1536
|
if (createSessionKey) {
|
|
@@ -2860,7 +2849,10 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
2860
2849
|
totalDays: data.total_days || data.totalDays || 0,
|
|
2861
2850
|
requestedDays: data.requested_days || data.requestedDays,
|
|
2862
2851
|
weightedApyWithRzfiAfterFee: data.average_final_weighted_apy_after_fee_with_rzfi,
|
|
2863
|
-
weightedApyAfterFee: data.average_final_weighted_apy_after_fee
|
|
2852
|
+
weightedApyAfterFee: data.average_final_weighted_apy_after_fee,
|
|
2853
|
+
averageRzfiMerklApr: data.average_rzfi_merkl_apr,
|
|
2854
|
+
weightedApyAfterFeeByChain: data.average_final_weighted_apy_after_fee_by_chain,
|
|
2855
|
+
weightedApyWithRzfiAfterFeeByChain: data.average_final_weighted_apy_after_fee_with_rzfi_by_chain
|
|
2864
2856
|
};
|
|
2865
2857
|
} catch (error) {
|
|
2866
2858
|
throw new Error(
|
|
@@ -2963,6 +2955,7 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
2963
2955
|
success: response.success || true,
|
|
2964
2956
|
allowedWallets: response.allowedWallets || [],
|
|
2965
2957
|
totalTvl: response.totalTvl || 0,
|
|
2958
|
+
totalVolume: response.totalVolume || 0,
|
|
2966
2959
|
tvlByWallet: response.tvlByWallet || [],
|
|
2967
2960
|
metadata: response.metadata || {
|
|
2968
2961
|
sdkKeyId: "",
|
package/dist/index.mjs
CHANGED
|
@@ -1507,17 +1507,6 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
1507
1507
|
safeAddress,
|
|
1508
1508
|
chainConfig.publicClient
|
|
1509
1509
|
);
|
|
1510
|
-
if (!alreadyDeployed) {
|
|
1511
|
-
const accountType = await getAccountType(
|
|
1512
|
-
userAddress,
|
|
1513
|
-
chainConfig.publicClient
|
|
1514
|
-
);
|
|
1515
|
-
if (accountType !== "EOA") {
|
|
1516
|
-
throw new Error(
|
|
1517
|
-
`Address ${userAddress} is not an EOA. Only EOA addresses can deploy Safe smart wallets.`
|
|
1518
|
-
);
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
1510
|
if (alreadyDeployed) {
|
|
1522
1511
|
let sessionKeyCreated2 = false;
|
|
1523
1512
|
if (createSessionKey) {
|
|
@@ -2836,7 +2825,10 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
2836
2825
|
totalDays: data.total_days || data.totalDays || 0,
|
|
2837
2826
|
requestedDays: data.requested_days || data.requestedDays,
|
|
2838
2827
|
weightedApyWithRzfiAfterFee: data.average_final_weighted_apy_after_fee_with_rzfi,
|
|
2839
|
-
weightedApyAfterFee: data.average_final_weighted_apy_after_fee
|
|
2828
|
+
weightedApyAfterFee: data.average_final_weighted_apy_after_fee,
|
|
2829
|
+
averageRzfiMerklApr: data.average_rzfi_merkl_apr,
|
|
2830
|
+
weightedApyAfterFeeByChain: data.average_final_weighted_apy_after_fee_by_chain,
|
|
2831
|
+
weightedApyWithRzfiAfterFeeByChain: data.average_final_weighted_apy_after_fee_with_rzfi_by_chain
|
|
2840
2832
|
};
|
|
2841
2833
|
} catch (error) {
|
|
2842
2834
|
throw new Error(
|
|
@@ -2939,6 +2931,7 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
2939
2931
|
success: response.success || true,
|
|
2940
2932
|
allowedWallets: response.allowedWallets || [],
|
|
2941
2933
|
totalTvl: response.totalTvl || 0,
|
|
2934
|
+
totalVolume: response.totalVolume || 0,
|
|
2942
2935
|
tvlByWallet: response.tvlByWallet || [],
|
|
2943
2936
|
metadata: response.metadata || {
|
|
2944
2937
|
sdkKeyId: "",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zyfai/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.34",
|
|
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",
|