@@ -29,6 +29,7 @@ import { AccountRepository } from './AccountRepository';
2929import { Http } from './Http' ;
3030import { QueryParams } from './QueryParams' ;
3131import { CreateTransactionFromDTO } from './transaction/CreateTransactionFromDTO' ;
32+ import { TransactionSearchCriteria } from './TransactionSearchCriteria' ;
3233
3334/**
3435 * Account http repository.
@@ -108,6 +109,7 @@ export class AccountHttp extends Http implements AccountRepository {
108109 UInt64 . fromNumericString ( dto . account . importance ) ,
109110 UInt64 . fromNumericString ( dto . account . importanceHeight ) ,
110111 ) ;
112+
111113 }
112114
113115 /**
@@ -116,18 +118,18 @@ export class AccountHttp extends Http implements AccountRepository {
116118 * @param queryParams - (Optional) Query params
117119 * @returns Observable<Transaction[]>
118120 */
119- public getAccountTransactions ( address : Address , queryParams ?: QueryParams ) : Observable < Transaction [ ] > {
121+ public getAccountTransactions ( address : Address , queryParams ?: TransactionSearchCriteria ) : Observable < Transaction [ ] > {
120122 return observableFrom (
121123 this . accountRoutesApi . getAccountConfirmedTransactions ( address . plain ( ) ,
122- this . queryParams ( queryParams ) . pageSize ,
123- this . queryParams ( queryParams ) . id ,
124- this . queryParams ( queryParams ) . order ,
125- this . queryParams ( queryParams ) . transactionType ) ) . pipe (
126- map ( ( { body} ) => body . map ( ( transactionDTO ) => {
127- return CreateTransactionFromDTO ( transactionDTO ) ;
128- } ) ) ,
129- catchError ( ( error ) => throwError ( this . errorHandling ( error ) ) ) ,
130- ) ;
124+ this . transactionSearchCriteria ( queryParams ) . pageSize ,
125+ this . transactionSearchCriteria ( queryParams ) . id ,
126+ this . transactionSearchCriteria ( queryParams ) . ordering ,
127+ this . transactionSearchCriteria ( queryParams ) . type ) ) . pipe (
128+ map ( ( { body} ) => body . map ( ( transactionDTO ) => {
129+ return CreateTransactionFromDTO ( transactionDTO ) ;
130+ } ) ) ,
131+ catchError ( ( error ) => throwError ( this . errorHandling ( error ) ) ) ,
132+ ) ;
131133 }
132134
133135 /**
@@ -137,13 +139,13 @@ export class AccountHttp extends Http implements AccountRepository {
137139 * @param queryParams - (Optional) Query params
138140 * @returns Observable<Transaction[]>
139141 */
140- public getAccountIncomingTransactions ( address : Address , queryParams ?: QueryParams ) : Observable < Transaction [ ] > {
142+ public getAccountIncomingTransactions ( address : Address , queryParams ?: TransactionSearchCriteria ) : Observable < Transaction [ ] > {
141143 return observableFrom (
142144 this . accountRoutesApi . getAccountIncomingTransactions ( address . plain ( ) ,
143- this . queryParams ( queryParams ) . pageSize ,
144- this . queryParams ( queryParams ) . id ,
145- this . queryParams ( queryParams ) . order ) ,
146- this . queryParams ( queryParams ) . transactionType ) . pipe (
145+ this . transactionSearchCriteria ( queryParams ) . pageSize ,
146+ this . transactionSearchCriteria ( queryParams ) . id ,
147+ this . transactionSearchCriteria ( queryParams ) . ordering ) ,
148+ this . transactionSearchCriteria ( queryParams ) . type ) . pipe (
147149 map ( ( { body} ) => body . map ( ( transactionDTO ) => {
148150 return CreateTransactionFromDTO ( transactionDTO ) ;
149151 } ) ) ,
@@ -158,13 +160,13 @@ export class AccountHttp extends Http implements AccountRepository {
158160 * @param queryParams - (Optional) Query params
159161 * @returns Observable<Transaction[]>
160162 */
161- public getAccountOutgoingTransactions ( address : Address , queryParams ?: QueryParams ) : Observable < Transaction [ ] > {
163+ public getAccountOutgoingTransactions ( address : Address , queryParams ?: TransactionSearchCriteria ) : Observable < Transaction [ ] > {
162164 return observableFrom (
163165 this . accountRoutesApi . getAccountOutgoingTransactions ( address . plain ( ) ,
164- this . queryParams ( queryParams ) . pageSize ,
165- this . queryParams ( queryParams ) . id ,
166- this . queryParams ( queryParams ) . order ) ,
167- this . queryParams ( queryParams ) . transactionType ) . pipe (
166+ this . transactionSearchCriteria ( queryParams ) . pageSize ,
167+ this . transactionSearchCriteria ( queryParams ) . id ,
168+ this . transactionSearchCriteria ( queryParams ) . ordering ) ,
169+ this . transactionSearchCriteria ( queryParams ) . type ) . pipe (
168170 map ( ( { body} ) => body . map ( ( transactionDTO ) => {
169171 return CreateTransactionFromDTO ( transactionDTO ) ;
170172 } ) ) ,
@@ -180,13 +182,13 @@ export class AccountHttp extends Http implements AccountRepository {
180182 * @param queryParams - (Optional) Query params
181183 * @returns Observable<Transaction[]>
182184 */
183- public getAccountUnconfirmedTransactions ( address : Address , queryParams ?: QueryParams ) : Observable < Transaction [ ] > {
185+ public getAccountUnconfirmedTransactions ( address : Address , queryParams ?: TransactionSearchCriteria ) : Observable < Transaction [ ] > {
184186 return observableFrom (
185187 this . accountRoutesApi . getAccountUnconfirmedTransactions ( address . plain ( ) ,
186- this . queryParams ( queryParams ) . pageSize ,
187- this . queryParams ( queryParams ) . id ,
188- this . queryParams ( queryParams ) . order ) ,
189- this . queryParams ( queryParams ) . transactionType ) . pipe (
188+ this . transactionSearchCriteria ( queryParams ) . pageSize ,
189+ this . transactionSearchCriteria ( queryParams ) . id ,
190+ this . transactionSearchCriteria ( queryParams ) . ordering ) ,
191+ this . transactionSearchCriteria ( queryParams ) . type ) . pipe (
190192 map ( ( { body} ) => body . map ( ( transactionDTO ) => {
191193 return CreateTransactionFromDTO ( transactionDTO ) ;
192194 } ) ) ,
@@ -201,13 +203,13 @@ export class AccountHttp extends Http implements AccountRepository {
201203 * @param queryParams - (Optional) Query params
202204 * @returns Observable<AggregateTransaction[]>
203205 */
204- public getAccountPartialTransactions ( address : Address , queryParams ?: QueryParams ) : Observable < AggregateTransaction [ ] > {
206+ public getAccountPartialTransactions ( address : Address , queryParams ?: TransactionSearchCriteria ) : Observable < AggregateTransaction [ ] > {
205207 return observableFrom (
206208 this . accountRoutesApi . getAccountPartialTransactions ( address . plain ( ) ,
207- this . queryParams ( queryParams ) . pageSize ,
208- this . queryParams ( queryParams ) . id ,
209- this . queryParams ( queryParams ) . order ) ,
210- this . queryParams ( queryParams ) . transactionType ) . pipe (
209+ this . transactionSearchCriteria ( queryParams ) . pageSize ,
210+ this . transactionSearchCriteria ( queryParams ) . id ,
211+ this . transactionSearchCriteria ( queryParams ) . ordering ) ,
212+ this . transactionSearchCriteria ( queryParams ) . type ) . pipe (
211213 map ( ( { body} ) => body . map ( ( transactionDTO ) => {
212214 return CreateTransactionFromDTO ( transactionDTO ) as AggregateTransaction ;
213215 } ) ) ,
0 commit comments