Class: ApiPaginatedResultAdapter<Data, AdaptedData, JSONData, Params>

moralis-monorepo / @moralisweb3/api-utils / ApiPaginatedResultAdapter

Class: ApiPaginatedResultAdapter<Data, AdaptedData, JSONData, Params>

@moralisweb3/api-utils.ApiPaginatedResultAdapter

The adapter for a paginated API result.

Type parameters

NameType
Dataextends PaginatedResult<unknown>
AdaptedDataAdaptedData
JSONDataJSONData
ParamsParams

Hierarchy

  • ApiResultAdapter<Data, AdaptedData, JSONData, Params>

    ApiPaginatedResultAdapter

Table of contents

Methods

Accessors

Methods

hasNext

hasNext(): boolean

Checks an existence of the next page.

Returns

boolean

true if a next page exists, otherwise false.


next

next(): Promise<ApiPaginatedResultAdapter<Data, AdaptedData, JSONData, Params>>

Gets a next page of the paginated result.

Returns

Promise<ApiPaginatedResultAdapter<Data, AdaptedData, JSONData, Params>>

a new instance of a paginated adapter.


toJSON

toJSON(): JSONData

Returns

JSONData

the result in the JSON format.

Inherited from

ApiResultAdapter.toJSON


format

format(formatType): Data

Parameters

NameType
formatTypeRAW

Returns

Data

the result in the raw format.

Inherited from

ApiResultAdapter.format

format(formatType): unknown

Parameters

NameType
formatTypeJSON

Returns

unknown

athe result in the JSON format.

Inherited from

ApiResultAdapter.format

format(formatType): AdaptedData

Parameters

NameType
formatTypeNORMAL

Returns

AdaptedData

the result adapted into SDK types.

Inherited from

ApiResultAdapter.format

Accessors

pagination

get pagination(): Object

Returns

Object

an info about pagination.

NameType
totalnumber
pagenumber
pageSizenumber
cursorstring

raw

get raw(): Data

Returns

Data

a raw data from the API.

Inherited from

ApiResultAdapter.raw


result

get result(): AdaptedData

Returns

AdaptedData

the result adapted into SDK types.

Inherited from

ApiResultAdapter.result


Did this page help you?