sei-chain icon indicating copy to clipboard operation
sei-chain copied to clipboard

REST route endpoint standardization

Open codebycarson opened this issue 1 year ago • 1 comments

Describe your changes and provide context

Currently, there is in-congruency in the Sei REST API endpoint’s routes for all the custom sei-protocol modules.

Typically REST endpoints have the format /{org}/{module}/{version}/, for example “/cosmwasm/wasm/v1/” or “/cosmos/feegrant/v1beta1/*”.

IBC routes have the format /{org}/{package}/{module}/{version}/, such as IBC “/ibc/apps/transfer/v1/”.

Some of the Sei routes use “sei-chain” as the package, while others use “seichain”. Some have “sei-protocol” as the org prefix, while others do not have an org prefix. Only mint contains versions, while the others do not.

This PR standardizes the REST routes and proto package names to be /org/module/version/** with "sei" as the org.

Example:

Old route: http://localhost:1317/sei-protocol/sei-chain/oracle/slash_window

New route: http://localhost:1317/sei/oracle/v1/slash_window

It is important to note that for backwards compatibility the old routes have been kept in this version. Once merged, docs and integration guides will be updated to use the newer routes formats.

Testing performed to validate your change

Tested locally on all custom module endpoints by two separate people

codebycarson avatar Jul 29 '24 16:07 codebycarson

So this adds additional routes while keeping existing ones for compatibility?

cordt-sei avatar Sep 12 '24 03:09 cordt-sei