@zyfai/sdk 0.2.26 → 0.2.28

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.d.mts CHANGED
@@ -21,6 +21,7 @@ interface DeploySafeResponse {
21
21
  safeAddress: Address;
22
22
  txHash: string;
23
23
  status: "deployed" | "failed";
24
+ sessionKeyCreated?: boolean;
24
25
  }
25
26
  interface UpdateUserProfileRequest {
26
27
  strategy?: string;
@@ -120,7 +121,6 @@ interface Portfolio {
120
121
  smartWallet?: Address;
121
122
  positions?: PositionSlot[];
122
123
  hasActiveSessionKey?: boolean;
123
- hasBalance?: boolean;
124
124
  newSessionKeyAvailable?: boolean;
125
125
  contracts?: Address[];
126
126
  omniAccount?: boolean;
@@ -131,6 +131,16 @@ interface Portfolio {
131
131
  executorProxy?: boolean;
132
132
  assetTypeSettings?: AssetTypeSettings;
133
133
  }
134
+ interface PortfolioDetailed {
135
+ hasBalance?: boolean;
136
+ staleBalances?: string[];
137
+ hasActiveSessionKey?: boolean;
138
+ positions?: PositionSlot[];
139
+ portfolioByAssetType?: Record<string, {
140
+ balance: string;
141
+ decimals: number;
142
+ }>;
143
+ }
134
144
  interface AssetTypeSettings {
135
145
  [assetType: string]: {
136
146
  rebalanceStrategy?: string;
@@ -162,6 +172,11 @@ interface PortfolioResponse {
162
172
  userAddress: string;
163
173
  portfolio: Portfolio;
164
174
  }
175
+ interface PortfolioDetailedResponse {
176
+ success: boolean;
177
+ userAddress: string;
178
+ portfolio: PortfolioDetailed;
179
+ }
165
180
  interface TVLResponse {
166
181
  success: boolean;
167
182
  totalTvl: number;
@@ -257,9 +272,6 @@ type TokenEarnings = Record<string, string>;
257
272
  interface OnchainEarnings {
258
273
  walletAddress: string;
259
274
  totalEarningsByToken: TokenEarnings;
260
- lifetimeEarningsByToken: TokenEarnings;
261
- currentEarningsByChain: Record<string, TokenEarnings>;
262
- unrealizedEarnings: Record<string, TokenEarnings>;
263
275
  lastCheckTimestamp?: string;
264
276
  lastLogDate?: Record<string, string | null>;
265
277
  }
@@ -270,13 +282,7 @@ interface OnchainEarningsResponse {
270
282
  interface DailyEarning {
271
283
  wallet_address?: string;
272
284
  snapshot_date: string;
273
- current_earnings_by_token: TokenEarnings;
274
- lifetime_earnings_by_token: TokenEarnings;
275
- unrealized_earnings_by_token: TokenEarnings;
276
285
  total_earnings_by_token: TokenEarnings;
277
- daily_current_delta_by_token: TokenEarnings;
278
- daily_lifetime_delta_by_token: TokenEarnings;
279
- daily_unrealized_delta_by_token: TokenEarnings;
280
286
  daily_total_delta_by_token: TokenEarnings;
281
287
  created_at?: string;
282
288
  }
@@ -500,6 +506,37 @@ interface Session {
500
506
  permitERC4337Paymaster: boolean;
501
507
  chainId: bigint;
502
508
  }
509
+ type VaultAsset = "USDC";
510
+ interface VaultDepositResponse {
511
+ success: boolean;
512
+ txHash: string;
513
+ amount: string;
514
+ asset: VaultAsset;
515
+ vaultAddress: Address;
516
+ }
517
+ interface VaultWithdrawResponse {
518
+ success: boolean;
519
+ txHash: string;
520
+ withdrawKey: Hex;
521
+ status: "pending" | "claimable";
522
+ }
523
+ interface VaultClaimResponse {
524
+ success: boolean;
525
+ txHash: string;
526
+ claimed: boolean;
527
+ }
528
+ interface VaultWithdrawStatusResponse {
529
+ success: boolean;
530
+ withdrawKey: Hex | null;
531
+ isClaimable: boolean;
532
+ isPending: boolean;
533
+ nonce: bigint;
534
+ }
535
+ interface VaultSharesResponse {
536
+ success: boolean;
537
+ shares: bigint;
538
+ symbol: string;
539
+ }
503
540
 
504
541
  type SupportedChainId = 8453 | 42161 | 9745;
505
542
  interface ChainConfig {
@@ -731,6 +768,7 @@ declare class ZyfaiSDK {
731
768
  * @param userAddress - User's EOA address (the connected EOA, not the smart wallet address)
732
769
  * @param chainId - Target chain ID
733
770
  * @param strategy - Optional strategy selection: "conservative" (default) or "aggressive"
771
+ * @param createSessionKey - If true, automatically creates a session key after deployment (default: false)
734
772
  * @returns Deployment response with Safe address and transaction hash
735
773
  *
736
774
  * @example
@@ -740,9 +778,12 @@ declare class ZyfaiSDK {
740
778
  *
741
779
  * // Deploy with aggressive strategy
742
780
  * await sdk.deploySafe(userAddress, 8453, "aggressive");
781
+ *
782
+ * // Deploy and automatically create session key
783
+ * await sdk.deploySafe(userAddress, 8453, "conservative", true);
743
784
  * ```
744
785
  */
745
- deploySafe(userAddress: string, chainId: SupportedChainId, strategy?: Strategy): Promise<DeploySafeResponse>;
786
+ deploySafe(userAddress: string, chainId: SupportedChainId, strategy?: Strategy, createSessionKey?: boolean): Promise<DeploySafeResponse>;
746
787
  /**
747
788
  * Create session key with auto-fetched configuration from Zyfai API
748
789
  * This is the simplified method that automatically fetches session configuration
@@ -902,6 +943,23 @@ declare class ZyfaiSDK {
902
943
  * ```
903
944
  */
904
945
  getPositions(userAddress: string, chainId?: SupportedChainId): Promise<PortfolioResponse>;
946
+ /**
947
+ * Get all active positions and portfolio for a user
948
+ *
949
+ * @param userAddress - User's EOA address
950
+ * @param chainId - Optional: Filter by specific chain ID
951
+ * @returns User's positions across all protocols
952
+ *
953
+ * @example
954
+ * ```typescript
955
+ * // Get all positions across all chains
956
+ * const positions = await sdk.getPositions(userAddress);
957
+ *
958
+ * // Get positions on a specific chain
959
+ * const basePositions = await sdk.getPositions(userAddress, 8453);
960
+ * ```
961
+ */
962
+ getPortfolio(userAddress: string): Promise<PortfolioDetailedResponse>;
905
963
  /**
906
964
  * Get current authenticated user details
907
965
  * Requires SIWE authentication
@@ -1311,6 +1369,141 @@ declare class ZyfaiSDK {
1311
1369
  * ```
1312
1370
  */
1313
1371
  registerAgentOnIdentityRegistry(smartWallet: string, chainId: SupportedChainId): Promise<RegisterAgentResponse>;
1372
+ /**
1373
+ * Deposit assets into the Zyfai Vault
1374
+ * Currently only supports USDC on Base chain
1375
+ *
1376
+ * @param amount - Amount to deposit (in human readable format, e.g., "100" for 100 USDC)
1377
+ * @param asset - Asset to deposit (default: "USDC")
1378
+ * @returns Deposit transaction result
1379
+ *
1380
+ * @example
1381
+ * ```typescript
1382
+ * const result = await sdk.vaultDeposit("100", "USDC");
1383
+ * console.log("Deposited:", result.txHash);
1384
+ * ```
1385
+ */
1386
+ vaultDeposit(amount: string, asset?: VaultAsset, chainId?: SupportedChainId): Promise<VaultDepositResponse>;
1387
+ /**
1388
+ * Request withdrawal from the Zyfai Vault
1389
+ * Withdrawals are async - use getVaultWithdrawStatus and vaultClaim after
1390
+ *
1391
+ * @param shares - Amount of shares to redeem (optional, defaults to all shares)
1392
+ * @returns Withdraw request result with withdrawKey
1393
+ *
1394
+ * @example
1395
+ * ```typescript
1396
+ * const result = await sdk.vaultWithdraw();
1397
+ * console.log("Withdraw key:", result.withdrawKey);
1398
+ * // Later, check status and claim
1399
+ * ```
1400
+ */
1401
+ vaultWithdraw(shares?: string, chainId?: SupportedChainId): Promise<VaultWithdrawResponse>;
1402
+ /**
1403
+ * Get the status of a pending withdrawal
1404
+ *
1405
+ * @param withdrawKey - The withdraw key to check (optional, gets latest if not provided)
1406
+ * @returns Withdraw status
1407
+ *
1408
+ * @example
1409
+ * ```typescript
1410
+ * const status = await sdk.getVaultWithdrawStatus();
1411
+ * if (status.isClaimable) {
1412
+ * await sdk.vaultClaim(status.withdrawKey);
1413
+ * }
1414
+ * ```
1415
+ */
1416
+ getVaultWithdrawStatus(withdrawKey?: Hex, chainId?: SupportedChainId): Promise<VaultWithdrawStatusResponse>;
1417
+ /**
1418
+ * Claim a completed withdrawal from the Zyfai Vault
1419
+ *
1420
+ * @param withdrawKey - The withdraw key to claim
1421
+ * @returns Claim transaction result
1422
+ *
1423
+ * @example
1424
+ * ```typescript
1425
+ * const status = await sdk.getVaultWithdrawStatus();
1426
+ * if (status.isClaimable) {
1427
+ * const claim = await sdk.vaultClaim(status.withdrawKey);
1428
+ * console.log("Claimed:", claim.txHash);
1429
+ * }
1430
+ * ```
1431
+ */
1432
+ vaultClaim(withdrawKey: Hex, chainId?: SupportedChainId): Promise<VaultClaimResponse>;
1433
+ /**
1434
+ * Get vault shares info for the connected wallet
1435
+ *
1436
+ * @param userAddress - Optional user address (defaults to connected wallet)
1437
+ * @returns Vault shares balance and token symbol
1438
+ *
1439
+ * @example
1440
+ * ```typescript
1441
+ * const { shares, symbol } = await sdk.getVaultShares();
1442
+ * console.log(`Balance: ${shares} ${symbol}`);
1443
+ * ```
1444
+ */
1445
+ getVaultShares(userAddress?: string, chainId?: SupportedChainId): Promise<VaultSharesResponse>;
1314
1446
  }
1315
1447
 
1316
- export { type APYPerStrategy, type APYPerStrategyResponse, type ActionData, type ActiveWallet, type ActiveWalletsResponse, type AddWalletToSdkResponse, type Address, type ApyPosition, type BestOpportunityDetails, type BestOpportunityResponse, type ChainConfig, type ChainPortfolio, type CustomizationConfig, type CustomizeBatchRequest, type CustomizeBatchResponse, DEFAULT_TOKEN_ADDRESSES, type DailyApyEntry, type DailyApyHistoryResponse, type DailyEarning, type DailyEarningsResponse, type DebankPortfolioResponse, type DeploySafeResponse, type DepositResponse, type ERC7739Context, type ERC7739Data, type FirstTopupResponse, type GetPoolsResponse, type GetSelectedPoolsResponse, type Hex, type HistoryEntry, type HistoryPosition, type HistoryResponse, type LogDepositResponse, type OnchainEarnings, type OnchainEarningsResponse, type OpportunitiesResponse, type Opportunity, type OpportunityPosition, type PolicyData, type Pool, type Portfolio, type PortfolioResponse, type PortfolioToken, type PositionSlot, type Protocol, type ProtocolsResponse, type RebalanceFrequencyResponse, type RegisterAgentResponse, type SDKConfig, type SdkKeyTVLResponse, type Session, type SessionKeyResponse, type SmartWalletByEOAResponse, type SmartWalletResponse, type Strategy, type SupportedChainId, type TVLResponse, type TokenApy, type TokenEarnings, type UpdateUserProfileRequest, type UpdateUserProfileResponse, type VolumeResponse, type WalletTVL, type WithdrawResponse, ZyfaiSDK, getChainConfig, getDefaultTokenAddress, getSupportedChainIds, isSupportedChain };
1448
+ /**
1449
+ * Bankr EIP-1193 Provider Adapter
1450
+ *
1451
+ * Wraps Bankr's Agent API Sign endpoint to create an EIP-1193 compatible provider.
1452
+ * This allows using Bankr wallets with any EIP-1193 compatible SDK without exposing private keys.
1453
+ *
1454
+ * @see https://docs.bankr.bot/agent-api/sign-endpoint
1455
+ */
1456
+ interface BankrProviderConfig {
1457
+ /** Bankr API key with signing permissions */
1458
+ apiKey: string;
1459
+ /** Base URL for Bankr API (default: https://api.bankr.bot) */
1460
+ baseUrl?: string;
1461
+ /** Default chain ID (default: 8453 - Base) */
1462
+ chainId?: number;
1463
+ }
1464
+ /**
1465
+ * Creates an EIP-1193 compatible provider that uses Bankr's Agent API for signing.
1466
+ *
1467
+ * @param config - Bankr provider configuration
1468
+ * @returns EIP-1193 compatible provider object
1469
+ *
1470
+ * @example
1471
+ * ```typescript
1472
+ * import { createBankrProvider } from '@zyfai/sdk';
1473
+ * import { ZyfaiSDK } from '@zyfai/sdk';
1474
+ *
1475
+ * const provider = createBankrProvider({ apiKey: process.env.BANKR_API_KEY });
1476
+ * const sdk = new ZyfaiSDK({ apiKey: process.env.ZYFAI_API_KEY });
1477
+ *
1478
+ * const address = await sdk.connectAccount(provider);
1479
+ * await sdk.deploySafe(address, 8453, 'conservative', true);
1480
+ * ```
1481
+ */
1482
+ declare function createBankrProvider(config: BankrProviderConfig): {
1483
+ /**
1484
+ * EIP-1193 request method
1485
+ * Routes RPC calls to appropriate Bankr API endpoints
1486
+ */
1487
+ request({ method, params }: {
1488
+ method: string;
1489
+ params?: any[];
1490
+ }): Promise<any>;
1491
+ /**
1492
+ * Event listener stub (required by EIP-1193)
1493
+ * Bankr API doesn't support real-time events
1494
+ */
1495
+ on: (event: string, callback: (...args: any[]) => void) => void;
1496
+ /**
1497
+ * Remove event listener stub (required by EIP-1193)
1498
+ */
1499
+ removeListener: (event: string, callback: (...args: any[]) => void) => void;
1500
+ /**
1501
+ * Check if this is a Bankr provider
1502
+ */
1503
+ isBankr: boolean;
1504
+ };
1505
+ type BankrProvider = ReturnType<typeof createBankrProvider>;
1506
+
1507
+ declare const VAULT_ADDRESS: "0xD580071c47d4a667858B5FafAb85BC9C609beC5D";
1508
+
1509
+ export { type APYPerStrategy, type APYPerStrategyResponse, type ActionData, type ActiveWallet, type ActiveWalletsResponse, type AddWalletToSdkResponse, type Address, type ApyPosition, type BankrProvider, type BankrProviderConfig, type BestOpportunityDetails, type BestOpportunityResponse, type ChainConfig, type ChainPortfolio, type CustomizationConfig, type CustomizeBatchRequest, type CustomizeBatchResponse, DEFAULT_TOKEN_ADDRESSES, type DailyApyEntry, type DailyApyHistoryResponse, type DailyEarning, type DailyEarningsResponse, type DebankPortfolioResponse, type DeploySafeResponse, type DepositResponse, type ERC7739Context, type ERC7739Data, type FirstTopupResponse, type GetPoolsResponse, type GetSelectedPoolsResponse, type Hex, type HistoryEntry, type HistoryPosition, type HistoryResponse, type LogDepositResponse, type OnchainEarnings, type OnchainEarningsResponse, type OpportunitiesResponse, type Opportunity, type OpportunityPosition, type PolicyData, type Pool, type Portfolio, type PortfolioDetailed, type PortfolioDetailedResponse, type PortfolioResponse, type PortfolioToken, type PositionSlot, type Protocol, type ProtocolsResponse, type RebalanceFrequencyResponse, type RegisterAgentResponse, type SDKConfig, type SdkKeyTVLResponse, type Session, type SessionKeyResponse, type SmartWalletByEOAResponse, type SmartWalletResponse, type Strategy, type SupportedChainId, type TVLResponse, type TokenApy, type TokenEarnings, type UpdateUserProfileRequest, type UpdateUserProfileResponse, VAULT_ADDRESS, type VaultAsset, type VaultClaimResponse, type VaultDepositResponse, type VaultSharesResponse, type VaultWithdrawResponse, type VaultWithdrawStatusResponse, type VolumeResponse, type WalletTVL, type WithdrawResponse, ZyfaiSDK, createBankrProvider, getChainConfig, getDefaultTokenAddress, getSupportedChainIds, isSupportedChain };
package/dist/index.d.ts CHANGED
@@ -21,6 +21,7 @@ interface DeploySafeResponse {
21
21
  safeAddress: Address;
22
22
  txHash: string;
23
23
  status: "deployed" | "failed";
24
+ sessionKeyCreated?: boolean;
24
25
  }
25
26
  interface UpdateUserProfileRequest {
26
27
  strategy?: string;
@@ -120,7 +121,6 @@ interface Portfolio {
120
121
  smartWallet?: Address;
121
122
  positions?: PositionSlot[];
122
123
  hasActiveSessionKey?: boolean;
123
- hasBalance?: boolean;
124
124
  newSessionKeyAvailable?: boolean;
125
125
  contracts?: Address[];
126
126
  omniAccount?: boolean;
@@ -131,6 +131,16 @@ interface Portfolio {
131
131
  executorProxy?: boolean;
132
132
  assetTypeSettings?: AssetTypeSettings;
133
133
  }
134
+ interface PortfolioDetailed {
135
+ hasBalance?: boolean;
136
+ staleBalances?: string[];
137
+ hasActiveSessionKey?: boolean;
138
+ positions?: PositionSlot[];
139
+ portfolioByAssetType?: Record<string, {
140
+ balance: string;
141
+ decimals: number;
142
+ }>;
143
+ }
134
144
  interface AssetTypeSettings {
135
145
  [assetType: string]: {
136
146
  rebalanceStrategy?: string;
@@ -162,6 +172,11 @@ interface PortfolioResponse {
162
172
  userAddress: string;
163
173
  portfolio: Portfolio;
164
174
  }
175
+ interface PortfolioDetailedResponse {
176
+ success: boolean;
177
+ userAddress: string;
178
+ portfolio: PortfolioDetailed;
179
+ }
165
180
  interface TVLResponse {
166
181
  success: boolean;
167
182
  totalTvl: number;
@@ -257,9 +272,6 @@ type TokenEarnings = Record<string, string>;
257
272
  interface OnchainEarnings {
258
273
  walletAddress: string;
259
274
  totalEarningsByToken: TokenEarnings;
260
- lifetimeEarningsByToken: TokenEarnings;
261
- currentEarningsByChain: Record<string, TokenEarnings>;
262
- unrealizedEarnings: Record<string, TokenEarnings>;
263
275
  lastCheckTimestamp?: string;
264
276
  lastLogDate?: Record<string, string | null>;
265
277
  }
@@ -270,13 +282,7 @@ interface OnchainEarningsResponse {
270
282
  interface DailyEarning {
271
283
  wallet_address?: string;
272
284
  snapshot_date: string;
273
- current_earnings_by_token: TokenEarnings;
274
- lifetime_earnings_by_token: TokenEarnings;
275
- unrealized_earnings_by_token: TokenEarnings;
276
285
  total_earnings_by_token: TokenEarnings;
277
- daily_current_delta_by_token: TokenEarnings;
278
- daily_lifetime_delta_by_token: TokenEarnings;
279
- daily_unrealized_delta_by_token: TokenEarnings;
280
286
  daily_total_delta_by_token: TokenEarnings;
281
287
  created_at?: string;
282
288
  }
@@ -500,6 +506,37 @@ interface Session {
500
506
  permitERC4337Paymaster: boolean;
501
507
  chainId: bigint;
502
508
  }
509
+ type VaultAsset = "USDC";
510
+ interface VaultDepositResponse {
511
+ success: boolean;
512
+ txHash: string;
513
+ amount: string;
514
+ asset: VaultAsset;
515
+ vaultAddress: Address;
516
+ }
517
+ interface VaultWithdrawResponse {
518
+ success: boolean;
519
+ txHash: string;
520
+ withdrawKey: Hex;
521
+ status: "pending" | "claimable";
522
+ }
523
+ interface VaultClaimResponse {
524
+ success: boolean;
525
+ txHash: string;
526
+ claimed: boolean;
527
+ }
528
+ interface VaultWithdrawStatusResponse {
529
+ success: boolean;
530
+ withdrawKey: Hex | null;
531
+ isClaimable: boolean;
532
+ isPending: boolean;
533
+ nonce: bigint;
534
+ }
535
+ interface VaultSharesResponse {
536
+ success: boolean;
537
+ shares: bigint;
538
+ symbol: string;
539
+ }
503
540
 
504
541
  type SupportedChainId = 8453 | 42161 | 9745;
505
542
  interface ChainConfig {
@@ -731,6 +768,7 @@ declare class ZyfaiSDK {
731
768
  * @param userAddress - User's EOA address (the connected EOA, not the smart wallet address)
732
769
  * @param chainId - Target chain ID
733
770
  * @param strategy - Optional strategy selection: "conservative" (default) or "aggressive"
771
+ * @param createSessionKey - If true, automatically creates a session key after deployment (default: false)
734
772
  * @returns Deployment response with Safe address and transaction hash
735
773
  *
736
774
  * @example
@@ -740,9 +778,12 @@ declare class ZyfaiSDK {
740
778
  *
741
779
  * // Deploy with aggressive strategy
742
780
  * await sdk.deploySafe(userAddress, 8453, "aggressive");
781
+ *
782
+ * // Deploy and automatically create session key
783
+ * await sdk.deploySafe(userAddress, 8453, "conservative", true);
743
784
  * ```
744
785
  */
745
- deploySafe(userAddress: string, chainId: SupportedChainId, strategy?: Strategy): Promise<DeploySafeResponse>;
786
+ deploySafe(userAddress: string, chainId: SupportedChainId, strategy?: Strategy, createSessionKey?: boolean): Promise<DeploySafeResponse>;
746
787
  /**
747
788
  * Create session key with auto-fetched configuration from Zyfai API
748
789
  * This is the simplified method that automatically fetches session configuration
@@ -902,6 +943,23 @@ declare class ZyfaiSDK {
902
943
  * ```
903
944
  */
904
945
  getPositions(userAddress: string, chainId?: SupportedChainId): Promise<PortfolioResponse>;
946
+ /**
947
+ * Get all active positions and portfolio for a user
948
+ *
949
+ * @param userAddress - User's EOA address
950
+ * @param chainId - Optional: Filter by specific chain ID
951
+ * @returns User's positions across all protocols
952
+ *
953
+ * @example
954
+ * ```typescript
955
+ * // Get all positions across all chains
956
+ * const positions = await sdk.getPositions(userAddress);
957
+ *
958
+ * // Get positions on a specific chain
959
+ * const basePositions = await sdk.getPositions(userAddress, 8453);
960
+ * ```
961
+ */
962
+ getPortfolio(userAddress: string): Promise<PortfolioDetailedResponse>;
905
963
  /**
906
964
  * Get current authenticated user details
907
965
  * Requires SIWE authentication
@@ -1311,6 +1369,141 @@ declare class ZyfaiSDK {
1311
1369
  * ```
1312
1370
  */
1313
1371
  registerAgentOnIdentityRegistry(smartWallet: string, chainId: SupportedChainId): Promise<RegisterAgentResponse>;
1372
+ /**
1373
+ * Deposit assets into the Zyfai Vault
1374
+ * Currently only supports USDC on Base chain
1375
+ *
1376
+ * @param amount - Amount to deposit (in human readable format, e.g., "100" for 100 USDC)
1377
+ * @param asset - Asset to deposit (default: "USDC")
1378
+ * @returns Deposit transaction result
1379
+ *
1380
+ * @example
1381
+ * ```typescript
1382
+ * const result = await sdk.vaultDeposit("100", "USDC");
1383
+ * console.log("Deposited:", result.txHash);
1384
+ * ```
1385
+ */
1386
+ vaultDeposit(amount: string, asset?: VaultAsset, chainId?: SupportedChainId): Promise<VaultDepositResponse>;
1387
+ /**
1388
+ * Request withdrawal from the Zyfai Vault
1389
+ * Withdrawals are async - use getVaultWithdrawStatus and vaultClaim after
1390
+ *
1391
+ * @param shares - Amount of shares to redeem (optional, defaults to all shares)
1392
+ * @returns Withdraw request result with withdrawKey
1393
+ *
1394
+ * @example
1395
+ * ```typescript
1396
+ * const result = await sdk.vaultWithdraw();
1397
+ * console.log("Withdraw key:", result.withdrawKey);
1398
+ * // Later, check status and claim
1399
+ * ```
1400
+ */
1401
+ vaultWithdraw(shares?: string, chainId?: SupportedChainId): Promise<VaultWithdrawResponse>;
1402
+ /**
1403
+ * Get the status of a pending withdrawal
1404
+ *
1405
+ * @param withdrawKey - The withdraw key to check (optional, gets latest if not provided)
1406
+ * @returns Withdraw status
1407
+ *
1408
+ * @example
1409
+ * ```typescript
1410
+ * const status = await sdk.getVaultWithdrawStatus();
1411
+ * if (status.isClaimable) {
1412
+ * await sdk.vaultClaim(status.withdrawKey);
1413
+ * }
1414
+ * ```
1415
+ */
1416
+ getVaultWithdrawStatus(withdrawKey?: Hex, chainId?: SupportedChainId): Promise<VaultWithdrawStatusResponse>;
1417
+ /**
1418
+ * Claim a completed withdrawal from the Zyfai Vault
1419
+ *
1420
+ * @param withdrawKey - The withdraw key to claim
1421
+ * @returns Claim transaction result
1422
+ *
1423
+ * @example
1424
+ * ```typescript
1425
+ * const status = await sdk.getVaultWithdrawStatus();
1426
+ * if (status.isClaimable) {
1427
+ * const claim = await sdk.vaultClaim(status.withdrawKey);
1428
+ * console.log("Claimed:", claim.txHash);
1429
+ * }
1430
+ * ```
1431
+ */
1432
+ vaultClaim(withdrawKey: Hex, chainId?: SupportedChainId): Promise<VaultClaimResponse>;
1433
+ /**
1434
+ * Get vault shares info for the connected wallet
1435
+ *
1436
+ * @param userAddress - Optional user address (defaults to connected wallet)
1437
+ * @returns Vault shares balance and token symbol
1438
+ *
1439
+ * @example
1440
+ * ```typescript
1441
+ * const { shares, symbol } = await sdk.getVaultShares();
1442
+ * console.log(`Balance: ${shares} ${symbol}`);
1443
+ * ```
1444
+ */
1445
+ getVaultShares(userAddress?: string, chainId?: SupportedChainId): Promise<VaultSharesResponse>;
1314
1446
  }
1315
1447
 
1316
- export { type APYPerStrategy, type APYPerStrategyResponse, type ActionData, type ActiveWallet, type ActiveWalletsResponse, type AddWalletToSdkResponse, type Address, type ApyPosition, type BestOpportunityDetails, type BestOpportunityResponse, type ChainConfig, type ChainPortfolio, type CustomizationConfig, type CustomizeBatchRequest, type CustomizeBatchResponse, DEFAULT_TOKEN_ADDRESSES, type DailyApyEntry, type DailyApyHistoryResponse, type DailyEarning, type DailyEarningsResponse, type DebankPortfolioResponse, type DeploySafeResponse, type DepositResponse, type ERC7739Context, type ERC7739Data, type FirstTopupResponse, type GetPoolsResponse, type GetSelectedPoolsResponse, type Hex, type HistoryEntry, type HistoryPosition, type HistoryResponse, type LogDepositResponse, type OnchainEarnings, type OnchainEarningsResponse, type OpportunitiesResponse, type Opportunity, type OpportunityPosition, type PolicyData, type Pool, type Portfolio, type PortfolioResponse, type PortfolioToken, type PositionSlot, type Protocol, type ProtocolsResponse, type RebalanceFrequencyResponse, type RegisterAgentResponse, type SDKConfig, type SdkKeyTVLResponse, type Session, type SessionKeyResponse, type SmartWalletByEOAResponse, type SmartWalletResponse, type Strategy, type SupportedChainId, type TVLResponse, type TokenApy, type TokenEarnings, type UpdateUserProfileRequest, type UpdateUserProfileResponse, type VolumeResponse, type WalletTVL, type WithdrawResponse, ZyfaiSDK, getChainConfig, getDefaultTokenAddress, getSupportedChainIds, isSupportedChain };
1448
+ /**
1449
+ * Bankr EIP-1193 Provider Adapter
1450
+ *
1451
+ * Wraps Bankr's Agent API Sign endpoint to create an EIP-1193 compatible provider.
1452
+ * This allows using Bankr wallets with any EIP-1193 compatible SDK without exposing private keys.
1453
+ *
1454
+ * @see https://docs.bankr.bot/agent-api/sign-endpoint
1455
+ */
1456
+ interface BankrProviderConfig {
1457
+ /** Bankr API key with signing permissions */
1458
+ apiKey: string;
1459
+ /** Base URL for Bankr API (default: https://api.bankr.bot) */
1460
+ baseUrl?: string;
1461
+ /** Default chain ID (default: 8453 - Base) */
1462
+ chainId?: number;
1463
+ }
1464
+ /**
1465
+ * Creates an EIP-1193 compatible provider that uses Bankr's Agent API for signing.
1466
+ *
1467
+ * @param config - Bankr provider configuration
1468
+ * @returns EIP-1193 compatible provider object
1469
+ *
1470
+ * @example
1471
+ * ```typescript
1472
+ * import { createBankrProvider } from '@zyfai/sdk';
1473
+ * import { ZyfaiSDK } from '@zyfai/sdk';
1474
+ *
1475
+ * const provider = createBankrProvider({ apiKey: process.env.BANKR_API_KEY });
1476
+ * const sdk = new ZyfaiSDK({ apiKey: process.env.ZYFAI_API_KEY });
1477
+ *
1478
+ * const address = await sdk.connectAccount(provider);
1479
+ * await sdk.deploySafe(address, 8453, 'conservative', true);
1480
+ * ```
1481
+ */
1482
+ declare function createBankrProvider(config: BankrProviderConfig): {
1483
+ /**
1484
+ * EIP-1193 request method
1485
+ * Routes RPC calls to appropriate Bankr API endpoints
1486
+ */
1487
+ request({ method, params }: {
1488
+ method: string;
1489
+ params?: any[];
1490
+ }): Promise<any>;
1491
+ /**
1492
+ * Event listener stub (required by EIP-1193)
1493
+ * Bankr API doesn't support real-time events
1494
+ */
1495
+ on: (event: string, callback: (...args: any[]) => void) => void;
1496
+ /**
1497
+ * Remove event listener stub (required by EIP-1193)
1498
+ */
1499
+ removeListener: (event: string, callback: (...args: any[]) => void) => void;
1500
+ /**
1501
+ * Check if this is a Bankr provider
1502
+ */
1503
+ isBankr: boolean;
1504
+ };
1505
+ type BankrProvider = ReturnType<typeof createBankrProvider>;
1506
+
1507
+ declare const VAULT_ADDRESS: "0xD580071c47d4a667858B5FafAb85BC9C609beC5D";
1508
+
1509
+ export { type APYPerStrategy, type APYPerStrategyResponse, type ActionData, type ActiveWallet, type ActiveWalletsResponse, type AddWalletToSdkResponse, type Address, type ApyPosition, type BankrProvider, type BankrProviderConfig, type BestOpportunityDetails, type BestOpportunityResponse, type ChainConfig, type ChainPortfolio, type CustomizationConfig, type CustomizeBatchRequest, type CustomizeBatchResponse, DEFAULT_TOKEN_ADDRESSES, type DailyApyEntry, type DailyApyHistoryResponse, type DailyEarning, type DailyEarningsResponse, type DebankPortfolioResponse, type DeploySafeResponse, type DepositResponse, type ERC7739Context, type ERC7739Data, type FirstTopupResponse, type GetPoolsResponse, type GetSelectedPoolsResponse, type Hex, type HistoryEntry, type HistoryPosition, type HistoryResponse, type LogDepositResponse, type OnchainEarnings, type OnchainEarningsResponse, type OpportunitiesResponse, type Opportunity, type OpportunityPosition, type PolicyData, type Pool, type Portfolio, type PortfolioDetailed, type PortfolioDetailedResponse, type PortfolioResponse, type PortfolioToken, type PositionSlot, type Protocol, type ProtocolsResponse, type RebalanceFrequencyResponse, type RegisterAgentResponse, type SDKConfig, type SdkKeyTVLResponse, type Session, type SessionKeyResponse, type SmartWalletByEOAResponse, type SmartWalletResponse, type Strategy, type SupportedChainId, type TVLResponse, type TokenApy, type TokenEarnings, type UpdateUserProfileRequest, type UpdateUserProfileResponse, VAULT_ADDRESS, type VaultAsset, type VaultClaimResponse, type VaultDepositResponse, type VaultSharesResponse, type VaultWithdrawResponse, type VaultWithdrawStatusResponse, type VolumeResponse, type WalletTVL, type WithdrawResponse, ZyfaiSDK, createBankrProvider, getChainConfig, getDefaultTokenAddress, getSupportedChainIds, isSupportedChain };