interchainjs
Version:
InterchainJS is a JavaScript library for interacting with Cosmos SDK based blockchains.
162 lines (161 loc) • 5.41 kB
JavaScript
import { Params } from "./host";
import { BinaryReader, BinaryWriter } from "../../../../../binary";
import { GlobalDecoderRegistry } from "../../../../../registry";
function createBaseQueryParamsRequest() {
return {};
}
/**
* QueryParamsRequest is the request type for the Query/Params RPC method.
* @name QueryParamsRequest
* @package ibc.applications.interchain_accounts.host.v1
* @see proto type: ibc.applications.interchain_accounts.host.v1.QueryParamsRequest
*/
export const QueryParamsRequest = {
typeUrl: "/ibc.applications.interchain_accounts.host.v1.QueryParamsRequest",
aminoType: "cosmos-sdk/QueryParamsRequest",
is(o) {
return o && o.$typeUrl === QueryParamsRequest.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === QueryParamsRequest.typeUrl;
},
encode(_, writer = BinaryWriter.create()) {
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 = createBaseQueryParamsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(_) {
const message = createBaseQueryParamsRequest();
return message;
},
fromAmino(_) {
const message = createBaseQueryParamsRequest();
return message;
},
toAmino(_) {
const obj = {};
return obj;
},
fromAminoMsg(object) {
return QueryParamsRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QueryParamsRequest",
value: QueryParamsRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return QueryParamsRequest.decode(message.value);
},
toProto(message) {
return QueryParamsRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/ibc.applications.interchain_accounts.host.v1.QueryParamsRequest",
value: QueryParamsRequest.encode(message).finish()
};
},
registerTypeUrl() { }
};
function createBaseQueryParamsResponse() {
return {
params: undefined
};
}
/**
* QueryParamsResponse is the response type for the Query/Params RPC method.
* @name QueryParamsResponse
* @package ibc.applications.interchain_accounts.host.v1
* @see proto type: ibc.applications.interchain_accounts.host.v1.QueryParamsResponse
*/
export const QueryParamsResponse = {
typeUrl: "/ibc.applications.interchain_accounts.host.v1.QueryParamsResponse",
aminoType: "cosmos-sdk/QueryParamsResponse",
is(o) {
return o && o.$typeUrl === QueryParamsResponse.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === QueryParamsResponse.typeUrl;
},
encode(message, writer = BinaryWriter.create()) {
if (message.params !== undefined) {
Params.encode(message.params, writer.uint32(10).fork()).ldelim();
}
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 = createBaseQueryParamsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.params = Params.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(object) {
const message = createBaseQueryParamsResponse();
message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined;
return message;
},
fromAmino(object) {
const message = createBaseQueryParamsResponse();
if (object.params !== undefined && object.params !== null) {
message.params = Params.fromAmino(object.params);
}
return message;
},
toAmino(message) {
const obj = {};
obj.params = message.params ? Params.toAmino(message.params) : undefined;
return obj;
},
fromAminoMsg(object) {
return QueryParamsResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QueryParamsResponse",
value: QueryParamsResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return QueryParamsResponse.decode(message.value);
},
toProto(message) {
return QueryParamsResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/ibc.applications.interchain_accounts.host.v1.QueryParamsResponse",
value: QueryParamsResponse.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryParamsResponse.typeUrl)) {
return;
}
Params.registerTypeUrl();
}
};