namada icon indicating copy to clipboard operation
namada copied to clipboard

Shims, shims, shims! - pretend to have a cosmos-sdk compatible API surface

Open adrianbrink opened this issue 1 year ago • 8 comments

Integrations are easier if Namada exposes an RPC (generally an API) surface that is exactly the same as the cosmos-sdk.

We can shim this.

adrianbrink avatar Nov 05 '23 14:11 adrianbrink

Which interfaces do we specifically want to be shimmed?

Another way to answer this question, at least in part: what existing Cosmos software do we want to build shims for, specifically?

cwgoes avatar Nov 05 '23 15:11 cwgoes

To make Keplr and Mintscan integration as easy as possible.

adrianbrink avatar Nov 05 '23 16:11 adrianbrink

Can we find out the specific APIs/interfaces we must shim in order to make those two work?

cwgoes avatar Nov 05 '23 17:11 cwgoes

/cosmos/bank/v1beta1/balances/{address}
/cosmos/distribution/v1beta1/delegators/{address}/rewards
/cosmos/staking/v1beta1/delegations/{address}
/cosmos/staking/v1beta1/validators
/cosmos/staking/v1beta1/delegators/{address}/unbonding_delegations
/cosmos/staking/v1beta1/validators/{address}
/cosmos/gov/v1beta1/proposals
/cosmos/gov/v1beta1/proposals/{proposalId}
/cosmos/gov/v1beta1/proposals/{proposalId}/votes/{address}
/cosmos/gov/v1beta1/proposals/{proposalId}/tally
/ibc/apps/transfer/v1/denom_traces/{hash}
/ibc/core/channel/v1/channels/{channelId}/ports/{portId}/client_state

adrianbrink avatar Nov 07 '23 10:11 adrianbrink

These must be available.

/cosmos/bank/v1beta1/balances/${bech32Address}?pagination.limit=1000
/cosmos/auth/v1beta1/accounts/${address}
POST /cosmos/tx/v1beta1/txs
POST /cosmos/tx/v1beta1/simulate

adrianbrink avatar Nov 07 '23 13:11 adrianbrink

The queries are one thing, but it won't be possible to simulate Cosmos transaction execution, we don't have the same signed bytes, transaction format, etc. What does Mintscan need that for, anyways? For Keplr it makes sense, but we will need them to implement some custom code, this part is unavoidable.

cwgoes avatar Nov 07 '23 13:11 cwgoes

@adrianbrink do you know if the pagination is needed? We don't have labeled optional args in our router yet so it would be easier to do without

tzemanovic avatar May 15 '24 13:05 tzemanovic