Stargate: no pagination available for Bank/TotalSupply
See original GitHub issueI am trying to paginate my call to TotalSupply in stargate’s Bank module but it returns the same response whether I pass pagination params or not:
In this screenshot I’m showing what I’ve done to create my own BankExtension, since stargate’s own one does not relay pagination details to the underlying call. I’ve had success creating my own extensions before, and I’ve verified that passing a pagination key in this way works when calling Staking/ValidatorDelegations, so it seems that this is purely an issue on the RPC node itself. The response is always the same (maxed out at 100) whether I pass pagination details or not.
The reason I think it’s on the RPC side is that stargate’s method of calling these endpoints is exactly the same:
Staking/ValidatorDelegations
ValidatorDelegations(request) {
const data = exports.QueryValidatorDelegationsRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "ValidatorDelegations", data);
return promise.then((data) => exports.QueryValidatorDelegationsResponse.decode(new minimal_1.default.Reader(data)));
}
Bank/TotalSupply
TotalSupply(request) {
const data = exports.QueryTotalSupplyRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "TotalSupply", data);
return promise.then((data) => exports.QueryTotalSupplyResponse.decode(new minimal_1.default.Reader(data)));
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top GitHub Comments
The problem was purely client side, but unfortunately Stargate doesn’t support specifying any pagination params, here’s my custom solution:
Please thumbs up this or something so people know to use this
It looks like I didn’t form the pagination object correctly