UNPKG

interchainjs

Version:

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

1,304 lines 101 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.QuerySendEnabledResponse = exports.QuerySendEnabledRequest = exports.QueryDenomOwnersByQueryResponse = exports.QueryDenomOwnersByQueryRequest = exports.QueryDenomOwnersResponse = exports.DenomOwner = exports.QueryDenomOwnersRequest = exports.QueryDenomMetadataByQueryStringResponse = exports.QueryDenomMetadataByQueryStringRequest = exports.QueryDenomMetadataResponse = exports.QueryDenomMetadataRequest = exports.QueryDenomsMetadataResponse = exports.QueryDenomsMetadataRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QuerySupplyOfResponse = exports.QuerySupplyOfRequest = exports.QueryTotalSupplyResponse = exports.QueryTotalSupplyRequest = exports.QuerySpendableBalanceByDenomResponse = exports.QuerySpendableBalanceByDenomRequest = exports.QuerySpendableBalancesResponse = exports.QuerySpendableBalancesRequest = exports.QueryAllBalancesResponse = exports.QueryAllBalancesRequest = exports.QueryBalanceResponse = exports.QueryBalanceRequest = void 0; const pagination_1 = require("../../base/query/v1beta1/pagination"); const coin_1 = require("../../base/v1beta1/coin"); const bank_1 = require("./bank"); const binary_1 = require("../../../binary"); const registry_1 = require("../../../registry"); function createBaseQueryBalanceRequest() { return { address: "", denom: "" }; } /** * QueryBalanceRequest is the request type for the Query/Balance RPC method. * @name QueryBalanceRequest * @package cosmos.bank.v1beta1 * @see proto type: cosmos.bank.v1beta1.QueryBalanceRequest */ exports.QueryBalanceRequest = { typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest", aminoType: "cosmos-sdk/QueryBalanceRequest", is(o) { return o && (o.$typeUrl === exports.QueryBalanceRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); }, isAmino(o) { return o && (o.$typeUrl === exports.QueryBalanceRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.address !== "") { writer.uint32(10).string(message.address); } if (message.denom !== "") { writer.uint32(18).string(message.denom); } 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 = createBaseQueryBalanceRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.address = reader.string(); break; case 2: message.denom = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryBalanceRequest(); message.address = object.address ?? ""; message.denom = object.denom ?? ""; return message; }, fromAmino(object) { const message = createBaseQueryBalanceRequest(); if (object.address !== undefined && object.address !== null) { message.address = object.address; } if (object.denom !== undefined && object.denom !== null) { message.denom = object.denom; } return message; }, toAmino(message) { const obj = {}; obj.address = message.address === "" ? undefined : message.address; obj.denom = message.denom === "" ? undefined : message.denom; return obj; }, fromAminoMsg(object) { return exports.QueryBalanceRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryBalanceRequest", value: exports.QueryBalanceRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryBalanceRequest.decode(message.value); }, toProto(message) { return exports.QueryBalanceRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest", value: exports.QueryBalanceRequest.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseQueryBalanceResponse() { return { balance: undefined }; } /** * QueryBalanceResponse is the response type for the Query/Balance RPC method. * @name QueryBalanceResponse * @package cosmos.bank.v1beta1 * @see proto type: cosmos.bank.v1beta1.QueryBalanceResponse */ exports.QueryBalanceResponse = { typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse", aminoType: "cosmos-sdk/QueryBalanceResponse", is(o) { return o && o.$typeUrl === exports.QueryBalanceResponse.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.QueryBalanceResponse.typeUrl; }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.balance !== undefined) { coin_1.Coin.encode(message.balance, writer.uint32(10).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 = createBaseQueryBalanceResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.balance = coin_1.Coin.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryBalanceResponse(); message.balance = object.balance !== undefined && object.balance !== null ? coin_1.Coin.fromPartial(object.balance) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryBalanceResponse(); if (object.balance !== undefined && object.balance !== null) { message.balance = coin_1.Coin.fromAmino(object.balance); } return message; }, toAmino(message) { const obj = {}; obj.balance = message.balance ? coin_1.Coin.toAmino(message.balance) : undefined; return obj; }, fromAminoMsg(object) { return exports.QueryBalanceResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryBalanceResponse", value: exports.QueryBalanceResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryBalanceResponse.decode(message.value); }, toProto(message) { return exports.QueryBalanceResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse", value: exports.QueryBalanceResponse.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryBalanceResponse.typeUrl)) { return; } coin_1.Coin.registerTypeUrl(); } }; function createBaseQueryAllBalancesRequest() { return { address: "", pagination: undefined, resolveDenom: false }; } /** * QueryBalanceRequest is the request type for the Query/AllBalances RPC method. * @name QueryAllBalancesRequest * @package cosmos.bank.v1beta1 * @see proto type: cosmos.bank.v1beta1.QueryAllBalancesRequest */ exports.QueryAllBalancesRequest = { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest", aminoType: "cosmos-sdk/QueryAllBalancesRequest", is(o) { return o && (o.$typeUrl === exports.QueryAllBalancesRequest.typeUrl || typeof o.address === "string" && typeof o.resolveDenom === "boolean"); }, isAmino(o) { return o && (o.$typeUrl === exports.QueryAllBalancesRequest.typeUrl || typeof o.address === "string" && typeof o.resolve_denom === "boolean"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.address !== "") { writer.uint32(10).string(message.address); } if (message.pagination !== undefined) { pagination_1.PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } if (message.resolveDenom === true) { writer.uint32(24).bool(message.resolveDenom); } 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 = createBaseQueryAllBalancesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.address = reader.string(); break; case 2: message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); break; case 3: message.resolveDenom = reader.bool(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryAllBalancesRequest(); message.address = object.address ?? ""; message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; message.resolveDenom = object.resolveDenom ?? false; return message; }, fromAmino(object) { const message = createBaseQueryAllBalancesRequest(); if (object.address !== undefined && object.address !== null) { message.address = object.address; } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = pagination_1.PageRequest.fromAmino(object.pagination); } if (object.resolve_denom !== undefined && object.resolve_denom !== null) { message.resolveDenom = object.resolve_denom; } return message; }, toAmino(message) { const obj = {}; obj.address = message.address === "" ? undefined : message.address; obj.pagination = message.pagination ? pagination_1.PageRequest.toAmino(message.pagination) : undefined; obj.resolve_denom = message.resolveDenom === false ? undefined : message.resolveDenom; return obj; }, fromAminoMsg(object) { return exports.QueryAllBalancesRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryAllBalancesRequest", value: exports.QueryAllBalancesRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryAllBalancesRequest.decode(message.value); }, toProto(message) { return exports.QueryAllBalancesRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest", value: exports.QueryAllBalancesRequest.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryAllBalancesRequest.typeUrl)) { return; } pagination_1.PageRequest.registerTypeUrl(); } }; function createBaseQueryAllBalancesResponse() { return { balances: [], pagination: undefined }; } /** * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC * method. * @name QueryAllBalancesResponse * @package cosmos.bank.v1beta1 * @see proto type: cosmos.bank.v1beta1.QueryAllBalancesResponse */ exports.QueryAllBalancesResponse = { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse", aminoType: "cosmos-sdk/QueryAllBalancesResponse", is(o) { return o && (o.$typeUrl === exports.QueryAllBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || coin_1.Coin.is(o.balances[0]))); }, isAmino(o) { return o && (o.$typeUrl === exports.QueryAllBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || coin_1.Coin.isAmino(o.balances[0]))); }, encode(message, writer = binary_1.BinaryWriter.create()) { for (const v of message.balances) { coin_1.Coin.encode(v, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { pagination_1.PageResponse.encode(message.pagination, 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 = createBaseQueryAllBalancesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.balances.push(coin_1.Coin.decode(reader, reader.uint32())); break; case 2: message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryAllBalancesResponse(); message.balances = object.balances?.map(e => coin_1.Coin.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryAllBalancesResponse(); message.balances = object.balances?.map(e => coin_1.Coin.fromAmino(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = pagination_1.PageResponse.fromAmino(object.pagination); } return message; }, toAmino(message) { const obj = {}; if (message.balances) { obj.balances = message.balances.map(e => e ? coin_1.Coin.toAmino(e) : undefined); } else { obj.balances = message.balances; } obj.pagination = message.pagination ? pagination_1.PageResponse.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object) { return exports.QueryAllBalancesResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryAllBalancesResponse", value: exports.QueryAllBalancesResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryAllBalancesResponse.decode(message.value); }, toProto(message) { return exports.QueryAllBalancesResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse", value: exports.QueryAllBalancesResponse.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryAllBalancesResponse.typeUrl)) { return; } coin_1.Coin.registerTypeUrl(); pagination_1.PageResponse.registerTypeUrl(); } }; function createBaseQuerySpendableBalancesRequest() { return { address: "", pagination: undefined }; } /** * QuerySpendableBalancesRequest defines the gRPC request structure for querying * an account's spendable balances. * * Since: cosmos-sdk 0.46 * @name QuerySpendableBalancesRequest * @package cosmos.bank.v1beta1 * @see proto type: cosmos.bank.v1beta1.QuerySpendableBalancesRequest */ exports.QuerySpendableBalancesRequest = { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest", aminoType: "cosmos-sdk/QuerySpendableBalancesRequest", is(o) { return o && (o.$typeUrl === exports.QuerySpendableBalancesRequest.typeUrl || typeof o.address === "string"); }, isAmino(o) { return o && (o.$typeUrl === exports.QuerySpendableBalancesRequest.typeUrl || typeof o.address === "string"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.address !== "") { writer.uint32(10).string(message.address); } if (message.pagination !== undefined) { pagination_1.PageRequest.encode(message.pagination, 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 = createBaseQuerySpendableBalancesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.address = reader.string(); break; case 2: message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQuerySpendableBalancesRequest(); message.address = object.address ?? ""; message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object) { const message = createBaseQuerySpendableBalancesRequest(); if (object.address !== undefined && object.address !== null) { message.address = object.address; } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = pagination_1.PageRequest.fromAmino(object.pagination); } return message; }, toAmino(message) { const obj = {}; obj.address = message.address === "" ? undefined : message.address; obj.pagination = message.pagination ? pagination_1.PageRequest.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object) { return exports.QuerySpendableBalancesRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QuerySpendableBalancesRequest", value: exports.QuerySpendableBalancesRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.QuerySpendableBalancesRequest.decode(message.value); }, toProto(message) { return exports.QuerySpendableBalancesRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest", value: exports.QuerySpendableBalancesRequest.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QuerySpendableBalancesRequest.typeUrl)) { return; } pagination_1.PageRequest.registerTypeUrl(); } }; function createBaseQuerySpendableBalancesResponse() { return { balances: [], pagination: undefined }; } /** * QuerySpendableBalancesResponse defines the gRPC response structure for querying * an account's spendable balances. * * Since: cosmos-sdk 0.46 * @name QuerySpendableBalancesResponse * @package cosmos.bank.v1beta1 * @see proto type: cosmos.bank.v1beta1.QuerySpendableBalancesResponse */ exports.QuerySpendableBalancesResponse = { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse", aminoType: "cosmos-sdk/QuerySpendableBalancesResponse", is(o) { return o && (o.$typeUrl === exports.QuerySpendableBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || coin_1.Coin.is(o.balances[0]))); }, isAmino(o) { return o && (o.$typeUrl === exports.QuerySpendableBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || coin_1.Coin.isAmino(o.balances[0]))); }, encode(message, writer = binary_1.BinaryWriter.create()) { for (const v of message.balances) { coin_1.Coin.encode(v, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { pagination_1.PageResponse.encode(message.pagination, 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 = createBaseQuerySpendableBalancesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.balances.push(coin_1.Coin.decode(reader, reader.uint32())); break; case 2: message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQuerySpendableBalancesResponse(); message.balances = object.balances?.map(e => coin_1.Coin.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object) { const message = createBaseQuerySpendableBalancesResponse(); message.balances = object.balances?.map(e => coin_1.Coin.fromAmino(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = pagination_1.PageResponse.fromAmino(object.pagination); } return message; }, toAmino(message) { const obj = {}; if (message.balances) { obj.balances = message.balances.map(e => e ? coin_1.Coin.toAmino(e) : undefined); } else { obj.balances = message.balances; } obj.pagination = message.pagination ? pagination_1.PageResponse.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object) { return exports.QuerySpendableBalancesResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QuerySpendableBalancesResponse", value: exports.QuerySpendableBalancesResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.QuerySpendableBalancesResponse.decode(message.value); }, toProto(message) { return exports.QuerySpendableBalancesResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse", value: exports.QuerySpendableBalancesResponse.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QuerySpendableBalancesResponse.typeUrl)) { return; } coin_1.Coin.registerTypeUrl(); pagination_1.PageResponse.registerTypeUrl(); } }; function createBaseQuerySpendableBalanceByDenomRequest() { return { address: "", denom: "" }; } /** * QuerySpendableBalanceByDenomRequest defines the gRPC request structure for * querying an account's spendable balance for a specific denom. * * Since: cosmos-sdk 0.47 * @name QuerySpendableBalanceByDenomRequest * @package cosmos.bank.v1beta1 * @see proto type: cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest */ exports.QuerySpendableBalanceByDenomRequest = { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", aminoType: "cosmos-sdk/QuerySpendableBalanceByDenomRequest", is(o) { return o && (o.$typeUrl === exports.QuerySpendableBalanceByDenomRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); }, isAmino(o) { return o && (o.$typeUrl === exports.QuerySpendableBalanceByDenomRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.address !== "") { writer.uint32(10).string(message.address); } if (message.denom !== "") { writer.uint32(18).string(message.denom); } 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 = createBaseQuerySpendableBalanceByDenomRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.address = reader.string(); break; case 2: message.denom = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQuerySpendableBalanceByDenomRequest(); message.address = object.address ?? ""; message.denom = object.denom ?? ""; return message; }, fromAmino(object) { const message = createBaseQuerySpendableBalanceByDenomRequest(); if (object.address !== undefined && object.address !== null) { message.address = object.address; } if (object.denom !== undefined && object.denom !== null) { message.denom = object.denom; } return message; }, toAmino(message) { const obj = {}; obj.address = message.address === "" ? undefined : message.address; obj.denom = message.denom === "" ? undefined : message.denom; return obj; }, fromAminoMsg(object) { return exports.QuerySpendableBalanceByDenomRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QuerySpendableBalanceByDenomRequest", value: exports.QuerySpendableBalanceByDenomRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.QuerySpendableBalanceByDenomRequest.decode(message.value); }, toProto(message) { return exports.QuerySpendableBalanceByDenomRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", value: exports.QuerySpendableBalanceByDenomRequest.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseQuerySpendableBalanceByDenomResponse() { return { balance: undefined }; } /** * QuerySpendableBalanceByDenomResponse defines the gRPC response structure for * querying an account's spendable balance for a specific denom. * * Since: cosmos-sdk 0.47 * @name QuerySpendableBalanceByDenomResponse * @package cosmos.bank.v1beta1 * @see proto type: cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse */ exports.QuerySpendableBalanceByDenomResponse = { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse", aminoType: "cosmos-sdk/QuerySpendableBalanceByDenomResponse", is(o) { return o && o.$typeUrl === exports.QuerySpendableBalanceByDenomResponse.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.QuerySpendableBalanceByDenomResponse.typeUrl; }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.balance !== undefined) { coin_1.Coin.encode(message.balance, writer.uint32(10).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 = createBaseQuerySpendableBalanceByDenomResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.balance = coin_1.Coin.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQuerySpendableBalanceByDenomResponse(); message.balance = object.balance !== undefined && object.balance !== null ? coin_1.Coin.fromPartial(object.balance) : undefined; return message; }, fromAmino(object) { const message = createBaseQuerySpendableBalanceByDenomResponse(); if (object.balance !== undefined && object.balance !== null) { message.balance = coin_1.Coin.fromAmino(object.balance); } return message; }, toAmino(message) { const obj = {}; obj.balance = message.balance ? coin_1.Coin.toAmino(message.balance) : undefined; return obj; }, fromAminoMsg(object) { return exports.QuerySpendableBalanceByDenomResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QuerySpendableBalanceByDenomResponse", value: exports.QuerySpendableBalanceByDenomResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.QuerySpendableBalanceByDenomResponse.decode(message.value); }, toProto(message) { return exports.QuerySpendableBalanceByDenomResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse", value: exports.QuerySpendableBalanceByDenomResponse.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QuerySpendableBalanceByDenomResponse.typeUrl)) { return; } coin_1.Coin.registerTypeUrl(); } }; function createBaseQueryTotalSupplyRequest() { return { pagination: undefined }; } /** * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC * method. * @name QueryTotalSupplyRequest * @package cosmos.bank.v1beta1 * @see proto type: cosmos.bank.v1beta1.QueryTotalSupplyRequest */ exports.QueryTotalSupplyRequest = { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest", aminoType: "cosmos-sdk/QueryTotalSupplyRequest", is(o) { return o && o.$typeUrl === exports.QueryTotalSupplyRequest.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.QueryTotalSupplyRequest.typeUrl; }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.pagination !== undefined) { pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).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 = createBaseQueryTotalSupplyRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryTotalSupplyRequest(); message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryTotalSupplyRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = pagination_1.PageRequest.fromAmino(object.pagination); } return message; }, toAmino(message) { const obj = {}; obj.pagination = message.pagination ? pagination_1.PageRequest.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object) { return exports.QueryTotalSupplyRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryTotalSupplyRequest", value: exports.QueryTotalSupplyRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryTotalSupplyRequest.decode(message.value); }, toProto(message) { return exports.QueryTotalSupplyRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest", value: exports.QueryTotalSupplyRequest.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryTotalSupplyRequest.typeUrl)) { return; } pagination_1.PageRequest.registerTypeUrl(); } }; function createBaseQueryTotalSupplyResponse() { return { supply: [], pagination: undefined }; } /** * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC * method * @name QueryTotalSupplyResponse * @package cosmos.bank.v1beta1 * @see proto type: cosmos.bank.v1beta1.QueryTotalSupplyResponse */ exports.QueryTotalSupplyResponse = { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse", aminoType: "cosmos-sdk/QueryTotalSupplyResponse", is(o) { return o && (o.$typeUrl === exports.QueryTotalSupplyResponse.typeUrl || Array.isArray(o.supply) && (!o.supply.length || coin_1.Coin.is(o.supply[0]))); }, isAmino(o) { return o && (o.$typeUrl === exports.QueryTotalSupplyResponse.typeUrl || Array.isArray(o.supply) && (!o.supply.length || coin_1.Coin.isAmino(o.supply[0]))); }, encode(message, writer = binary_1.BinaryWriter.create()) { for (const v of message.supply) { coin_1.Coin.encode(v, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { pagination_1.PageResponse.encode(message.pagination, 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 = createBaseQueryTotalSupplyResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.supply.push(coin_1.Coin.decode(reader, reader.uint32())); break; case 2: message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQueryTotalSupplyResponse(); message.supply = object.supply?.map(e => coin_1.Coin.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryTotalSupplyResponse(); message.supply = object.supply?.map(e => coin_1.Coin.fromAmino(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = pagination_1.PageResponse.fromAmino(object.pagination); } return message; }, toAmino(message) { const obj = {}; if (message.supply) { obj.supply = message.supply.map(e => e ? coin_1.Coin.toAmino(e) : undefined); } else { obj.supply = message.supply; } obj.pagination = message.pagination ? pagination_1.PageResponse.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object) { return exports.QueryTotalSupplyResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryTotalSupplyResponse", value: exports.QueryTotalSupplyResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryTotalSupplyResponse.decode(message.value); }, toProto(message) { return exports.QueryTotalSupplyResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse", value: exports.QueryTotalSupplyResponse.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryTotalSupplyResponse.typeUrl)) { return; } coin_1.Coin.registerTypeUrl(); pagination_1.PageResponse.registerTypeUrl(); } }; function createBaseQuerySupplyOfRequest() { return { denom: "" }; } /** * QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. * @name QuerySupplyOfRequest * @package cosmos.bank.v1beta1 * @see proto type: cosmos.bank.v1beta1.QuerySupplyOfRequest */ exports.QuerySupplyOfRequest = { typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest", aminoType: "cosmos-sdk/QuerySupplyOfRequest", is(o) { return o && (o.$typeUrl === exports.QuerySupplyOfRequest.typeUrl || typeof o.denom === "string"); }, isAmino(o) { return o && (o.$typeUrl === exports.QuerySupplyOfRequest.typeUrl || typeof o.denom === "string"); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.denom !== "") { writer.uint32(10).string(message.denom); } 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 = createBaseQuerySupplyOfRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.denom = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQuerySupplyOfRequest(); message.denom = object.denom ?? ""; return message; }, fromAmino(object) { const message = createBaseQuerySupplyOfRequest(); if (object.denom !== undefined && object.denom !== null) { message.denom = object.denom; } return message; }, toAmino(message) { const obj = {}; obj.denom = message.denom === "" ? undefined : message.denom; return obj; }, fromAminoMsg(object) { return exports.QuerySupplyOfRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QuerySupplyOfRequest", value: exports.QuerySupplyOfRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.QuerySupplyOfRequest.decode(message.value); }, toProto(message) { return exports.QuerySupplyOfRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest", value: exports.QuerySupplyOfRequest.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseQuerySupplyOfResponse() { return { amount: coin_1.Coin.fromPartial({}) }; } /** * QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. * @name QuerySupplyOfResponse * @package cosmos.bank.v1beta1 * @see proto type: cosmos.bank.v1beta1.QuerySupplyOfResponse */ exports.QuerySupplyOfResponse = { typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse", aminoType: "cosmos-sdk/QuerySupplyOfResponse", is(o) { return o && (o.$typeUrl === exports.QuerySupplyOfResponse.typeUrl || coin_1.Coin.is(o.amount)); }, isAmino(o) { return o && (o.$typeUrl === exports.QuerySupplyOfResponse.typeUrl || coin_1.Coin.isAmino(o.amount)); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.amount !== undefined) { coin_1.Coin.encode(message.amount, writer.uint32(10).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 = createBaseQuerySupplyOfResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.amount = coin_1.Coin.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object) { const message = createBaseQuerySupplyOfResponse(); message.amount = object.amount !== undefined && object.amount !== null ? coin_1.Coin.fromPartial(object.amount) : undefined; return message; }, fromAmino(object) { const message = createBaseQuerySupplyOfResponse(); if (object.amount !== undefined && object.amount !== null) { message.amount = coin_1.Coin.fromAmino(object.amount); } return message; }, toAmino(message) { const obj = {}; obj.amount = message.amount ? coin_1.Coin.toAmino(message.amount) : coin_1.Coin.toAmino(coin_1.Coin.fromPartial({})); return obj; }, fromAminoMsg(object) { return exports.QuerySupplyOfResponse.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QuerySupplyOfResponse", value: exports.QuerySupplyOfResponse.toAmino(message) }; }, fromProtoMsg(message) { return exports.QuerySupplyOfResponse.decode(message.value); }, toProto(message) { return exports.QuerySupplyOfResponse.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse", value: exports.QuerySupplyOfResponse.encode(message).finish() }; }, registerTypeUrl() { if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QuerySupplyOfResponse.typeUrl)) { return; } coin_1.Coin.registerTypeUrl(); } }; function createBaseQueryParamsRequest() { return {}; } /** * QueryParamsRequest defines the request type for querying x/bank parameters. * @name QueryParamsRequest * @package cosmos.bank.v1beta1 * @see proto type: cosmos.bank.v1beta1.QueryParamsRequest */ exports.QueryParamsRequest = { typeUrl: "/cosmos.bank.v1beta1.QueryParamsRequest", aminoType: "cosmos-sdk/QueryParamsRequest", is(o) { return o && o.$typeUrl === exports.QueryParamsRequest.typeUrl; }, isAmino(o) { return o && o.$typeUrl === exports.QueryParamsRequest.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 = 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 exports.QueryParamsRequest.fromAmino(object.value); }, toAminoMsg(message) { return { type: "cosmos-sdk/QueryParamsRequest", value: exports.QueryParamsRequest.toAmino(message) }; }, fromProtoMsg(message) { return exports.QueryParamsRequest.decode(message.value); }, toProto(message) { return exports.QueryParamsRequest.encode(message).finish(); }, toProtoMsg(message) { return { typeUrl: "/cosmos.bank.v1beta1.QueryParamsRequest", value: exports.QueryParamsRequest.encode(message).finish() }; }, registerTypeUrl() { } }; function createBaseQueryParamsResponse() { return { params: bank_1.Params.fromPartial({}) }; } /** * QueryParamsResponse defines the response type for querying x/bank parameters. * @name QueryParamsResponse * @package cosmos.bank.v1beta1 * @see proto type: cosmos.bank.v1beta1.QueryParamsResponse */ exports.QueryParamsResponse = { typeUrl: "/cosmos.bank.v1beta1.QueryParamsResponse", aminoType: "cosmos-sdk/QueryParamsResponse", is(o) { return o && (o.$typeUrl === exports.QueryParamsResponse.typeUrl || bank_1.Params.is(o.params)); }, isAmino(o) { return o && (o.$typeUrl === exports.QueryParamsResponse.typeUrl || bank_1.Params.isAmino(o.params)); }, encode(message, writer = binary_1.BinaryWriter.create()) { if (message.params !== undefined) { bank_1.Params.encode(message.params, writer.uint32(10).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 = createBaseQueryParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.params = bank_1.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 ? bank_1.Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object) { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = bank_1.Params.fromAmino(object.params); } return message; }, toAmino(message) { const obj = {}; obj.params = message.params ? bank_1.Params.toAmino(message.params) : bank_1.Params.toAmino(bank_1.Params.fromPartial({})); return obj; }, fromAminoMsg(object) { return exports.QueryParamsResponse.fromAmino(o