interchainjs
Version:
InterchainJS is a JavaScript library for interacting with Cosmos SDK based blockchains.
1,385 lines • 94.8 kB
JavaScript
import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination";
import { Coin } from "../../base/v1beta1/coin";
import { Params, Metadata, SendEnabled } from "./bank";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { GlobalDecoderRegistry } from "../../../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
*/
export const QueryBalanceRequest = {
typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest",
aminoType: "cosmos-sdk/QueryBalanceRequest",
is(o) {
return o && (o.$typeUrl === QueryBalanceRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string");
},
isAmino(o) {
return o && (o.$typeUrl === QueryBalanceRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string");
},
encode(message, writer = 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 BinaryReader ? input : new 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 QueryBalanceRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QueryBalanceRequest",
value: QueryBalanceRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return QueryBalanceRequest.decode(message.value);
},
toProto(message) {
return QueryBalanceRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.bank.v1beta1.QueryBalanceRequest",
value: 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
*/
export const QueryBalanceResponse = {
typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse",
aminoType: "cosmos-sdk/QueryBalanceResponse",
is(o) {
return o && o.$typeUrl === QueryBalanceResponse.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === QueryBalanceResponse.typeUrl;
},
encode(message, writer = BinaryWriter.create()) {
if (message.balance !== undefined) {
Coin.encode(message.balance, 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 = createBaseQueryBalanceResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.balance = 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.fromPartial(object.balance) : undefined;
return message;
},
fromAmino(object) {
const message = createBaseQueryBalanceResponse();
if (object.balance !== undefined && object.balance !== null) {
message.balance = Coin.fromAmino(object.balance);
}
return message;
},
toAmino(message) {
const obj = {};
obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined;
return obj;
},
fromAminoMsg(object) {
return QueryBalanceResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QueryBalanceResponse",
value: QueryBalanceResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return QueryBalanceResponse.decode(message.value);
},
toProto(message) {
return QueryBalanceResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.bank.v1beta1.QueryBalanceResponse",
value: QueryBalanceResponse.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryBalanceResponse.typeUrl)) {
return;
}
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
*/
export const QueryAllBalancesRequest = {
typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest",
aminoType: "cosmos-sdk/QueryAllBalancesRequest",
is(o) {
return o && (o.$typeUrl === QueryAllBalancesRequest.typeUrl || typeof o.address === "string" && typeof o.resolveDenom === "boolean");
},
isAmino(o) {
return o && (o.$typeUrl === QueryAllBalancesRequest.typeUrl || typeof o.address === "string" && typeof o.resolve_denom === "boolean");
},
encode(message, writer = BinaryWriter.create()) {
if (message.address !== "") {
writer.uint32(10).string(message.address);
}
if (message.pagination !== undefined) {
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 BinaryReader ? input : new 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 = 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 ? 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 = 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 ? PageRequest.toAmino(message.pagination) : undefined;
obj.resolve_denom = message.resolveDenom === false ? undefined : message.resolveDenom;
return obj;
},
fromAminoMsg(object) {
return QueryAllBalancesRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QueryAllBalancesRequest",
value: QueryAllBalancesRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return QueryAllBalancesRequest.decode(message.value);
},
toProto(message) {
return QueryAllBalancesRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest",
value: QueryAllBalancesRequest.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryAllBalancesRequest.typeUrl)) {
return;
}
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
*/
export const QueryAllBalancesResponse = {
typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse",
aminoType: "cosmos-sdk/QueryAllBalancesResponse",
is(o) {
return o && (o.$typeUrl === QueryAllBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.is(o.balances[0])));
},
isAmino(o) {
return o && (o.$typeUrl === QueryAllBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.isAmino(o.balances[0])));
},
encode(message, writer = BinaryWriter.create()) {
for (const v of message.balances) {
Coin.encode(v, writer.uint32(10).fork()).ldelim();
}
if (message.pagination !== undefined) {
PageResponse.encode(message.pagination, writer.uint32(18).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 = createBaseQueryAllBalancesResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.balances.push(Coin.decode(reader, reader.uint32()));
break;
case 2:
message.pagination = 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.fromPartial(e)) || [];
message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined;
return message;
},
fromAmino(object) {
const message = createBaseQueryAllBalancesResponse();
message.balances = object.balances?.map(e => Coin.fromAmino(e)) || [];
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageResponse.fromAmino(object.pagination);
}
return message;
},
toAmino(message) {
const obj = {};
if (message.balances) {
obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined);
}
else {
obj.balances = message.balances;
}
obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined;
return obj;
},
fromAminoMsg(object) {
return QueryAllBalancesResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QueryAllBalancesResponse",
value: QueryAllBalancesResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return QueryAllBalancesResponse.decode(message.value);
},
toProto(message) {
return QueryAllBalancesResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesResponse",
value: QueryAllBalancesResponse.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryAllBalancesResponse.typeUrl)) {
return;
}
Coin.registerTypeUrl();
PageResponse.registerTypeUrl();
}
};
function createBaseQuerySpendableBalancesRequest() {
return {
address: "",
pagination: undefined
};
}
/**
* QuerySpendableBalancesRequest defines the gRPC request structure for querying
* an account's spendable balances.
* @name QuerySpendableBalancesRequest
* @package cosmos.bank.v1beta1
* @see proto type: cosmos.bank.v1beta1.QuerySpendableBalancesRequest
*/
export const QuerySpendableBalancesRequest = {
typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest",
aminoType: "cosmos-sdk/QuerySpendableBalancesRequest",
is(o) {
return o && (o.$typeUrl === QuerySpendableBalancesRequest.typeUrl || typeof o.address === "string");
},
isAmino(o) {
return o && (o.$typeUrl === QuerySpendableBalancesRequest.typeUrl || typeof o.address === "string");
},
encode(message, writer = BinaryWriter.create()) {
if (message.address !== "") {
writer.uint32(10).string(message.address);
}
if (message.pagination !== undefined) {
PageRequest.encode(message.pagination, writer.uint32(18).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 = createBaseQuerySpendableBalancesRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.address = reader.string();
break;
case 2:
message.pagination = 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 ? 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 = PageRequest.fromAmino(object.pagination);
}
return message;
},
toAmino(message) {
const obj = {};
obj.address = message.address === "" ? undefined : message.address;
obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined;
return obj;
},
fromAminoMsg(object) {
return QuerySpendableBalancesRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QuerySpendableBalancesRequest",
value: QuerySpendableBalancesRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return QuerySpendableBalancesRequest.decode(message.value);
},
toProto(message) {
return QuerySpendableBalancesRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesRequest",
value: QuerySpendableBalancesRequest.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(QuerySpendableBalancesRequest.typeUrl)) {
return;
}
PageRequest.registerTypeUrl();
}
};
function createBaseQuerySpendableBalancesResponse() {
return {
balances: [],
pagination: undefined
};
}
/**
* QuerySpendableBalancesResponse defines the gRPC response structure for querying
* an account's spendable balances.
* @name QuerySpendableBalancesResponse
* @package cosmos.bank.v1beta1
* @see proto type: cosmos.bank.v1beta1.QuerySpendableBalancesResponse
*/
export const QuerySpendableBalancesResponse = {
typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse",
aminoType: "cosmos-sdk/QuerySpendableBalancesResponse",
is(o) {
return o && (o.$typeUrl === QuerySpendableBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.is(o.balances[0])));
},
isAmino(o) {
return o && (o.$typeUrl === QuerySpendableBalancesResponse.typeUrl || Array.isArray(o.balances) && (!o.balances.length || Coin.isAmino(o.balances[0])));
},
encode(message, writer = BinaryWriter.create()) {
for (const v of message.balances) {
Coin.encode(v, writer.uint32(10).fork()).ldelim();
}
if (message.pagination !== undefined) {
PageResponse.encode(message.pagination, writer.uint32(18).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 = createBaseQuerySpendableBalancesResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.balances.push(Coin.decode(reader, reader.uint32()));
break;
case 2:
message.pagination = 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.fromPartial(e)) || [];
message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined;
return message;
},
fromAmino(object) {
const message = createBaseQuerySpendableBalancesResponse();
message.balances = object.balances?.map(e => Coin.fromAmino(e)) || [];
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageResponse.fromAmino(object.pagination);
}
return message;
},
toAmino(message) {
const obj = {};
if (message.balances) {
obj.balances = message.balances.map(e => e ? Coin.toAmino(e) : undefined);
}
else {
obj.balances = message.balances;
}
obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined;
return obj;
},
fromAminoMsg(object) {
return QuerySpendableBalancesResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QuerySpendableBalancesResponse",
value: QuerySpendableBalancesResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return QuerySpendableBalancesResponse.decode(message.value);
},
toProto(message) {
return QuerySpendableBalancesResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalancesResponse",
value: QuerySpendableBalancesResponse.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(QuerySpendableBalancesResponse.typeUrl)) {
return;
}
Coin.registerTypeUrl();
PageResponse.registerTypeUrl();
}
};
function createBaseQuerySpendableBalanceByDenomRequest() {
return {
address: "",
denom: ""
};
}
/**
* QuerySpendableBalanceByDenomRequest defines the gRPC request structure for
* querying an account's spendable balance for a specific denom.
* @name QuerySpendableBalanceByDenomRequest
* @package cosmos.bank.v1beta1
* @see proto type: cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest
*/
export const QuerySpendableBalanceByDenomRequest = {
typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest",
aminoType: "cosmos-sdk/QuerySpendableBalanceByDenomRequest",
is(o) {
return o && (o.$typeUrl === QuerySpendableBalanceByDenomRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string");
},
isAmino(o) {
return o && (o.$typeUrl === QuerySpendableBalanceByDenomRequest.typeUrl || typeof o.address === "string" && typeof o.denom === "string");
},
encode(message, writer = 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 BinaryReader ? input : new 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 QuerySpendableBalanceByDenomRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QuerySpendableBalanceByDenomRequest",
value: QuerySpendableBalanceByDenomRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return QuerySpendableBalanceByDenomRequest.decode(message.value);
},
toProto(message) {
return QuerySpendableBalanceByDenomRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest",
value: 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.
* @name QuerySpendableBalanceByDenomResponse
* @package cosmos.bank.v1beta1
* @see proto type: cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse
*/
export const QuerySpendableBalanceByDenomResponse = {
typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse",
aminoType: "cosmos-sdk/QuerySpendableBalanceByDenomResponse",
is(o) {
return o && o.$typeUrl === QuerySpendableBalanceByDenomResponse.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === QuerySpendableBalanceByDenomResponse.typeUrl;
},
encode(message, writer = BinaryWriter.create()) {
if (message.balance !== undefined) {
Coin.encode(message.balance, 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 = createBaseQuerySpendableBalanceByDenomResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.balance = 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.fromPartial(object.balance) : undefined;
return message;
},
fromAmino(object) {
const message = createBaseQuerySpendableBalanceByDenomResponse();
if (object.balance !== undefined && object.balance !== null) {
message.balance = Coin.fromAmino(object.balance);
}
return message;
},
toAmino(message) {
const obj = {};
obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined;
return obj;
},
fromAminoMsg(object) {
return QuerySpendableBalanceByDenomResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QuerySpendableBalanceByDenomResponse",
value: QuerySpendableBalanceByDenomResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return QuerySpendableBalanceByDenomResponse.decode(message.value);
},
toProto(message) {
return QuerySpendableBalanceByDenomResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse",
value: QuerySpendableBalanceByDenomResponse.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(QuerySpendableBalanceByDenomResponse.typeUrl)) {
return;
}
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
*/
export const QueryTotalSupplyRequest = {
typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest",
aminoType: "cosmos-sdk/QueryTotalSupplyRequest",
is(o) {
return o && o.$typeUrl === QueryTotalSupplyRequest.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === QueryTotalSupplyRequest.typeUrl;
},
encode(message, writer = BinaryWriter.create()) {
if (message.pagination !== undefined) {
PageRequest.encode(message.pagination, 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 = createBaseQueryTotalSupplyRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.pagination = 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 ? PageRequest.fromPartial(object.pagination) : undefined;
return message;
},
fromAmino(object) {
const message = createBaseQueryTotalSupplyRequest();
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageRequest.fromAmino(object.pagination);
}
return message;
},
toAmino(message) {
const obj = {};
obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined;
return obj;
},
fromAminoMsg(object) {
return QueryTotalSupplyRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QueryTotalSupplyRequest",
value: QueryTotalSupplyRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return QueryTotalSupplyRequest.decode(message.value);
},
toProto(message) {
return QueryTotalSupplyRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest",
value: QueryTotalSupplyRequest.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryTotalSupplyRequest.typeUrl)) {
return;
}
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
*/
export const QueryTotalSupplyResponse = {
typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse",
aminoType: "cosmos-sdk/QueryTotalSupplyResponse",
is(o) {
return o && (o.$typeUrl === QueryTotalSupplyResponse.typeUrl || Array.isArray(o.supply) && (!o.supply.length || Coin.is(o.supply[0])));
},
isAmino(o) {
return o && (o.$typeUrl === QueryTotalSupplyResponse.typeUrl || Array.isArray(o.supply) && (!o.supply.length || Coin.isAmino(o.supply[0])));
},
encode(message, writer = BinaryWriter.create()) {
for (const v of message.supply) {
Coin.encode(v, writer.uint32(10).fork()).ldelim();
}
if (message.pagination !== undefined) {
PageResponse.encode(message.pagination, writer.uint32(18).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 = createBaseQueryTotalSupplyResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.supply.push(Coin.decode(reader, reader.uint32()));
break;
case 2:
message.pagination = 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.fromPartial(e)) || [];
message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined;
return message;
},
fromAmino(object) {
const message = createBaseQueryTotalSupplyResponse();
message.supply = object.supply?.map(e => Coin.fromAmino(e)) || [];
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageResponse.fromAmino(object.pagination);
}
return message;
},
toAmino(message) {
const obj = {};
if (message.supply) {
obj.supply = message.supply.map(e => e ? Coin.toAmino(e) : undefined);
}
else {
obj.supply = message.supply;
}
obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined;
return obj;
},
fromAminoMsg(object) {
return QueryTotalSupplyResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QueryTotalSupplyResponse",
value: QueryTotalSupplyResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return QueryTotalSupplyResponse.decode(message.value);
},
toProto(message) {
return QueryTotalSupplyResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyResponse",
value: QueryTotalSupplyResponse.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryTotalSupplyResponse.typeUrl)) {
return;
}
Coin.registerTypeUrl();
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
*/
export const QuerySupplyOfRequest = {
typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest",
aminoType: "cosmos-sdk/QuerySupplyOfRequest",
is(o) {
return o && (o.$typeUrl === QuerySupplyOfRequest.typeUrl || typeof o.denom === "string");
},
isAmino(o) {
return o && (o.$typeUrl === QuerySupplyOfRequest.typeUrl || typeof o.denom === "string");
},
encode(message, writer = BinaryWriter.create()) {
if (message.denom !== "") {
writer.uint32(10).string(message.denom);
}
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 = 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 QuerySupplyOfRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QuerySupplyOfRequest",
value: QuerySupplyOfRequest.toAmino(message)
};
},
fromProtoMsg(message) {
return QuerySupplyOfRequest.decode(message.value);
},
toProto(message) {
return QuerySupplyOfRequest.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfRequest",
value: QuerySupplyOfRequest.encode(message).finish()
};
},
registerTypeUrl() { }
};
function createBaseQuerySupplyOfResponse() {
return {
amount: 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
*/
export const QuerySupplyOfResponse = {
typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse",
aminoType: "cosmos-sdk/QuerySupplyOfResponse",
is(o) {
return o && (o.$typeUrl === QuerySupplyOfResponse.typeUrl || Coin.is(o.amount));
},
isAmino(o) {
return o && (o.$typeUrl === QuerySupplyOfResponse.typeUrl || Coin.isAmino(o.amount));
},
encode(message, writer = BinaryWriter.create()) {
if (message.amount !== undefined) {
Coin.encode(message.amount, 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 = createBaseQuerySupplyOfResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.amount = 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.fromPartial(object.amount) : undefined;
return message;
},
fromAmino(object) {
const message = createBaseQuerySupplyOfResponse();
if (object.amount !== undefined && object.amount !== null) {
message.amount = Coin.fromAmino(object.amount);
}
return message;
},
toAmino(message) {
const obj = {};
obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.toAmino(Coin.fromPartial({}));
return obj;
},
fromAminoMsg(object) {
return QuerySupplyOfResponse.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QuerySupplyOfResponse",
value: QuerySupplyOfResponse.toAmino(message)
};
},
fromProtoMsg(message) {
return QuerySupplyOfResponse.decode(message.value);
},
toProto(message) {
return QuerySupplyOfResponse.encode(message).finish();
},
toProtoMsg(message) {
return {
typeUrl: "/cosmos.bank.v1beta1.QuerySupplyOfResponse",
value: QuerySupplyOfResponse.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(QuerySupplyOfResponse.typeUrl)) {
return;
}
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
*/
export const QueryParamsRequest = {
typeUrl: "/cosmos.bank.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.bank.v1beta1.QueryParamsRequest",
value: QueryParamsRequest.encode(message).finish()
};
},
registerTypeUrl() { }
};
function createBaseQueryParamsResponse() {
return {
params: 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
*/
export const QueryParamsResponse = {
typeUrl: "/cosmos.bank.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.bank.v1beta1.QueryParamsResponse",
value: QueryParamsResponse.encode(message).finish()
};
},
registerTypeUrl() {
if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryParamsResponse.typeUrl)) {
return;
}
Params.registerTypeUrl();
}
};
function createBaseQueryDenomsMetadataRequest() {
return {
pagination: undefined
};
}
/**
* QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method.
* @name QueryDenomsMetadataRequest
* @package cosmos.bank.v1beta1
* @see proto type: cosmos.bank.v1beta1.QueryDenomsMetadataRequest
*/
export const QueryDenomsMetadataRequest = {
typeUrl: "/cosmos.bank.v1beta1.QueryDenomsMetadataRequest",
aminoType: "cosmos-sdk/QueryDenomsMetadataRequest",
is(o) {
return o && o.$typeUrl === QueryDenomsMetadataRequest.typeUrl;
},
isAmino(o) {
return o && o.$typeUrl === QueryDenomsMetadataRequest.typeUrl;
},
encode(message, writer = BinaryWriter.create()) {
if (message.pagination !== undefined) {
PageRequest.encode(message.pagination, 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 = createBaseQueryDenomsMetadataRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.pagination = PageRequest.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(object) {
const message = createBaseQueryDenomsMetadataRequest();
message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined;
return message;
},
fromAmino(object) {
const message = createBaseQueryDenomsMetadataRequest();
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageRequest.fromAmino(object.pagination);
}
return message;
},
toAmino(message) {
const obj = {};
obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined;
return obj;
},
fromAminoMsg(object) {
return QueryDenomsMetadataRequest.fromAmino(object.value);
},
toAminoMsg(message) {
return {
type: "cosmos-sdk/QueryDe