import { APIClient } from './APIClient' ; export class BacktestClient { public constructor ( private api ) { } public async get ( projectId , backtestId ) { const data = await this . api . get ( 'backtests/read' , { projectId , backtestId , } ) ; return data . backtest ; } public async getAll ( projectId ) { const data = await this . api . get ( 'backtests/read' , { projectId } ) ; return data . backtests ; } public async create ( projectId , compileId , name ) { const data = await this . api . post ( 'backtests/create' , { projectId , compileId , backtestName : name , } ) ; return data . backtest ; } public getReport ( projectId , backtestId ) { return this . api . post ( 'backtests/read/report' , { projectId , backtestId , } ) ; } public async update ( projectId , backtestId , name , note ) { await this . api . post ( 'backtests/update' , { projectId , backtestId , name , note , } ) ; } public async delete ( projectId , backtestId ) { await this . api . post ( 'backtests/delete' , { projectId , backtestId , } ) ; } }