-
Notifications
You must be signed in to change notification settings - Fork 346
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
Duplication code #1524
Comments
Ideally I would want something like this. |
What if make https://github.com/cosmos/cosmjs/blob/v0.32.0/packages/stargate/src/stargateclient.ts#L200 |
The whole idea of those wrapper functions does not scale and needs to be abandoned at some point, for both queries and messages/transactions. This was already touched briefly in #1440. There is an experimental generic Client class that comes without them shown in #1486. So yeah, it was a good idea when this API was originally designed but we can't keep up with the amount of functionality and at the same time using the protobuf API directly got more convenient. |
Hi, why need such funcs?
https://github.com/cosmos/cosmjs/blob/v0.32.0/packages/stargate/src/stargateclient.ts#L333
It is not possible to just use them from inherited modules, than make public?
In our project our devs made same, and code looks duplicated https://github.com/cybercongress/soft3.js/blob/main/src/cyberclient.ts#L430
Or you can do:
public getAllBalances = this.forceGetQueryClient().bank.allBalances;
it will be shorter, and keep types correct.
What do you think?
The text was updated successfully, but these errors were encountered: