omgnetwork / elixir-omg

OMG-Network repository of Watcher and Watcher Info
https://omg.network
Apache License 2.0
211 stars 59 forks source link

Enable transaction count by address. #1415

Open kalouo opened 4 years ago

kalouo commented 4 years ago

Open question whether we implement this on an existing endpoint (transaction.all) or a new one.

It would mainly be to enable the block explorer use case of showing transactions for a given address.

Screen Shot 2563-03-23 at 14 28 16

Related to: https://github.com/omisego/blockexplorer/issues/149

jrhite commented 4 years ago

@okalouti

IMHO, total number of txns should be returned from this and any pageable list API endpoint. So yes, I think it belongs on this endpoint.

It might also make sense to include txn count in other API endpoints as well, depending on context...

Regarding list API endpoints see this project here: https://github.com/swimlane/ngx-datatable/blob/master/src/app/paging/paging-server.component.ts#L33-L35

For paging: page number, page size and total number of elements are often standard.

swimlane/ngx-datatable - is a pretty good example of working with list API endpoints. It allows for paging, filtering and sorting. And it allows for this to be done on client or server-side (bigger datasets done server-side, smaller ones client side).