fix(kalshi): remove synthetically constructed outputs (#2677)

* fix(kalshi): remove synthetically constructed outputs

* fix api interface
This commit is contained in:
Vikhyath Mondreti
2026-01-03 17:40:55 -08:00
committed by GitHub
parent 195e0e8e3f
commit ac942416de
2 changed files with 4 additions and 10 deletions

View File

@@ -8,9 +8,7 @@ export interface KalshiGetBalanceResponse {
success: boolean success: boolean
output: { output: {
balance: number // In cents balance: number // In cents
portfolioValue?: number // In cents portfolioValue: number // In cents
balanceDollars: number // Converted to dollars
portfolioValueDollars?: number // Converted to dollars
} }
} }
@@ -51,16 +49,14 @@ export const kalshiGetBalanceTool: ToolConfig<KalshiGetBalanceParams, KalshiGetB
handleKalshiError(data, response.status, 'get_balance') handleKalshiError(data, response.status, 'get_balance')
} }
const balance = data.balance || 0 const balance = data.balance ?? 0
const portfolioValue = data.portfolio_value const portfolioValue = data.portfolio_value ?? 0
return { return {
success: true, success: true,
output: { output: {
balance, balance,
portfolioValue, portfolioValue,
balanceDollars: balance / 100,
portfolioValueDollars: portfolioValue ? portfolioValue / 100 : undefined,
}, },
} }
}, },
@@ -68,7 +64,5 @@ export const kalshiGetBalanceTool: ToolConfig<KalshiGetBalanceParams, KalshiGetB
outputs: { outputs: {
balance: { type: 'number', description: 'Account balance in cents' }, balance: { type: 'number', description: 'Account balance in cents' },
portfolioValue: { type: 'number', description: 'Portfolio value in cents' }, portfolioValue: { type: 'number', description: 'Portfolio value in cents' },
balanceDollars: { type: 'number', description: 'Account balance in dollars' },
portfolioValueDollars: { type: 'number', description: 'Portfolio value in dollars' },
}, },
} }

View File

@@ -82,7 +82,7 @@ export interface KalshiEvent {
// Balance type // Balance type
export interface KalshiBalance { export interface KalshiBalance {
balance: number // In cents balance: number // In cents
portfolio_value?: number // In cents portfolio_value: number // In cents
} }
// Position type // Position type