99 PaginationParams ,
1010 PriceInfo ,
1111 SwapOrderResponse ,
12- Tick ,
1312 WithdrawOrderResponse
1413} from '../api.types' ;
1514import { Asset , Token } from '../models/Asset' ;
@@ -18,6 +17,7 @@ import { OperationStatus } from '../models/OperationStatus';
1817import { WithdrawOrder } from '../models/WithdrawOrder' ;
1918import { DepositOrder } from '../models/DepositOrder' ;
2019import { TickInterval } from '../enums' ;
20+ import { Tick } from '../models/Tick' ;
2121
2222export class LiquidityPoolService extends BaseApiService {
2323
@@ -59,6 +59,7 @@ export class LiquidityPoolService extends BaseApiService {
5959 data : response . data . data . map ( ( order : SwapOrderResponse ) => {
6060 const operationStatuses : OperationStatus [ ] = order . statuses . map ( ( status : OperationStatusResponse ) => {
6161 return new OperationStatus (
62+ null ,
6263 status . status ,
6364 status . slot ,
6465 status . txHash ,
@@ -104,6 +105,7 @@ export class LiquidityPoolService extends BaseApiService {
104105 data : response . data . data . map ( ( order : DepositOrderResponse ) => {
105106 const operationStatuses : OperationStatus [ ] = order . statuses . map ( ( status : OperationStatusResponse ) => {
106107 return new OperationStatus (
108+ null ,
107109 status . status ,
108110 status . slot ,
109111 status . txHash ,
@@ -130,6 +132,8 @@ export class LiquidityPoolService extends BaseApiService {
130132 order . senderPubKeyHash ,
131133 order . senderStakeKeyHash ,
132134 operationStatuses ,
135+ order . txHash ,
136+ Number ( order . outputIndex ) ,
133137 liquidityPool ,
134138 ) ;
135139 } ) ,
@@ -145,6 +149,7 @@ export class LiquidityPoolService extends BaseApiService {
145149 data : response . data . data . map ( ( order : WithdrawOrderResponse ) => {
146150 const operationStatuses : OperationStatus [ ] = order . statuses . map ( ( status : OperationStatusResponse ) => {
147151 return new OperationStatus (
152+ null ,
148153 status . status ,
149154 status . slot ,
150155 status . txHash ,
@@ -167,6 +172,8 @@ export class LiquidityPoolService extends BaseApiService {
167172 order . senderPubKeyHash ,
168173 order . senderStakeKeyHash ,
169174 operationStatuses ,
175+ order . txHash ,
176+ Number ( order . outputIndex ) ,
170177 liquidityPool ,
171178 ) ;
172179 } ) ,
@@ -176,7 +183,7 @@ export class LiquidityPoolService extends BaseApiService {
176183 }
177184
178185 public prices ( poolIdentifiers : string [ ] ) : Promise < PriceInfo [ ] > {
179- return axios . post ( `${ this . _baseHost } /api/liquidity-pools/analytics/ prices` , {
186+ return axios . post ( `${ this . _baseHost } /api/liquidity-pools/prices` , {
180187 identifiers : poolIdentifiers ,
181188 } ) . then ( ( response : any ) => response . data . map ( ( entry : any ) => {
182189 return {
@@ -201,10 +208,17 @@ export class LiquidityPoolService extends BaseApiService {
201208 }
202209
203210 return axios . get ( url ) . then ( ( response : any ) => {
204- return response . data . map ( ( tick : any ) => {
205- tick . time *= 1000 ;
206-
207- return tick ;
211+ return response . data . map ( ( tickInfo : any ) => {
212+ return new Tick (
213+ tickInfo . liquidityPool ? this . responseToLiquidityPool ( tickInfo . liquidityPool ) : null ,
214+ tickInfo . resolution ,
215+ tickInfo . time * 1000 ,
216+ tickInfo . open ,
217+ tickInfo . high ,
218+ tickInfo . low ,
219+ tickInfo . close ,
220+ tickInfo . volume ,
221+ ) ;
208222 } ) ;
209223 } ) ;
210224 }
0 commit comments