@cheqd/ts-proto
Version:
A TypeScript package for all transpiled cheqd ProtoBuf definitions.
453 lines • 15.9 kB
JavaScript
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.3.0
// protoc unknown
// source: feeabstraction/feeabs/v1beta1/query.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Coin } from "../../../cosmos/base/v1beta1/coin.js";
import { HostChainFeeAbsConfig } from "./proposal.js";
function createBaseQueryHostChainConfigRequest() {
return { ibcDenom: "" };
}
export const QueryHostChainConfigRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.ibcDenom !== "") {
writer.uint32(10).string(message.ibcDenom);
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryHostChainConfigRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.ibcDenom = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { ibcDenom: isSet(object.ibcDenom) ? globalThis.String(object.ibcDenom) : "" };
},
toJSON(message) {
const obj = {};
if (message.ibcDenom !== "") {
obj.ibcDenom = message.ibcDenom;
}
return obj;
},
create(base) {
return QueryHostChainConfigRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseQueryHostChainConfigRequest();
message.ibcDenom = object.ibcDenom ?? "";
return message;
},
};
function createBaseQueryHostChainConfigResponse() {
return { hostChainConfig: undefined };
}
export const QueryHostChainConfigResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.hostChainConfig !== undefined) {
HostChainFeeAbsConfig.encode(message.hostChainConfig, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryHostChainConfigResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.hostChainConfig = HostChainFeeAbsConfig.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
hostChainConfig: isSet(object.hostChainConfig)
? HostChainFeeAbsConfig.fromJSON(object.hostChainConfig)
: undefined,
};
},
toJSON(message) {
const obj = {};
if (message.hostChainConfig !== undefined) {
obj.hostChainConfig = HostChainFeeAbsConfig.toJSON(message.hostChainConfig);
}
return obj;
},
create(base) {
return QueryHostChainConfigResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseQueryHostChainConfigResponse();
message.hostChainConfig = (object.hostChainConfig !== undefined && object.hostChainConfig !== null)
? HostChainFeeAbsConfig.fromPartial(object.hostChainConfig)
: undefined;
return message;
},
};
function createBaseQueryOsmosisArithmeticTwapRequest() {
return { ibcDenom: "" };
}
export const QueryOsmosisArithmeticTwapRequest = {
encode(message, writer = new BinaryWriter()) {
if (message.ibcDenom !== "") {
writer.uint32(10).string(message.ibcDenom);
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryOsmosisArithmeticTwapRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.ibcDenom = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { ibcDenom: isSet(object.ibcDenom) ? globalThis.String(object.ibcDenom) : "" };
},
toJSON(message) {
const obj = {};
if (message.ibcDenom !== "") {
obj.ibcDenom = message.ibcDenom;
}
return obj;
},
create(base) {
return QueryOsmosisArithmeticTwapRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseQueryOsmosisArithmeticTwapRequest();
message.ibcDenom = object.ibcDenom ?? "";
return message;
},
};
function createBaseQueryOsmosisArithmeticTwapResponse() {
return { arithmeticTwap: "" };
}
export const QueryOsmosisArithmeticTwapResponse = {
encode(message, writer = new BinaryWriter()) {
if (message.arithmeticTwap !== "") {
writer.uint32(10).string(message.arithmeticTwap);
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryOsmosisArithmeticTwapResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.arithmeticTwap = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { arithmeticTwap: isSet(object.arithmeticTwap) ? globalThis.String(object.arithmeticTwap) : "" };
},
toJSON(message) {
const obj = {};
if (message.arithmeticTwap !== "") {
obj.arithmeticTwap = message.arithmeticTwap;
}
return obj;
},
create(base) {
return QueryOsmosisArithmeticTwapResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseQueryOsmosisArithmeticTwapResponse();
message.arithmeticTwap = object.arithmeticTwap ?? "";
return message;
},
};
function createBaseQueryFeeabsModuleBalacesRequest() {
return {};
}
export const QueryFeeabsModuleBalacesRequest = {
encode(_, writer = new BinaryWriter()) {
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryFeeabsModuleBalacesRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return {};
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return QueryFeeabsModuleBalacesRequest.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseQueryFeeabsModuleBalacesRequest();
return message;
},
};
function createBaseQueryFeeabsModuleBalacesResponse() {
return { balances: [], address: "" };
}
export const QueryFeeabsModuleBalacesResponse = {
encode(message, writer = new BinaryWriter()) {
for (const v of message.balances) {
Coin.encode(v, writer.uint32(10).fork()).join();
}
if (message.address !== "") {
writer.uint32(18).string(message.address);
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryFeeabsModuleBalacesResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.balances.push(Coin.decode(reader, reader.uint32()));
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.address = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
balances: globalThis.Array.isArray(object?.balances) ? object.balances.map((e) => Coin.fromJSON(e)) : [],
address: isSet(object.address) ? globalThis.String(object.address) : "",
};
},
toJSON(message) {
const obj = {};
if (message.balances?.length) {
obj.balances = message.balances.map((e) => Coin.toJSON(e));
}
if (message.address !== "") {
obj.address = message.address;
}
return obj;
},
create(base) {
return QueryFeeabsModuleBalacesResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseQueryFeeabsModuleBalacesResponse();
message.balances = object.balances?.map((e) => Coin.fromPartial(e)) || [];
message.address = object.address ?? "";
return message;
},
};
function createBaseAllQueryHostChainConfigRequest() {
return {};
}
export const AllQueryHostChainConfigRequest = {
encode(_, writer = new BinaryWriter()) {
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseAllQueryHostChainConfigRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return {};
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return AllQueryHostChainConfigRequest.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseAllQueryHostChainConfigRequest();
return message;
},
};
function createBaseAllQueryHostChainConfigResponse() {
return { allHostChainConfig: [] };
}
export const AllQueryHostChainConfigResponse = {
encode(message, writer = new BinaryWriter()) {
for (const v of message.allHostChainConfig) {
HostChainFeeAbsConfig.encode(v, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseAllQueryHostChainConfigResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.allHostChainConfig.push(HostChainFeeAbsConfig.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
allHostChainConfig: globalThis.Array.isArray(object?.allHostChainConfig)
? object.allHostChainConfig.map((e) => HostChainFeeAbsConfig.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.allHostChainConfig?.length) {
obj.allHostChainConfig = message.allHostChainConfig.map((e) => HostChainFeeAbsConfig.toJSON(e));
}
return obj;
},
create(base) {
return AllQueryHostChainConfigResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAllQueryHostChainConfigResponse();
message.allHostChainConfig = object.allHostChainConfig?.map((e) => HostChainFeeAbsConfig.fromPartial(e)) || [];
return message;
},
};
export const QueryServiceName = "feeabstraction.feeabs.v1beta1.Query";
export class QueryClientImpl {
rpc;
service;
constructor(rpc, opts) {
this.service = opts?.service || QueryServiceName;
this.rpc = rpc;
this.OsmosisArithmeticTwap = this.OsmosisArithmeticTwap.bind(this);
this.FeeabsModuleBalances = this.FeeabsModuleBalances.bind(this);
this.HostChainConfig = this.HostChainConfig.bind(this);
this.AllHostChainConfig = this.AllHostChainConfig.bind(this);
}
OsmosisArithmeticTwap(request) {
const data = QueryOsmosisArithmeticTwapRequest.encode(request).finish();
const promise = this.rpc.request(this.service, "OsmosisArithmeticTwap", data);
return promise.then((data) => QueryOsmosisArithmeticTwapResponse.decode(new BinaryReader(data)));
}
FeeabsModuleBalances(request) {
const data = QueryFeeabsModuleBalacesRequest.encode(request).finish();
const promise = this.rpc.request(this.service, "FeeabsModuleBalances", data);
return promise.then((data) => QueryFeeabsModuleBalacesResponse.decode(new BinaryReader(data)));
}
HostChainConfig(request) {
const data = QueryHostChainConfigRequest.encode(request).finish();
const promise = this.rpc.request(this.service, "HostChainConfig", data);
return promise.then((data) => QueryHostChainConfigResponse.decode(new BinaryReader(data)));
}
AllHostChainConfig(request) {
const data = AllQueryHostChainConfigRequest.encode(request).finish();
const promise = this.rpc.request(this.service, "AllHostChainConfig", data);
return promise.then((data) => AllQueryHostChainConfigResponse.decode(new BinaryReader(data)));
}
}
function isSet(value) {
return value !== null && value !== undefined;
}
//# sourceMappingURL=query.js.map