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

error 501 rest api (v1beta1/balances) #11626

Closed
mshadowz opened this issue Apr 13, 2022 · 4 comments
Closed

error 501 rest api (v1beta1/balances) #11626

mshadowz opened this issue Apr 13, 2022 · 4 comments

Comments

@mshadowz
Copy link

im trying to get balance of uatom via Legacy REST API and it throws error 501 every time. tried with multiple accounts and still the same.

Request :
curl -X GET "https://api.cosmos.network/cosmos/bank/v1beta1/balances/account_address/uatom" -H "accept: application/json"

Response :
{
"code": 12,
"message": "Not Implemented",
"details": []
}

@alexanderbez
Copy link
Contributor

/cosmos/bank/v1beta1/balances/account_address isn't a legacy API -- it's the gRPC gateway API. It's also incorrect as there is no such endpoint.

You're looking for /cosmos/bank/v1beta1/balances/{address}/{denom} which you can find here: https://v1.cosmos.network/rpc/v0.41.4

@s4bs
Copy link

s4bs commented Apr 13, 2022

/cosmos/bank/v1beta1/balances/account_address isn't a legacy API -- it's the gRPC gateway API. It's also incorrect as there is no such endpoint.

You're looking for /cosmos/bank/v1beta1/balances/{address}/{denom} which you can find here: https://v1.cosmos.network/rpc/v0.41.4

@alexanderbez I'm having the same issue. /cosmos/bank/v1beta1/balances/{address} works fine, but /cosmos/bank/v1beta1/balances/{address}/{denom} does not.

I have the denom set to uatom, here's an example path that's throws the Not Implemented 501: /cosmos/bank/v1beta1/balances/cosmos156gqf9837u7d4c4678yt3rl4ls9c5vuuxyhkw6/uatom

@s4bs
Copy link

s4bs commented Apr 13, 2022

For posterity, I have found the solution. The path changed here, it is now cosmos/bank/v1beta1/balances/{address}/by_denom?denom={denom}.

@alexanderbez
Copy link
Contributor

Yup! That was to allow arbitrary denoms, such as IBC denoms.

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

3 participants