RSS3-Network / Global-Indexer

In the vast RSS3 Network, the Global Indexer navigates requests with precision, it is a beacon in the byte-filled sea.
MIT License
13 stars 0 forks source link

feat!: update API responses to snake_case #219

Closed HenryQW closed 1 month ago

HenryQW commented 1 month ago

other than camelCase to snake_case for all fields,

response fields changes:

  1. totalChipAmounts -> total_chip_amount
  2. totalChipValues -> total_chip_value
  3. nodeAddrs -> node_addresses
  4. pnl -> profit_and_loss

query changes:

  1. itemsLimit -> item_limit for /epochs/distributions/:transaction_hash
  2. staker -> staker_address and node -> node_address for /stake/stakings
  3. node_address -> node_addresses for /nodes

endpoint path changes:

  1. /networks/:networks/list-workers -> /networks/:networks_name/list_workers
  2. /nodes/:id/hideTaxRate -> /nodes/:node_address/hide_tax_rate
  3. /snapshots/nodes/minTokensToStake -> /snapshots/nodes/min_tokens_to_stake
  4. /operation/:operator_address/profit -> /nodes/:node_address/operation/profit
  5. /snapshots/operators/profit -> /snapshots/nodes/operation/profit
  6. /get_endpoint_config -> /endpoint_config
HenryQW commented 1 month ago

~Auto-generate OpenAPI with https://github.com/a-h/rest~ ~We can live without examples for now.~

See a separate PR: https://github.com/RSS3-Network/Global-Indexer/pull/224

Songkeys commented 1 month ago

if it's using automated transformation, make sure we don't transform ID to i_d, APY to a_p_y, URL to u_r_l etc.

HenryQW commented 1 month ago

if it's using automated transformation, make sure we don't transform ID to i_d, APY to a_p_y, URL to u_r_l etc.

Yes that won't happen.

I've listed all the breaking changes that may affect the frontend.

HenryQW commented 1 month ago

pending https://github.com/RSS3-Network/Node/pull/297