Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy endpoint /txs with stargate v0.44 keplr transaction fails with basic send-token #167

Closed
cybermelons opened this issue Oct 20, 2021 · 9 comments

Comments

@cybermelons
Copy link

For a chain built with cosmos sdk v0.44, I can't send tokens to another wallet. Keplr returns a 501 from attempting to make a request to localhost:1317/txs. Seems like transactions don't get broadcasted to the new endpoint.

background.bundle.js:32 

       POST http://localhost:1317/txs 501 (Not Implemented)

My keplr extension is a 0.9.4 (latest in chrome store at this writing).

I noticed some comments about relevant stargate changes mentioned here.

This doc page says

For Cosmos SDK blockchains using cosmos-sdk v0.4+. (However, even if the stargate isn't set, Keplr will query "/cosmos/base/tendermint/v1beta1/node_info" to check if it succeeds.

But the network tab in chrome dev tools never shows that node_info endpoint ever being queried.

How do we workaround this or should we just wait for a fix on keplr?

@Thunnini
Copy link
Member

#163
All the basics are implemented.
As expected, it should check the POST /txs endpoint and automatically add the "no-legacy-stdTx" feature if "Not Implemented". But if that doesn't work, try manually adding "no-legacy-stdTx" to your chain's features

@cybermelons
Copy link
Author

It worked. I had to add features: ['no-legacy-stdTx'], to my config.

@daniel-farina
Copy link

@Thunnini
Follow up on this, a brand new starport app works fine with the app's wallet but Keplr is giving us 500 error.

More details here:

ignite/web#128 (comment)
Step by step to reproduce there and a live server to test it with.

Where was the no-legacy-stdTx setting added @cybermelons ?

@cybermelons
Copy link
Author

cybermelons commented Nov 10, 2021

Where was the no-legacy-stdTx setting added @cybermelons ?

You'd want to specify it as a feature when your app suggests its chain to keplr

The osmosis frontend does it here: https://github.com/osmosis-labs/osmosis-frontend/blob/master/src/config.ts#L916

in your own code, it'd look something like

window.keplr.experimentalSuggestChain({

                features: ['no-legacy-stdTx'],

                chainId: "osmosis-1",
                chainName: "osmosis",
                rpc: ...,
                rest: ...,
                // Staking coin information
                stakeCurrency: {
                    // Coin denomination to be displayed to the user.
                    coinDenom: "OSMO",
                    // Actual denom (i.e. uatom, uscrt) used by the blockchain.
                    coinMinimalDenom: "uosmo",
                    // # of decimal points to convert minimal denomination to user-facing denomination.
                    coinDecimals: 6,
...

@marinhoarthur
Copy link

marinhoarthur commented Nov 18, 2021

Since I'm using solely the extension to try to send token and getting the 501 error, the adding of such a flag via JS seems out of place as in where would I configure this if it's just the extension that I'm using and not via my web application?

Just to clarify: If I try to sign the transaction via my web application integrated with Keplr, I get success. If I try to make the transaction using only the extension, I get 501.

cc @Thunnini

image

@marinhoarthur
Copy link

marinhoarthur commented Nov 18, 2021

update:

I tried first removing the chain from Keplr and adding it again with the no-legacy-stdTx flag on. It worked.

Even then, shouldn't we look out for Keplr not auto adding that flag? Maybe to avoid future incompatibilities like this?

@daniel-farina
Copy link

This is great news.
Thank you @marinhoarthur

@rodri-r
Copy link

rodri-r commented Nov 19, 2021

Adding the no-legacy-stdTx flag worked for us too!!

Thank you

no-legacy-stdTx-works

@terryyyyyy
Copy link

terryyyyyy commented Feb 16, 2022

Where was the no-legacy-stdTx setting added @cybermelons ?

You'd want to specify it as a feature when your app suggests its chain to keplr

The osmosis frontend does it here: https://github.com/osmosis-labs/osmosis-frontend/blob/master/src/config.ts#L916

in your own code, it'd look something like

window.keplr.experimentalSuggestChain({

                features: ['no-legacy-stdTx'],

                chainId: "osmosis-1",
                chainName: "osmosis",
                rpc: ...,
                rest: ...,
                // Staking coin information
                stakeCurrency: {
                    // Coin denomination to be displayed to the user.
                    coinDenom: "OSMO",
                    // Actual denom (i.e. uatom, uscrt) used by the blockchain.
                    coinMinimalDenom: "uosmo",
                    // # of decimal points to convert minimal denomination to user-facing denomination.
                    coinDecimals: 6,
...

I just use cosmos-hub4 chain, need i SuggestChain in the frontend code?
And if I use the api: 'https://api.cosmos.network/cosmos/tx/v1beta1/txs' to post transactions.How do I build the [tx_bytes] field?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants