import { AccountClient, AssetClient, BundleClient, Configuration, TransferClient, SupplyClient } from '@energyweb/exchange-client'; import { DemandClient, OrderbookClient, OrdersClient, TradeClient } from '@energyweb/exchange-irec-client'; import { BaseClient } from '@energyweb/origin-ui-core'; export class ExchangeClient extends BaseClient { accountClient: AccountClient; assetClient: AssetClient; bundleClient: BundleClient; demandClient: DemandClient; orderbookClient: OrderbookClient; ordersClient: OrdersClient; tradeClient: TradeClient; transferClient: TransferClient; supplyClient: SupplyClient; setup(accessToken?: string) { const config = new Configuration( accessToken ? { baseOptions: { headers: { Authorization: `Bearer ${accessToken}` } }, accessToken } : {} ); this.accountClient = new AccountClient(config, this.backendUrl); this.assetClient = new AssetClient(config, this.backendUrl); this.bundleClient = new BundleClient(config, this.backendUrl); this.demandClient = new DemandClient(config, this.backendUrl); this.orderbookClient = new OrderbookClient(config, this.backendUrl); this.ordersClient = new OrdersClient(config, this.backendUrl); this.tradeClient = new TradeClient(config, this.backendUrl); this.transferClient = new TransferClient(config, this.backendUrl); this.supplyClient = new SupplyClient(config, this.backendUrl); } }