interchainjs
Version:
InterchainJS is a JavaScript library for interacting with Cosmos SDK based blockchains.
472 lines (471 loc) • 15.9 kB
JavaScript
import { Params } from "./mint";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { bytesFromBase64, base64FromBytes } from "../../../helpers";
import { GlobalDecoderRegistry } from "../../../registry";
function createBaseQueryParamsRequest() {
return {};
}
/**
* QueryParamsRequest is the request type for the Query/Params RPC method.
* @name QueryParamsRequest
* @package cosmos.mint.v1beta1
* @see proto type: cosmos.mint.v1beta1.QueryParamsRequest
*/
export const QueryParamsRequest = {
typeUrl: "/cosmos.mint.v1beta1.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: "/cosmos.mint.v1beta1.QueryParamsRequest",
value: QueryParamsRequest.encode(message).finish()
};
},
registerTypeUrl() { }
};
function createBaseQueryParamsResponse() {
return {
params: Params.fromPartial({})
};
}
/**
* QueryParamsResponse is the response type for the Query/Params RPC method.
* @name QueryParamsResponse
* @package cosmos.mint.v1beta1
* @see proto type: cosmos.mint.v1beta1.QueryParamsResponse
*/
export const QueryParamsResponse = {
typeUrl: "/cosmos.mint.v1beta1.QueryParamsResponse",
aminoType: "cosmos-sdk/QueryParamsResponse",
is(o) {
return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.is(o.params));
},
isAmino(o) {
return o && (o.$typeUrl === QueryParamsResponse.typeUrl || Params.isAmino(o.params));
},
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) : Params.toAmino(Params.fromPartial({}));
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: "/cosmos.mint.v1beta1.QueryParamsResponse",
value: QueryParamsResponse.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryParamsResponse.typeUrl)) {
return;
}
Params.registerTypeUrl();
}
};
function createBaseQueryInflationRequest() {
return {};
}
/**
* QueryInflationRequest is the request type for the Query/Inflation RPC method.
* @name QueryInflationRequest
* @package cosmos.mint.v1beta1
* @see proto type: cosmos.mint.v1beta1.QueryInflationRequest
*/
export const QueryInflationRequest = {
typeUrl: "/cosmos.mint.v1beta1.QueryInflationRequest",
aminoType: "cosmos-sdk/QueryInflationRequest",
is(o) {
return o && o.$typeUrl === QueryInflationRequest.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === QueryInflationRequest.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 = createBaseQueryInflationRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(_) {
const message = createBaseQueryInflationRequest();
return message;
},
fromAmino(_) {
const message = createBaseQueryInflationRequest();
return message;
},
toAmino(_) {
const obj = {};
return obj;
},
fromAminoMsg(object) {
return QueryInflationRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QueryInflationRequest",
value: QueryInflationRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return QueryInflationRequest.decode(message.value);
},
toProto(message) {
return QueryInflationRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.mint.v1beta1.QueryInflationRequest",
value: QueryInflationRequest.encode(message).finish()
};
},
registerTypeUrl() { }
};
function createBaseQueryInflationResponse() {
return {
inflation: new Uint8Array()
};
}
/**
* QueryInflationResponse is the response type for the Query/Inflation RPC
* method.
* @name QueryInflationResponse
* @package cosmos.mint.v1beta1
* @see proto type: cosmos.mint.v1beta1.QueryInflationResponse
*/
export const QueryInflationResponse = {
typeUrl: "/cosmos.mint.v1beta1.QueryInflationResponse",
aminoType: "cosmos-sdk/QueryInflationResponse",
is(o) {
return o && (o.$typeUrl === QueryInflationResponse.typeUrl || o.inflation instanceof Uint8Array || typeof o.inflation === "string");
},
isAmino(o) {
return o && (o.$typeUrl === QueryInflationResponse.typeUrl || o.inflation instanceof Uint8Array || typeof o.inflation === "string");
},
encode(message, writer = BinaryWriter.create()) {
if (message.inflation.length !== 0) {
writer.uint32(10).bytes(message.inflation);
}
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 = createBaseQueryInflationResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.inflation = reader.bytes();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(object) {
const message = createBaseQueryInflationResponse();
message.inflation = object.inflation ?? new Uint8Array();
return message;
},
fromAmino(object) {
const message = createBaseQueryInflationResponse();
if (object.inflation !== undefined && object.inflation !== null) {
message.inflation = bytesFromBase64(object.inflation);
}
return message;
},
toAmino(message) {
const obj = {};
obj.inflation = message.inflation ? base64FromBytes(message.inflation) : "";
return obj;
},
fromAminoMsg(object) {
return QueryInflationResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QueryInflationResponse",
value: QueryInflationResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return QueryInflationResponse.decode(message.value);
},
toProto(message) {
return QueryInflationResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.mint.v1beta1.QueryInflationResponse",
value: QueryInflationResponse.encode(message).finish()
};
},
registerTypeUrl() { }
};
function createBaseQueryAnnualProvisionsRequest() {
return {};
}
/**
* QueryAnnualProvisionsRequest is the request type for the
* Query/AnnualProvisions RPC method.
* @name QueryAnnualProvisionsRequest
* @package cosmos.mint.v1beta1
* @see proto type: cosmos.mint.v1beta1.QueryAnnualProvisionsRequest
*/
export const QueryAnnualProvisionsRequest = {
typeUrl: "/cosmos.mint.v1beta1.QueryAnnualProvisionsRequest",
aminoType: "cosmos-sdk/QueryAnnualProvisionsRequest",
is(o) {
return o && o.$typeUrl === QueryAnnualProvisionsRequest.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === QueryAnnualProvisionsRequest.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 = createBaseQueryAnnualProvisionsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(_) {
const message = createBaseQueryAnnualProvisionsRequest();
return message;
},
fromAmino(_) {
const message = createBaseQueryAnnualProvisionsRequest();
return message;
},
toAmino(_) {
const obj = {};
return obj;
},
fromAminoMsg(object) {
return QueryAnnualProvisionsRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QueryAnnualProvisionsRequest",
value: QueryAnnualProvisionsRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return QueryAnnualProvisionsRequest.decode(message.value);
},
toProto(message) {
return QueryAnnualProvisionsRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.mint.v1beta1.QueryAnnualProvisionsRequest",
value: QueryAnnualProvisionsRequest.encode(message).finish()
};
},
registerTypeUrl() { }
};
function createBaseQueryAnnualProvisionsResponse() {
return {
annualProvisions: new Uint8Array()
};
}
/**
* QueryAnnualProvisionsResponse is the response type for the
* Query/AnnualProvisions RPC method.
* @name QueryAnnualProvisionsResponse
* @package cosmos.mint.v1beta1
* @see proto type: cosmos.mint.v1beta1.QueryAnnualProvisionsResponse
*/
export const QueryAnnualProvisionsResponse = {
typeUrl: "/cosmos.mint.v1beta1.QueryAnnualProvisionsResponse",
aminoType: "cosmos-sdk/QueryAnnualProvisionsResponse",
is(o) {
return o && (o.$typeUrl === QueryAnnualProvisionsResponse.typeUrl || o.annualProvisions instanceof Uint8Array || typeof o.annualProvisions === "string");
},
isAmino(o) {
return o && (o.$typeUrl === QueryAnnualProvisionsResponse.typeUrl || o.annual_provisions instanceof Uint8Array || typeof o.annual_provisions === "string");
},
encode(message, writer = BinaryWriter.create()) {
if (message.annualProvisions.length !== 0) {
writer.uint32(10).bytes(message.annualProvisions);
}
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 = createBaseQueryAnnualProvisionsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.annualProvisions = reader.bytes();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(object) {
const message = createBaseQueryAnnualProvisionsResponse();
message.annualProvisions = object.annualProvisions ?? new Uint8Array();
return message;
},
fromAmino(object) {
const message = createBaseQueryAnnualProvisionsResponse();
if (object.annual_provisions !== undefined && object.annual_provisions !== null) {
message.annualProvisions = bytesFromBase64(object.annual_provisions);
}
return message;
},
toAmino(message) {
const obj = {};
obj.annual_provisions = message.annualProvisions ? base64FromBytes(message.annualProvisions) : "";
return obj;
},
fromAminoMsg(object) {
return QueryAnnualProvisionsResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QueryAnnualProvisionsResponse",
value: QueryAnnualProvisionsResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return QueryAnnualProvisionsResponse.decode(message.value);
},
toProto(message) {
return QueryAnnualProvisionsResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.mint.v1beta1.QueryAnnualProvisionsResponse",
value: QueryAnnualProvisionsResponse.encode(message).finish()
};
},
registerTypeUrl() { }
};