@cheqd/ts-proto
Version:
A TypeScript package for all transpiled cheqd ProtoBuf definitions.
409 lines • 14.6 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/proposal.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
/** HostChainFeeAbsStatus */
export var HostChainFeeAbsStatus;
(function (HostChainFeeAbsStatus) {
HostChainFeeAbsStatus[HostChainFeeAbsStatus["UPDATED"] = 0] = "UPDATED";
HostChainFeeAbsStatus[HostChainFeeAbsStatus["OUTDATED"] = 1] = "OUTDATED";
HostChainFeeAbsStatus[HostChainFeeAbsStatus["FROZEN"] = 2] = "FROZEN";
HostChainFeeAbsStatus[HostChainFeeAbsStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(HostChainFeeAbsStatus || (HostChainFeeAbsStatus = {}));
export function hostChainFeeAbsStatusFromJSON(object) {
switch (object) {
case 0:
case "UPDATED":
return HostChainFeeAbsStatus.UPDATED;
case 1:
case "OUTDATED":
return HostChainFeeAbsStatus.OUTDATED;
case 2:
case "FROZEN":
return HostChainFeeAbsStatus.FROZEN;
case -1:
case "UNRECOGNIZED":
default:
return HostChainFeeAbsStatus.UNRECOGNIZED;
}
}
export function hostChainFeeAbsStatusToJSON(object) {
switch (object) {
case HostChainFeeAbsStatus.UPDATED:
return "UPDATED";
case HostChainFeeAbsStatus.OUTDATED:
return "OUTDATED";
case HostChainFeeAbsStatus.FROZEN:
return "FROZEN";
case HostChainFeeAbsStatus.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
function createBaseHostChainFeeAbsConfig() {
return { ibcDenom: "", osmosisPoolTokenDenomIn: "", poolId: 0n, status: 0 };
}
export const HostChainFeeAbsConfig = {
encode(message, writer = new BinaryWriter()) {
if (message.ibcDenom !== "") {
writer.uint32(10).string(message.ibcDenom);
}
if (message.osmosisPoolTokenDenomIn !== "") {
writer.uint32(18).string(message.osmosisPoolTokenDenomIn);
}
if (message.poolId !== 0n) {
if (BigInt.asUintN(64, message.poolId) !== message.poolId) {
throw new globalThis.Error("value provided for field message.poolId of type uint64 too large");
}
writer.uint32(24).uint64(message.poolId);
}
if (message.status !== 0) {
writer.uint32(32).int32(message.status);
}
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 = createBaseHostChainFeeAbsConfig();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.ibcDenom = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.osmosisPoolTokenDenomIn = reader.string();
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.poolId = reader.uint64();
continue;
}
case 4: {
if (tag !== 32) {
break;
}
message.status = reader.int32();
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) : "",
osmosisPoolTokenDenomIn: isSet(object.osmosisPoolTokenDenomIn)
? globalThis.String(object.osmosisPoolTokenDenomIn)
: "",
poolId: isSet(object.poolId) ? BigInt(object.poolId) : 0n,
status: isSet(object.status) ? hostChainFeeAbsStatusFromJSON(object.status) : 0,
};
},
toJSON(message) {
const obj = {};
if (message.ibcDenom !== "") {
obj.ibcDenom = message.ibcDenom;
}
if (message.osmosisPoolTokenDenomIn !== "") {
obj.osmosisPoolTokenDenomIn = message.osmosisPoolTokenDenomIn;
}
if (message.poolId !== 0n) {
obj.poolId = message.poolId.toString();
}
if (message.status !== 0) {
obj.status = hostChainFeeAbsStatusToJSON(message.status);
}
return obj;
},
create(base) {
return HostChainFeeAbsConfig.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseHostChainFeeAbsConfig();
message.ibcDenom = object.ibcDenom ?? "";
message.osmosisPoolTokenDenomIn = object.osmosisPoolTokenDenomIn ?? "";
message.poolId = object.poolId ?? 0n;
message.status = object.status ?? 0;
return message;
},
};
function createBaseAddHostZoneProposal() {
return { title: "", description: "", hostChainConfig: undefined };
}
export const AddHostZoneProposal = {
encode(message, writer = new BinaryWriter()) {
if (message.title !== "") {
writer.uint32(10).string(message.title);
}
if (message.description !== "") {
writer.uint32(18).string(message.description);
}
if (message.hostChainConfig !== undefined) {
HostChainFeeAbsConfig.encode(message.hostChainConfig, writer.uint32(26).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 = createBaseAddHostZoneProposal();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.title = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.description = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
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 {
title: isSet(object.title) ? globalThis.String(object.title) : "",
description: isSet(object.description) ? globalThis.String(object.description) : "",
hostChainConfig: isSet(object.hostChainConfig)
? HostChainFeeAbsConfig.fromJSON(object.hostChainConfig)
: undefined,
};
},
toJSON(message) {
const obj = {};
if (message.title !== "") {
obj.title = message.title;
}
if (message.description !== "") {
obj.description = message.description;
}
if (message.hostChainConfig !== undefined) {
obj.hostChainConfig = HostChainFeeAbsConfig.toJSON(message.hostChainConfig);
}
return obj;
},
create(base) {
return AddHostZoneProposal.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAddHostZoneProposal();
message.title = object.title ?? "";
message.description = object.description ?? "";
message.hostChainConfig = (object.hostChainConfig !== undefined && object.hostChainConfig !== null)
? HostChainFeeAbsConfig.fromPartial(object.hostChainConfig)
: undefined;
return message;
},
};
function createBaseDeleteHostZoneProposal() {
return { title: "", description: "", ibcDenom: "" };
}
export const DeleteHostZoneProposal = {
encode(message, writer = new BinaryWriter()) {
if (message.title !== "") {
writer.uint32(10).string(message.title);
}
if (message.description !== "") {
writer.uint32(18).string(message.description);
}
if (message.ibcDenom !== "") {
writer.uint32(26).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 = createBaseDeleteHostZoneProposal();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.title = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.description = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.ibcDenom = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
title: isSet(object.title) ? globalThis.String(object.title) : "",
description: isSet(object.description) ? globalThis.String(object.description) : "",
ibcDenom: isSet(object.ibcDenom) ? globalThis.String(object.ibcDenom) : "",
};
},
toJSON(message) {
const obj = {};
if (message.title !== "") {
obj.title = message.title;
}
if (message.description !== "") {
obj.description = message.description;
}
if (message.ibcDenom !== "") {
obj.ibcDenom = message.ibcDenom;
}
return obj;
},
create(base) {
return DeleteHostZoneProposal.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseDeleteHostZoneProposal();
message.title = object.title ?? "";
message.description = object.description ?? "";
message.ibcDenom = object.ibcDenom ?? "";
return message;
},
};
function createBaseSetHostZoneProposal() {
return { title: "", description: "", hostChainConfig: undefined };
}
export const SetHostZoneProposal = {
encode(message, writer = new BinaryWriter()) {
if (message.title !== "") {
writer.uint32(10).string(message.title);
}
if (message.description !== "") {
writer.uint32(18).string(message.description);
}
if (message.hostChainConfig !== undefined) {
HostChainFeeAbsConfig.encode(message.hostChainConfig, writer.uint32(26).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 = createBaseSetHostZoneProposal();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.title = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.description = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
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 {
title: isSet(object.title) ? globalThis.String(object.title) : "",
description: isSet(object.description) ? globalThis.String(object.description) : "",
hostChainConfig: isSet(object.hostChainConfig)
? HostChainFeeAbsConfig.fromJSON(object.hostChainConfig)
: undefined,
};
},
toJSON(message) {
const obj = {};
if (message.title !== "") {
obj.title = message.title;
}
if (message.description !== "") {
obj.description = message.description;
}
if (message.hostChainConfig !== undefined) {
obj.hostChainConfig = HostChainFeeAbsConfig.toJSON(message.hostChainConfig);
}
return obj;
},
create(base) {
return SetHostZoneProposal.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseSetHostZoneProposal();
message.title = object.title ?? "";
message.description = object.description ?? "";
message.hostChainConfig = (object.hostChainConfig !== undefined && object.hostChainConfig !== null)
? HostChainFeeAbsConfig.fromPartial(object.hostChainConfig)
: undefined;
return message;
},
};
function isSet(value) {
return value !== null && value !== undefined;
}
//# sourceMappingURL=proposal.js.map