anoma / namada

Rust implementation of Namada, a Proof-of-Stake L1 for interchain asset-agnostic privacy
https://namada.net
GNU General Public License v3.0
2.39k stars 945 forks source link

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

Open adrianbrink opened 10 months ago

adrianbrink commented 10 months ago

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.

cwgoes commented 10 months ago

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?

adrianbrink commented 10 months ago

To make Keplr and Mintscan integration as easy as possible.

cwgoes commented 10 months ago

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

adrianbrink commented 10 months ago
/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 commented 10 months ago

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
cwgoes commented 10 months ago

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.

tzemanovic commented 3 months ago

@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

cwgoes commented 2 weeks ago

Unclear to me if we actually still need this. @adrianbrink Do you know?