@zyfai/sdk 0.2.51 → 0.2.52
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 +1 -0
- package/dist/index.d.mts +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +4 -1
- package/dist/index.mjs +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -804,6 +804,7 @@ Returns per-position APY breakdowns with per-token weighted averages.
|
|
|
804
804
|
|
|
805
805
|
```typescript
|
|
806
806
|
const apyHistory = await sdk.getDailyApyHistory(walletAddress, "30D");
|
|
807
|
+
// days: "7D" | "14D" | "30D" | "60D" | "120D" | "180D" (default "7D")
|
|
807
808
|
// Per-token weighted APY: { "USDC": 4.64, "WETH": 1.94 }
|
|
808
809
|
console.log("Weighted APY after fee:", apyHistory.weightedApyAfterFee);
|
|
809
810
|
console.log("Weighted APY (with rZFI Merkl):", apyHistory.weightedApyWithRzfiAfterFee);
|
package/dist/index.d.mts
CHANGED
|
@@ -725,6 +725,16 @@ declare const isSupportedChain: (chainId: number) => chainId is SupportedChainId
|
|
|
725
725
|
*/
|
|
726
726
|
declare const getSupportedChainIds: () => SupportedChainId[];
|
|
727
727
|
|
|
728
|
+
/**
|
|
729
|
+
* Global SDK Constants
|
|
730
|
+
*/
|
|
731
|
+
|
|
732
|
+
/** Allowed lookback windows for `getDailyApyHistory`, in days. */
|
|
733
|
+
declare const ALLOWED_HISTORY_DAYS: readonly [7, 14, 30, 60, 120, 180];
|
|
734
|
+
type AllowedHistoryDays = (typeof ALLOWED_HISTORY_DAYS)[number];
|
|
735
|
+
/** Query period passed to the daily APY history endpoint, e.g. `"30D"`. */
|
|
736
|
+
type DailyApyHistoryPeriod = `${AllowedHistoryDays}D`;
|
|
737
|
+
|
|
728
738
|
/**
|
|
729
739
|
* Zyfai SDK Main Class
|
|
730
740
|
*/
|
|
@@ -1488,7 +1498,7 @@ declare class ZyfaiSDK {
|
|
|
1488
1498
|
* Get daily APY history with weighted average for a wallet
|
|
1489
1499
|
*
|
|
1490
1500
|
* @param walletAddress - Smart wallet address
|
|
1491
|
-
* @param days - Period: "7D", "14D", or "
|
|
1501
|
+
* @param days - Period: "7D", "14D", "30D", "60D", "120D", or "180D" (default: "7D")
|
|
1492
1502
|
* @returns Daily APY history with per-position breakdowns and weighted averages
|
|
1493
1503
|
*
|
|
1494
1504
|
* @example
|
|
@@ -1497,7 +1507,7 @@ declare class ZyfaiSDK {
|
|
|
1497
1507
|
* console.log("Weighted APY after fee:", apyHistory.weightedApyAfterFee); // { "USDC": 4.64, "WETH": 1.94 }
|
|
1498
1508
|
* ```
|
|
1499
1509
|
*/
|
|
1500
|
-
getDailyApyHistory(walletAddress: string, days?:
|
|
1510
|
+
getDailyApyHistory(walletAddress: string, days?: DailyApyHistoryPeriod): Promise<DailyApyHistoryResponse>;
|
|
1501
1511
|
/**
|
|
1502
1512
|
* Get rebalance frequency/tier for a wallet
|
|
1503
1513
|
* Determines how often the wallet can be rebalanced based on tier
|
|
@@ -1889,4 +1899,4 @@ declare const ERC7579_LAUNCHPAD_ADDRESS: Address$1;
|
|
|
1889
1899
|
*/
|
|
1890
1900
|
declare const POOL_MODULE_ADDRESSES: readonly Address$1[];
|
|
1891
1901
|
|
|
1892
|
-
export { type APYPerStrategy, type APYPerStrategyResponse, type ActionData, type ActiveWallet, type ActiveWalletsResponse, type AddWalletToSdkResponse, type Address, type AllocationDetail, type ApyPosition, type BankrProvider, type BankrProviderConfig, type BestOpportunityDetails, type BestOpportunityResponse, type ChainConfig, type ChainPortfolio, type ChainTokenEarnings, type CustomizationConfig, type CustomizeBatchRequest, type CustomizeBatchResponse, DEFAULT_TOKEN_ADDRESSES, type DailyApyEntry, type DailyApyHistoryResponse, type DailyEarning, type DailyEarningsResponse, type DebankPortfolioResponse, type DepegEvent, type DeploySafeResponse, type DepositResponse, ERC7579_LAUNCHPAD_ADDRESS, type ERC7739Context, type ERC7739Data, type ExcludedPool, type FirstTopupResponse, type GetPoolsResponse, type GetSelectedPoolsResponse, type Hex, type HistoryEntry, type HistoryFeeData, type HistoryPosition, type HistoryRebalanceLog, type HistoryResponse, INTENT_EXECUTOR, INTENT_SMART_SESSIONS, type LiquidityDropEvent, type LogDepositResponse, type NewCollateralDetectedEvent, OWNABLE_VALIDATOR, type OnchainEarnings, type OnchainEarningsResponse, type OpportunitiesResponse, type Opportunity, type OpportunityPosition, POOL_MODULE_ADDRESSES, PROXY_EXECUTOR, type PolicyData, type Pool, type Portfolio, type PortfolioAssetBalance, type PortfolioByAssetType, type PortfolioByChain, type PortfolioDetailed, type PortfolioDetailedResponse, type PortfolioResponse, type PortfolioToken, type PositionSlot, type Protocol, type ProtocolsResponse, type RebalanceFrequencyResponse, type RegisterAgentResponse, SAFE_7579_ADDRESS, type SDKConfig, SMART_SESSIONS_FALLBACK, SMART_SESSIONS_VALIDATOR, type SdkKeyTVLResponse, type Session, type SessionKeyResponse, type SimulateBestPositionsParams, type SimulateBestPositionsResponse, type SimulateCalldataItem, type SimulatedPosition, type SmartWalletByEOAResponse, type SmartWalletResponse, type Strategy, type SupportedAsset, type SupportedChainId, type TVLResponse, type TokenApy, type TokenEarnings, type UpdateUserProfileRequest, type UpdateUserProfileResponse, type UserPosition, VAULT_ADDRESS, type VaultAsset, type VaultClaimResponse, type VaultDepositResponse, type VaultSharesResponse, type VaultWithdrawResponse, type VaultWithdrawStatusResponse, type VolumeResponse, type WalletTVL, type WithdrawResponse, type ZyfaiEventFilters, type ZyfaiEventHandlers, ZyfaiSDK, createBankrProvider, getChainConfig, getDefaultTokenAddress, getSupportedChainIds, isSupportedChain };
|
|
1902
|
+
export { ALLOWED_HISTORY_DAYS, type APYPerStrategy, type APYPerStrategyResponse, type ActionData, type ActiveWallet, type ActiveWalletsResponse, type AddWalletToSdkResponse, type Address, type AllocationDetail, type AllowedHistoryDays, type ApyPosition, type BankrProvider, type BankrProviderConfig, type BestOpportunityDetails, type BestOpportunityResponse, type ChainConfig, type ChainPortfolio, type ChainTokenEarnings, type CustomizationConfig, type CustomizeBatchRequest, type CustomizeBatchResponse, DEFAULT_TOKEN_ADDRESSES, type DailyApyEntry, type DailyApyHistoryPeriod, type DailyApyHistoryResponse, type DailyEarning, type DailyEarningsResponse, type DebankPortfolioResponse, type DepegEvent, type DeploySafeResponse, type DepositResponse, ERC7579_LAUNCHPAD_ADDRESS, type ERC7739Context, type ERC7739Data, type ExcludedPool, type FirstTopupResponse, type GetPoolsResponse, type GetSelectedPoolsResponse, type Hex, type HistoryEntry, type HistoryFeeData, type HistoryPosition, type HistoryRebalanceLog, type HistoryResponse, INTENT_EXECUTOR, INTENT_SMART_SESSIONS, type LiquidityDropEvent, type LogDepositResponse, type NewCollateralDetectedEvent, OWNABLE_VALIDATOR, type OnchainEarnings, type OnchainEarningsResponse, type OpportunitiesResponse, type Opportunity, type OpportunityPosition, POOL_MODULE_ADDRESSES, PROXY_EXECUTOR, type PolicyData, type Pool, type Portfolio, type PortfolioAssetBalance, type PortfolioByAssetType, type PortfolioByChain, type PortfolioDetailed, type PortfolioDetailedResponse, type PortfolioResponse, type PortfolioToken, type PositionSlot, type Protocol, type ProtocolsResponse, type RebalanceFrequencyResponse, type RegisterAgentResponse, SAFE_7579_ADDRESS, type SDKConfig, SMART_SESSIONS_FALLBACK, SMART_SESSIONS_VALIDATOR, type SdkKeyTVLResponse, type Session, type SessionKeyResponse, type SimulateBestPositionsParams, type SimulateBestPositionsResponse, type SimulateCalldataItem, type SimulatedPosition, type SmartWalletByEOAResponse, type SmartWalletResponse, type Strategy, type SupportedAsset, type SupportedChainId, type TVLResponse, type TokenApy, type TokenEarnings, type UpdateUserProfileRequest, type UpdateUserProfileResponse, type UserPosition, VAULT_ADDRESS, type VaultAsset, type VaultClaimResponse, type VaultDepositResponse, type VaultSharesResponse, type VaultWithdrawResponse, type VaultWithdrawStatusResponse, type VolumeResponse, type WalletTVL, type WithdrawResponse, type ZyfaiEventFilters, type ZyfaiEventHandlers, ZyfaiSDK, createBankrProvider, getChainConfig, getDefaultTokenAddress, getSupportedChainIds, isSupportedChain };
|
package/dist/index.d.ts
CHANGED
|
@@ -725,6 +725,16 @@ declare const isSupportedChain: (chainId: number) => chainId is SupportedChainId
|
|
|
725
725
|
*/
|
|
726
726
|
declare const getSupportedChainIds: () => SupportedChainId[];
|
|
727
727
|
|
|
728
|
+
/**
|
|
729
|
+
* Global SDK Constants
|
|
730
|
+
*/
|
|
731
|
+
|
|
732
|
+
/** Allowed lookback windows for `getDailyApyHistory`, in days. */
|
|
733
|
+
declare const ALLOWED_HISTORY_DAYS: readonly [7, 14, 30, 60, 120, 180];
|
|
734
|
+
type AllowedHistoryDays = (typeof ALLOWED_HISTORY_DAYS)[number];
|
|
735
|
+
/** Query period passed to the daily APY history endpoint, e.g. `"30D"`. */
|
|
736
|
+
type DailyApyHistoryPeriod = `${AllowedHistoryDays}D`;
|
|
737
|
+
|
|
728
738
|
/**
|
|
729
739
|
* Zyfai SDK Main Class
|
|
730
740
|
*/
|
|
@@ -1488,7 +1498,7 @@ declare class ZyfaiSDK {
|
|
|
1488
1498
|
* Get daily APY history with weighted average for a wallet
|
|
1489
1499
|
*
|
|
1490
1500
|
* @param walletAddress - Smart wallet address
|
|
1491
|
-
* @param days - Period: "7D", "14D", or "
|
|
1501
|
+
* @param days - Period: "7D", "14D", "30D", "60D", "120D", or "180D" (default: "7D")
|
|
1492
1502
|
* @returns Daily APY history with per-position breakdowns and weighted averages
|
|
1493
1503
|
*
|
|
1494
1504
|
* @example
|
|
@@ -1497,7 +1507,7 @@ declare class ZyfaiSDK {
|
|
|
1497
1507
|
* console.log("Weighted APY after fee:", apyHistory.weightedApyAfterFee); // { "USDC": 4.64, "WETH": 1.94 }
|
|
1498
1508
|
* ```
|
|
1499
1509
|
*/
|
|
1500
|
-
getDailyApyHistory(walletAddress: string, days?:
|
|
1510
|
+
getDailyApyHistory(walletAddress: string, days?: DailyApyHistoryPeriod): Promise<DailyApyHistoryResponse>;
|
|
1501
1511
|
/**
|
|
1502
1512
|
* Get rebalance frequency/tier for a wallet
|
|
1503
1513
|
* Determines how often the wallet can be rebalanced based on tier
|
|
@@ -1889,4 +1899,4 @@ declare const ERC7579_LAUNCHPAD_ADDRESS: Address$1;
|
|
|
1889
1899
|
*/
|
|
1890
1900
|
declare const POOL_MODULE_ADDRESSES: readonly Address$1[];
|
|
1891
1901
|
|
|
1892
|
-
export { type APYPerStrategy, type APYPerStrategyResponse, type ActionData, type ActiveWallet, type ActiveWalletsResponse, type AddWalletToSdkResponse, type Address, type AllocationDetail, type ApyPosition, type BankrProvider, type BankrProviderConfig, type BestOpportunityDetails, type BestOpportunityResponse, type ChainConfig, type ChainPortfolio, type ChainTokenEarnings, type CustomizationConfig, type CustomizeBatchRequest, type CustomizeBatchResponse, DEFAULT_TOKEN_ADDRESSES, type DailyApyEntry, type DailyApyHistoryResponse, type DailyEarning, type DailyEarningsResponse, type DebankPortfolioResponse, type DepegEvent, type DeploySafeResponse, type DepositResponse, ERC7579_LAUNCHPAD_ADDRESS, type ERC7739Context, type ERC7739Data, type ExcludedPool, type FirstTopupResponse, type GetPoolsResponse, type GetSelectedPoolsResponse, type Hex, type HistoryEntry, type HistoryFeeData, type HistoryPosition, type HistoryRebalanceLog, type HistoryResponse, INTENT_EXECUTOR, INTENT_SMART_SESSIONS, type LiquidityDropEvent, type LogDepositResponse, type NewCollateralDetectedEvent, OWNABLE_VALIDATOR, type OnchainEarnings, type OnchainEarningsResponse, type OpportunitiesResponse, type Opportunity, type OpportunityPosition, POOL_MODULE_ADDRESSES, PROXY_EXECUTOR, type PolicyData, type Pool, type Portfolio, type PortfolioAssetBalance, type PortfolioByAssetType, type PortfolioByChain, type PortfolioDetailed, type PortfolioDetailedResponse, type PortfolioResponse, type PortfolioToken, type PositionSlot, type Protocol, type ProtocolsResponse, type RebalanceFrequencyResponse, type RegisterAgentResponse, SAFE_7579_ADDRESS, type SDKConfig, SMART_SESSIONS_FALLBACK, SMART_SESSIONS_VALIDATOR, type SdkKeyTVLResponse, type Session, type SessionKeyResponse, type SimulateBestPositionsParams, type SimulateBestPositionsResponse, type SimulateCalldataItem, type SimulatedPosition, type SmartWalletByEOAResponse, type SmartWalletResponse, type Strategy, type SupportedAsset, type SupportedChainId, type TVLResponse, type TokenApy, type TokenEarnings, type UpdateUserProfileRequest, type UpdateUserProfileResponse, type UserPosition, VAULT_ADDRESS, type VaultAsset, type VaultClaimResponse, type VaultDepositResponse, type VaultSharesResponse, type VaultWithdrawResponse, type VaultWithdrawStatusResponse, type VolumeResponse, type WalletTVL, type WithdrawResponse, type ZyfaiEventFilters, type ZyfaiEventHandlers, ZyfaiSDK, createBankrProvider, getChainConfig, getDefaultTokenAddress, getSupportedChainIds, isSupportedChain };
|
|
1902
|
+
export { ALLOWED_HISTORY_DAYS, type APYPerStrategy, type APYPerStrategyResponse, type ActionData, type ActiveWallet, type ActiveWalletsResponse, type AddWalletToSdkResponse, type Address, type AllocationDetail, type AllowedHistoryDays, type ApyPosition, type BankrProvider, type BankrProviderConfig, type BestOpportunityDetails, type BestOpportunityResponse, type ChainConfig, type ChainPortfolio, type ChainTokenEarnings, type CustomizationConfig, type CustomizeBatchRequest, type CustomizeBatchResponse, DEFAULT_TOKEN_ADDRESSES, type DailyApyEntry, type DailyApyHistoryPeriod, type DailyApyHistoryResponse, type DailyEarning, type DailyEarningsResponse, type DebankPortfolioResponse, type DepegEvent, type DeploySafeResponse, type DepositResponse, ERC7579_LAUNCHPAD_ADDRESS, type ERC7739Context, type ERC7739Data, type ExcludedPool, type FirstTopupResponse, type GetPoolsResponse, type GetSelectedPoolsResponse, type Hex, type HistoryEntry, type HistoryFeeData, type HistoryPosition, type HistoryRebalanceLog, type HistoryResponse, INTENT_EXECUTOR, INTENT_SMART_SESSIONS, type LiquidityDropEvent, type LogDepositResponse, type NewCollateralDetectedEvent, OWNABLE_VALIDATOR, type OnchainEarnings, type OnchainEarningsResponse, type OpportunitiesResponse, type Opportunity, type OpportunityPosition, POOL_MODULE_ADDRESSES, PROXY_EXECUTOR, type PolicyData, type Pool, type Portfolio, type PortfolioAssetBalance, type PortfolioByAssetType, type PortfolioByChain, type PortfolioDetailed, type PortfolioDetailedResponse, type PortfolioResponse, type PortfolioToken, type PositionSlot, type Protocol, type ProtocolsResponse, type RebalanceFrequencyResponse, type RegisterAgentResponse, SAFE_7579_ADDRESS, type SDKConfig, SMART_SESSIONS_FALLBACK, SMART_SESSIONS_VALIDATOR, type SdkKeyTVLResponse, type Session, type SessionKeyResponse, type SimulateBestPositionsParams, type SimulateBestPositionsResponse, type SimulateCalldataItem, type SimulatedPosition, type SmartWalletByEOAResponse, type SmartWalletResponse, type Strategy, type SupportedAsset, type SupportedChainId, type TVLResponse, type TokenApy, type TokenEarnings, type UpdateUserProfileRequest, type UpdateUserProfileResponse, type UserPosition, VAULT_ADDRESS, type VaultAsset, type VaultClaimResponse, type VaultDepositResponse, type VaultSharesResponse, type VaultWithdrawResponse, type VaultWithdrawStatusResponse, type VolumeResponse, type WalletTVL, type WithdrawResponse, type ZyfaiEventFilters, type ZyfaiEventHandlers, ZyfaiSDK, createBankrProvider, getChainConfig, getDefaultTokenAddress, getSupportedChainIds, isSupportedChain };
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
ALLOWED_HISTORY_DAYS: () => ALLOWED_HISTORY_DAYS,
|
|
33
34
|
DEFAULT_TOKEN_ADDRESSES: () => DEFAULT_TOKEN_ADDRESSES,
|
|
34
35
|
ERC7579_LAUNCHPAD_ADDRESS: () => ERC7579_LAUNCHPAD_ADDRESS,
|
|
35
36
|
INTENT_EXECUTOR: () => INTENT_EXECUTOR,
|
|
@@ -516,6 +517,7 @@ var VAULT_ADDRESS = "0xD580071c47d4a667858B5FafAb85BC9C609beC5D";
|
|
|
516
517
|
|
|
517
518
|
// src/config/constants.ts
|
|
518
519
|
var ZYFI_FEE_RATE = 0.1;
|
|
520
|
+
var ALLOWED_HISTORY_DAYS = [7, 14, 30, 60, 120, 180];
|
|
519
521
|
var MIN_PORTFOLIO_BALANCE = {
|
|
520
522
|
1: {
|
|
521
523
|
USDC: 100n * 10n ** 6n,
|
|
@@ -3601,7 +3603,7 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
3601
3603
|
* Get daily APY history with weighted average for a wallet
|
|
3602
3604
|
*
|
|
3603
3605
|
* @param walletAddress - Smart wallet address
|
|
3604
|
-
* @param days - Period: "7D", "14D", or "
|
|
3606
|
+
* @param days - Period: "7D", "14D", "30D", "60D", "120D", or "180D" (default: "7D")
|
|
3605
3607
|
* @returns Daily APY history with per-position breakdowns and weighted averages
|
|
3606
3608
|
*
|
|
3607
3609
|
* @example
|
|
@@ -4592,6 +4594,7 @@ function createBankrProvider(config) {
|
|
|
4592
4594
|
}
|
|
4593
4595
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4594
4596
|
0 && (module.exports = {
|
|
4597
|
+
ALLOWED_HISTORY_DAYS,
|
|
4595
4598
|
DEFAULT_TOKEN_ADDRESSES,
|
|
4596
4599
|
ERC7579_LAUNCHPAD_ADDRESS,
|
|
4597
4600
|
INTENT_EXECUTOR,
|
package/dist/index.mjs
CHANGED
|
@@ -464,6 +464,7 @@ var VAULT_ADDRESS = "0xD580071c47d4a667858B5FafAb85BC9C609beC5D";
|
|
|
464
464
|
|
|
465
465
|
// src/config/constants.ts
|
|
466
466
|
var ZYFI_FEE_RATE = 0.1;
|
|
467
|
+
var ALLOWED_HISTORY_DAYS = [7, 14, 30, 60, 120, 180];
|
|
467
468
|
var MIN_PORTFOLIO_BALANCE = {
|
|
468
469
|
1: {
|
|
469
470
|
USDC: 100n * 10n ** 6n,
|
|
@@ -3569,7 +3570,7 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
3569
3570
|
* Get daily APY history with weighted average for a wallet
|
|
3570
3571
|
*
|
|
3571
3572
|
* @param walletAddress - Smart wallet address
|
|
3572
|
-
* @param days - Period: "7D", "14D", or "
|
|
3573
|
+
* @param days - Period: "7D", "14D", "30D", "60D", "120D", or "180D" (default: "7D")
|
|
3573
3574
|
* @returns Daily APY history with per-position breakdowns and weighted averages
|
|
3574
3575
|
*
|
|
3575
3576
|
* @example
|
|
@@ -4559,6 +4560,7 @@ function createBankrProvider(config) {
|
|
|
4559
4560
|
return provider;
|
|
4560
4561
|
}
|
|
4561
4562
|
export {
|
|
4563
|
+
ALLOWED_HISTORY_DAYS,
|
|
4562
4564
|
DEFAULT_TOKEN_ADDRESSES,
|
|
4563
4565
|
ERC7579_LAUNCHPAD_ADDRESS,
|
|
4564
4566
|
INTENT_EXECUTOR,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zyfai/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.52",
|
|
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",
|