Closed pyramation closed 1 year ago
editing the code this also works by editing the QueryPoolsResponse.decode
method
First import Pool
object deps
var _balancer = require("../pool-models/balancer/balancerPool");
update the decode method
decode: function decode(input, length) {
var reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
var end = length === undefined ? reader.len : reader.pos + length;
var message = createBaseQueryPoolsResponse();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
// message.pools.push(_any.Any.decode(reader, reader.uint32()));
message.pools.push(_balancer.Pool.decode(reader, reader.uint32()))
break;
case 2:
message.pagination = _pagination.PageResponse.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
Looks like decoding works automatically now. This is what the response looks like.
{ '$typeUrl': '/osmosis.gamm.v1beta1.Pool', address: 'osmo1zg4rlhp843nn3jk0uz2kvk4zzvp7wm6qpvlnuv7dnp4jlz9pmpws90duk8', id: Long { low: 82, high: 0, unsigned: true }, poolParams: { swapFee: '2000000000000000', exitFee: '0', smoothWeightChangeParams: undefined }, futurePoolGovernor: '24h', totalShares: { denom: 'gamm/pool/82', amount: '100000000000000000' }, poolAssets: [ [Object], [Object] ], totalWeight: '1073741824000000' },
Any chance you can update https://github.com/cosmology-tech/cosmology/tree/main/packages/core @pyramation ?
not sure if this is intended, but decoding RPC for Pools Request doesn't decode Pool automatically.