@zyfai/sdk 1.3.2 → 1.4.0
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 +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +15 -3
- package/dist/index.mjs +15 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1027,6 +1027,7 @@ const history = await sdk.getHistory(walletAddress, 8453, {
|
|
|
1027
1027
|
limit: 50,
|
|
1028
1028
|
fromDate: "2024-01-01",
|
|
1029
1029
|
assetType: "eth", // usdc | eth | eurc | usdt | pyusd | nvdac | wbtc
|
|
1030
|
+
// rebalanceLegs: true marks async rebalance request, claim, and redeploy rows
|
|
1030
1031
|
});
|
|
1031
1032
|
history.data.forEach((tx) => {
|
|
1032
1033
|
console.log(tx.action, tx.transactionHash);
|
package/dist/index.d.mts
CHANGED
|
@@ -1049,6 +1049,12 @@ interface CustomizeBatchRequest {
|
|
|
1049
1049
|
interface CustomizeBatchResponse {
|
|
1050
1050
|
success: boolean;
|
|
1051
1051
|
}
|
|
1052
|
+
interface GetAvailablePoolsOptions {
|
|
1053
|
+
/** Omit pools whose status is not live. Default false. */
|
|
1054
|
+
liveOnly?: boolean;
|
|
1055
|
+
/** Include each pool's status. Default false. */
|
|
1056
|
+
includeStatus?: boolean;
|
|
1057
|
+
}
|
|
1052
1058
|
interface GetPoolsResponse {
|
|
1053
1059
|
success: boolean;
|
|
1054
1060
|
pools: string[];
|
|
@@ -2561,6 +2567,8 @@ declare class ZyfaiSDK {
|
|
|
2561
2567
|
fromDate?: string;
|
|
2562
2568
|
toDate?: string;
|
|
2563
2569
|
assetType?: HistoryAssetType;
|
|
2570
|
+
/** Mark async rebalance request, claim, and redeploy rows as rebalance. */
|
|
2571
|
+
rebalanceLegs?: boolean;
|
|
2564
2572
|
}): Promise<HistoryResponse>;
|
|
2565
2573
|
/**
|
|
2566
2574
|
* Get onchain earnings for a wallet.
|
|
@@ -2927,6 +2935,7 @@ declare class ZyfaiSDK {
|
|
|
2927
2935
|
*
|
|
2928
2936
|
* @param protocolId - The protocol UUID
|
|
2929
2937
|
* @param strategy - Optional {@link Strategy} filter
|
|
2938
|
+
* @param options - `liveOnly` omits not-live pools. `includeStatus` adds each pool's status. Both default off.
|
|
2930
2939
|
* @returns List of available pool names
|
|
2931
2940
|
*
|
|
2932
2941
|
* @example
|
|
@@ -2942,7 +2951,7 @@ declare class ZyfaiSDK {
|
|
|
2942
2951
|
* );
|
|
2943
2952
|
* ```
|
|
2944
2953
|
*/
|
|
2945
|
-
getAvailablePools(protocolId: string, strategy?: Strategy): Promise<GetPoolsResponse>;
|
|
2954
|
+
getAvailablePools(protocolId: string, strategy?: Strategy, options?: GetAvailablePoolsOptions): Promise<GetPoolsResponse>;
|
|
2946
2955
|
/**
|
|
2947
2956
|
* Simulate the best yield positions for a given amount, splitting it across
|
|
2948
2957
|
* the top-ranked pools (up to minSplit positions) for the requested chains/strategy.
|
|
@@ -3354,4 +3363,4 @@ declare const ERC7579_LAUNCHPAD_ADDRESS: Address$1;
|
|
|
3354
3363
|
*/
|
|
3355
3364
|
declare const POOL_MODULE_ADDRESSES: readonly Address$1[];
|
|
3356
3365
|
|
|
3357
|
-
export { ALLOWED_HISTORY_DAYS, API_ENDPOINT, type APYPerStrategy, type APYPerStrategyResponse, type ActionData, type ActiveWallet, type ActiveWalletsResponse, type AddWalletToSdkResponse, type Address, type AllocationDetail, type AllowedHistoryDays, type ApyPosition, type AsyncWithdrawal, type AsyncWithdrawalStatus, type BackendEnvironment, type BankrProvider, type BankrProviderConfig, type BaseMerklCampaignId, type BestOpportunityDetails, type BestOpportunityResponse, type ChainConfig, type ChainPortfolio, type ChainTokenEarnings, type CustomizationConfig, type CustomizeBatchRequest, type CustomizeBatchResponse, DATA_API_BASE_URLS, DATA_API_ENDPOINT, DEFAULT_RELAY_SLIPPAGE_BPS, DEFAULT_TOKEN_ADDRESSES, type DailyApyEntry, type DailyApyHistoryPeriod, type DailyApyHistoryResponse, type DailyEarning, type DailyEarningsResponse, type DebankPortfolioResponse, type DepegEvent, type DeploySafeResponse, type DepositLifecycleResponse, type DepositLifecycleStatus, type DepositPositionOutcome, type DepositResponse, type DepositRoute, type DepositRouteInput, ERC7579_LAUNCHPAD_ADDRESS, type ERC7739Context, type ERC7739Data, EXECUTION_API_BASE_URLS, type ExcludedPool, type FirstPermitDepositStatus, type FirstTopupResponse, type GetPoolsResponse, type GetSelectedPoolsResponse, type Hex, type HistoryAssetType, type HistoryEntry, type HistoryFeeData, type HistoryPosition, type HistoryRebalanceLog, type HistoryResponse, INTENT_EXECUTOR, INTENT_SMART_SESSIONS, LOCAL_DATA_API_BASE_URL, LOCAL_EXECUTION_API_BASE_URL, LOCAL_WS_URL, type LiquidityDropEvent, type LogDepositResponse, MAX_RELAY_SLIPPAGE_BPS, type MerklCampaign, 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, RELAY_SLIPPAGE_PRESETS_BPS, type RebalanceFrequencyResponse, type RegisterAgentResponse, type RzfiClaimResponse, type RzfiClaimTransaction, SAFE_7579_ADDRESS, type SDKConfig, SMART_SESSIONS_FALLBACK, SMART_SESSIONS_VALIDATOR, STAGING_DATA_API_BASE_URL, STAGING_EXECUTION_API_BASE_URL, STAGING_WS_URL, type SdkKeyTVLResponse, type SendDepositParams, type Session, type SessionKeyResponse, type SimulateBestPositionsParams, type SimulateBestPositionsResponse, type SimulateCalldataItem, type SimulatedPosition, type SmartWalletByEOAResponse, type SmartWalletResponse, type Strategy, type SupportedAsset, type SupportedChainId, type SwapDepositOrder, type SwapDepositParams, type SwapDepositQuote, type TVLResponse, type TokenApy, type TokenEarnings, type UpdateUserProfileRequest, type UpdateUserProfileResponse, type UserPosition, type UserSessionAuth, VAULT_ADDRESS, type VaultAsset, type VaultClaimResponse, type VaultDepositResponse, type VaultSharesResponse, type VaultWithdrawResponse, type VaultWithdrawStatusResponse, type VolumeAssetType, type VolumeResponse, WS_ENDPOINT, WS_URLS, type WaitForDepositCreditOptions, type WaitForDepositPositionOptions, type WaitForWithdrawCompleteOptions, type WaitForWithdrawSettlementOptions, type WalletTVL, type WithdrawAsyncLeg, type WithdrawLifecycleResponse, type WithdrawLifecycleStatus, type WithdrawResponse, type ZyfaiEventFilters, type ZyfaiEventHandlers, ZyfaiSDK, createBankrProvider, getChainConfig, getDataApiBaseUrl, getDefaultTokenAddress, getExecutionApiBaseUrl, getManagedAssets, getSupportedChainIds, getWsUrl, isSupportedChain, resolveDepositRoute, resolveRelaySlippageBps, type staleBalances };
|
|
3366
|
+
export { ALLOWED_HISTORY_DAYS, API_ENDPOINT, type APYPerStrategy, type APYPerStrategyResponse, type ActionData, type ActiveWallet, type ActiveWalletsResponse, type AddWalletToSdkResponse, type Address, type AllocationDetail, type AllowedHistoryDays, type ApyPosition, type AsyncWithdrawal, type AsyncWithdrawalStatus, type BackendEnvironment, type BankrProvider, type BankrProviderConfig, type BaseMerklCampaignId, type BestOpportunityDetails, type BestOpportunityResponse, type ChainConfig, type ChainPortfolio, type ChainTokenEarnings, type CustomizationConfig, type CustomizeBatchRequest, type CustomizeBatchResponse, DATA_API_BASE_URLS, DATA_API_ENDPOINT, DEFAULT_RELAY_SLIPPAGE_BPS, DEFAULT_TOKEN_ADDRESSES, type DailyApyEntry, type DailyApyHistoryPeriod, type DailyApyHistoryResponse, type DailyEarning, type DailyEarningsResponse, type DebankPortfolioResponse, type DepegEvent, type DeploySafeResponse, type DepositLifecycleResponse, type DepositLifecycleStatus, type DepositPositionOutcome, type DepositResponse, type DepositRoute, type DepositRouteInput, ERC7579_LAUNCHPAD_ADDRESS, type ERC7739Context, type ERC7739Data, EXECUTION_API_BASE_URLS, type ExcludedPool, type FirstPermitDepositStatus, type FirstTopupResponse, type GetAvailablePoolsOptions, type GetPoolsResponse, type GetSelectedPoolsResponse, type Hex, type HistoryAssetType, type HistoryEntry, type HistoryFeeData, type HistoryPosition, type HistoryRebalanceLog, type HistoryResponse, INTENT_EXECUTOR, INTENT_SMART_SESSIONS, LOCAL_DATA_API_BASE_URL, LOCAL_EXECUTION_API_BASE_URL, LOCAL_WS_URL, type LiquidityDropEvent, type LogDepositResponse, MAX_RELAY_SLIPPAGE_BPS, type MerklCampaign, 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, RELAY_SLIPPAGE_PRESETS_BPS, type RebalanceFrequencyResponse, type RegisterAgentResponse, type RzfiClaimResponse, type RzfiClaimTransaction, SAFE_7579_ADDRESS, type SDKConfig, SMART_SESSIONS_FALLBACK, SMART_SESSIONS_VALIDATOR, STAGING_DATA_API_BASE_URL, STAGING_EXECUTION_API_BASE_URL, STAGING_WS_URL, type SdkKeyTVLResponse, type SendDepositParams, type Session, type SessionKeyResponse, type SimulateBestPositionsParams, type SimulateBestPositionsResponse, type SimulateCalldataItem, type SimulatedPosition, type SmartWalletByEOAResponse, type SmartWalletResponse, type Strategy, type SupportedAsset, type SupportedChainId, type SwapDepositOrder, type SwapDepositParams, type SwapDepositQuote, type TVLResponse, type TokenApy, type TokenEarnings, type UpdateUserProfileRequest, type UpdateUserProfileResponse, type UserPosition, type UserSessionAuth, VAULT_ADDRESS, type VaultAsset, type VaultClaimResponse, type VaultDepositResponse, type VaultSharesResponse, type VaultWithdrawResponse, type VaultWithdrawStatusResponse, type VolumeAssetType, type VolumeResponse, WS_ENDPOINT, WS_URLS, type WaitForDepositCreditOptions, type WaitForDepositPositionOptions, type WaitForWithdrawCompleteOptions, type WaitForWithdrawSettlementOptions, type WalletTVL, type WithdrawAsyncLeg, type WithdrawLifecycleResponse, type WithdrawLifecycleStatus, type WithdrawResponse, type ZyfaiEventFilters, type ZyfaiEventHandlers, ZyfaiSDK, createBankrProvider, getChainConfig, getDataApiBaseUrl, getDefaultTokenAddress, getExecutionApiBaseUrl, getManagedAssets, getSupportedChainIds, getWsUrl, isSupportedChain, resolveDepositRoute, resolveRelaySlippageBps, type staleBalances };
|
package/dist/index.d.ts
CHANGED
|
@@ -1049,6 +1049,12 @@ interface CustomizeBatchRequest {
|
|
|
1049
1049
|
interface CustomizeBatchResponse {
|
|
1050
1050
|
success: boolean;
|
|
1051
1051
|
}
|
|
1052
|
+
interface GetAvailablePoolsOptions {
|
|
1053
|
+
/** Omit pools whose status is not live. Default false. */
|
|
1054
|
+
liveOnly?: boolean;
|
|
1055
|
+
/** Include each pool's status. Default false. */
|
|
1056
|
+
includeStatus?: boolean;
|
|
1057
|
+
}
|
|
1052
1058
|
interface GetPoolsResponse {
|
|
1053
1059
|
success: boolean;
|
|
1054
1060
|
pools: string[];
|
|
@@ -2561,6 +2567,8 @@ declare class ZyfaiSDK {
|
|
|
2561
2567
|
fromDate?: string;
|
|
2562
2568
|
toDate?: string;
|
|
2563
2569
|
assetType?: HistoryAssetType;
|
|
2570
|
+
/** Mark async rebalance request, claim, and redeploy rows as rebalance. */
|
|
2571
|
+
rebalanceLegs?: boolean;
|
|
2564
2572
|
}): Promise<HistoryResponse>;
|
|
2565
2573
|
/**
|
|
2566
2574
|
* Get onchain earnings for a wallet.
|
|
@@ -2927,6 +2935,7 @@ declare class ZyfaiSDK {
|
|
|
2927
2935
|
*
|
|
2928
2936
|
* @param protocolId - The protocol UUID
|
|
2929
2937
|
* @param strategy - Optional {@link Strategy} filter
|
|
2938
|
+
* @param options - `liveOnly` omits not-live pools. `includeStatus` adds each pool's status. Both default off.
|
|
2930
2939
|
* @returns List of available pool names
|
|
2931
2940
|
*
|
|
2932
2941
|
* @example
|
|
@@ -2942,7 +2951,7 @@ declare class ZyfaiSDK {
|
|
|
2942
2951
|
* );
|
|
2943
2952
|
* ```
|
|
2944
2953
|
*/
|
|
2945
|
-
getAvailablePools(protocolId: string, strategy?: Strategy): Promise<GetPoolsResponse>;
|
|
2954
|
+
getAvailablePools(protocolId: string, strategy?: Strategy, options?: GetAvailablePoolsOptions): Promise<GetPoolsResponse>;
|
|
2946
2955
|
/**
|
|
2947
2956
|
* Simulate the best yield positions for a given amount, splitting it across
|
|
2948
2957
|
* the top-ranked pools (up to minSplit positions) for the requested chains/strategy.
|
|
@@ -3354,4 +3363,4 @@ declare const ERC7579_LAUNCHPAD_ADDRESS: Address$1;
|
|
|
3354
3363
|
*/
|
|
3355
3364
|
declare const POOL_MODULE_ADDRESSES: readonly Address$1[];
|
|
3356
3365
|
|
|
3357
|
-
export { ALLOWED_HISTORY_DAYS, API_ENDPOINT, type APYPerStrategy, type APYPerStrategyResponse, type ActionData, type ActiveWallet, type ActiveWalletsResponse, type AddWalletToSdkResponse, type Address, type AllocationDetail, type AllowedHistoryDays, type ApyPosition, type AsyncWithdrawal, type AsyncWithdrawalStatus, type BackendEnvironment, type BankrProvider, type BankrProviderConfig, type BaseMerklCampaignId, type BestOpportunityDetails, type BestOpportunityResponse, type ChainConfig, type ChainPortfolio, type ChainTokenEarnings, type CustomizationConfig, type CustomizeBatchRequest, type CustomizeBatchResponse, DATA_API_BASE_URLS, DATA_API_ENDPOINT, DEFAULT_RELAY_SLIPPAGE_BPS, DEFAULT_TOKEN_ADDRESSES, type DailyApyEntry, type DailyApyHistoryPeriod, type DailyApyHistoryResponse, type DailyEarning, type DailyEarningsResponse, type DebankPortfolioResponse, type DepegEvent, type DeploySafeResponse, type DepositLifecycleResponse, type DepositLifecycleStatus, type DepositPositionOutcome, type DepositResponse, type DepositRoute, type DepositRouteInput, ERC7579_LAUNCHPAD_ADDRESS, type ERC7739Context, type ERC7739Data, EXECUTION_API_BASE_URLS, type ExcludedPool, type FirstPermitDepositStatus, type FirstTopupResponse, type GetPoolsResponse, type GetSelectedPoolsResponse, type Hex, type HistoryAssetType, type HistoryEntry, type HistoryFeeData, type HistoryPosition, type HistoryRebalanceLog, type HistoryResponse, INTENT_EXECUTOR, INTENT_SMART_SESSIONS, LOCAL_DATA_API_BASE_URL, LOCAL_EXECUTION_API_BASE_URL, LOCAL_WS_URL, type LiquidityDropEvent, type LogDepositResponse, MAX_RELAY_SLIPPAGE_BPS, type MerklCampaign, 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, RELAY_SLIPPAGE_PRESETS_BPS, type RebalanceFrequencyResponse, type RegisterAgentResponse, type RzfiClaimResponse, type RzfiClaimTransaction, SAFE_7579_ADDRESS, type SDKConfig, SMART_SESSIONS_FALLBACK, SMART_SESSIONS_VALIDATOR, STAGING_DATA_API_BASE_URL, STAGING_EXECUTION_API_BASE_URL, STAGING_WS_URL, type SdkKeyTVLResponse, type SendDepositParams, type Session, type SessionKeyResponse, type SimulateBestPositionsParams, type SimulateBestPositionsResponse, type SimulateCalldataItem, type SimulatedPosition, type SmartWalletByEOAResponse, type SmartWalletResponse, type Strategy, type SupportedAsset, type SupportedChainId, type SwapDepositOrder, type SwapDepositParams, type SwapDepositQuote, type TVLResponse, type TokenApy, type TokenEarnings, type UpdateUserProfileRequest, type UpdateUserProfileResponse, type UserPosition, type UserSessionAuth, VAULT_ADDRESS, type VaultAsset, type VaultClaimResponse, type VaultDepositResponse, type VaultSharesResponse, type VaultWithdrawResponse, type VaultWithdrawStatusResponse, type VolumeAssetType, type VolumeResponse, WS_ENDPOINT, WS_URLS, type WaitForDepositCreditOptions, type WaitForDepositPositionOptions, type WaitForWithdrawCompleteOptions, type WaitForWithdrawSettlementOptions, type WalletTVL, type WithdrawAsyncLeg, type WithdrawLifecycleResponse, type WithdrawLifecycleStatus, type WithdrawResponse, type ZyfaiEventFilters, type ZyfaiEventHandlers, ZyfaiSDK, createBankrProvider, getChainConfig, getDataApiBaseUrl, getDefaultTokenAddress, getExecutionApiBaseUrl, getManagedAssets, getSupportedChainIds, getWsUrl, isSupportedChain, resolveDepositRoute, resolveRelaySlippageBps, type staleBalances };
|
|
3366
|
+
export { ALLOWED_HISTORY_DAYS, API_ENDPOINT, type APYPerStrategy, type APYPerStrategyResponse, type ActionData, type ActiveWallet, type ActiveWalletsResponse, type AddWalletToSdkResponse, type Address, type AllocationDetail, type AllowedHistoryDays, type ApyPosition, type AsyncWithdrawal, type AsyncWithdrawalStatus, type BackendEnvironment, type BankrProvider, type BankrProviderConfig, type BaseMerklCampaignId, type BestOpportunityDetails, type BestOpportunityResponse, type ChainConfig, type ChainPortfolio, type ChainTokenEarnings, type CustomizationConfig, type CustomizeBatchRequest, type CustomizeBatchResponse, DATA_API_BASE_URLS, DATA_API_ENDPOINT, DEFAULT_RELAY_SLIPPAGE_BPS, DEFAULT_TOKEN_ADDRESSES, type DailyApyEntry, type DailyApyHistoryPeriod, type DailyApyHistoryResponse, type DailyEarning, type DailyEarningsResponse, type DebankPortfolioResponse, type DepegEvent, type DeploySafeResponse, type DepositLifecycleResponse, type DepositLifecycleStatus, type DepositPositionOutcome, type DepositResponse, type DepositRoute, type DepositRouteInput, ERC7579_LAUNCHPAD_ADDRESS, type ERC7739Context, type ERC7739Data, EXECUTION_API_BASE_URLS, type ExcludedPool, type FirstPermitDepositStatus, type FirstTopupResponse, type GetAvailablePoolsOptions, type GetPoolsResponse, type GetSelectedPoolsResponse, type Hex, type HistoryAssetType, type HistoryEntry, type HistoryFeeData, type HistoryPosition, type HistoryRebalanceLog, type HistoryResponse, INTENT_EXECUTOR, INTENT_SMART_SESSIONS, LOCAL_DATA_API_BASE_URL, LOCAL_EXECUTION_API_BASE_URL, LOCAL_WS_URL, type LiquidityDropEvent, type LogDepositResponse, MAX_RELAY_SLIPPAGE_BPS, type MerklCampaign, 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, RELAY_SLIPPAGE_PRESETS_BPS, type RebalanceFrequencyResponse, type RegisterAgentResponse, type RzfiClaimResponse, type RzfiClaimTransaction, SAFE_7579_ADDRESS, type SDKConfig, SMART_SESSIONS_FALLBACK, SMART_SESSIONS_VALIDATOR, STAGING_DATA_API_BASE_URL, STAGING_EXECUTION_API_BASE_URL, STAGING_WS_URL, type SdkKeyTVLResponse, type SendDepositParams, type Session, type SessionKeyResponse, type SimulateBestPositionsParams, type SimulateBestPositionsResponse, type SimulateCalldataItem, type SimulatedPosition, type SmartWalletByEOAResponse, type SmartWalletResponse, type Strategy, type SupportedAsset, type SupportedChainId, type SwapDepositOrder, type SwapDepositParams, type SwapDepositQuote, type TVLResponse, type TokenApy, type TokenEarnings, type UpdateUserProfileRequest, type UpdateUserProfileResponse, type UserPosition, type UserSessionAuth, VAULT_ADDRESS, type VaultAsset, type VaultClaimResponse, type VaultDepositResponse, type VaultSharesResponse, type VaultWithdrawResponse, type VaultWithdrawStatusResponse, type VolumeAssetType, type VolumeResponse, WS_ENDPOINT, WS_URLS, type WaitForDepositCreditOptions, type WaitForDepositPositionOptions, type WaitForWithdrawCompleteOptions, type WaitForWithdrawSettlementOptions, type WalletTVL, type WithdrawAsyncLeg, type WithdrawLifecycleResponse, type WithdrawLifecycleStatus, type WithdrawResponse, type ZyfaiEventFilters, type ZyfaiEventHandlers, ZyfaiSDK, createBankrProvider, getChainConfig, getDataApiBaseUrl, getDefaultTokenAddress, getExecutionApiBaseUrl, getManagedAssets, getSupportedChainIds, getWsUrl, isSupportedChain, resolveDepositRoute, resolveRelaySlippageBps, type staleBalances };
|
package/dist/index.js
CHANGED
|
@@ -187,7 +187,13 @@ var ENDPOINTS = {
|
|
|
187
187
|
},
|
|
188
188
|
// Customization
|
|
189
189
|
CUSTOMIZE_BATCH: "/customization/customize-batch",
|
|
190
|
-
CUSTOMIZATION_POOLS: (protocolId, strategy) =>
|
|
190
|
+
CUSTOMIZATION_POOLS: (protocolId, strategy, options) => {
|
|
191
|
+
const query = [`protocolId=${protocolId}`];
|
|
192
|
+
if (strategy) query.push(`strategy=${strategy}`);
|
|
193
|
+
if (options?.liveOnly) query.push("liveOnly=true");
|
|
194
|
+
if (options?.includeStatus) query.push("includeStatus=true");
|
|
195
|
+
return `/customization/pools?${query.join("&")}`;
|
|
196
|
+
},
|
|
191
197
|
CUSTOMIZATION_SELECTED_POOLS: (protocolId, chainId) => `/customization/selected-pools?protocolId=${protocolId}&chainId=${chainId}`
|
|
192
198
|
};
|
|
193
199
|
var DATA_ENDPOINTS = {
|
|
@@ -5852,6 +5858,7 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
5852
5858
|
if (options?.offset) endpoint += `&offset=${options.offset}`;
|
|
5853
5859
|
if (options?.fromDate) endpoint += `&fromDate=${options.fromDate}`;
|
|
5854
5860
|
if (options?.toDate) endpoint += `&toDate=${options.toDate}`;
|
|
5861
|
+
if (options?.rebalanceLegs) endpoint += `&rebalanceLegs=true`;
|
|
5855
5862
|
const response = await this.httpClient.get(endpoint);
|
|
5856
5863
|
const convertedData = convertStrategiesToPublic(
|
|
5857
5864
|
response.data || []
|
|
@@ -6700,6 +6707,7 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
6700
6707
|
*
|
|
6701
6708
|
* @param protocolId - The protocol UUID
|
|
6702
6709
|
* @param strategy - Optional {@link Strategy} filter
|
|
6710
|
+
* @param options - `liveOnly` omits not-live pools. `includeStatus` adds each pool's status. Both default off.
|
|
6703
6711
|
* @returns List of available pool names
|
|
6704
6712
|
*
|
|
6705
6713
|
* @example
|
|
@@ -6715,7 +6723,7 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
6715
6723
|
* );
|
|
6716
6724
|
* ```
|
|
6717
6725
|
*/
|
|
6718
|
-
async getAvailablePools(protocolId, strategy) {
|
|
6726
|
+
async getAvailablePools(protocolId, strategy, options) {
|
|
6719
6727
|
try {
|
|
6720
6728
|
let internalStrategy;
|
|
6721
6729
|
if (strategy) {
|
|
@@ -6727,7 +6735,11 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
6727
6735
|
internalStrategy = toInternalStrategy(strategy);
|
|
6728
6736
|
}
|
|
6729
6737
|
const response = await this.httpClient.get(
|
|
6730
|
-
ENDPOINTS.CUSTOMIZATION_POOLS(
|
|
6738
|
+
ENDPOINTS.CUSTOMIZATION_POOLS(
|
|
6739
|
+
protocolId,
|
|
6740
|
+
internalStrategy,
|
|
6741
|
+
options
|
|
6742
|
+
)
|
|
6731
6743
|
);
|
|
6732
6744
|
return response;
|
|
6733
6745
|
} catch (error) {
|
package/dist/index.mjs
CHANGED
|
@@ -113,7 +113,13 @@ var ENDPOINTS = {
|
|
|
113
113
|
},
|
|
114
114
|
// Customization
|
|
115
115
|
CUSTOMIZE_BATCH: "/customization/customize-batch",
|
|
116
|
-
CUSTOMIZATION_POOLS: (protocolId, strategy) =>
|
|
116
|
+
CUSTOMIZATION_POOLS: (protocolId, strategy, options) => {
|
|
117
|
+
const query = [`protocolId=${protocolId}`];
|
|
118
|
+
if (strategy) query.push(`strategy=${strategy}`);
|
|
119
|
+
if (options?.liveOnly) query.push("liveOnly=true");
|
|
120
|
+
if (options?.includeStatus) query.push("includeStatus=true");
|
|
121
|
+
return `/customization/pools?${query.join("&")}`;
|
|
122
|
+
},
|
|
117
123
|
CUSTOMIZATION_SELECTED_POOLS: (protocolId, chainId) => `/customization/selected-pools?protocolId=${protocolId}&chainId=${chainId}`
|
|
118
124
|
};
|
|
119
125
|
var DATA_ENDPOINTS = {
|
|
@@ -5810,6 +5816,7 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
5810
5816
|
if (options?.offset) endpoint += `&offset=${options.offset}`;
|
|
5811
5817
|
if (options?.fromDate) endpoint += `&fromDate=${options.fromDate}`;
|
|
5812
5818
|
if (options?.toDate) endpoint += `&toDate=${options.toDate}`;
|
|
5819
|
+
if (options?.rebalanceLegs) endpoint += `&rebalanceLegs=true`;
|
|
5813
5820
|
const response = await this.httpClient.get(endpoint);
|
|
5814
5821
|
const convertedData = convertStrategiesToPublic(
|
|
5815
5822
|
response.data || []
|
|
@@ -6658,6 +6665,7 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
6658
6665
|
*
|
|
6659
6666
|
* @param protocolId - The protocol UUID
|
|
6660
6667
|
* @param strategy - Optional {@link Strategy} filter
|
|
6668
|
+
* @param options - `liveOnly` omits not-live pools. `includeStatus` adds each pool's status. Both default off.
|
|
6661
6669
|
* @returns List of available pool names
|
|
6662
6670
|
*
|
|
6663
6671
|
* @example
|
|
@@ -6673,7 +6681,7 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
6673
6681
|
* );
|
|
6674
6682
|
* ```
|
|
6675
6683
|
*/
|
|
6676
|
-
async getAvailablePools(protocolId, strategy) {
|
|
6684
|
+
async getAvailablePools(protocolId, strategy, options) {
|
|
6677
6685
|
try {
|
|
6678
6686
|
let internalStrategy;
|
|
6679
6687
|
if (strategy) {
|
|
@@ -6685,7 +6693,11 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
6685
6693
|
internalStrategy = toInternalStrategy(strategy);
|
|
6686
6694
|
}
|
|
6687
6695
|
const response = await this.httpClient.get(
|
|
6688
|
-
ENDPOINTS.CUSTOMIZATION_POOLS(
|
|
6696
|
+
ENDPOINTS.CUSTOMIZATION_POOLS(
|
|
6697
|
+
protocolId,
|
|
6698
|
+
internalStrategy,
|
|
6699
|
+
options
|
|
6700
|
+
)
|
|
6689
6701
|
);
|
|
6690
6702
|
return response;
|
|
6691
6703
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zyfai/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "TypeScript SDK for self-custodial Zyfai yield agents: discover DeFi opportunities and manage deposits, withdrawals, positions, and strategies across Ethereum, Base, and Arbitrum",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|