import { PageRequest, PageResponse } from "../../cosmos/base/query/v1beta1/pagination"; import { Coin } from "../../cosmos/base/v1beta1/coin"; import { Gauge } from "./gauge"; import { Duration } from "../../google/protobuf/duration"; import { Rpc } from "@osmonauts/helpers"; import * as _m0 from "protobufjs/minimal"; import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsResponse, ModuleDistributedCoinsRequest, ModuleDistributedCoinsResponse, GaugeByIDRequest, GaugeByIDResponse, GaugesRequest, GaugesResponse, ActiveGaugesRequest, ActiveGaugesResponse, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomResponse, UpcomingGaugesRequest, UpcomingGaugesResponse, UpcomingGaugesPerDenomRequest, UpcomingGaugesPerDenomResponse, RewardsEstRequest, RewardsEstResponse, QueryLockableDurationsRequest, QueryLockableDurationsResponse } from "./query"; /** Query defines the RPC service */ export interface Query { moduleToDistributeCoins(request: ModuleToDistributeCoinsRequest): Promise; /*returns coins that is going to be distributed*/ moduleDistributedCoins(request: ModuleDistributedCoinsRequest): Promise; /*returns coins that are distributed by module so far*/ gaugeByID(request: GaugeByIDRequest): Promise; /*returns Gauge by id*/ gauges(request: GaugesRequest): Promise; /*returns gauges both upcoming and active*/ activeGauges(request: ActiveGaugesRequest): Promise; /*returns active gauges*/ activeGaugesPerDenom(request: ActiveGaugesPerDenomRequest): Promise; /*returns active gauges per denom*/ upcomingGauges(request: UpcomingGaugesRequest): Promise; /*returns scheduled gauges*/ upcomingGaugesPerDenom(request: UpcomingGaugesPerDenomRequest): Promise; /*returns scheduled gauges per denom*/ rewardsEst(request: RewardsEstRequest): Promise; /*RewardsEst returns an estimate of the rewards at a future specific time. The querier either provides an address or a set of locks for which they want to find the associated rewards.*/ lockableDurations(request: QueryLockableDurationsRequest): Promise; /*returns lockable durations that are valid to give incentives*/ } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.moduleToDistributeCoins = this.moduleToDistributeCoins.bind(this); this.moduleDistributedCoins = this.moduleDistributedCoins.bind(this); this.gaugeByID = this.gaugeByID.bind(this); this.gauges = this.gauges.bind(this); this.activeGauges = this.activeGauges.bind(this); this.activeGaugesPerDenom = this.activeGaugesPerDenom.bind(this); this.upcomingGauges = this.upcomingGauges.bind(this); this.upcomingGaugesPerDenom = this.upcomingGaugesPerDenom.bind(this); this.rewardsEst = this.rewardsEst.bind(this); this.lockableDurations = this.lockableDurations.bind(this); } moduleToDistributeCoins(request: ModuleToDistributeCoinsRequest): Promise { const data = ModuleToDistributeCoinsRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.incentives.Query", "ModuleToDistributeCoins", data); return promise.then(data => ModuleToDistributeCoinsResponse.decode(new _m0.Reader(data))); } moduleDistributedCoins(request: ModuleDistributedCoinsRequest): Promise { const data = ModuleDistributedCoinsRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.incentives.Query", "ModuleDistributedCoins", data); return promise.then(data => ModuleDistributedCoinsResponse.decode(new _m0.Reader(data))); } gaugeByID(request: GaugeByIDRequest): Promise { const data = GaugeByIDRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.incentives.Query", "GaugeByID", data); return promise.then(data => GaugeByIDResponse.decode(new _m0.Reader(data))); } gauges(request: GaugesRequest): Promise { const data = GaugesRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.incentives.Query", "Gauges", data); return promise.then(data => GaugesResponse.decode(new _m0.Reader(data))); } activeGauges(request: ActiveGaugesRequest): Promise { const data = ActiveGaugesRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.incentives.Query", "ActiveGauges", data); return promise.then(data => ActiveGaugesResponse.decode(new _m0.Reader(data))); } activeGaugesPerDenom(request: ActiveGaugesPerDenomRequest): Promise { const data = ActiveGaugesPerDenomRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.incentives.Query", "ActiveGaugesPerDenom", data); return promise.then(data => ActiveGaugesPerDenomResponse.decode(new _m0.Reader(data))); } upcomingGauges(request: UpcomingGaugesRequest): Promise { const data = UpcomingGaugesRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.incentives.Query", "UpcomingGauges", data); return promise.then(data => UpcomingGaugesResponse.decode(new _m0.Reader(data))); } upcomingGaugesPerDenom(request: UpcomingGaugesPerDenomRequest): Promise { const data = UpcomingGaugesPerDenomRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.incentives.Query", "UpcomingGaugesPerDenom", data); return promise.then(data => UpcomingGaugesPerDenomResponse.decode(new _m0.Reader(data))); } rewardsEst(request: RewardsEstRequest): Promise { const data = RewardsEstRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.incentives.Query", "RewardsEst", data); return promise.then(data => RewardsEstResponse.decode(new _m0.Reader(data))); } lockableDurations(request: QueryLockableDurationsRequest): Promise { const data = QueryLockableDurationsRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.incentives.Query", "LockableDurations", data); return promise.then(data => QueryLockableDurationsResponse.decode(new _m0.Reader(data))); } }