mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-08 22:48:14 -05:00
fix(kalshi): remove synthetically constructed outputs (#2677)
* fix(kalshi): remove synthetically constructed outputs * fix api interface
This commit is contained in:
committed by
GitHub
parent
195e0e8e3f
commit
ac942416de
@@ -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' },
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user