@cheqd/ts-proto
Version:
A TypeScript package for all transpiled cheqd ProtoBuf definitions.
793 lines • 26.3 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/tx.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Coin } from "../../../cosmos/base/v1beta1/coin.js";
import { Params } from "./params.js";
import { HostChainFeeAbsConfig } from "./proposal.js";
function createBaseMsgFundFeeAbsModuleAccount() {
return { sender: "", amount: [] };
}
export const MsgFundFeeAbsModuleAccount = {
encode(message, writer = new BinaryWriter()) {
if (message.sender !== "") {
writer.uint32(10).string(message.sender);
}
for (const v of message.amount) {
Coin.encode(v, writer.uint32(18).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 = createBaseMsgFundFeeAbsModuleAccount();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.sender = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.amount.push(Coin.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
sender: isSet(object.sender) ? globalThis.String(object.sender) : "",
amount: globalThis.Array.isArray(object?.amount) ? object.amount.map((e) => Coin.fromJSON(e)) : [],
};
},
toJSON(message) {
const obj = {};
if (message.sender !== "") {
obj.sender = message.sender;
}
if (message.amount?.length) {
obj.amount = message.amount.map((e) => Coin.toJSON(e));
}
return obj;
},
create(base) {
return MsgFundFeeAbsModuleAccount.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgFundFeeAbsModuleAccount();
message.sender = object.sender ?? "";
message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [];
return message;
},
};
function createBaseMsgFundFeeAbsModuleAccountResponse() {
return {};
}
export const MsgFundFeeAbsModuleAccountResponse = {
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 = createBaseMsgFundFeeAbsModuleAccountResponse();
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 MsgFundFeeAbsModuleAccountResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseMsgFundFeeAbsModuleAccountResponse();
return message;
},
};
function createBaseMsgSendQueryIbcDenomTWAP() {
return { sender: "" };
}
export const MsgSendQueryIbcDenomTWAP = {
encode(message, writer = new BinaryWriter()) {
if (message.sender !== "") {
writer.uint32(10).string(message.sender);
}
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 = createBaseMsgSendQueryIbcDenomTWAP();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.sender = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { sender: isSet(object.sender) ? globalThis.String(object.sender) : "" };
},
toJSON(message) {
const obj = {};
if (message.sender !== "") {
obj.sender = message.sender;
}
return obj;
},
create(base) {
return MsgSendQueryIbcDenomTWAP.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgSendQueryIbcDenomTWAP();
message.sender = object.sender ?? "";
return message;
},
};
function createBaseMsgSendQueryIbcDenomTWAPResponse() {
return {};
}
export const MsgSendQueryIbcDenomTWAPResponse = {
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 = createBaseMsgSendQueryIbcDenomTWAPResponse();
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 MsgSendQueryIbcDenomTWAPResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseMsgSendQueryIbcDenomTWAPResponse();
return message;
},
};
function createBaseMsgSwapCrossChain() {
return { sender: "", ibcDenom: "" };
}
export const MsgSwapCrossChain = {
encode(message, writer = new BinaryWriter()) {
if (message.sender !== "") {
writer.uint32(10).string(message.sender);
}
if (message.ibcDenom !== "") {
writer.uint32(18).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 = createBaseMsgSwapCrossChain();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.sender = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.ibcDenom = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
sender: isSet(object.sender) ? globalThis.String(object.sender) : "",
ibcDenom: isSet(object.ibcDenom) ? globalThis.String(object.ibcDenom) : "",
};
},
toJSON(message) {
const obj = {};
if (message.sender !== "") {
obj.sender = message.sender;
}
if (message.ibcDenom !== "") {
obj.ibcDenom = message.ibcDenom;
}
return obj;
},
create(base) {
return MsgSwapCrossChain.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgSwapCrossChain();
message.sender = object.sender ?? "";
message.ibcDenom = object.ibcDenom ?? "";
return message;
},
};
function createBaseMsgSwapCrossChainResponse() {
return {};
}
export const MsgSwapCrossChainResponse = {
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 = createBaseMsgSwapCrossChainResponse();
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 MsgSwapCrossChainResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseMsgSwapCrossChainResponse();
return message;
},
};
function createBaseMsgUpdateParams() {
return { authority: "", params: undefined };
}
export const MsgUpdateParams = {
encode(message, writer = new BinaryWriter()) {
if (message.authority !== "") {
writer.uint32(10).string(message.authority);
}
if (message.params !== undefined) {
Params.encode(message.params, writer.uint32(18).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 = createBaseMsgUpdateParams();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.authority = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.params = Params.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
authority: isSet(object.authority) ? globalThis.String(object.authority) : "",
params: isSet(object.params) ? Params.fromJSON(object.params) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.authority !== "") {
obj.authority = message.authority;
}
if (message.params !== undefined) {
obj.params = Params.toJSON(message.params);
}
return obj;
},
create(base) {
return MsgUpdateParams.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgUpdateParams();
message.authority = object.authority ?? "";
message.params = (object.params !== undefined && object.params !== null)
? Params.fromPartial(object.params)
: undefined;
return message;
},
};
function createBaseMsgUpdateParamsResponse() {
return {};
}
export const MsgUpdateParamsResponse = {
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 = createBaseMsgUpdateParamsResponse();
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 MsgUpdateParamsResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseMsgUpdateParamsResponse();
return message;
},
};
function createBaseMsgAddHostZone() {
return { authority: "", hostChainConfig: undefined };
}
export const MsgAddHostZone = {
encode(message, writer = new BinaryWriter()) {
if (message.authority !== "") {
writer.uint32(10).string(message.authority);
}
if (message.hostChainConfig !== undefined) {
HostChainFeeAbsConfig.encode(message.hostChainConfig, writer.uint32(18).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 = createBaseMsgAddHostZone();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.authority = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
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 {
authority: isSet(object.authority) ? globalThis.String(object.authority) : "",
hostChainConfig: isSet(object.hostChainConfig)
? HostChainFeeAbsConfig.fromJSON(object.hostChainConfig)
: undefined,
};
},
toJSON(message) {
const obj = {};
if (message.authority !== "") {
obj.authority = message.authority;
}
if (message.hostChainConfig !== undefined) {
obj.hostChainConfig = HostChainFeeAbsConfig.toJSON(message.hostChainConfig);
}
return obj;
},
create(base) {
return MsgAddHostZone.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgAddHostZone();
message.authority = object.authority ?? "";
message.hostChainConfig = (object.hostChainConfig !== undefined && object.hostChainConfig !== null)
? HostChainFeeAbsConfig.fromPartial(object.hostChainConfig)
: undefined;
return message;
},
};
function createBaseMsgAddHostZoneResponse() {
return {};
}
export const MsgAddHostZoneResponse = {
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 = createBaseMsgAddHostZoneResponse();
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 MsgAddHostZoneResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseMsgAddHostZoneResponse();
return message;
},
};
function createBaseMsgUpdateHostZone() {
return { authority: "", hostChainConfig: undefined };
}
export const MsgUpdateHostZone = {
encode(message, writer = new BinaryWriter()) {
if (message.authority !== "") {
writer.uint32(10).string(message.authority);
}
if (message.hostChainConfig !== undefined) {
HostChainFeeAbsConfig.encode(message.hostChainConfig, writer.uint32(18).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 = createBaseMsgUpdateHostZone();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.authority = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
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 {
authority: isSet(object.authority) ? globalThis.String(object.authority) : "",
hostChainConfig: isSet(object.hostChainConfig)
? HostChainFeeAbsConfig.fromJSON(object.hostChainConfig)
: undefined,
};
},
toJSON(message) {
const obj = {};
if (message.authority !== "") {
obj.authority = message.authority;
}
if (message.hostChainConfig !== undefined) {
obj.hostChainConfig = HostChainFeeAbsConfig.toJSON(message.hostChainConfig);
}
return obj;
},
create(base) {
return MsgUpdateHostZone.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgUpdateHostZone();
message.authority = object.authority ?? "";
message.hostChainConfig = (object.hostChainConfig !== undefined && object.hostChainConfig !== null)
? HostChainFeeAbsConfig.fromPartial(object.hostChainConfig)
: undefined;
return message;
},
};
function createBaseMsgUpdateHostZoneResponse() {
return {};
}
export const MsgUpdateHostZoneResponse = {
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 = createBaseMsgUpdateHostZoneResponse();
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 MsgUpdateHostZoneResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseMsgUpdateHostZoneResponse();
return message;
},
};
function createBaseMsgRemoveHostZone() {
return { authority: "", ibcDenom: "" };
}
export const MsgRemoveHostZone = {
encode(message, writer = new BinaryWriter()) {
if (message.authority !== "") {
writer.uint32(10).string(message.authority);
}
if (message.ibcDenom !== "") {
writer.uint32(18).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 = createBaseMsgRemoveHostZone();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.authority = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.ibcDenom = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
authority: isSet(object.authority) ? globalThis.String(object.authority) : "",
ibcDenom: isSet(object.ibcDenom) ? globalThis.String(object.ibcDenom) : "",
};
},
toJSON(message) {
const obj = {};
if (message.authority !== "") {
obj.authority = message.authority;
}
if (message.ibcDenom !== "") {
obj.ibcDenom = message.ibcDenom;
}
return obj;
},
create(base) {
return MsgRemoveHostZone.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMsgRemoveHostZone();
message.authority = object.authority ?? "";
message.ibcDenom = object.ibcDenom ?? "";
return message;
},
};
function createBaseMsgRemoveHostZoneResponse() {
return {};
}
export const MsgRemoveHostZoneResponse = {
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 = createBaseMsgRemoveHostZoneResponse();
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 MsgRemoveHostZoneResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseMsgRemoveHostZoneResponse();
return message;
},
};
export const MsgServiceName = "feeabstraction.feeabs.v1beta1.Msg";
export class MsgClientImpl {
rpc;
service;
constructor(rpc, opts) {
this.service = opts?.service || MsgServiceName;
this.rpc = rpc;
this.SendQueryIbcDenomTWAP = this.SendQueryIbcDenomTWAP.bind(this);
this.SwapCrossChain = this.SwapCrossChain.bind(this);
this.FundFeeAbsModuleAccount = this.FundFeeAbsModuleAccount.bind(this);
this.UpdateParams = this.UpdateParams.bind(this);
this.AddHostZone = this.AddHostZone.bind(this);
this.UpdateHostZone = this.UpdateHostZone.bind(this);
this.RemoveHostZone = this.RemoveHostZone.bind(this);
}
SendQueryIbcDenomTWAP(request) {
const data = MsgSendQueryIbcDenomTWAP.encode(request).finish();
const promise = this.rpc.request(this.service, "SendQueryIbcDenomTWAP", data);
return promise.then((data) => MsgSendQueryIbcDenomTWAPResponse.decode(new BinaryReader(data)));
}
SwapCrossChain(request) {
const data = MsgSwapCrossChain.encode(request).finish();
const promise = this.rpc.request(this.service, "SwapCrossChain", data);
return promise.then((data) => MsgSwapCrossChainResponse.decode(new BinaryReader(data)));
}
FundFeeAbsModuleAccount(request) {
const data = MsgFundFeeAbsModuleAccount.encode(request).finish();
const promise = this.rpc.request(this.service, "FundFeeAbsModuleAccount", data);
return promise.then((data) => MsgFundFeeAbsModuleAccountResponse.decode(new BinaryReader(data)));
}
UpdateParams(request) {
const data = MsgUpdateParams.encode(request).finish();
const promise = this.rpc.request(this.service, "UpdateParams", data);
return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data)));
}
AddHostZone(request) {
const data = MsgAddHostZone.encode(request).finish();
const promise = this.rpc.request(this.service, "AddHostZone", data);
return promise.then((data) => MsgAddHostZoneResponse.decode(new BinaryReader(data)));
}
UpdateHostZone(request) {
const data = MsgUpdateHostZone.encode(request).finish();
const promise = this.rpc.request(this.service, "UpdateHostZone", data);
return promise.then((data) => MsgUpdateHostZoneResponse.decode(new BinaryReader(data)));
}
RemoveHostZone(request) {
const data = MsgRemoveHostZone.encode(request).finish();
const promise = this.rpc.request(this.service, "RemoveHostZone", data);
return promise.then((data) => MsgRemoveHostZoneResponse.decode(new BinaryReader(data)));
}
}
function isSet(value) {
return value !== null && value !== undefined;
}
//# sourceMappingURL=tx.js.map