1717 * Catapult REST Endpoints
1818 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
1919 *
20- * The version of the OpenAPI document: 0.7.18
20+ * The version of the OpenAPI document: 0.7.19
2121 *
2222 *
2323 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -29,6 +29,7 @@ import localVarRequest = require('request');
2929import http = require( 'http' ) ;
3030
3131/* tslint:disable:no-unused-locals */
32+ import { AccountIds } from '../model/accountIds' ;
3233import { ModelError } from '../model/modelError' ;
3334import { MosaicIds } from '../model/mosaicIds' ;
3435import { MosaicInfoDTO } from '../model/mosaicInfoDTO' ;
@@ -205,6 +206,129 @@ export class MosaicRoutesApi {
205206 } ) ;
206207 } ) ;
207208 }
209+ /**
210+ * Gets an array of mosaics created for a given account address.
211+ * @summary Get mosaics created by an account
212+ * @param accountId Account public key or address.
213+ * @param pageSize Number of transactions to return for each request.
214+ * @param id Mosaic identifier up to which transactions are returned.
215+ */
216+ public async getMosaicsFromAccount ( accountId : string , pageSize ?: number , id ?: string , options : { headers : { [ name : string ] : string } } = { headers : { } } ) : Promise < { response : http . ClientResponse ; body : Array < MosaicInfoDTO > ; } > {
217+ const localVarPath = this . basePath + '/account/{accountId}/mosaics'
218+ . replace ( '{' + 'accountId' + '}' , encodeURIComponent ( String ( accountId ) ) ) ;
219+ let localVarQueryParameters : any = { } ;
220+ let localVarHeaderParams : any = ( < any > Object ) . assign ( { } , this . defaultHeaders ) ;
221+ let localVarFormParams : any = { } ;
222+
223+ // verify required parameter 'accountId' is not null or undefined
224+ if ( accountId === null || accountId === undefined ) {
225+ throw new Error ( 'Required parameter accountId was null or undefined when calling getMosaicsFromAccount.' ) ;
226+ }
227+
228+ if ( pageSize !== undefined ) {
229+ localVarQueryParameters [ 'pageSize' ] = ObjectSerializer . serialize ( pageSize , "number" ) ;
230+ }
231+
232+ if ( id !== undefined ) {
233+ localVarQueryParameters [ 'id' ] = ObjectSerializer . serialize ( id , "string" ) ;
234+ }
235+
236+ ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ;
237+
238+ let localVarUseFormData = false ;
239+
240+ let localVarRequestOptions : localVarRequest . Options = {
241+ method : 'GET' ,
242+ qs : localVarQueryParameters ,
243+ headers : localVarHeaderParams ,
244+ uri : localVarPath ,
245+ useQuerystring : this . _useQuerystring ,
246+ json : true ,
247+ } ;
248+
249+ let authenticationPromise = Promise . resolve ( ) ;
250+ authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . default . applyToRequest ( localVarRequestOptions ) ) ;
251+ return authenticationPromise . then ( ( ) => {
252+ if ( Object . keys ( localVarFormParams ) . length ) {
253+ if ( localVarUseFormData ) {
254+ ( < any > localVarRequestOptions ) . formData = localVarFormParams ;
255+ } else {
256+ localVarRequestOptions . form = localVarFormParams ;
257+ }
258+ }
259+ return new Promise < { response : http . ClientResponse ; body : Array < MosaicInfoDTO > ; } > ( ( resolve , reject ) => {
260+ localVarRequest ( localVarRequestOptions , ( error , response , body ) => {
261+ if ( error ) {
262+ reject ( error ) ;
263+ } else {
264+ body = ObjectSerializer . deserialize ( body , "Array<MosaicInfoDTO>" ) ;
265+ if ( response . statusCode && response . statusCode >= 200 && response . statusCode <= 299 ) {
266+ resolve ( { response : response , body : body } ) ;
267+ } else {
268+ reject ( { response : {
269+ statusCode : response . statusCode ,
270+ statusMessage : response . statusMessage ,
271+ } , body : response . body } ) ;
272+ }
273+ }
274+ } ) ;
275+ } ) ;
276+ } ) ;
277+ }
278+ /**
279+ * Gets mosaics created for a given array of addresses.
280+ * @summary Get mosaics created for given array of addresses
281+ * @param accountIds
282+ */
283+ public async getMosaicsFromAccounts ( accountIds ?: AccountIds , options : { headers : { [ name : string ] : string } } = { headers : { } } ) : Promise < { response : http . ClientResponse ; body : Array < MosaicInfoDTO > ; } > {
284+ const localVarPath = this . basePath + '/account/mosaics' ;
285+ let localVarQueryParameters : any = { } ;
286+ let localVarHeaderParams : any = ( < any > Object ) . assign ( { } , this . defaultHeaders ) ;
287+ let localVarFormParams : any = { } ;
288+
289+ ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ;
290+
291+ let localVarUseFormData = false ;
292+
293+ let localVarRequestOptions : localVarRequest . Options = {
294+ method : 'POST' ,
295+ qs : localVarQueryParameters ,
296+ headers : localVarHeaderParams ,
297+ uri : localVarPath ,
298+ useQuerystring : this . _useQuerystring ,
299+ json : true ,
300+ body : ObjectSerializer . serialize ( accountIds , "AccountIds" )
301+ } ;
302+
303+ let authenticationPromise = Promise . resolve ( ) ;
304+ authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . default . applyToRequest ( localVarRequestOptions ) ) ;
305+ return authenticationPromise . then ( ( ) => {
306+ if ( Object . keys ( localVarFormParams ) . length ) {
307+ if ( localVarUseFormData ) {
308+ ( < any > localVarRequestOptions ) . formData = localVarFormParams ;
309+ } else {
310+ localVarRequestOptions . form = localVarFormParams ;
311+ }
312+ }
313+ return new Promise < { response : http . ClientResponse ; body : Array < MosaicInfoDTO > ; } > ( ( resolve , reject ) => {
314+ localVarRequest ( localVarRequestOptions , ( error , response , body ) => {
315+ if ( error ) {
316+ reject ( error ) ;
317+ } else {
318+ body = ObjectSerializer . deserialize ( body , "Array<MosaicInfoDTO>" ) ;
319+ if ( response . statusCode && response . statusCode >= 200 && response . statusCode <= 299 ) {
320+ resolve ( { response : response , body : body } ) ;
321+ } else {
322+ reject ( { response : {
323+ statusCode : response . statusCode ,
324+ statusMessage : response . statusMessage ,
325+ } , body : response . body } ) ;
326+ }
327+ }
328+ } ) ;
329+ } ) ;
330+ } ) ;
331+ }
208332 /**
209333 * Returns friendly names for mosaics.
210334 * @summary Get readable names for a set of mosaics
0 commit comments