UNPKG

interchainjs

Version:

InterchainJS is a JavaScript library for interacting with Cosmos SDK based blockchains.

182 lines (181 loc) 6.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.QueryLegacyAccountResponse = exports.QueryLegacyAccount = void 0; const any_1 = require("../../../google/protobuf/any"); const auth_1 = require("./auth"); const binary_1 = require("../../../binary"); const registry_1 = require("../../../registry"); function createBaseQueryLegacyAccount() { return {}; } /** * QueryLegacyAccount defines a query that can be implemented by an x/account * to return an auth understandable representation of an account. * This query is only used for accounts retro-compatibility at gRPC * level, the state machine must not make any assumptions around this. * @name QueryLegacyAccount * @package cosmos.auth.v1beta1 * @see proto type: cosmos.auth.v1beta1.QueryLegacyAccount */ exports.QueryLegacyAccount = { typeUrl: "/cosmos.auth.v1beta1.QueryLegacyAccount", aminoType: "cosmos-sdk/QueryLegacyAccount", is(o) { return o && o.$typeUrl === exports.QueryLegacyAccount.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.QueryLegacyAccount.typeUrl; }, encode(_, writer = binary_1.BinaryWriter.create()) { return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryLegacyAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_) { const message = createBaseQueryLegacyAccount(); return message; }, fromAmino(_) { const message = createBaseQueryLegacyAccount(); return message; }, toAmino(_) { const obj = {}; return obj; }, fromAminoMsg(object) { return exports.QueryLegacyAccount.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryLegacyAccount", value: exports.QueryLegacyAccount.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryLegacyAccount.decode(message.value); }, toProto(message) { return exports.QueryLegacyAccount.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.auth.v1beta1.QueryLegacyAccount", value: exports.QueryLegacyAccount.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseQueryLegacyAccountResponse() { return { account: undefined, base: undefined }; } /** * QueryLegacyAccountResponse defines the response type of the * `QueryLegacyAccount` query. * @name QueryLegacyAccountResponse * @package cosmos.auth.v1beta1 * @see proto type: cosmos.auth.v1beta1.QueryLegacyAccountResponse */ exports.QueryLegacyAccountResponse = { typeUrl: "/cosmos.auth.v1beta1.QueryLegacyAccountResponse", aminoType: "cosmos-sdk/QueryLegacyAccountResponse", is(o) { return o && o.$typeUrl === exports.QueryLegacyAccountResponse.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.QueryLegacyAccountResponse.typeUrl; }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.account !== undefined) { any_1.Any.encode(message.account, writer.uint32(10).fork()).ldelim(); } if (message.base !== undefined) { auth_1.BaseAccount.encode(message.base, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryLegacyAccountResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.account = any_1.Any.decode(reader, reader.uint32()); break; case 2: message.base = auth_1.BaseAccount.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryLegacyAccountResponse(); message.account = object.account !== undefined && object.account !== null ? any_1.Any.fromPartial(object.account) : undefined; message.base = object.base !== undefined && object.base !== null ? auth_1.BaseAccount.fromPartial(object.base) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryLegacyAccountResponse(); if (object.account !== undefined && object.account !== null) { message.account = any_1.Any.fromAmino(object.account); } if (object.base !== undefined && object.base !== null) { message.base = auth_1.BaseAccount.fromAmino(object.base); } return message; }, toAmino(message) { const obj = {}; obj.account = message.account ? any_1.Any.toAmino(message.account) : undefined; obj.base = message.base ? auth_1.BaseAccount.toAmino(message.base) : undefined; return obj; }, fromAminoMsg(object) { return exports.QueryLegacyAccountResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryLegacyAccountResponse", value: exports.QueryLegacyAccountResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryLegacyAccountResponse.decode(message.value); }, toProto(message) { return exports.QueryLegacyAccountResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.auth.v1beta1.QueryLegacyAccountResponse", value: exports.QueryLegacyAccountResponse.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryLegacyAccountResponse.typeUrl)) { return; } auth_1.BaseAccount.registerTypeUrl(); } };