fix: TypeScript errors in withdrawal system
- Fixed LAST_WITHDRAWAL_TIME type (null | string) - Removed parseFloat on health.freeCollateral (already number) - Fixed getDriftClient() → getClient() method name - Build now compiles successfully Deployed: Withdrawal system now live on dashboard
This commit is contained in:
@@ -45,7 +45,7 @@ export async function withdrawFromDrift(
|
||||
|
||||
// Execute withdrawal via Drift SDK
|
||||
// withdraw(amount, marketIndex, associatedTokenAddress, reduceOnly, subAccountId, txParams, updateFuel)
|
||||
const signature = await driftService.getDriftClient().withdraw(
|
||||
const signature = await driftService.getClient().withdraw(
|
||||
tokenAmount,
|
||||
usdcMarketIndex,
|
||||
destination,
|
||||
@@ -93,7 +93,7 @@ export async function calculateWithdrawalAmount(): Promise<{
|
||||
try {
|
||||
const driftService = await initializeDriftService()
|
||||
const health = await driftService.getAccountHealth()
|
||||
const currentBalance = parseFloat(health.freeCollateral)
|
||||
const currentBalance = health.freeCollateral // Already a number
|
||||
|
||||
// Configuration
|
||||
const totalInvested = 546 // From roadmap
|
||||
|
||||
Reference in New Issue
Block a user