stargate: Update ts-proto-generated codec

This commit is contained in:
willclarktech 2021-01-27 15:07:07 +00:00
parent ad1ac84b3b
commit d026a92f68
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7
39 changed files with 5798 additions and 28111 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3,10 +3,12 @@ import { Any } from "../../../google/protobuf/any";
import * as Long from "long";
import { Writer, Reader } from "protobufjs/minimal";
export const protobufPackage = "cosmos.auth.v1beta1";
/**
* BaseAccount defines a base account type. It contains all the necessary fields
* for basic account functionality. Any custom account type should extend this
* type for additional functionality (e.g. vesting).
* BaseAccount defines a base account type. It contains all the necessary fields
* for basic account functionality. Any custom account type should extend this
* type for additional functionality (e.g. vesting).
*/
export interface BaseAccount {
address: string;
@ -15,18 +17,14 @@ export interface BaseAccount {
sequence: Long;
}
/**
* ModuleAccount defines an account for modules that holds coins on a pool.
*/
/** ModuleAccount defines an account for modules that holds coins on a pool. */
export interface ModuleAccount {
baseAccount?: BaseAccount;
name: string;
permissions: string[];
}
/**
* Params defines the parameters for the auth module.
*/
/** Params defines the parameters for the auth module. */
export interface Params {
maxMemoCharacters: Long;
txSigLimit: Long;
@ -35,26 +33,7 @@ export interface Params {
sigVerifyCostSecp256k1: Long;
}
const baseBaseAccount: object = {
address: "",
accountNumber: Long.UZERO,
sequence: Long.UZERO,
};
const baseModuleAccount: object = {
name: "",
permissions: "",
};
const baseParams: object = {
maxMemoCharacters: Long.UZERO,
txSigLimit: Long.UZERO,
txSizeCostPerByte: Long.UZERO,
sigVerifyCostEd25519: Long.UZERO,
sigVerifyCostSecp256k1: Long.UZERO,
};
export const protobufPackage = "cosmos.auth.v1beta1";
const baseBaseAccount: object = { address: "", accountNumber: Long.UZERO, sequence: Long.UZERO };
export const BaseAccount = {
encode(message: BaseAccount, writer: Writer = Writer.create()): Writer {
@ -66,7 +45,8 @@ export const BaseAccount = {
writer.uint32(32).uint64(message.sequence);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): BaseAccount {
decode(input: Reader | Uint8Array, length?: number): BaseAccount {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseBaseAccount } as BaseAccount;
@ -92,6 +72,7 @@ export const BaseAccount = {
}
return message;
},
fromJSON(object: any): BaseAccount {
const message = { ...baseBaseAccount } as BaseAccount;
if (object.address !== undefined && object.address !== null) {
@ -116,6 +97,7 @@ export const BaseAccount = {
}
return message;
},
fromPartial(object: DeepPartial<BaseAccount>): BaseAccount {
const message = { ...baseBaseAccount } as BaseAccount;
if (object.address !== undefined && object.address !== null) {
@ -140,6 +122,7 @@ export const BaseAccount = {
}
return message;
},
toJSON(message: BaseAccount): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
@ -151,6 +134,8 @@ export const BaseAccount = {
},
};
const baseModuleAccount: object = { name: "", permissions: "" };
export const ModuleAccount = {
encode(message: ModuleAccount, writer: Writer = Writer.create()): Writer {
if (message.baseAccount !== undefined && message.baseAccount !== undefined) {
@ -162,7 +147,8 @@ export const ModuleAccount = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ModuleAccount {
decode(input: Reader | Uint8Array, length?: number): ModuleAccount {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseModuleAccount } as ModuleAccount;
@ -186,6 +172,7 @@ export const ModuleAccount = {
}
return message;
},
fromJSON(object: any): ModuleAccount {
const message = { ...baseModuleAccount } as ModuleAccount;
message.permissions = [];
@ -206,6 +193,7 @@ export const ModuleAccount = {
}
return message;
},
fromPartial(object: DeepPartial<ModuleAccount>): ModuleAccount {
const message = { ...baseModuleAccount } as ModuleAccount;
message.permissions = [];
@ -226,6 +214,7 @@ export const ModuleAccount = {
}
return message;
},
toJSON(message: ModuleAccount): unknown {
const obj: any = {};
message.baseAccount !== undefined &&
@ -240,6 +229,14 @@ export const ModuleAccount = {
},
};
const baseParams: object = {
maxMemoCharacters: Long.UZERO,
txSigLimit: Long.UZERO,
txSizeCostPerByte: Long.UZERO,
sigVerifyCostEd25519: Long.UZERO,
sigVerifyCostSecp256k1: Long.UZERO,
};
export const Params = {
encode(message: Params, writer: Writer = Writer.create()): Writer {
writer.uint32(8).uint64(message.maxMemoCharacters);
@ -249,7 +246,8 @@ export const Params = {
writer.uint32(40).uint64(message.sigVerifyCostSecp256k1);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Params {
decode(input: Reader | Uint8Array, length?: number): Params {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseParams } as Params;
@ -278,6 +276,7 @@ export const Params = {
}
return message;
},
fromJSON(object: any): Params {
const message = { ...baseParams } as Params;
if (object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null) {
@ -307,6 +306,7 @@ export const Params = {
}
return message;
},
fromPartial(object: DeepPartial<Params>): Params {
const message = { ...baseParams } as Params;
if (object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null) {
@ -336,6 +336,7 @@ export const Params = {
}
return message;
},
toJSON(message: Params): unknown {
const obj: any = {};
message.maxMemoCharacters !== undefined &&
@ -351,7 +352,7 @@ export const Params = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -2,99 +2,40 @@
import { Any } from "../../../google/protobuf/any";
import { Params } from "../../../cosmos/auth/v1beta1/auth";
import { Reader, Writer } from "protobufjs/minimal";
import * as Long from "long";
/**
* QueryAccountRequest is the request type for the Query/Account RPC method.
*/
export const protobufPackage = "cosmos.auth.v1beta1";
/** QueryAccountRequest is the request type for the Query/Account RPC method. */
export interface QueryAccountRequest {
/**
* address defines the address to query for.
*/
/** address defines the address to query for. */
address: string;
}
/**
* QueryAccountResponse is the response type for the Query/Account RPC method.
*/
/** QueryAccountResponse is the response type for the Query/Account RPC method. */
export interface QueryAccountResponse {
/**
* account defines the account of the corresponding address.
*/
/** account defines the account of the corresponding address. */
account?: Any;
}
/**
* QueryParamsRequest is the request type for the Query/Params RPC method.
*/
/** QueryParamsRequest is the request type for the Query/Params RPC method. */
export interface QueryParamsRequest {}
/**
* QueryParamsResponse is the response type for the Query/Params RPC method.
*/
/** QueryParamsResponse is the response type for the Query/Params RPC method. */
export interface QueryParamsResponse {
/**
* params defines the parameters of the module.
*/
/** params defines the parameters of the module. */
params?: Params;
}
const baseQueryAccountRequest: object = {
address: "",
};
const baseQueryAccountResponse: object = {};
const baseQueryParamsRequest: object = {};
const baseQueryParamsResponse: object = {};
/**
* Query defines the gRPC querier service.
*/
export interface Query {
/**
* Account returns account details based on address.
*/
Account(request: QueryAccountRequest): Promise<QueryAccountResponse>;
/**
* Params queries all parameters.
*/
Params(request: QueryParamsRequest): Promise<QueryParamsResponse>;
}
export class QueryClientImpl implements Query {
private readonly rpc: Rpc;
constructor(rpc: Rpc) {
this.rpc = rpc;
}
Account(request: QueryAccountRequest): Promise<QueryAccountResponse> {
const data = QueryAccountRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Account", data);
return promise.then((data) => QueryAccountResponse.decode(new Reader(data)));
}
Params(request: QueryParamsRequest): Promise<QueryParamsResponse> {
const data = QueryParamsRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Params", data);
return promise.then((data) => QueryParamsResponse.decode(new Reader(data)));
}
}
interface Rpc {
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
}
export const protobufPackage = "cosmos.auth.v1beta1";
const baseQueryAccountRequest: object = { address: "" };
export const QueryAccountRequest = {
encode(message: QueryAccountRequest, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.address);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryAccountRequest {
decode(input: Reader | Uint8Array, length?: number): QueryAccountRequest {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryAccountRequest } as QueryAccountRequest;
@ -111,6 +52,7 @@ export const QueryAccountRequest = {
}
return message;
},
fromJSON(object: any): QueryAccountRequest {
const message = { ...baseQueryAccountRequest } as QueryAccountRequest;
if (object.address !== undefined && object.address !== null) {
@ -120,6 +62,7 @@ export const QueryAccountRequest = {
}
return message;
},
fromPartial(object: DeepPartial<QueryAccountRequest>): QueryAccountRequest {
const message = { ...baseQueryAccountRequest } as QueryAccountRequest;
if (object.address !== undefined && object.address !== null) {
@ -129,6 +72,7 @@ export const QueryAccountRequest = {
}
return message;
},
toJSON(message: QueryAccountRequest): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
@ -136,6 +80,8 @@ export const QueryAccountRequest = {
},
};
const baseQueryAccountResponse: object = {};
export const QueryAccountResponse = {
encode(message: QueryAccountResponse, writer: Writer = Writer.create()): Writer {
if (message.account !== undefined && message.account !== undefined) {
@ -143,7 +89,8 @@ export const QueryAccountResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryAccountResponse {
decode(input: Reader | Uint8Array, length?: number): QueryAccountResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryAccountResponse } as QueryAccountResponse;
@ -160,6 +107,7 @@ export const QueryAccountResponse = {
}
return message;
},
fromJSON(object: any): QueryAccountResponse {
const message = { ...baseQueryAccountResponse } as QueryAccountResponse;
if (object.account !== undefined && object.account !== null) {
@ -169,6 +117,7 @@ export const QueryAccountResponse = {
}
return message;
},
fromPartial(object: DeepPartial<QueryAccountResponse>): QueryAccountResponse {
const message = { ...baseQueryAccountResponse } as QueryAccountResponse;
if (object.account !== undefined && object.account !== null) {
@ -178,6 +127,7 @@ export const QueryAccountResponse = {
}
return message;
},
toJSON(message: QueryAccountResponse): unknown {
const obj: any = {};
message.account !== undefined &&
@ -186,11 +136,14 @@ export const QueryAccountResponse = {
},
};
const baseQueryParamsRequest: object = {};
export const QueryParamsRequest = {
encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer {
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryParamsRequest {
decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
@ -204,20 +157,25 @@ export const QueryParamsRequest = {
}
return message;
},
fromJSON(_: any): QueryParamsRequest {
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
return message;
},
fromPartial(_: DeepPartial<QueryParamsRequest>): QueryParamsRequest {
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
return message;
},
toJSON(_: QueryParamsRequest): unknown {
const obj: any = {};
return obj;
},
};
const baseQueryParamsResponse: object = {};
export const QueryParamsResponse = {
encode(message: QueryParamsResponse, writer: Writer = Writer.create()): Writer {
if (message.params !== undefined && message.params !== undefined) {
@ -225,7 +183,8 @@ export const QueryParamsResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryParamsResponse {
decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
@ -242,6 +201,7 @@ export const QueryParamsResponse = {
}
return message;
},
fromJSON(object: any): QueryParamsResponse {
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
if (object.params !== undefined && object.params !== null) {
@ -251,6 +211,7 @@ export const QueryParamsResponse = {
}
return message;
},
fromPartial(object: DeepPartial<QueryParamsResponse>): QueryParamsResponse {
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
if (object.params !== undefined && object.params !== null) {
@ -260,6 +221,7 @@ export const QueryParamsResponse = {
}
return message;
},
toJSON(message: QueryParamsResponse): unknown {
const obj: any = {};
message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined);
@ -267,7 +229,37 @@ export const QueryParamsResponse = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined;
/** Query defines the gRPC querier service. */
export interface Query {
/** Account returns account details based on address. */
Account(request: QueryAccountRequest): Promise<QueryAccountResponse>;
/** Params queries all parameters. */
Params(request: QueryParamsRequest): Promise<QueryParamsResponse>;
}
export class QueryClientImpl implements Query {
private readonly rpc: Rpc;
constructor(rpc: Rpc) {
this.rpc = rpc;
}
Account(request: QueryAccountRequest): Promise<QueryAccountResponse> {
const data = QueryAccountRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "methodDesc.name", data);
return promise.then((data) => QueryAccountResponse.decode(new Reader(data)));
}
Params(request: QueryParamsRequest): Promise<QueryParamsResponse> {
const data = QueryParamsRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "methodDesc.name", data);
return promise.then((data) => QueryParamsResponse.decode(new Reader(data)));
}
}
interface Rpc {
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
}
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -1,124 +1,82 @@
/* eslint-disable */
import { Coin } from "../../../cosmos/base/v1beta1/coin";
import { Writer, Reader } from "protobufjs/minimal";
import * as Long from "long";
/**
* Params defines the parameters for the bank module.
*/
export const protobufPackage = "cosmos.bank.v1beta1";
/** Params defines the parameters for the bank module. */
export interface Params {
sendEnabled: SendEnabled[];
defaultSendEnabled: boolean;
}
/**
* SendEnabled maps coin denom to a send_enabled status (whether a denom is
* sendable).
* SendEnabled maps coin denom to a send_enabled status (whether a denom is
* sendable).
*/
export interface SendEnabled {
denom: string;
enabled: boolean;
}
/**
* Input models transaction input.
*/
/** Input models transaction input. */
export interface Input {
address: string;
coins: Coin[];
}
/**
* Output models transaction outputs.
*/
/** Output models transaction outputs. */
export interface Output {
address: string;
coins: Coin[];
}
/**
* Supply represents a struct that passively keeps track of the total supply
* amounts in the network.
* Supply represents a struct that passively keeps track of the total supply
* amounts in the network.
*/
export interface Supply {
total: Coin[];
}
/**
* DenomUnit represents a struct that describes a given
* denomination unit of the basic token.
* DenomUnit represents a struct that describes a given
* denomination unit of the basic token.
*/
export interface DenomUnit {
/**
* denom represents the string name of the given denom unit (e.g uatom).
*/
/** denom represents the string name of the given denom unit (e.g uatom). */
denom: string;
/**
* exponent represents power of 10 exponent that one must
* raise the base_denom to in order to equal the given DenomUnit's denom
* 1 denom = 1^exponent base_denom
* (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with
* exponent = 6, thus: 1 atom = 10^6 uatom).
* exponent represents power of 10 exponent that one must
* raise the base_denom to in order to equal the given DenomUnit's denom
* 1 denom = 1^exponent base_denom
* (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with
* exponent = 6, thus: 1 atom = 10^6 uatom).
*/
exponent: number;
/**
* aliases is a list of string aliases for the given denom
*/
/** aliases is a list of string aliases for the given denom */
aliases: string[];
}
/**
* Metadata represents a struct that describes
* a basic token.
* Metadata represents a struct that describes
* a basic token.
*/
export interface Metadata {
description: string;
/**
* denom_units represents the list of DenomUnit's for a given coin
*/
/** denom_units represents the list of DenomUnit's for a given coin */
denomUnits: DenomUnit[];
/**
* base represents the base denom (should be the DenomUnit with exponent = 0).
*/
/** base represents the base denom (should be the DenomUnit with exponent = 0). */
base: string;
/**
* display indicates the suggested denom that should be
* displayed in clients.
* display indicates the suggested denom that should be
* displayed in clients.
*/
display: string;
}
const baseParams: object = {
defaultSendEnabled: false,
};
const baseSendEnabled: object = {
denom: "",
enabled: false,
};
const baseInput: object = {
address: "",
};
const baseOutput: object = {
address: "",
};
const baseSupply: object = {};
const baseDenomUnit: object = {
denom: "",
exponent: 0,
aliases: "",
};
const baseMetadata: object = {
description: "",
base: "",
display: "",
};
export const protobufPackage = "cosmos.bank.v1beta1";
const baseParams: object = { defaultSendEnabled: false };
export const Params = {
encode(message: Params, writer: Writer = Writer.create()): Writer {
@ -128,7 +86,8 @@ export const Params = {
writer.uint32(16).bool(message.defaultSendEnabled);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Params {
decode(input: Reader | Uint8Array, length?: number): Params {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseParams } as Params;
@ -149,6 +108,7 @@ export const Params = {
}
return message;
},
fromJSON(object: any): Params {
const message = { ...baseParams } as Params;
message.sendEnabled = [];
@ -164,6 +124,7 @@ export const Params = {
}
return message;
},
fromPartial(object: DeepPartial<Params>): Params {
const message = { ...baseParams } as Params;
message.sendEnabled = [];
@ -179,6 +140,7 @@ export const Params = {
}
return message;
},
toJSON(message: Params): unknown {
const obj: any = {};
if (message.sendEnabled) {
@ -191,13 +153,16 @@ export const Params = {
},
};
const baseSendEnabled: object = { denom: "", enabled: false };
export const SendEnabled = {
encode(message: SendEnabled, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.denom);
writer.uint32(16).bool(message.enabled);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): SendEnabled {
decode(input: Reader | Uint8Array, length?: number): SendEnabled {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseSendEnabled } as SendEnabled;
@ -217,6 +182,7 @@ export const SendEnabled = {
}
return message;
},
fromJSON(object: any): SendEnabled {
const message = { ...baseSendEnabled } as SendEnabled;
if (object.denom !== undefined && object.denom !== null) {
@ -231,6 +197,7 @@ export const SendEnabled = {
}
return message;
},
fromPartial(object: DeepPartial<SendEnabled>): SendEnabled {
const message = { ...baseSendEnabled } as SendEnabled;
if (object.denom !== undefined && object.denom !== null) {
@ -245,6 +212,7 @@ export const SendEnabled = {
}
return message;
},
toJSON(message: SendEnabled): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
@ -253,6 +221,8 @@ export const SendEnabled = {
},
};
const baseInput: object = { address: "" };
export const Input = {
encode(message: Input, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.address);
@ -261,7 +231,8 @@ export const Input = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Input {
decode(input: Reader | Uint8Array, length?: number): Input {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseInput } as Input;
@ -282,6 +253,7 @@ export const Input = {
}
return message;
},
fromJSON(object: any): Input {
const message = { ...baseInput } as Input;
message.coins = [];
@ -297,6 +269,7 @@ export const Input = {
}
return message;
},
fromPartial(object: DeepPartial<Input>): Input {
const message = { ...baseInput } as Input;
message.coins = [];
@ -312,6 +285,7 @@ export const Input = {
}
return message;
},
toJSON(message: Input): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
@ -324,6 +298,8 @@ export const Input = {
},
};
const baseOutput: object = { address: "" };
export const Output = {
encode(message: Output, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.address);
@ -332,7 +308,8 @@ export const Output = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Output {
decode(input: Reader | Uint8Array, length?: number): Output {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseOutput } as Output;
@ -353,6 +330,7 @@ export const Output = {
}
return message;
},
fromJSON(object: any): Output {
const message = { ...baseOutput } as Output;
message.coins = [];
@ -368,6 +346,7 @@ export const Output = {
}
return message;
},
fromPartial(object: DeepPartial<Output>): Output {
const message = { ...baseOutput } as Output;
message.coins = [];
@ -383,6 +362,7 @@ export const Output = {
}
return message;
},
toJSON(message: Output): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
@ -395,6 +375,8 @@ export const Output = {
},
};
const baseSupply: object = {};
export const Supply = {
encode(message: Supply, writer: Writer = Writer.create()): Writer {
for (const v of message.total) {
@ -402,7 +384,8 @@ export const Supply = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Supply {
decode(input: Reader | Uint8Array, length?: number): Supply {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseSupply } as Supply;
@ -420,6 +403,7 @@ export const Supply = {
}
return message;
},
fromJSON(object: any): Supply {
const message = { ...baseSupply } as Supply;
message.total = [];
@ -430,6 +414,7 @@ export const Supply = {
}
return message;
},
fromPartial(object: DeepPartial<Supply>): Supply {
const message = { ...baseSupply } as Supply;
message.total = [];
@ -440,6 +425,7 @@ export const Supply = {
}
return message;
},
toJSON(message: Supply): unknown {
const obj: any = {};
if (message.total) {
@ -451,6 +437,8 @@ export const Supply = {
},
};
const baseDenomUnit: object = { denom: "", exponent: 0, aliases: "" };
export const DenomUnit = {
encode(message: DenomUnit, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.denom);
@ -460,7 +448,8 @@ export const DenomUnit = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): DenomUnit {
decode(input: Reader | Uint8Array, length?: number): DenomUnit {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseDenomUnit } as DenomUnit;
@ -484,6 +473,7 @@ export const DenomUnit = {
}
return message;
},
fromJSON(object: any): DenomUnit {
const message = { ...baseDenomUnit } as DenomUnit;
message.aliases = [];
@ -504,6 +494,7 @@ export const DenomUnit = {
}
return message;
},
fromPartial(object: DeepPartial<DenomUnit>): DenomUnit {
const message = { ...baseDenomUnit } as DenomUnit;
message.aliases = [];
@ -524,6 +515,7 @@ export const DenomUnit = {
}
return message;
},
toJSON(message: DenomUnit): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
@ -537,6 +529,8 @@ export const DenomUnit = {
},
};
const baseMetadata: object = { description: "", base: "", display: "" };
export const Metadata = {
encode(message: Metadata, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.description);
@ -547,7 +541,8 @@ export const Metadata = {
writer.uint32(34).string(message.display);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Metadata {
decode(input: Reader | Uint8Array, length?: number): Metadata {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMetadata } as Metadata;
@ -574,6 +569,7 @@ export const Metadata = {
}
return message;
},
fromJSON(object: any): Metadata {
const message = { ...baseMetadata } as Metadata;
message.denomUnits = [];
@ -599,6 +595,7 @@ export const Metadata = {
}
return message;
},
fromPartial(object: DeepPartial<Metadata>): Metadata {
const message = { ...baseMetadata } as Metadata;
message.denomUnits = [];
@ -624,6 +621,7 @@ export const Metadata = {
}
return message;
},
toJSON(message: Metadata): unknown {
const obj: any = {};
message.description !== undefined && (obj.description = message.description);
@ -638,7 +636,7 @@ export const Metadata = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -3,209 +3,79 @@ import { Coin } from "../../../cosmos/base/v1beta1/coin";
import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination";
import { Params } from "../../../cosmos/bank/v1beta1/bank";
import { Reader, Writer } from "protobufjs/minimal";
import * as Long from "long";
/**
* QueryBalanceRequest is the request type for the Query/Balance RPC method.
*/
export const protobufPackage = "cosmos.bank.v1beta1";
/** QueryBalanceRequest is the request type for the Query/Balance RPC method. */
export interface QueryBalanceRequest {
/**
* address is the address to query balances for.
*/
/** address is the address to query balances for. */
address: string;
/**
* denom is the coin denom to query balances for.
*/
/** denom is the coin denom to query balances for. */
denom: string;
}
/**
* QueryBalanceResponse is the response type for the Query/Balance RPC method.
*/
/** QueryBalanceResponse is the response type for the Query/Balance RPC method. */
export interface QueryBalanceResponse {
/**
* balance is the balance of the coin.
*/
/** balance is the balance of the coin. */
balance?: Coin;
}
/**
* QueryBalanceRequest is the request type for the Query/AllBalances RPC method.
*/
/** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */
export interface QueryAllBalancesRequest {
/**
* address is the address to query balances for.
*/
/** address is the address to query balances for. */
address: string;
/**
* pagination defines an optional pagination for the request.
*/
/** pagination defines an optional pagination for the request. */
pagination?: PageRequest;
}
/**
* QueryAllBalancesResponse is the response type for the Query/AllBalances RPC
* method.
* QueryAllBalancesResponse is the response type for the Query/AllBalances RPC
* method.
*/
export interface QueryAllBalancesResponse {
/**
* balances is the balances of all the coins.
*/
/** balances is the balances of all the coins. */
balances: Coin[];
/**
* pagination defines the pagination in the response.
*/
/** pagination defines the pagination in the response. */
pagination?: PageResponse;
}
/**
* QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC
* method.
* QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC
* method.
*/
export interface QueryTotalSupplyRequest {}
/**
* QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC
* method
* QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC
* method
*/
export interface QueryTotalSupplyResponse {
/**
* supply is the supply of the coins
*/
/** supply is the supply of the coins */
supply: Coin[];
}
/**
* QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method.
*/
/** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */
export interface QuerySupplyOfRequest {
/**
* denom is the coin denom to query balances for.
*/
/** denom is the coin denom to query balances for. */
denom: string;
}
/**
* QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method.
*/
/** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */
export interface QuerySupplyOfResponse {
/**
* amount is the supply of the coin.
*/
/** amount is the supply of the coin. */
amount?: Coin;
}
/**
* QueryParamsRequest defines the request type for querying x/bank parameters.
*/
/** QueryParamsRequest defines the request type for querying x/bank parameters. */
export interface QueryParamsRequest {}
/**
* QueryParamsResponse defines the response type for querying x/bank parameters.
*/
/** QueryParamsResponse defines the response type for querying x/bank parameters. */
export interface QueryParamsResponse {
params?: Params;
}
const baseQueryBalanceRequest: object = {
address: "",
denom: "",
};
const baseQueryBalanceResponse: object = {};
const baseQueryAllBalancesRequest: object = {
address: "",
};
const baseQueryAllBalancesResponse: object = {};
const baseQueryTotalSupplyRequest: object = {};
const baseQueryTotalSupplyResponse: object = {};
const baseQuerySupplyOfRequest: object = {
denom: "",
};
const baseQuerySupplyOfResponse: object = {};
const baseQueryParamsRequest: object = {};
const baseQueryParamsResponse: object = {};
/**
* Query defines the gRPC querier service.
*/
export interface Query {
/**
* Balance queries the balance of a single coin for a single account.
*/
Balance(request: QueryBalanceRequest): Promise<QueryBalanceResponse>;
/**
* AllBalances queries the balance of all coins for a single account.
*/
AllBalances(request: QueryAllBalancesRequest): Promise<QueryAllBalancesResponse>;
/**
* TotalSupply queries the total supply of all coins.
*/
TotalSupply(request: QueryTotalSupplyRequest): Promise<QueryTotalSupplyResponse>;
/**
* SupplyOf queries the supply of a single coin.
*/
SupplyOf(request: QuerySupplyOfRequest): Promise<QuerySupplyOfResponse>;
/**
* Params queries the parameters of x/bank module.
*/
Params(request: QueryParamsRequest): Promise<QueryParamsResponse>;
}
export class QueryClientImpl implements Query {
private readonly rpc: Rpc;
constructor(rpc: Rpc) {
this.rpc = rpc;
}
Balance(request: QueryBalanceRequest): Promise<QueryBalanceResponse> {
const data = QueryBalanceRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Balance", data);
return promise.then((data) => QueryBalanceResponse.decode(new Reader(data)));
}
AllBalances(request: QueryAllBalancesRequest): Promise<QueryAllBalancesResponse> {
const data = QueryAllBalancesRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "AllBalances", data);
return promise.then((data) => QueryAllBalancesResponse.decode(new Reader(data)));
}
TotalSupply(request: QueryTotalSupplyRequest): Promise<QueryTotalSupplyResponse> {
const data = QueryTotalSupplyRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "TotalSupply", data);
return promise.then((data) => QueryTotalSupplyResponse.decode(new Reader(data)));
}
SupplyOf(request: QuerySupplyOfRequest): Promise<QuerySupplyOfResponse> {
const data = QuerySupplyOfRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SupplyOf", data);
return promise.then((data) => QuerySupplyOfResponse.decode(new Reader(data)));
}
Params(request: QueryParamsRequest): Promise<QueryParamsResponse> {
const data = QueryParamsRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Params", data);
return promise.then((data) => QueryParamsResponse.decode(new Reader(data)));
}
}
interface Rpc {
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
}
export const protobufPackage = "cosmos.bank.v1beta1";
const baseQueryBalanceRequest: object = { address: "", denom: "" };
export const QueryBalanceRequest = {
encode(message: QueryBalanceRequest, writer: Writer = Writer.create()): Writer {
@ -213,7 +83,8 @@ export const QueryBalanceRequest = {
writer.uint32(18).string(message.denom);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryBalanceRequest {
decode(input: Reader | Uint8Array, length?: number): QueryBalanceRequest {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest;
@ -233,6 +104,7 @@ export const QueryBalanceRequest = {
}
return message;
},
fromJSON(object: any): QueryBalanceRequest {
const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest;
if (object.address !== undefined && object.address !== null) {
@ -247,6 +119,7 @@ export const QueryBalanceRequest = {
}
return message;
},
fromPartial(object: DeepPartial<QueryBalanceRequest>): QueryBalanceRequest {
const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest;
if (object.address !== undefined && object.address !== null) {
@ -261,6 +134,7 @@ export const QueryBalanceRequest = {
}
return message;
},
toJSON(message: QueryBalanceRequest): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
@ -269,6 +143,8 @@ export const QueryBalanceRequest = {
},
};
const baseQueryBalanceResponse: object = {};
export const QueryBalanceResponse = {
encode(message: QueryBalanceResponse, writer: Writer = Writer.create()): Writer {
if (message.balance !== undefined && message.balance !== undefined) {
@ -276,7 +152,8 @@ export const QueryBalanceResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryBalanceResponse {
decode(input: Reader | Uint8Array, length?: number): QueryBalanceResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse;
@ -293,6 +170,7 @@ export const QueryBalanceResponse = {
}
return message;
},
fromJSON(object: any): QueryBalanceResponse {
const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse;
if (object.balance !== undefined && object.balance !== null) {
@ -302,6 +180,7 @@ export const QueryBalanceResponse = {
}
return message;
},
fromPartial(object: DeepPartial<QueryBalanceResponse>): QueryBalanceResponse {
const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse;
if (object.balance !== undefined && object.balance !== null) {
@ -311,6 +190,7 @@ export const QueryBalanceResponse = {
}
return message;
},
toJSON(message: QueryBalanceResponse): unknown {
const obj: any = {};
message.balance !== undefined &&
@ -319,6 +199,8 @@ export const QueryBalanceResponse = {
},
};
const baseQueryAllBalancesRequest: object = { address: "" };
export const QueryAllBalancesRequest = {
encode(message: QueryAllBalancesRequest, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.address);
@ -327,7 +209,8 @@ export const QueryAllBalancesRequest = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryAllBalancesRequest {
decode(input: Reader | Uint8Array, length?: number): QueryAllBalancesRequest {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryAllBalancesRequest } as QueryAllBalancesRequest;
@ -347,6 +230,7 @@ export const QueryAllBalancesRequest = {
}
return message;
},
fromJSON(object: any): QueryAllBalancesRequest {
const message = { ...baseQueryAllBalancesRequest } as QueryAllBalancesRequest;
if (object.address !== undefined && object.address !== null) {
@ -361,6 +245,7 @@ export const QueryAllBalancesRequest = {
}
return message;
},
fromPartial(object: DeepPartial<QueryAllBalancesRequest>): QueryAllBalancesRequest {
const message = { ...baseQueryAllBalancesRequest } as QueryAllBalancesRequest;
if (object.address !== undefined && object.address !== null) {
@ -375,6 +260,7 @@ export const QueryAllBalancesRequest = {
}
return message;
},
toJSON(message: QueryAllBalancesRequest): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
@ -384,6 +270,8 @@ export const QueryAllBalancesRequest = {
},
};
const baseQueryAllBalancesResponse: object = {};
export const QueryAllBalancesResponse = {
encode(message: QueryAllBalancesResponse, writer: Writer = Writer.create()): Writer {
for (const v of message.balances) {
@ -394,7 +282,8 @@ export const QueryAllBalancesResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryAllBalancesResponse {
decode(input: Reader | Uint8Array, length?: number): QueryAllBalancesResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse;
@ -415,6 +304,7 @@ export const QueryAllBalancesResponse = {
}
return message;
},
fromJSON(object: any): QueryAllBalancesResponse {
const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse;
message.balances = [];
@ -430,6 +320,7 @@ export const QueryAllBalancesResponse = {
}
return message;
},
fromPartial(object: DeepPartial<QueryAllBalancesResponse>): QueryAllBalancesResponse {
const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse;
message.balances = [];
@ -445,6 +336,7 @@ export const QueryAllBalancesResponse = {
}
return message;
},
toJSON(message: QueryAllBalancesResponse): unknown {
const obj: any = {};
if (message.balances) {
@ -458,11 +350,14 @@ export const QueryAllBalancesResponse = {
},
};
const baseQueryTotalSupplyRequest: object = {};
export const QueryTotalSupplyRequest = {
encode(_: QueryTotalSupplyRequest, writer: Writer = Writer.create()): Writer {
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryTotalSupplyRequest {
decode(input: Reader | Uint8Array, length?: number): QueryTotalSupplyRequest {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryTotalSupplyRequest } as QueryTotalSupplyRequest;
@ -476,20 +371,25 @@ export const QueryTotalSupplyRequest = {
}
return message;
},
fromJSON(_: any): QueryTotalSupplyRequest {
const message = { ...baseQueryTotalSupplyRequest } as QueryTotalSupplyRequest;
return message;
},
fromPartial(_: DeepPartial<QueryTotalSupplyRequest>): QueryTotalSupplyRequest {
const message = { ...baseQueryTotalSupplyRequest } as QueryTotalSupplyRequest;
return message;
},
toJSON(_: QueryTotalSupplyRequest): unknown {
const obj: any = {};
return obj;
},
};
const baseQueryTotalSupplyResponse: object = {};
export const QueryTotalSupplyResponse = {
encode(message: QueryTotalSupplyResponse, writer: Writer = Writer.create()): Writer {
for (const v of message.supply) {
@ -497,7 +397,8 @@ export const QueryTotalSupplyResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryTotalSupplyResponse {
decode(input: Reader | Uint8Array, length?: number): QueryTotalSupplyResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryTotalSupplyResponse } as QueryTotalSupplyResponse;
@ -515,6 +416,7 @@ export const QueryTotalSupplyResponse = {
}
return message;
},
fromJSON(object: any): QueryTotalSupplyResponse {
const message = { ...baseQueryTotalSupplyResponse } as QueryTotalSupplyResponse;
message.supply = [];
@ -525,6 +427,7 @@ export const QueryTotalSupplyResponse = {
}
return message;
},
fromPartial(object: DeepPartial<QueryTotalSupplyResponse>): QueryTotalSupplyResponse {
const message = { ...baseQueryTotalSupplyResponse } as QueryTotalSupplyResponse;
message.supply = [];
@ -535,6 +438,7 @@ export const QueryTotalSupplyResponse = {
}
return message;
},
toJSON(message: QueryTotalSupplyResponse): unknown {
const obj: any = {};
if (message.supply) {
@ -546,12 +450,15 @@ export const QueryTotalSupplyResponse = {
},
};
const baseQuerySupplyOfRequest: object = { denom: "" };
export const QuerySupplyOfRequest = {
encode(message: QuerySupplyOfRequest, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.denom);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QuerySupplyOfRequest {
decode(input: Reader | Uint8Array, length?: number): QuerySupplyOfRequest {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest;
@ -568,6 +475,7 @@ export const QuerySupplyOfRequest = {
}
return message;
},
fromJSON(object: any): QuerySupplyOfRequest {
const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest;
if (object.denom !== undefined && object.denom !== null) {
@ -577,6 +485,7 @@ export const QuerySupplyOfRequest = {
}
return message;
},
fromPartial(object: DeepPartial<QuerySupplyOfRequest>): QuerySupplyOfRequest {
const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest;
if (object.denom !== undefined && object.denom !== null) {
@ -586,6 +495,7 @@ export const QuerySupplyOfRequest = {
}
return message;
},
toJSON(message: QuerySupplyOfRequest): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
@ -593,6 +503,8 @@ export const QuerySupplyOfRequest = {
},
};
const baseQuerySupplyOfResponse: object = {};
export const QuerySupplyOfResponse = {
encode(message: QuerySupplyOfResponse, writer: Writer = Writer.create()): Writer {
if (message.amount !== undefined && message.amount !== undefined) {
@ -600,7 +512,8 @@ export const QuerySupplyOfResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QuerySupplyOfResponse {
decode(input: Reader | Uint8Array, length?: number): QuerySupplyOfResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse;
@ -617,6 +530,7 @@ export const QuerySupplyOfResponse = {
}
return message;
},
fromJSON(object: any): QuerySupplyOfResponse {
const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse;
if (object.amount !== undefined && object.amount !== null) {
@ -626,6 +540,7 @@ export const QuerySupplyOfResponse = {
}
return message;
},
fromPartial(object: DeepPartial<QuerySupplyOfResponse>): QuerySupplyOfResponse {
const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse;
if (object.amount !== undefined && object.amount !== null) {
@ -635,6 +550,7 @@ export const QuerySupplyOfResponse = {
}
return message;
},
toJSON(message: QuerySupplyOfResponse): unknown {
const obj: any = {};
message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined);
@ -642,11 +558,14 @@ export const QuerySupplyOfResponse = {
},
};
const baseQueryParamsRequest: object = {};
export const QueryParamsRequest = {
encode(_: QueryParamsRequest, writer: Writer = Writer.create()): Writer {
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryParamsRequest {
decode(input: Reader | Uint8Array, length?: number): QueryParamsRequest {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
@ -660,20 +579,25 @@ export const QueryParamsRequest = {
}
return message;
},
fromJSON(_: any): QueryParamsRequest {
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
return message;
},
fromPartial(_: DeepPartial<QueryParamsRequest>): QueryParamsRequest {
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
return message;
},
toJSON(_: QueryParamsRequest): unknown {
const obj: any = {};
return obj;
},
};
const baseQueryParamsResponse: object = {};
export const QueryParamsResponse = {
encode(message: QueryParamsResponse, writer: Writer = Writer.create()): Writer {
if (message.params !== undefined && message.params !== undefined) {
@ -681,7 +605,8 @@ export const QueryParamsResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryParamsResponse {
decode(input: Reader | Uint8Array, length?: number): QueryParamsResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
@ -698,6 +623,7 @@ export const QueryParamsResponse = {
}
return message;
},
fromJSON(object: any): QueryParamsResponse {
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
if (object.params !== undefined && object.params !== null) {
@ -707,6 +633,7 @@ export const QueryParamsResponse = {
}
return message;
},
fromPartial(object: DeepPartial<QueryParamsResponse>): QueryParamsResponse {
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
if (object.params !== undefined && object.params !== null) {
@ -716,6 +643,7 @@ export const QueryParamsResponse = {
}
return message;
},
toJSON(message: QueryParamsResponse): unknown {
const obj: any = {};
message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined);
@ -723,7 +651,61 @@ export const QueryParamsResponse = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined;
/** Query defines the gRPC querier service. */
export interface Query {
/** Balance queries the balance of a single coin for a single account. */
Balance(request: QueryBalanceRequest): Promise<QueryBalanceResponse>;
/** AllBalances queries the balance of all coins for a single account. */
AllBalances(request: QueryAllBalancesRequest): Promise<QueryAllBalancesResponse>;
/** TotalSupply queries the total supply of all coins. */
TotalSupply(request: QueryTotalSupplyRequest): Promise<QueryTotalSupplyResponse>;
/** SupplyOf queries the supply of a single coin. */
SupplyOf(request: QuerySupplyOfRequest): Promise<QuerySupplyOfResponse>;
/** Params queries the parameters of x/bank module. */
Params(request: QueryParamsRequest): Promise<QueryParamsResponse>;
}
export class QueryClientImpl implements Query {
private readonly rpc: Rpc;
constructor(rpc: Rpc) {
this.rpc = rpc;
}
Balance(request: QueryBalanceRequest): Promise<QueryBalanceResponse> {
const data = QueryBalanceRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "methodDesc.name", data);
return promise.then((data) => QueryBalanceResponse.decode(new Reader(data)));
}
AllBalances(request: QueryAllBalancesRequest): Promise<QueryAllBalancesResponse> {
const data = QueryAllBalancesRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "methodDesc.name", data);
return promise.then((data) => QueryAllBalancesResponse.decode(new Reader(data)));
}
TotalSupply(request: QueryTotalSupplyRequest): Promise<QueryTotalSupplyResponse> {
const data = QueryTotalSupplyRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "methodDesc.name", data);
return promise.then((data) => QueryTotalSupplyResponse.decode(new Reader(data)));
}
SupplyOf(request: QuerySupplyOfRequest): Promise<QuerySupplyOfResponse> {
const data = QuerySupplyOfRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "methodDesc.name", data);
return promise.then((data) => QuerySupplyOfResponse.decode(new Reader(data)));
}
Params(request: QueryParamsRequest): Promise<QueryParamsResponse> {
const data = QueryParamsRequest.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "methodDesc.name", data);
return promise.then((data) => QueryParamsResponse.decode(new Reader(data)));
}
}
interface Rpc {
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
}
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -1,86 +1,31 @@
/* eslint-disable */
import { Reader, Writer } from "protobufjs/minimal";
import { Coin } from "../../../cosmos/base/v1beta1/coin";
import { Input, Output } from "../../../cosmos/bank/v1beta1/bank";
import { Reader, Writer } from "protobufjs/minimal";
import * as Long from "long";
/**
* MsgSend represents a message to send coins from one account to another.
*/
export const protobufPackage = "cosmos.bank.v1beta1";
/** MsgSend represents a message to send coins from one account to another. */
export interface MsgSend {
fromAddress: string;
toAddress: string;
amount: Coin[];
}
/**
* MsgSendResponse defines the Msg/Send response type.
*/
/** MsgSendResponse defines the Msg/Send response type. */
export interface MsgSendResponse {}
/**
* MsgMultiSend represents an arbitrary multi-in, multi-out send message.
*/
/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */
export interface MsgMultiSend {
inputs: Input[];
outputs: Output[];
}
/**
* MsgMultiSendResponse defines the Msg/MultiSend response type.
*/
/** MsgMultiSendResponse defines the Msg/MultiSend response type. */
export interface MsgMultiSendResponse {}
const baseMsgSend: object = {
fromAddress: "",
toAddress: "",
};
const baseMsgSendResponse: object = {};
const baseMsgMultiSend: object = {};
const baseMsgMultiSendResponse: object = {};
/**
* Msg defines the bank Msg service.
*/
export interface Msg {
/**
* Send defines a method for sending coins from one account to another account.
*/
Send(request: MsgSend): Promise<MsgSendResponse>;
/**
* MultiSend defines a method for sending coins from some accounts to other accounts.
*/
MultiSend(request: MsgMultiSend): Promise<MsgMultiSendResponse>;
}
export class MsgClientImpl implements Msg {
private readonly rpc: Rpc;
constructor(rpc: Rpc) {
this.rpc = rpc;
}
Send(request: MsgSend): Promise<MsgSendResponse> {
const data = MsgSend.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "Send", data);
return promise.then((data) => MsgSendResponse.decode(new Reader(data)));
}
MultiSend(request: MsgMultiSend): Promise<MsgMultiSendResponse> {
const data = MsgMultiSend.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "MultiSend", data);
return promise.then((data) => MsgMultiSendResponse.decode(new Reader(data)));
}
}
interface Rpc {
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
}
export const protobufPackage = "cosmos.bank.v1beta1";
const baseMsgSend: object = { fromAddress: "", toAddress: "" };
export const MsgSend = {
encode(message: MsgSend, writer: Writer = Writer.create()): Writer {
@ -91,7 +36,8 @@ export const MsgSend = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgSend {
decode(input: Reader | Uint8Array, length?: number): MsgSend {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgSend } as MsgSend;
@ -115,6 +61,7 @@ export const MsgSend = {
}
return message;
},
fromJSON(object: any): MsgSend {
const message = { ...baseMsgSend } as MsgSend;
message.amount = [];
@ -135,6 +82,7 @@ export const MsgSend = {
}
return message;
},
fromPartial(object: DeepPartial<MsgSend>): MsgSend {
const message = { ...baseMsgSend } as MsgSend;
message.amount = [];
@ -155,6 +103,7 @@ export const MsgSend = {
}
return message;
},
toJSON(message: MsgSend): unknown {
const obj: any = {};
message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress);
@ -168,11 +117,14 @@ export const MsgSend = {
},
};
const baseMsgSendResponse: object = {};
export const MsgSendResponse = {
encode(_: MsgSendResponse, writer: Writer = Writer.create()): Writer {
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgSendResponse {
decode(input: Reader | Uint8Array, length?: number): MsgSendResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgSendResponse } as MsgSendResponse;
@ -186,20 +138,25 @@ export const MsgSendResponse = {
}
return message;
},
fromJSON(_: any): MsgSendResponse {
const message = { ...baseMsgSendResponse } as MsgSendResponse;
return message;
},
fromPartial(_: DeepPartial<MsgSendResponse>): MsgSendResponse {
const message = { ...baseMsgSendResponse } as MsgSendResponse;
return message;
},
toJSON(_: MsgSendResponse): unknown {
const obj: any = {};
return obj;
},
};
const baseMsgMultiSend: object = {};
export const MsgMultiSend = {
encode(message: MsgMultiSend, writer: Writer = Writer.create()): Writer {
for (const v of message.inputs) {
@ -210,7 +167,8 @@ export const MsgMultiSend = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgMultiSend {
decode(input: Reader | Uint8Array, length?: number): MsgMultiSend {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgMultiSend } as MsgMultiSend;
@ -232,6 +190,7 @@ export const MsgMultiSend = {
}
return message;
},
fromJSON(object: any): MsgMultiSend {
const message = { ...baseMsgMultiSend } as MsgMultiSend;
message.inputs = [];
@ -248,6 +207,7 @@ export const MsgMultiSend = {
}
return message;
},
fromPartial(object: DeepPartial<MsgMultiSend>): MsgMultiSend {
const message = { ...baseMsgMultiSend } as MsgMultiSend;
message.inputs = [];
@ -264,6 +224,7 @@ export const MsgMultiSend = {
}
return message;
},
toJSON(message: MsgMultiSend): unknown {
const obj: any = {};
if (message.inputs) {
@ -280,11 +241,14 @@ export const MsgMultiSend = {
},
};
const baseMsgMultiSendResponse: object = {};
export const MsgMultiSendResponse = {
encode(_: MsgMultiSendResponse, writer: Writer = Writer.create()): Writer {
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgMultiSendResponse {
decode(input: Reader | Uint8Array, length?: number): MsgMultiSendResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse;
@ -298,21 +262,54 @@ export const MsgMultiSendResponse = {
}
return message;
},
fromJSON(_: any): MsgMultiSendResponse {
const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse;
return message;
},
fromPartial(_: DeepPartial<MsgMultiSendResponse>): MsgMultiSendResponse {
const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse;
return message;
},
toJSON(_: MsgMultiSendResponse): unknown {
const obj: any = {};
return obj;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined;
/** Msg defines the bank Msg service. */
export interface Msg {
/** Send defines a method for sending coins from one account to another account. */
Send(request: MsgSend): Promise<MsgSendResponse>;
/** MultiSend defines a method for sending coins from some accounts to other accounts. */
MultiSend(request: MsgMultiSend): Promise<MsgMultiSendResponse>;
}
export class MsgClientImpl implements Msg {
private readonly rpc: Rpc;
constructor(rpc: Rpc) {
this.rpc = rpc;
}
Send(request: MsgSend): Promise<MsgSendResponse> {
const data = MsgSend.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "methodDesc.name", data);
return promise.then((data) => MsgSendResponse.decode(new Reader(data)));
}
MultiSend(request: MsgMultiSend): Promise<MsgMultiSendResponse> {
const data = MsgMultiSend.encode(request).finish();
const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "methodDesc.name", data);
return promise.then((data) => MsgMultiSendResponse.decode(new Reader(data)));
}
}
interface Rpc {
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
}
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -4,80 +4,60 @@ import { Any } from "../../../../google/protobuf/any";
import { Event } from "../../../../tendermint/abci/types";
import { Writer, Reader } from "protobufjs/minimal";
export const protobufPackage = "cosmos.base.abci.v1beta1";
/**
* TxResponse defines a structure containing relevant tx data and metadata. The
* tags are stringified and the log is JSON decoded.
* TxResponse defines a structure containing relevant tx data and metadata. The
* tags are stringified and the log is JSON decoded.
*/
export interface TxResponse {
/**
* The block height
*/
/** The block height */
height: Long;
/**
* The transaction hash.
*/
/** The transaction hash. */
txhash: string;
/**
* Namespace for the Code
*/
/** Namespace for the Code */
codespace: string;
/**
* Response code.
*/
/** Response code. */
code: number;
/**
* Result bytes, if any.
*/
/** Result bytes, if any. */
data: string;
/**
* The output of the application's logger (raw string). May be
* non-deterministic.
* The output of the application's logger (raw string). May be
* non-deterministic.
*/
rawLog: string;
/**
* The output of the application's logger (typed). May be non-deterministic.
*/
/** The output of the application's logger (typed). May be non-deterministic. */
logs: ABCIMessageLog[];
/**
* Additional information. May be non-deterministic.
*/
/** Additional information. May be non-deterministic. */
info: string;
/**
* Amount of gas requested for transaction.
*/
/** Amount of gas requested for transaction. */
gasWanted: Long;
/**
* Amount of gas consumed by transaction.
*/
/** Amount of gas consumed by transaction. */
gasUsed: Long;
/**
* The request transaction bytes.
*/
/** The request transaction bytes. */
tx?: Any;
/**
* Time of the previous block. For heights > 1, it's the weighted median of
* the timestamps of the valid votes in the block.LastCommit. For height == 1,
* it's genesis time.
* Time of the previous block. For heights > 1, it's the weighted median of
* the timestamps of the valid votes in the block.LastCommit. For height == 1,
* it's genesis time.
*/
timestamp: string;
}
/**
* ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
*/
/** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */
export interface ABCIMessageLog {
msgIndex: number;
log: string;
/**
* Events contains a slice of Event objects that were emitted during some
* execution.
* Events contains a slice of Event objects that were emitted during some
* execution.
*/
events: StringEvent[];
}
/**
* StringEvent defines en Event object wrapper where all the attributes
* contain key/value pairs that are strings instead of raw bytes.
* StringEvent defines en Event object wrapper where all the attributes
* contain key/value pairs that are strings instead of raw bytes.
*/
export interface StringEvent {
type: string;
@ -85,51 +65,41 @@ export interface StringEvent {
}
/**
* Attribute defines an attribute wrapper where the key and value are
* strings instead of raw bytes.
* Attribute defines an attribute wrapper where the key and value are
* strings instead of raw bytes.
*/
export interface Attribute {
key: string;
value: string;
}
/**
* GasInfo defines tx execution gas context.
*/
/** GasInfo defines tx execution gas context. */
export interface GasInfo {
/**
* GasWanted is the maximum units of work we allow this tx to perform.
*/
/** GasWanted is the maximum units of work we allow this tx to perform. */
gasWanted: Long;
/**
* GasUsed is the amount of gas actually consumed.
*/
/** GasUsed is the amount of gas actually consumed. */
gasUsed: Long;
}
/**
* Result is the union of ResponseFormat and ResponseCheckTx.
*/
/** Result is the union of ResponseFormat and ResponseCheckTx. */
export interface Result {
/**
* Data is any data returned from message or handler execution. It MUST be
* length prefixed in order to separate data from multiple message executions.
* Data is any data returned from message or handler execution. It MUST be
* length prefixed in order to separate data from multiple message executions.
*/
data: Uint8Array;
/**
* Log contains the log information from message or handler execution.
*/
/** Log contains the log information from message or handler execution. */
log: string;
/**
* Events contains a slice of Event objects that were emitted during message
* or handler execution.
* Events contains a slice of Event objects that were emitted during message
* or handler execution.
*/
events: Event[];
}
/**
* SimulationResponse defines the response generated when a transaction is
* successfully simulated.
* SimulationResponse defines the response generated when a transaction is
* successfully simulated.
*/
export interface SimulationResponse {
gasInfo?: GasInfo;
@ -137,8 +107,8 @@ export interface SimulationResponse {
}
/**
* MsgData defines the data returned in a Result object during message
* execution.
* MsgData defines the data returned in a Result object during message
* execution.
*/
export interface MsgData {
msgType: string;
@ -146,40 +116,26 @@ export interface MsgData {
}
/**
* TxMsgData defines a list of MsgData. A transaction will have a MsgData object
* for each message.
* TxMsgData defines a list of MsgData. A transaction will have a MsgData object
* for each message.
*/
export interface TxMsgData {
data: MsgData[];
}
/**
* SearchTxsResult defines a structure for querying txs pageable
*/
/** SearchTxsResult defines a structure for querying txs pageable */
export interface SearchTxsResult {
/**
* Count of all txs
*/
/** Count of all txs */
totalCount: Long;
/**
* Count of txs in current page
*/
/** Count of txs in current page */
count: Long;
/**
* Index of current page, start from 1
*/
/** Index of current page, start from 1 */
pageNumber: Long;
/**
* Count of total pages
*/
/** Count of total pages */
pageTotal: Long;
/**
* Max count txs per page
*/
/** Max count txs per page */
limit: Long;
/**
* List of txs in current page
*/
/** List of txs in current page */
txs: TxResponse[];
}
@ -196,47 +152,6 @@ const baseTxResponse: object = {
timestamp: "",
};
const baseABCIMessageLog: object = {
msgIndex: 0,
log: "",
};
const baseStringEvent: object = {
type: "",
};
const baseAttribute: object = {
key: "",
value: "",
};
const baseGasInfo: object = {
gasWanted: Long.UZERO,
gasUsed: Long.UZERO,
};
const baseResult: object = {
log: "",
};
const baseSimulationResponse: object = {};
const baseMsgData: object = {
msgType: "",
};
const baseTxMsgData: object = {};
const baseSearchTxsResult: object = {
totalCount: Long.UZERO,
count: Long.UZERO,
pageNumber: Long.UZERO,
pageTotal: Long.UZERO,
limit: Long.UZERO,
};
export const protobufPackage = "cosmos.base.abci.v1beta1";
export const TxResponse = {
encode(message: TxResponse, writer: Writer = Writer.create()): Writer {
writer.uint32(8).int64(message.height);
@ -257,7 +172,8 @@ export const TxResponse = {
writer.uint32(98).string(message.timestamp);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): TxResponse {
decode(input: Reader | Uint8Array, length?: number): TxResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseTxResponse } as TxResponse;
@ -308,6 +224,7 @@ export const TxResponse = {
}
return message;
},
fromJSON(object: any): TxResponse {
const message = { ...baseTxResponse } as TxResponse;
message.logs = [];
@ -373,6 +290,7 @@ export const TxResponse = {
}
return message;
},
fromPartial(object: DeepPartial<TxResponse>): TxResponse {
const message = { ...baseTxResponse } as TxResponse;
message.logs = [];
@ -438,6 +356,7 @@ export const TxResponse = {
}
return message;
},
toJSON(message: TxResponse): unknown {
const obj: any = {};
message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString());
@ -460,6 +379,8 @@ export const TxResponse = {
},
};
const baseABCIMessageLog: object = { msgIndex: 0, log: "" };
export const ABCIMessageLog = {
encode(message: ABCIMessageLog, writer: Writer = Writer.create()): Writer {
writer.uint32(8).uint32(message.msgIndex);
@ -469,7 +390,8 @@ export const ABCIMessageLog = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ABCIMessageLog {
decode(input: Reader | Uint8Array, length?: number): ABCIMessageLog {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseABCIMessageLog } as ABCIMessageLog;
@ -493,6 +415,7 @@ export const ABCIMessageLog = {
}
return message;
},
fromJSON(object: any): ABCIMessageLog {
const message = { ...baseABCIMessageLog } as ABCIMessageLog;
message.events = [];
@ -513,6 +436,7 @@ export const ABCIMessageLog = {
}
return message;
},
fromPartial(object: DeepPartial<ABCIMessageLog>): ABCIMessageLog {
const message = { ...baseABCIMessageLog } as ABCIMessageLog;
message.events = [];
@ -533,6 +457,7 @@ export const ABCIMessageLog = {
}
return message;
},
toJSON(message: ABCIMessageLog): unknown {
const obj: any = {};
message.msgIndex !== undefined && (obj.msgIndex = message.msgIndex);
@ -546,6 +471,8 @@ export const ABCIMessageLog = {
},
};
const baseStringEvent: object = { type: "" };
export const StringEvent = {
encode(message: StringEvent, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.type);
@ -554,7 +481,8 @@ export const StringEvent = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): StringEvent {
decode(input: Reader | Uint8Array, length?: number): StringEvent {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseStringEvent } as StringEvent;
@ -575,6 +503,7 @@ export const StringEvent = {
}
return message;
},
fromJSON(object: any): StringEvent {
const message = { ...baseStringEvent } as StringEvent;
message.attributes = [];
@ -590,6 +519,7 @@ export const StringEvent = {
}
return message;
},
fromPartial(object: DeepPartial<StringEvent>): StringEvent {
const message = { ...baseStringEvent } as StringEvent;
message.attributes = [];
@ -605,6 +535,7 @@ export const StringEvent = {
}
return message;
},
toJSON(message: StringEvent): unknown {
const obj: any = {};
message.type !== undefined && (obj.type = message.type);
@ -617,13 +548,16 @@ export const StringEvent = {
},
};
const baseAttribute: object = { key: "", value: "" };
export const Attribute = {
encode(message: Attribute, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.key);
writer.uint32(18).string(message.value);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Attribute {
decode(input: Reader | Uint8Array, length?: number): Attribute {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseAttribute } as Attribute;
@ -643,6 +577,7 @@ export const Attribute = {
}
return message;
},
fromJSON(object: any): Attribute {
const message = { ...baseAttribute } as Attribute;
if (object.key !== undefined && object.key !== null) {
@ -657,6 +592,7 @@ export const Attribute = {
}
return message;
},
fromPartial(object: DeepPartial<Attribute>): Attribute {
const message = { ...baseAttribute } as Attribute;
if (object.key !== undefined && object.key !== null) {
@ -671,6 +607,7 @@ export const Attribute = {
}
return message;
},
toJSON(message: Attribute): unknown {
const obj: any = {};
message.key !== undefined && (obj.key = message.key);
@ -679,13 +616,16 @@ export const Attribute = {
},
};
const baseGasInfo: object = { gasWanted: Long.UZERO, gasUsed: Long.UZERO };
export const GasInfo = {
encode(message: GasInfo, writer: Writer = Writer.create()): Writer {
writer.uint32(8).uint64(message.gasWanted);
writer.uint32(16).uint64(message.gasUsed);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): GasInfo {
decode(input: Reader | Uint8Array, length?: number): GasInfo {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseGasInfo } as GasInfo;
@ -705,6 +645,7 @@ export const GasInfo = {
}
return message;
},
fromJSON(object: any): GasInfo {
const message = { ...baseGasInfo } as GasInfo;
if (object.gasWanted !== undefined && object.gasWanted !== null) {
@ -719,6 +660,7 @@ export const GasInfo = {
}
return message;
},
fromPartial(object: DeepPartial<GasInfo>): GasInfo {
const message = { ...baseGasInfo } as GasInfo;
if (object.gasWanted !== undefined && object.gasWanted !== null) {
@ -733,6 +675,7 @@ export const GasInfo = {
}
return message;
},
toJSON(message: GasInfo): unknown {
const obj: any = {};
message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.UZERO).toString());
@ -741,6 +684,8 @@ export const GasInfo = {
},
};
const baseResult: object = { log: "" };
export const Result = {
encode(message: Result, writer: Writer = Writer.create()): Writer {
writer.uint32(10).bytes(message.data);
@ -750,7 +695,8 @@ export const Result = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Result {
decode(input: Reader | Uint8Array, length?: number): Result {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseResult } as Result;
@ -774,6 +720,7 @@ export const Result = {
}
return message;
},
fromJSON(object: any): Result {
const message = { ...baseResult } as Result;
message.events = [];
@ -792,6 +739,7 @@ export const Result = {
}
return message;
},
fromPartial(object: DeepPartial<Result>): Result {
const message = { ...baseResult } as Result;
message.events = [];
@ -812,6 +760,7 @@ export const Result = {
}
return message;
},
toJSON(message: Result): unknown {
const obj: any = {};
message.data !== undefined &&
@ -826,6 +775,8 @@ export const Result = {
},
};
const baseSimulationResponse: object = {};
export const SimulationResponse = {
encode(message: SimulationResponse, writer: Writer = Writer.create()): Writer {
if (message.gasInfo !== undefined && message.gasInfo !== undefined) {
@ -836,7 +787,8 @@ export const SimulationResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): SimulationResponse {
decode(input: Reader | Uint8Array, length?: number): SimulationResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseSimulationResponse } as SimulationResponse;
@ -856,6 +808,7 @@ export const SimulationResponse = {
}
return message;
},
fromJSON(object: any): SimulationResponse {
const message = { ...baseSimulationResponse } as SimulationResponse;
if (object.gasInfo !== undefined && object.gasInfo !== null) {
@ -870,6 +823,7 @@ export const SimulationResponse = {
}
return message;
},
fromPartial(object: DeepPartial<SimulationResponse>): SimulationResponse {
const message = { ...baseSimulationResponse } as SimulationResponse;
if (object.gasInfo !== undefined && object.gasInfo !== null) {
@ -884,6 +838,7 @@ export const SimulationResponse = {
}
return message;
},
toJSON(message: SimulationResponse): unknown {
const obj: any = {};
message.gasInfo !== undefined &&
@ -893,13 +848,16 @@ export const SimulationResponse = {
},
};
const baseMsgData: object = { msgType: "" };
export const MsgData = {
encode(message: MsgData, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.msgType);
writer.uint32(18).bytes(message.data);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgData {
decode(input: Reader | Uint8Array, length?: number): MsgData {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgData } as MsgData;
@ -919,6 +877,7 @@ export const MsgData = {
}
return message;
},
fromJSON(object: any): MsgData {
const message = { ...baseMsgData } as MsgData;
if (object.msgType !== undefined && object.msgType !== null) {
@ -931,6 +890,7 @@ export const MsgData = {
}
return message;
},
fromPartial(object: DeepPartial<MsgData>): MsgData {
const message = { ...baseMsgData } as MsgData;
if (object.msgType !== undefined && object.msgType !== null) {
@ -945,6 +905,7 @@ export const MsgData = {
}
return message;
},
toJSON(message: MsgData): unknown {
const obj: any = {};
message.msgType !== undefined && (obj.msgType = message.msgType);
@ -954,6 +915,8 @@ export const MsgData = {
},
};
const baseTxMsgData: object = {};
export const TxMsgData = {
encode(message: TxMsgData, writer: Writer = Writer.create()): Writer {
for (const v of message.data) {
@ -961,7 +924,8 @@ export const TxMsgData = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): TxMsgData {
decode(input: Reader | Uint8Array, length?: number): TxMsgData {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseTxMsgData } as TxMsgData;
@ -979,6 +943,7 @@ export const TxMsgData = {
}
return message;
},
fromJSON(object: any): TxMsgData {
const message = { ...baseTxMsgData } as TxMsgData;
message.data = [];
@ -989,6 +954,7 @@ export const TxMsgData = {
}
return message;
},
fromPartial(object: DeepPartial<TxMsgData>): TxMsgData {
const message = { ...baseTxMsgData } as TxMsgData;
message.data = [];
@ -999,6 +965,7 @@ export const TxMsgData = {
}
return message;
},
toJSON(message: TxMsgData): unknown {
const obj: any = {};
if (message.data) {
@ -1010,6 +977,14 @@ export const TxMsgData = {
},
};
const baseSearchTxsResult: object = {
totalCount: Long.UZERO,
count: Long.UZERO,
pageNumber: Long.UZERO,
pageTotal: Long.UZERO,
limit: Long.UZERO,
};
export const SearchTxsResult = {
encode(message: SearchTxsResult, writer: Writer = Writer.create()): Writer {
writer.uint32(8).uint64(message.totalCount);
@ -1022,7 +997,8 @@ export const SearchTxsResult = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): SearchTxsResult {
decode(input: Reader | Uint8Array, length?: number): SearchTxsResult {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseSearchTxsResult } as SearchTxsResult;
@ -1055,6 +1031,7 @@ export const SearchTxsResult = {
}
return message;
},
fromJSON(object: any): SearchTxsResult {
const message = { ...baseSearchTxsResult } as SearchTxsResult;
message.txs = [];
@ -1090,6 +1067,7 @@ export const SearchTxsResult = {
}
return message;
},
fromPartial(object: DeepPartial<SearchTxsResult>): SearchTxsResult {
const message = { ...baseSearchTxsResult } as SearchTxsResult;
message.txs = [];
@ -1125,6 +1103,7 @@ export const SearchTxsResult = {
}
return message;
},
toJSON(message: SearchTxsResult): unknown {
const obj: any = {};
message.totalCount !== undefined && (obj.totalCount = (message.totalCount || Long.UZERO).toString());
@ -1141,15 +1120,18 @@ export const SearchTxsResult = {
},
};
interface WindowBase64 {
atob(b64: string): string;
btoa(bin: string): string;
}
const windowBase64 = (globalThis as unknown) as WindowBase64;
const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary"));
const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64"));
declare var self: any | undefined;
declare var window: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw new Error("Unable to locate global object");
})();
const atob: (b64: string) => string =
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64: string): Uint8Array {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@ -1159,6 +1141,8 @@ function bytesFromBase64(b64: string): Uint8Array {
return arr;
}
const btoa: (bin: string) => string =
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr: Uint8Array): string {
const bin: string[] = [];
for (let i = 0; i < arr.byteLength; ++i) {
@ -1166,7 +1150,8 @@ function base64FromBytes(arr: Uint8Array): string {
}
return btoa(bin.join(""));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -2,75 +2,67 @@
import * as Long from "long";
import { Writer, Reader } from "protobufjs/minimal";
export const protobufPackage = "cosmos.base.query.v1beta1";
/**
* PageRequest is to be embedded in gRPC request messages for efficient
* pagination. Ex:
* PageRequest is to be embedded in gRPC request messages for efficient
* pagination. Ex:
*
* message SomeRequest {
* Foo some_parameter = 1;
* PageRequest pagination = 2;
* }
* message SomeRequest {
* Foo some_parameter = 1;
* PageRequest pagination = 2;
* }
*/
export interface PageRequest {
/**
* key is a value returned in PageResponse.next_key to begin
* querying the next page most efficiently. Only one of offset or key
* should be set.
* key is a value returned in PageResponse.next_key to begin
* querying the next page most efficiently. Only one of offset or key
* should be set.
*/
key: Uint8Array;
/**
* offset is a numeric offset that can be used when key is unavailable.
* It is less efficient than using key. Only one of offset or key should
* be set.
* offset is a numeric offset that can be used when key is unavailable.
* It is less efficient than using key. Only one of offset or key should
* be set.
*/
offset: Long;
/**
* limit is the total number of results to be returned in the result page.
* If left empty it will default to a value to be set by each app.
* limit is the total number of results to be returned in the result page.
* If left empty it will default to a value to be set by each app.
*/
limit: Long;
/**
* count_total is set to true to indicate that the result set should include
* a count of the total number of items available for pagination in UIs.
* count_total is only respected when offset is used. It is ignored when key
* is set.
* count_total is set to true to indicate that the result set should include
* a count of the total number of items available for pagination in UIs.
* count_total is only respected when offset is used. It is ignored when key
* is set.
*/
countTotal: boolean;
}
/**
* PageResponse is to be embedded in gRPC response messages where the
* corresponding request message has used PageRequest.
* PageResponse is to be embedded in gRPC response messages where the
* corresponding request message has used PageRequest.
*
* message SomeResponse {
* repeated Bar results = 1;
* PageResponse page = 2;
* }
* message SomeResponse {
* repeated Bar results = 1;
* PageResponse page = 2;
* }
*/
export interface PageResponse {
/**
* next_key is the key to be passed to PageRequest.key to
* query the next page most efficiently
* next_key is the key to be passed to PageRequest.key to
* query the next page most efficiently
*/
nextKey: Uint8Array;
/**
* total is total number of results available if PageRequest.count_total
* was set, its value is undefined otherwise
* total is total number of results available if PageRequest.count_total
* was set, its value is undefined otherwise
*/
total: Long;
}
const basePageRequest: object = {
offset: Long.UZERO,
limit: Long.UZERO,
countTotal: false,
};
const basePageResponse: object = {
total: Long.UZERO,
};
export const protobufPackage = "cosmos.base.query.v1beta1";
const basePageRequest: object = { offset: Long.UZERO, limit: Long.UZERO, countTotal: false };
export const PageRequest = {
encode(message: PageRequest, writer: Writer = Writer.create()): Writer {
@ -80,7 +72,8 @@ export const PageRequest = {
writer.uint32(32).bool(message.countTotal);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): PageRequest {
decode(input: Reader | Uint8Array, length?: number): PageRequest {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...basePageRequest } as PageRequest;
@ -106,6 +99,7 @@ export const PageRequest = {
}
return message;
},
fromJSON(object: any): PageRequest {
const message = { ...basePageRequest } as PageRequest;
if (object.key !== undefined && object.key !== null) {
@ -128,6 +122,7 @@ export const PageRequest = {
}
return message;
},
fromPartial(object: DeepPartial<PageRequest>): PageRequest {
const message = { ...basePageRequest } as PageRequest;
if (object.key !== undefined && object.key !== null) {
@ -152,6 +147,7 @@ export const PageRequest = {
}
return message;
},
toJSON(message: PageRequest): unknown {
const obj: any = {};
message.key !== undefined &&
@ -163,13 +159,16 @@ export const PageRequest = {
},
};
const basePageResponse: object = { total: Long.UZERO };
export const PageResponse = {
encode(message: PageResponse, writer: Writer = Writer.create()): Writer {
writer.uint32(10).bytes(message.nextKey);
writer.uint32(16).uint64(message.total);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): PageResponse {
decode(input: Reader | Uint8Array, length?: number): PageResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...basePageResponse } as PageResponse;
@ -189,6 +188,7 @@ export const PageResponse = {
}
return message;
},
fromJSON(object: any): PageResponse {
const message = { ...basePageResponse } as PageResponse;
if (object.nextKey !== undefined && object.nextKey !== null) {
@ -201,6 +201,7 @@ export const PageResponse = {
}
return message;
},
fromPartial(object: DeepPartial<PageResponse>): PageResponse {
const message = { ...basePageResponse } as PageResponse;
if (object.nextKey !== undefined && object.nextKey !== null) {
@ -215,6 +216,7 @@ export const PageResponse = {
}
return message;
},
toJSON(message: PageResponse): unknown {
const obj: any = {};
message.nextKey !== undefined &&
@ -224,15 +226,18 @@ export const PageResponse = {
},
};
interface WindowBase64 {
atob(b64: string): string;
btoa(bin: string): string;
}
const windowBase64 = (globalThis as unknown) as WindowBase64;
const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary"));
const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64"));
declare var self: any | undefined;
declare var window: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw new Error("Unable to locate global object");
})();
const atob: (b64: string) => string =
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64: string): Uint8Array {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@ -242,6 +247,8 @@ function bytesFromBase64(b64: string): Uint8Array {
return arr;
}
const btoa: (bin: string) => string =
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr: Uint8Array): string {
const bin: string[] = [];
for (let i = 0; i < arr.byteLength; ++i) {
@ -249,7 +256,8 @@ function base64FromBytes(arr: Uint8Array): string {
}
return btoa(bin.join(""));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -1,11 +1,14 @@
/* eslint-disable */
import { Writer, Reader } from "protobufjs/minimal";
import * as Long from "long";
export const protobufPackage = "cosmos.base.v1beta1";
/**
* Coin defines a token with a denomination and an amount.
* Coin defines a token with a denomination and an amount.
*
* NOTE: The amount field is an Int which implements the custom method
* signatures required by gogoproto.
* NOTE: The amount field is an Int which implements the custom method
* signatures required by gogoproto.
*/
export interface Coin {
denom: string;
@ -13,49 +16,27 @@ export interface Coin {
}
/**
* DecCoin defines a token with a denomination and a decimal amount.
* DecCoin defines a token with a denomination and a decimal amount.
*
* NOTE: The amount field is an Dec which implements the custom method
* signatures required by gogoproto.
* NOTE: The amount field is an Dec which implements the custom method
* signatures required by gogoproto.
*/
export interface DecCoin {
denom: string;
amount: string;
}
/**
* IntProto defines a Protobuf wrapper around an Int object.
*/
/** IntProto defines a Protobuf wrapper around an Int object. */
export interface IntProto {
int: string;
}
/**
* DecProto defines a Protobuf wrapper around a Dec object.
*/
/** DecProto defines a Protobuf wrapper around a Dec object. */
export interface DecProto {
dec: string;
}
const baseCoin: object = {
denom: "",
amount: "",
};
const baseDecCoin: object = {
denom: "",
amount: "",
};
const baseIntProto: object = {
int: "",
};
const baseDecProto: object = {
dec: "",
};
export const protobufPackage = "cosmos.base.v1beta1";
const baseCoin: object = { denom: "", amount: "" };
export const Coin = {
encode(message: Coin, writer: Writer = Writer.create()): Writer {
@ -63,7 +44,8 @@ export const Coin = {
writer.uint32(18).string(message.amount);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Coin {
decode(input: Reader | Uint8Array, length?: number): Coin {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseCoin } as Coin;
@ -83,6 +65,7 @@ export const Coin = {
}
return message;
},
fromJSON(object: any): Coin {
const message = { ...baseCoin } as Coin;
if (object.denom !== undefined && object.denom !== null) {
@ -97,6 +80,7 @@ export const Coin = {
}
return message;
},
fromPartial(object: DeepPartial<Coin>): Coin {
const message = { ...baseCoin } as Coin;
if (object.denom !== undefined && object.denom !== null) {
@ -111,6 +95,7 @@ export const Coin = {
}
return message;
},
toJSON(message: Coin): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
@ -119,13 +104,16 @@ export const Coin = {
},
};
const baseDecCoin: object = { denom: "", amount: "" };
export const DecCoin = {
encode(message: DecCoin, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.denom);
writer.uint32(18).string(message.amount);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): DecCoin {
decode(input: Reader | Uint8Array, length?: number): DecCoin {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseDecCoin } as DecCoin;
@ -145,6 +133,7 @@ export const DecCoin = {
}
return message;
},
fromJSON(object: any): DecCoin {
const message = { ...baseDecCoin } as DecCoin;
if (object.denom !== undefined && object.denom !== null) {
@ -159,6 +148,7 @@ export const DecCoin = {
}
return message;
},
fromPartial(object: DeepPartial<DecCoin>): DecCoin {
const message = { ...baseDecCoin } as DecCoin;
if (object.denom !== undefined && object.denom !== null) {
@ -173,6 +163,7 @@ export const DecCoin = {
}
return message;
},
toJSON(message: DecCoin): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
@ -181,12 +172,15 @@ export const DecCoin = {
},
};
const baseIntProto: object = { int: "" };
export const IntProto = {
encode(message: IntProto, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.int);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): IntProto {
decode(input: Reader | Uint8Array, length?: number): IntProto {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseIntProto } as IntProto;
@ -203,6 +197,7 @@ export const IntProto = {
}
return message;
},
fromJSON(object: any): IntProto {
const message = { ...baseIntProto } as IntProto;
if (object.int !== undefined && object.int !== null) {
@ -212,6 +207,7 @@ export const IntProto = {
}
return message;
},
fromPartial(object: DeepPartial<IntProto>): IntProto {
const message = { ...baseIntProto } as IntProto;
if (object.int !== undefined && object.int !== null) {
@ -221,6 +217,7 @@ export const IntProto = {
}
return message;
},
toJSON(message: IntProto): unknown {
const obj: any = {};
message.int !== undefined && (obj.int = message.int);
@ -228,12 +225,15 @@ export const IntProto = {
},
};
const baseDecProto: object = { dec: "" };
export const DecProto = {
encode(message: DecProto, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.dec);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): DecProto {
decode(input: Reader | Uint8Array, length?: number): DecProto {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseDecProto } as DecProto;
@ -250,6 +250,7 @@ export const DecProto = {
}
return message;
},
fromJSON(object: any): DecProto {
const message = { ...baseDecProto } as DecProto;
if (object.dec !== undefined && object.dec !== null) {
@ -259,6 +260,7 @@ export const DecProto = {
}
return message;
},
fromPartial(object: DeepPartial<DecProto>): DecProto {
const message = { ...baseDecProto } as DecProto;
if (object.dec !== undefined && object.dec !== null) {
@ -268,6 +270,7 @@ export const DecProto = {
}
return message;
},
toJSON(message: DecProto): unknown {
const obj: any = {};
message.dec !== undefined && (obj.dec = message.dec);
@ -275,7 +278,7 @@ export const DecProto = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -1,20 +1,23 @@
/* eslint-disable */
import { Writer, Reader } from "protobufjs/minimal";
import * as Long from "long";
export const protobufPackage = "cosmos.crypto.multisig.v1beta1";
/**
* MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey.
* See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers
* signed and with which modes.
* MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey.
* See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers
* signed and with which modes.
*/
export interface MultiSignature {
signatures: Uint8Array[];
}
/**
* CompactBitArray is an implementation of a space efficient bit array.
* This is used to ensure that the encoded data takes up a minimal amount of
* space after proto encoding.
* This is not thread safe, and is not intended for concurrent usage.
* CompactBitArray is an implementation of a space efficient bit array.
* This is used to ensure that the encoded data takes up a minimal amount of
* space after proto encoding.
* This is not thread safe, and is not intended for concurrent usage.
*/
export interface CompactBitArray {
extraBitsStored: number;
@ -23,12 +26,6 @@ export interface CompactBitArray {
const baseMultiSignature: object = {};
const baseCompactBitArray: object = {
extraBitsStored: 0,
};
export const protobufPackage = "cosmos.crypto.multisig.v1beta1";
export const MultiSignature = {
encode(message: MultiSignature, writer: Writer = Writer.create()): Writer {
for (const v of message.signatures) {
@ -36,7 +33,8 @@ export const MultiSignature = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MultiSignature {
decode(input: Reader | Uint8Array, length?: number): MultiSignature {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMultiSignature } as MultiSignature;
@ -54,6 +52,7 @@ export const MultiSignature = {
}
return message;
},
fromJSON(object: any): MultiSignature {
const message = { ...baseMultiSignature } as MultiSignature;
message.signatures = [];
@ -64,6 +63,7 @@ export const MultiSignature = {
}
return message;
},
fromPartial(object: DeepPartial<MultiSignature>): MultiSignature {
const message = { ...baseMultiSignature } as MultiSignature;
message.signatures = [];
@ -74,6 +74,7 @@ export const MultiSignature = {
}
return message;
},
toJSON(message: MultiSignature): unknown {
const obj: any = {};
if (message.signatures) {
@ -85,13 +86,16 @@ export const MultiSignature = {
},
};
const baseCompactBitArray: object = { extraBitsStored: 0 };
export const CompactBitArray = {
encode(message: CompactBitArray, writer: Writer = Writer.create()): Writer {
writer.uint32(8).uint32(message.extraBitsStored);
writer.uint32(18).bytes(message.elems);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): CompactBitArray {
decode(input: Reader | Uint8Array, length?: number): CompactBitArray {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseCompactBitArray } as CompactBitArray;
@ -111,6 +115,7 @@ export const CompactBitArray = {
}
return message;
},
fromJSON(object: any): CompactBitArray {
const message = { ...baseCompactBitArray } as CompactBitArray;
if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) {
@ -123,6 +128,7 @@ export const CompactBitArray = {
}
return message;
},
fromPartial(object: DeepPartial<CompactBitArray>): CompactBitArray {
const message = { ...baseCompactBitArray } as CompactBitArray;
if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) {
@ -137,6 +143,7 @@ export const CompactBitArray = {
}
return message;
},
toJSON(message: CompactBitArray): unknown {
const obj: any = {};
message.extraBitsStored !== undefined && (obj.extraBitsStored = message.extraBitsStored);
@ -146,15 +153,18 @@ export const CompactBitArray = {
},
};
interface WindowBase64 {
atob(b64: string): string;
btoa(bin: string): string;
}
const windowBase64 = (globalThis as unknown) as WindowBase64;
const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary"));
const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64"));
declare var self: any | undefined;
declare var window: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw new Error("Unable to locate global object");
})();
const atob: (b64: string) => string =
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64: string): Uint8Array {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@ -164,6 +174,8 @@ function bytesFromBase64(b64: string): Uint8Array {
return arr;
}
const btoa: (bin: string) => string =
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr: Uint8Array): string {
const bin: string[] = [];
for (let i = 0; i < arr.byteLength; ++i) {
@ -171,7 +183,8 @@ function base64FromBytes(arr: Uint8Array): string {
}
return btoa(bin.join(""));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -1,36 +1,34 @@
/* eslint-disable */
import { Writer, Reader } from "protobufjs/minimal";
import * as Long from "long";
export const protobufPackage = "cosmos.crypto.secp256k1";
/**
* PubKey defines a secp256k1 public key
* Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte
* if the y-coordinate is the lexicographically largest of the two associated with
* the x-coordinate. Otherwise the first byte is a 0x03.
* This prefix is followed with the x-coordinate.
* PubKey defines a secp256k1 public key
* Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte
* if the y-coordinate is the lexicographically largest of the two associated with
* the x-coordinate. Otherwise the first byte is a 0x03.
* This prefix is followed with the x-coordinate.
*/
export interface PubKey {
key: Uint8Array;
}
/**
* PrivKey defines a secp256k1 private key.
*/
/** PrivKey defines a secp256k1 private key. */
export interface PrivKey {
key: Uint8Array;
}
const basePubKey: object = {};
const basePrivKey: object = {};
export const protobufPackage = "cosmos.crypto.secp256k1";
export const PubKey = {
encode(message: PubKey, writer: Writer = Writer.create()): Writer {
writer.uint32(10).bytes(message.key);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): PubKey {
decode(input: Reader | Uint8Array, length?: number): PubKey {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...basePubKey } as PubKey;
@ -47,6 +45,7 @@ export const PubKey = {
}
return message;
},
fromJSON(object: any): PubKey {
const message = { ...basePubKey } as PubKey;
if (object.key !== undefined && object.key !== null) {
@ -54,6 +53,7 @@ export const PubKey = {
}
return message;
},
fromPartial(object: DeepPartial<PubKey>): PubKey {
const message = { ...basePubKey } as PubKey;
if (object.key !== undefined && object.key !== null) {
@ -63,6 +63,7 @@ export const PubKey = {
}
return message;
},
toJSON(message: PubKey): unknown {
const obj: any = {};
message.key !== undefined &&
@ -71,12 +72,15 @@ export const PubKey = {
},
};
const basePrivKey: object = {};
export const PrivKey = {
encode(message: PrivKey, writer: Writer = Writer.create()): Writer {
writer.uint32(10).bytes(message.key);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): PrivKey {
decode(input: Reader | Uint8Array, length?: number): PrivKey {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...basePrivKey } as PrivKey;
@ -93,6 +97,7 @@ export const PrivKey = {
}
return message;
},
fromJSON(object: any): PrivKey {
const message = { ...basePrivKey } as PrivKey;
if (object.key !== undefined && object.key !== null) {
@ -100,6 +105,7 @@ export const PrivKey = {
}
return message;
},
fromPartial(object: DeepPartial<PrivKey>): PrivKey {
const message = { ...basePrivKey } as PrivKey;
if (object.key !== undefined && object.key !== null) {
@ -109,6 +115,7 @@ export const PrivKey = {
}
return message;
},
toJSON(message: PrivKey): unknown {
const obj: any = {};
message.key !== undefined &&
@ -117,15 +124,18 @@ export const PrivKey = {
},
};
interface WindowBase64 {
atob(b64: string): string;
btoa(bin: string): string;
}
const windowBase64 = (globalThis as unknown) as WindowBase64;
const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary"));
const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64"));
declare var self: any | undefined;
declare var window: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw new Error("Unable to locate global object");
})();
const atob: (b64: string) => string =
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64: string): Uint8Array {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@ -135,6 +145,8 @@ function bytesFromBase64(b64: string): Uint8Array {
return arr;
}
const btoa: (bin: string) => string =
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr: Uint8Array): string {
const bin: string[] = [];
for (let i = 0; i < arr.byteLength; ++i) {
@ -142,7 +154,8 @@ function base64FromBytes(arr: Uint8Array): string {
}
return btoa(bin.join(""));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

File diff suppressed because it is too large Load Diff

View File

@ -2,13 +2,13 @@
import { Description, CommissionRates } from "../../../cosmos/staking/v1beta1/staking";
import { Any } from "../../../google/protobuf/any";
import { Coin } from "../../../cosmos/base/v1beta1/coin";
import { Reader, Writer, util, configure } from "protobufjs/minimal";
import { Reader, util, configure, Writer } from "protobufjs/minimal";
import { Timestamp } from "../../../google/protobuf/timestamp";
import * as Long from "long";
/**
* MsgCreateValidator defines a SDK message for creating a new validator.
*/
export const protobufPackage = "cosmos.staking.v1beta1";
/** MsgCreateValidator defines a SDK message for creating a new validator. */
export interface MsgCreateValidator {
description?: Description;
commission?: CommissionRates;
@ -19,35 +19,29 @@ export interface MsgCreateValidator {
value?: Coin;
}
/**
* MsgCreateValidatorResponse defines the Msg/CreateValidator response type.
*/
/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */
export interface MsgCreateValidatorResponse {}
/**
* MsgEditValidator defines a SDK message for editing an existing validator.
*/
/** MsgEditValidator defines a SDK message for editing an existing validator. */
export interface MsgEditValidator {
description?: Description;
validatorAddress: string;
/**
* We pass a reference to the new commission rate and min self delegation as
* it's not mandatory to update. If not updated, the deserialized rate will be
* zero with no way to distinguish if an update was intended.
* REF: #2373
* We pass a reference to the new commission rate and min self delegation as
* it's not mandatory to update. If not updated, the deserialized rate will be
* zero with no way to distinguish if an update was intended.
* REF: #2373
*/
commissionRate: string;
minSelfDelegation: string;
}
/**
* MsgEditValidatorResponse defines the Msg/EditValidator response type.
*/
/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */
export interface MsgEditValidatorResponse {}
/**
* MsgDelegate defines a SDK message for performing a delegation of coins
* from a delegator to a validator.
* MsgDelegate defines a SDK message for performing a delegation of coins
* from a delegator to a validator.
*/
export interface MsgDelegate {
delegatorAddress: string;
@ -55,14 +49,12 @@ export interface MsgDelegate {
amount?: Coin;
}
/**
* MsgDelegateResponse defines the Msg/Delegate response type.
*/
/** MsgDelegateResponse defines the Msg/Delegate response type. */
export interface MsgDelegateResponse {}
/**
* MsgBeginRedelegate defines a SDK message for performing a redelegation
* of coins from a delegator and source validator to a destination validator.
* MsgBeginRedelegate defines a SDK message for performing a redelegation
* of coins from a delegator and source validator to a destination validator.
*/
export interface MsgBeginRedelegate {
delegatorAddress: string;
@ -71,16 +63,14 @@ export interface MsgBeginRedelegate {
amount?: Coin;
}
/**
* MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type.
*/
/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */
export interface MsgBeginRedelegateResponse {
completionTime?: Date;
}
/**
* MsgUndelegate defines a SDK message for performing an undelegation from a
* delegate and a validator.
* MsgUndelegate defines a SDK message for performing an undelegation from a
* delegate and a validator.
*/
export interface MsgUndelegate {
delegatorAddress: string;
@ -88,153 +78,12 @@ export interface MsgUndelegate {
amount?: Coin;
}
/**
* MsgUndelegateResponse defines the Msg/Undelegate response type.
*/
/** MsgUndelegateResponse defines the Msg/Undelegate response type. */
export interface MsgUndelegateResponse {
completionTime?: Date;
}
const baseMsgCreateValidator: object = {
minSelfDelegation: "",
delegatorAddress: "",
validatorAddress: "",
};
const baseMsgCreateValidatorResponse: object = {};
const baseMsgEditValidator: object = {
validatorAddress: "",
commissionRate: "",
minSelfDelegation: "",
};
const baseMsgEditValidatorResponse: object = {};
const baseMsgDelegate: object = {
delegatorAddress: "",
validatorAddress: "",
};
const baseMsgDelegateResponse: object = {};
const baseMsgBeginRedelegate: object = {
delegatorAddress: "",
validatorSrcAddress: "",
validatorDstAddress: "",
};
const baseMsgBeginRedelegateResponse: object = {};
const baseMsgUndelegate: object = {
delegatorAddress: "",
validatorAddress: "",
};
const baseMsgUndelegateResponse: object = {};
/**
* Msg defines the staking Msg service.
*/
export interface Msg {
/**
* CreateValidator defines a method for creating a new validator.
*/
CreateValidator(request: MsgCreateValidator): Promise<MsgCreateValidatorResponse>;
/**
* EditValidator defines a method for editing an existing validator.
*/
EditValidator(request: MsgEditValidator): Promise<MsgEditValidatorResponse>;
/**
* Delegate defines a method for performing a delegation of coins
* from a delegator to a validator.
*/
Delegate(request: MsgDelegate): Promise<MsgDelegateResponse>;
/**
* BeginRedelegate defines a method for performing a redelegation
* of coins from a delegator and source validator to a destination validator.
*/
BeginRedelegate(request: MsgBeginRedelegate): Promise<MsgBeginRedelegateResponse>;
/**
* Undelegate defines a method for performing an undelegation from a
* delegate and a validator.
*/
Undelegate(request: MsgUndelegate): Promise<MsgUndelegateResponse>;
}
export class MsgClientImpl implements Msg {
private readonly rpc: Rpc;
constructor(rpc: Rpc) {
this.rpc = rpc;
}
CreateValidator(request: MsgCreateValidator): Promise<MsgCreateValidatorResponse> {
const data = MsgCreateValidator.encode(request).finish();
const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "CreateValidator", data);
return promise.then((data) => MsgCreateValidatorResponse.decode(new Reader(data)));
}
EditValidator(request: MsgEditValidator): Promise<MsgEditValidatorResponse> {
const data = MsgEditValidator.encode(request).finish();
const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "EditValidator", data);
return promise.then((data) => MsgEditValidatorResponse.decode(new Reader(data)));
}
Delegate(request: MsgDelegate): Promise<MsgDelegateResponse> {
const data = MsgDelegate.encode(request).finish();
const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Delegate", data);
return promise.then((data) => MsgDelegateResponse.decode(new Reader(data)));
}
BeginRedelegate(request: MsgBeginRedelegate): Promise<MsgBeginRedelegateResponse> {
const data = MsgBeginRedelegate.encode(request).finish();
const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "BeginRedelegate", data);
return promise.then((data) => MsgBeginRedelegateResponse.decode(new Reader(data)));
}
Undelegate(request: MsgUndelegate): Promise<MsgUndelegateResponse> {
const data = MsgUndelegate.encode(request).finish();
const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Undelegate", data);
return promise.then((data) => MsgUndelegateResponse.decode(new Reader(data)));
}
}
interface Rpc {
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
}
function fromJsonTimestamp(o: any): Date {
if (o instanceof Date) {
return o;
} else if (typeof o === "string") {
return new Date(o);
} else {
return fromTimestamp(Timestamp.fromJSON(o));
}
}
function toTimestamp(date: Date): Timestamp {
const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
let millis = t.seconds.toNumber() * 1_000;
millis += t.nanos / 1_000_000;
return new Date(millis);
}
function numberToLong(number: number) {
return Long.fromNumber(number);
}
export const protobufPackage = "cosmos.staking.v1beta1";
const baseMsgCreateValidator: object = { minSelfDelegation: "", delegatorAddress: "", validatorAddress: "" };
export const MsgCreateValidator = {
encode(message: MsgCreateValidator, writer: Writer = Writer.create()): Writer {
@ -255,7 +104,8 @@ export const MsgCreateValidator = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgCreateValidator {
decode(input: Reader | Uint8Array, length?: number): MsgCreateValidator {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgCreateValidator } as MsgCreateValidator;
@ -290,6 +140,7 @@ export const MsgCreateValidator = {
}
return message;
},
fromJSON(object: any): MsgCreateValidator {
const message = { ...baseMsgCreateValidator } as MsgCreateValidator;
if (object.description !== undefined && object.description !== null) {
@ -329,6 +180,7 @@ export const MsgCreateValidator = {
}
return message;
},
fromPartial(object: DeepPartial<MsgCreateValidator>): MsgCreateValidator {
const message = { ...baseMsgCreateValidator } as MsgCreateValidator;
if (object.description !== undefined && object.description !== null) {
@ -368,6 +220,7 @@ export const MsgCreateValidator = {
}
return message;
},
toJSON(message: MsgCreateValidator): unknown {
const obj: any = {};
message.description !== undefined &&
@ -383,11 +236,14 @@ export const MsgCreateValidator = {
},
};
const baseMsgCreateValidatorResponse: object = {};
export const MsgCreateValidatorResponse = {
encode(_: MsgCreateValidatorResponse, writer: Writer = Writer.create()): Writer {
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgCreateValidatorResponse {
decode(input: Reader | Uint8Array, length?: number): MsgCreateValidatorResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgCreateValidatorResponse } as MsgCreateValidatorResponse;
@ -401,20 +257,25 @@ export const MsgCreateValidatorResponse = {
}
return message;
},
fromJSON(_: any): MsgCreateValidatorResponse {
const message = { ...baseMsgCreateValidatorResponse } as MsgCreateValidatorResponse;
return message;
},
fromPartial(_: DeepPartial<MsgCreateValidatorResponse>): MsgCreateValidatorResponse {
const message = { ...baseMsgCreateValidatorResponse } as MsgCreateValidatorResponse;
return message;
},
toJSON(_: MsgCreateValidatorResponse): unknown {
const obj: any = {};
return obj;
},
};
const baseMsgEditValidator: object = { validatorAddress: "", commissionRate: "", minSelfDelegation: "" };
export const MsgEditValidator = {
encode(message: MsgEditValidator, writer: Writer = Writer.create()): Writer {
if (message.description !== undefined && message.description !== undefined) {
@ -425,7 +286,8 @@ export const MsgEditValidator = {
writer.uint32(34).string(message.minSelfDelegation);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgEditValidator {
decode(input: Reader | Uint8Array, length?: number): MsgEditValidator {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgEditValidator } as MsgEditValidator;
@ -451,6 +313,7 @@ export const MsgEditValidator = {
}
return message;
},
fromJSON(object: any): MsgEditValidator {
const message = { ...baseMsgEditValidator } as MsgEditValidator;
if (object.description !== undefined && object.description !== null) {
@ -475,6 +338,7 @@ export const MsgEditValidator = {
}
return message;
},
fromPartial(object: DeepPartial<MsgEditValidator>): MsgEditValidator {
const message = { ...baseMsgEditValidator } as MsgEditValidator;
if (object.description !== undefined && object.description !== null) {
@ -499,6 +363,7 @@ export const MsgEditValidator = {
}
return message;
},
toJSON(message: MsgEditValidator): unknown {
const obj: any = {};
message.description !== undefined &&
@ -510,11 +375,14 @@ export const MsgEditValidator = {
},
};
const baseMsgEditValidatorResponse: object = {};
export const MsgEditValidatorResponse = {
encode(_: MsgEditValidatorResponse, writer: Writer = Writer.create()): Writer {
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgEditValidatorResponse {
decode(input: Reader | Uint8Array, length?: number): MsgEditValidatorResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgEditValidatorResponse } as MsgEditValidatorResponse;
@ -528,20 +396,25 @@ export const MsgEditValidatorResponse = {
}
return message;
},
fromJSON(_: any): MsgEditValidatorResponse {
const message = { ...baseMsgEditValidatorResponse } as MsgEditValidatorResponse;
return message;
},
fromPartial(_: DeepPartial<MsgEditValidatorResponse>): MsgEditValidatorResponse {
const message = { ...baseMsgEditValidatorResponse } as MsgEditValidatorResponse;
return message;
},
toJSON(_: MsgEditValidatorResponse): unknown {
const obj: any = {};
return obj;
},
};
const baseMsgDelegate: object = { delegatorAddress: "", validatorAddress: "" };
export const MsgDelegate = {
encode(message: MsgDelegate, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.delegatorAddress);
@ -551,7 +424,8 @@ export const MsgDelegate = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgDelegate {
decode(input: Reader | Uint8Array, length?: number): MsgDelegate {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgDelegate } as MsgDelegate;
@ -574,6 +448,7 @@ export const MsgDelegate = {
}
return message;
},
fromJSON(object: any): MsgDelegate {
const message = { ...baseMsgDelegate } as MsgDelegate;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
@ -593,6 +468,7 @@ export const MsgDelegate = {
}
return message;
},
fromPartial(object: DeepPartial<MsgDelegate>): MsgDelegate {
const message = { ...baseMsgDelegate } as MsgDelegate;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
@ -612,6 +488,7 @@ export const MsgDelegate = {
}
return message;
},
toJSON(message: MsgDelegate): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
@ -621,11 +498,14 @@ export const MsgDelegate = {
},
};
const baseMsgDelegateResponse: object = {};
export const MsgDelegateResponse = {
encode(_: MsgDelegateResponse, writer: Writer = Writer.create()): Writer {
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgDelegateResponse {
decode(input: Reader | Uint8Array, length?: number): MsgDelegateResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse;
@ -639,20 +519,29 @@ export const MsgDelegateResponse = {
}
return message;
},
fromJSON(_: any): MsgDelegateResponse {
const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse;
return message;
},
fromPartial(_: DeepPartial<MsgDelegateResponse>): MsgDelegateResponse {
const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse;
return message;
},
toJSON(_: MsgDelegateResponse): unknown {
const obj: any = {};
return obj;
},
};
const baseMsgBeginRedelegate: object = {
delegatorAddress: "",
validatorSrcAddress: "",
validatorDstAddress: "",
};
export const MsgBeginRedelegate = {
encode(message: MsgBeginRedelegate, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.delegatorAddress);
@ -663,7 +552,8 @@ export const MsgBeginRedelegate = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgBeginRedelegate {
decode(input: Reader | Uint8Array, length?: number): MsgBeginRedelegate {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate;
@ -689,6 +579,7 @@ export const MsgBeginRedelegate = {
}
return message;
},
fromJSON(object: any): MsgBeginRedelegate {
const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
@ -713,6 +604,7 @@ export const MsgBeginRedelegate = {
}
return message;
},
fromPartial(object: DeepPartial<MsgBeginRedelegate>): MsgBeginRedelegate {
const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
@ -737,6 +629,7 @@ export const MsgBeginRedelegate = {
}
return message;
},
toJSON(message: MsgBeginRedelegate): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
@ -747,6 +640,8 @@ export const MsgBeginRedelegate = {
},
};
const baseMsgBeginRedelegateResponse: object = {};
export const MsgBeginRedelegateResponse = {
encode(message: MsgBeginRedelegateResponse, writer: Writer = Writer.create()): Writer {
if (message.completionTime !== undefined && message.completionTime !== undefined) {
@ -754,7 +649,8 @@ export const MsgBeginRedelegateResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgBeginRedelegateResponse {
decode(input: Reader | Uint8Array, length?: number): MsgBeginRedelegateResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgBeginRedelegateResponse } as MsgBeginRedelegateResponse;
@ -771,6 +667,7 @@ export const MsgBeginRedelegateResponse = {
}
return message;
},
fromJSON(object: any): MsgBeginRedelegateResponse {
const message = { ...baseMsgBeginRedelegateResponse } as MsgBeginRedelegateResponse;
if (object.completionTime !== undefined && object.completionTime !== null) {
@ -780,6 +677,7 @@ export const MsgBeginRedelegateResponse = {
}
return message;
},
fromPartial(object: DeepPartial<MsgBeginRedelegateResponse>): MsgBeginRedelegateResponse {
const message = { ...baseMsgBeginRedelegateResponse } as MsgBeginRedelegateResponse;
if (object.completionTime !== undefined && object.completionTime !== null) {
@ -789,6 +687,7 @@ export const MsgBeginRedelegateResponse = {
}
return message;
},
toJSON(message: MsgBeginRedelegateResponse): unknown {
const obj: any = {};
message.completionTime !== undefined &&
@ -798,6 +697,8 @@ export const MsgBeginRedelegateResponse = {
},
};
const baseMsgUndelegate: object = { delegatorAddress: "", validatorAddress: "" };
export const MsgUndelegate = {
encode(message: MsgUndelegate, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.delegatorAddress);
@ -807,7 +708,8 @@ export const MsgUndelegate = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgUndelegate {
decode(input: Reader | Uint8Array, length?: number): MsgUndelegate {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgUndelegate } as MsgUndelegate;
@ -830,6 +732,7 @@ export const MsgUndelegate = {
}
return message;
},
fromJSON(object: any): MsgUndelegate {
const message = { ...baseMsgUndelegate } as MsgUndelegate;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
@ -849,6 +752,7 @@ export const MsgUndelegate = {
}
return message;
},
fromPartial(object: DeepPartial<MsgUndelegate>): MsgUndelegate {
const message = { ...baseMsgUndelegate } as MsgUndelegate;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
@ -868,6 +772,7 @@ export const MsgUndelegate = {
}
return message;
},
toJSON(message: MsgUndelegate): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
@ -877,6 +782,8 @@ export const MsgUndelegate = {
},
};
const baseMsgUndelegateResponse: object = {};
export const MsgUndelegateResponse = {
encode(message: MsgUndelegateResponse, writer: Writer = Writer.create()): Writer {
if (message.completionTime !== undefined && message.completionTime !== undefined) {
@ -884,7 +791,8 @@ export const MsgUndelegateResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MsgUndelegateResponse {
decode(input: Reader | Uint8Array, length?: number): MsgUndelegateResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse;
@ -901,6 +809,7 @@ export const MsgUndelegateResponse = {
}
return message;
},
fromJSON(object: any): MsgUndelegateResponse {
const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse;
if (object.completionTime !== undefined && object.completionTime !== null) {
@ -910,6 +819,7 @@ export const MsgUndelegateResponse = {
}
return message;
},
fromPartial(object: DeepPartial<MsgUndelegateResponse>): MsgUndelegateResponse {
const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse;
if (object.completionTime !== undefined && object.completionTime !== null) {
@ -919,6 +829,7 @@ export const MsgUndelegateResponse = {
}
return message;
},
toJSON(message: MsgUndelegateResponse): unknown {
const obj: any = {};
message.completionTime !== undefined &&
@ -928,12 +839,70 @@ export const MsgUndelegateResponse = {
},
};
if (util.Long !== (Long as any)) {
util.Long = Long as any;
configure();
/** Msg defines the staking Msg service. */
export interface Msg {
/** CreateValidator defines a method for creating a new validator. */
CreateValidator(request: MsgCreateValidator): Promise<MsgCreateValidatorResponse>;
/** EditValidator defines a method for editing an existing validator. */
EditValidator(request: MsgEditValidator): Promise<MsgEditValidatorResponse>;
/**
* Delegate defines a method for performing a delegation of coins
* from a delegator to a validator.
*/
Delegate(request: MsgDelegate): Promise<MsgDelegateResponse>;
/**
* BeginRedelegate defines a method for performing a redelegation
* of coins from a delegator and source validator to a destination validator.
*/
BeginRedelegate(request: MsgBeginRedelegate): Promise<MsgBeginRedelegateResponse>;
/**
* Undelegate defines a method for performing an undelegation from a
* delegate and a validator.
*/
Undelegate(request: MsgUndelegate): Promise<MsgUndelegateResponse>;
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
export class MsgClientImpl implements Msg {
private readonly rpc: Rpc;
constructor(rpc: Rpc) {
this.rpc = rpc;
}
CreateValidator(request: MsgCreateValidator): Promise<MsgCreateValidatorResponse> {
const data = MsgCreateValidator.encode(request).finish();
const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "methodDesc.name", data);
return promise.then((data) => MsgCreateValidatorResponse.decode(new Reader(data)));
}
EditValidator(request: MsgEditValidator): Promise<MsgEditValidatorResponse> {
const data = MsgEditValidator.encode(request).finish();
const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "methodDesc.name", data);
return promise.then((data) => MsgEditValidatorResponse.decode(new Reader(data)));
}
Delegate(request: MsgDelegate): Promise<MsgDelegateResponse> {
const data = MsgDelegate.encode(request).finish();
const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "methodDesc.name", data);
return promise.then((data) => MsgDelegateResponse.decode(new Reader(data)));
}
BeginRedelegate(request: MsgBeginRedelegate): Promise<MsgBeginRedelegateResponse> {
const data = MsgBeginRedelegate.encode(request).finish();
const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "methodDesc.name", data);
return promise.then((data) => MsgBeginRedelegateResponse.decode(new Reader(data)));
}
Undelegate(request: MsgUndelegate): Promise<MsgUndelegateResponse> {
const data = MsgUndelegate.encode(request).finish();
const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "methodDesc.name", data);
return promise.then((data) => MsgUndelegateResponse.decode(new Reader(data)));
}
}
interface Rpc {
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
}
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>
@ -943,3 +912,34 @@ export type DeepPartial<T> = T extends Builtin
: T extends {}
? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
let millis = t.seconds.toNumber() * 1_000;
millis += t.nanos / 1_000_000;
return new Date(millis);
}
function fromJsonTimestamp(o: any): Date {
if (o instanceof Date) {
return o;
} else if (typeof o === "string") {
return new Date(o);
} else {
return fromTimestamp(Timestamp.fromJSON(o));
}
}
function numberToLong(number: number) {
return Long.fromNumber(number);
}
if (util.Long !== Long) {
util.Long = Long as any;
configure();
}

View File

@ -4,112 +4,29 @@ import * as Long from "long";
import { CompactBitArray } from "../../../../cosmos/crypto/multisig/v1beta1/multisig";
import { Writer, Reader } from "protobufjs/minimal";
/**
* SignatureDescriptors wraps multiple SignatureDescriptor's.
*/
export interface SignatureDescriptors {
/**
* signatures are the signature descriptors
*/
signatures: SignatureDescriptor[];
}
/**
* SignatureDescriptor is a convenience type which represents the full data for
* a signature including the public key of the signer, signing modes and the
* signature itself. It is primarily used for coordinating signatures between
* clients.
*/
export interface SignatureDescriptor {
/**
* public_key is the public key of the signer
*/
publicKey?: Any;
data?: SignatureDescriptor_Data;
/**
* sequence is the sequence of the account, which describes the
* number of committed transactions signed by a given address. It is used to prevent
* replay attacks.
*/
sequence: Long;
}
/**
* Data represents signature data
*/
export interface SignatureDescriptor_Data {
/**
* single represents a single signer
*/
single?: SignatureDescriptor_Data_Single | undefined;
/**
* multi represents a multisig signer
*/
multi?: SignatureDescriptor_Data_Multi | undefined;
}
/**
* Single is the signature data for a single signer
*/
export interface SignatureDescriptor_Data_Single {
/**
* mode is the signing mode of the single signer
*/
mode: SignMode;
/**
* signature is the raw signature bytes
*/
signature: Uint8Array;
}
/**
* Multi is the signature data for a multisig public key
*/
export interface SignatureDescriptor_Data_Multi {
/**
* bitarray specifies which keys within the multisig are signing
*/
bitarray?: CompactBitArray;
/**
* signatures is the signatures of the multi-signature
*/
signatures: SignatureDescriptor_Data[];
}
const baseSignatureDescriptors: object = {};
const baseSignatureDescriptor: object = {
sequence: Long.UZERO,
};
const baseSignatureDescriptor_Data: object = {};
const baseSignatureDescriptor_Data_Single: object = {
mode: 0,
};
const baseSignatureDescriptor_Data_Multi: object = {};
export const protobufPackage = "cosmos.tx.signing.v1beta1";
/** SignMode represents a signing mode with its own security guarantees.
*/
/** SignMode represents a signing mode with its own security guarantees. */
export enum SignMode {
/** SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be
rejected
/**
* SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be
* rejected
*/
SIGN_MODE_UNSPECIFIED = 0,
/** SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is
verified with raw bytes from Tx
/**
* SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is
* verified with raw bytes from Tx
*/
SIGN_MODE_DIRECT = 1,
/** SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some
human-readable textual representation on top of the binary representation
from SIGN_MODE_DIRECT
/**
* SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some
* human-readable textual representation on top of the binary representation
* from SIGN_MODE_DIRECT
*/
SIGN_MODE_TEXTUAL = 2,
/** SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
Amino JSON and will be removed in the future
/**
* SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
* Amino JSON and will be removed in the future
*/
SIGN_MODE_LEGACY_AMINO_JSON = 127,
UNRECOGNIZED = -1,
@ -151,6 +68,56 @@ export function signModeToJSON(object: SignMode): string {
}
}
/** SignatureDescriptors wraps multiple SignatureDescriptor's. */
export interface SignatureDescriptors {
/** signatures are the signature descriptors */
signatures: SignatureDescriptor[];
}
/**
* SignatureDescriptor is a convenience type which represents the full data for
* a signature including the public key of the signer, signing modes and the
* signature itself. It is primarily used for coordinating signatures between
* clients.
*/
export interface SignatureDescriptor {
/** public_key is the public key of the signer */
publicKey?: Any;
data?: SignatureDescriptor_Data;
/**
* sequence is the sequence of the account, which describes the
* number of committed transactions signed by a given address. It is used to prevent
* replay attacks.
*/
sequence: Long;
}
/** Data represents signature data */
export interface SignatureDescriptor_Data {
/** single represents a single signer */
single?: SignatureDescriptor_Data_Single | undefined;
/** multi represents a multisig signer */
multi?: SignatureDescriptor_Data_Multi | undefined;
}
/** Single is the signature data for a single signer */
export interface SignatureDescriptor_Data_Single {
/** mode is the signing mode of the single signer */
mode: SignMode;
/** signature is the raw signature bytes */
signature: Uint8Array;
}
/** Multi is the signature data for a multisig public key */
export interface SignatureDescriptor_Data_Multi {
/** bitarray specifies which keys within the multisig are signing */
bitarray?: CompactBitArray;
/** signatures is the signatures of the multi-signature */
signatures: SignatureDescriptor_Data[];
}
const baseSignatureDescriptors: object = {};
export const SignatureDescriptors = {
encode(message: SignatureDescriptors, writer: Writer = Writer.create()): Writer {
for (const v of message.signatures) {
@ -158,7 +125,8 @@ export const SignatureDescriptors = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): SignatureDescriptors {
decode(input: Reader | Uint8Array, length?: number): SignatureDescriptors {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseSignatureDescriptors } as SignatureDescriptors;
@ -176,6 +144,7 @@ export const SignatureDescriptors = {
}
return message;
},
fromJSON(object: any): SignatureDescriptors {
const message = { ...baseSignatureDescriptors } as SignatureDescriptors;
message.signatures = [];
@ -186,6 +155,7 @@ export const SignatureDescriptors = {
}
return message;
},
fromPartial(object: DeepPartial<SignatureDescriptors>): SignatureDescriptors {
const message = { ...baseSignatureDescriptors } as SignatureDescriptors;
message.signatures = [];
@ -196,6 +166,7 @@ export const SignatureDescriptors = {
}
return message;
},
toJSON(message: SignatureDescriptors): unknown {
const obj: any = {};
if (message.signatures) {
@ -207,6 +178,8 @@ export const SignatureDescriptors = {
},
};
const baseSignatureDescriptor: object = { sequence: Long.UZERO };
export const SignatureDescriptor = {
encode(message: SignatureDescriptor, writer: Writer = Writer.create()): Writer {
if (message.publicKey !== undefined && message.publicKey !== undefined) {
@ -218,7 +191,8 @@ export const SignatureDescriptor = {
writer.uint32(24).uint64(message.sequence);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): SignatureDescriptor {
decode(input: Reader | Uint8Array, length?: number): SignatureDescriptor {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseSignatureDescriptor } as SignatureDescriptor;
@ -241,6 +215,7 @@ export const SignatureDescriptor = {
}
return message;
},
fromJSON(object: any): SignatureDescriptor {
const message = { ...baseSignatureDescriptor } as SignatureDescriptor;
if (object.publicKey !== undefined && object.publicKey !== null) {
@ -260,6 +235,7 @@ export const SignatureDescriptor = {
}
return message;
},
fromPartial(object: DeepPartial<SignatureDescriptor>): SignatureDescriptor {
const message = { ...baseSignatureDescriptor } as SignatureDescriptor;
if (object.publicKey !== undefined && object.publicKey !== null) {
@ -279,6 +255,7 @@ export const SignatureDescriptor = {
}
return message;
},
toJSON(message: SignatureDescriptor): unknown {
const obj: any = {};
message.publicKey !== undefined &&
@ -290,6 +267,8 @@ export const SignatureDescriptor = {
},
};
const baseSignatureDescriptor_Data: object = {};
export const SignatureDescriptor_Data = {
encode(message: SignatureDescriptor_Data, writer: Writer = Writer.create()): Writer {
if (message.single !== undefined) {
@ -300,7 +279,8 @@ export const SignatureDescriptor_Data = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): SignatureDescriptor_Data {
decode(input: Reader | Uint8Array, length?: number): SignatureDescriptor_Data {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data;
@ -320,6 +300,7 @@ export const SignatureDescriptor_Data = {
}
return message;
},
fromJSON(object: any): SignatureDescriptor_Data {
const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data;
if (object.single !== undefined && object.single !== null) {
@ -334,6 +315,7 @@ export const SignatureDescriptor_Data = {
}
return message;
},
fromPartial(object: DeepPartial<SignatureDescriptor_Data>): SignatureDescriptor_Data {
const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data;
if (object.single !== undefined && object.single !== null) {
@ -348,6 +330,7 @@ export const SignatureDescriptor_Data = {
}
return message;
},
toJSON(message: SignatureDescriptor_Data): unknown {
const obj: any = {};
message.single !== undefined &&
@ -358,13 +341,16 @@ export const SignatureDescriptor_Data = {
},
};
const baseSignatureDescriptor_Data_Single: object = { mode: 0 };
export const SignatureDescriptor_Data_Single = {
encode(message: SignatureDescriptor_Data_Single, writer: Writer = Writer.create()): Writer {
writer.uint32(8).int32(message.mode);
writer.uint32(18).bytes(message.signature);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): SignatureDescriptor_Data_Single {
decode(input: Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Single {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single;
@ -384,6 +370,7 @@ export const SignatureDescriptor_Data_Single = {
}
return message;
},
fromJSON(object: any): SignatureDescriptor_Data_Single {
const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single;
if (object.mode !== undefined && object.mode !== null) {
@ -396,6 +383,7 @@ export const SignatureDescriptor_Data_Single = {
}
return message;
},
fromPartial(object: DeepPartial<SignatureDescriptor_Data_Single>): SignatureDescriptor_Data_Single {
const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single;
if (object.mode !== undefined && object.mode !== null) {
@ -410,6 +398,7 @@ export const SignatureDescriptor_Data_Single = {
}
return message;
},
toJSON(message: SignatureDescriptor_Data_Single): unknown {
const obj: any = {};
message.mode !== undefined && (obj.mode = signModeToJSON(message.mode));
@ -421,6 +410,8 @@ export const SignatureDescriptor_Data_Single = {
},
};
const baseSignatureDescriptor_Data_Multi: object = {};
export const SignatureDescriptor_Data_Multi = {
encode(message: SignatureDescriptor_Data_Multi, writer: Writer = Writer.create()): Writer {
if (message.bitarray !== undefined && message.bitarray !== undefined) {
@ -431,7 +422,8 @@ export const SignatureDescriptor_Data_Multi = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): SignatureDescriptor_Data_Multi {
decode(input: Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi;
@ -452,6 +444,7 @@ export const SignatureDescriptor_Data_Multi = {
}
return message;
},
fromJSON(object: any): SignatureDescriptor_Data_Multi {
const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi;
message.signatures = [];
@ -467,6 +460,7 @@ export const SignatureDescriptor_Data_Multi = {
}
return message;
},
fromPartial(object: DeepPartial<SignatureDescriptor_Data_Multi>): SignatureDescriptor_Data_Multi {
const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi;
message.signatures = [];
@ -482,6 +476,7 @@ export const SignatureDescriptor_Data_Multi = {
}
return message;
},
toJSON(message: SignatureDescriptor_Data_Multi): unknown {
const obj: any = {};
message.bitarray !== undefined &&
@ -495,15 +490,18 @@ export const SignatureDescriptor_Data_Multi = {
},
};
interface WindowBase64 {
atob(b64: string): string;
btoa(bin: string): string;
}
const windowBase64 = (globalThis as unknown) as WindowBase64;
const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary"));
const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64"));
declare var self: any | undefined;
declare var window: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw new Error("Unable to locate global object");
})();
const atob: (b64: string) => string =
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64: string): Uint8Array {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@ -513,6 +511,8 @@ function bytesFromBase64(b64: string): Uint8Array {
return arr;
}
const btoa: (bin: string) => string =
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr: Uint8Array): string {
const bin: string[] = [];
for (let i = 0; i < arr.byteLength; ++i) {
@ -520,7 +520,8 @@ function base64FromBytes(arr: Uint8Array): string {
}
return btoa(bin.join(""));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -6,267 +6,209 @@ import { CompactBitArray } from "../../../cosmos/crypto/multisig/v1beta1/multisi
import { Coin } from "../../../cosmos/base/v1beta1/coin";
import { Writer, Reader } from "protobufjs/minimal";
/**
* Tx is the standard type used for broadcasting transactions.
*/
export const protobufPackage = "cosmos.tx.v1beta1";
/** Tx is the standard type used for broadcasting transactions. */
export interface Tx {
/**
* body is the processable content of the transaction
*/
/** body is the processable content of the transaction */
body?: TxBody;
/**
* auth_info is the authorization related content of the transaction,
* specifically signers, signer modes and fee
* auth_info is the authorization related content of the transaction,
* specifically signers, signer modes and fee
*/
authInfo?: AuthInfo;
/**
* signatures is a list of signatures that matches the length and order of
* AuthInfo's signer_infos to allow connecting signature meta information like
* public key and signing mode by position.
* signatures is a list of signatures that matches the length and order of
* AuthInfo's signer_infos to allow connecting signature meta information like
* public key and signing mode by position.
*/
signatures: Uint8Array[];
}
/**
* TxRaw is a variant of Tx that pins the signer's exact binary representation
* of body and auth_info. This is used for signing, broadcasting and
* verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and
* the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used
* as the transaction ID.
* TxRaw is a variant of Tx that pins the signer's exact binary representation
* of body and auth_info. This is used for signing, broadcasting and
* verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and
* the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used
* as the transaction ID.
*/
export interface TxRaw {
/**
* body_bytes is a protobuf serialization of a TxBody that matches the
* representation in SignDoc.
* body_bytes is a protobuf serialization of a TxBody that matches the
* representation in SignDoc.
*/
bodyBytes: Uint8Array;
/**
* auth_info_bytes is a protobuf serialization of an AuthInfo that matches the
* representation in SignDoc.
* auth_info_bytes is a protobuf serialization of an AuthInfo that matches the
* representation in SignDoc.
*/
authInfoBytes: Uint8Array;
/**
* signatures is a list of signatures that matches the length and order of
* AuthInfo's signer_infos to allow connecting signature meta information like
* public key and signing mode by position.
* signatures is a list of signatures that matches the length and order of
* AuthInfo's signer_infos to allow connecting signature meta information like
* public key and signing mode by position.
*/
signatures: Uint8Array[];
}
/**
* SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT.
*/
/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */
export interface SignDoc {
/**
* body_bytes is protobuf serialization of a TxBody that matches the
* representation in TxRaw.
* body_bytes is protobuf serialization of a TxBody that matches the
* representation in TxRaw.
*/
bodyBytes: Uint8Array;
/**
* auth_info_bytes is a protobuf serialization of an AuthInfo that matches the
* representation in TxRaw.
* auth_info_bytes is a protobuf serialization of an AuthInfo that matches the
* representation in TxRaw.
*/
authInfoBytes: Uint8Array;
/**
* chain_id is the unique identifier of the chain this transaction targets.
* It prevents signed transactions from being used on another chain by an
* attacker
* chain_id is the unique identifier of the chain this transaction targets.
* It prevents signed transactions from being used on another chain by an
* attacker
*/
chainId: string;
/**
* account_number is the account number of the account in state
*/
/** account_number is the account number of the account in state */
accountNumber: Long;
}
/**
* TxBody is the body of a transaction that all signers sign over.
*/
/** TxBody is the body of a transaction that all signers sign over. */
export interface TxBody {
/**
* messages is a list of messages to be executed. The required signers of
* those messages define the number and order of elements in AuthInfo's
* signer_infos and Tx's signatures. Each required signer address is added to
* the list only the first time it occurs.
* By convention, the first required signer (usually from the first message)
* is referred to as the primary signer and pays the fee for the whole
* transaction.
* messages is a list of messages to be executed. The required signers of
* those messages define the number and order of elements in AuthInfo's
* signer_infos and Tx's signatures. Each required signer address is added to
* the list only the first time it occurs.
* By convention, the first required signer (usually from the first message)
* is referred to as the primary signer and pays the fee for the whole
* transaction.
*/
messages: Any[];
/**
* memo is any arbitrary memo to be added to the transaction
*/
/** memo is any arbitrary memo to be added to the transaction */
memo: string;
/**
* timeout is the block height after which this transaction will not
* be processed by the chain
* timeout is the block height after which this transaction will not
* be processed by the chain
*/
timeoutHeight: Long;
/**
* extension_options are arbitrary options that can be added by chains
* when the default options are not sufficient. If any of these are present
* and can't be handled, the transaction will be rejected
* extension_options are arbitrary options that can be added by chains
* when the default options are not sufficient. If any of these are present
* and can't be handled, the transaction will be rejected
*/
extensionOptions: Any[];
/**
* extension_options are arbitrary options that can be added by chains
* when the default options are not sufficient. If any of these are present
* and can't be handled, they will be ignored
* extension_options are arbitrary options that can be added by chains
* when the default options are not sufficient. If any of these are present
* and can't be handled, they will be ignored
*/
nonCriticalExtensionOptions: Any[];
}
/**
* AuthInfo describes the fee and signer modes that are used to sign a
* transaction.
* AuthInfo describes the fee and signer modes that are used to sign a
* transaction.
*/
export interface AuthInfo {
/**
* signer_infos defines the signing modes for the required signers. The number
* and order of elements must match the required signers from TxBody's
* messages. The first element is the primary signer and the one which pays
* the fee.
* signer_infos defines the signing modes for the required signers. The number
* and order of elements must match the required signers from TxBody's
* messages. The first element is the primary signer and the one which pays
* the fee.
*/
signerInfos: SignerInfo[];
/**
* Fee is the fee and gas limit for the transaction. The first signer is the
* primary signer and the one which pays the fee. The fee can be calculated
* based on the cost of evaluating the body and doing signature verification
* of the signers. This can be estimated via simulation.
* Fee is the fee and gas limit for the transaction. The first signer is the
* primary signer and the one which pays the fee. The fee can be calculated
* based on the cost of evaluating the body and doing signature verification
* of the signers. This can be estimated via simulation.
*/
fee?: Fee;
}
/**
* SignerInfo describes the public key and signing mode of a single top-level
* signer.
* SignerInfo describes the public key and signing mode of a single top-level
* signer.
*/
export interface SignerInfo {
/**
* public_key is the public key of the signer. It is optional for accounts
* that already exist in state. If unset, the verifier can use the required \
* signer address for this position and lookup the public key.
* public_key is the public key of the signer. It is optional for accounts
* that already exist in state. If unset, the verifier can use the required \
* signer address for this position and lookup the public key.
*/
publicKey?: Any;
/**
* mode_info describes the signing mode of the signer and is a nested
* structure to support nested multisig pubkey's
* mode_info describes the signing mode of the signer and is a nested
* structure to support nested multisig pubkey's
*/
modeInfo?: ModeInfo;
/**
* sequence is the sequence of the account, which describes the
* number of committed transactions signed by a given address. It is used to
* prevent replay attacks.
* sequence is the sequence of the account, which describes the
* number of committed transactions signed by a given address. It is used to
* prevent replay attacks.
*/
sequence: Long;
}
/**
* ModeInfo describes the signing mode of a single or nested multisig signer.
*/
/** ModeInfo describes the signing mode of a single or nested multisig signer. */
export interface ModeInfo {
/**
* single represents a single signer
*/
/** single represents a single signer */
single?: ModeInfo_Single | undefined;
/**
* multi represents a nested multisig signer
*/
/** multi represents a nested multisig signer */
multi?: ModeInfo_Multi | undefined;
}
/**
* Single is the mode info for a single signer. It is structured as a message
* to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the
* future
* Single is the mode info for a single signer. It is structured as a message
* to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the
* future
*/
export interface ModeInfo_Single {
/**
* mode is the signing mode of the single signer
*/
/** mode is the signing mode of the single signer */
mode: SignMode;
}
/**
* Multi is the mode info for a multisig public key
*/
/** Multi is the mode info for a multisig public key */
export interface ModeInfo_Multi {
/**
* bitarray specifies which keys within the multisig are signing
*/
/** bitarray specifies which keys within the multisig are signing */
bitarray?: CompactBitArray;
/**
* mode_infos is the corresponding modes of the signers of the multisig
* which could include nested multisig public keys
* mode_infos is the corresponding modes of the signers of the multisig
* which could include nested multisig public keys
*/
modeInfos: ModeInfo[];
}
/**
* Fee includes the amount of coins paid in fees and the maximum
* gas to be used by the transaction. The ratio yields an effective "gasprice",
* which must be above some miminum to be accepted into the mempool.
* Fee includes the amount of coins paid in fees and the maximum
* gas to be used by the transaction. The ratio yields an effective "gasprice",
* which must be above some miminum to be accepted into the mempool.
*/
export interface Fee {
/**
* amount is the amount of coins to be paid as a fee
*/
/** amount is the amount of coins to be paid as a fee */
amount: Coin[];
/**
* gas_limit is the maximum gas that can be used in transaction processing
* before an out of gas error occurs
* gas_limit is the maximum gas that can be used in transaction processing
* before an out of gas error occurs
*/
gasLimit: Long;
/**
* if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees.
* the payer must be a tx signer (and thus have signed this field in AuthInfo).
* setting this field does *not* change the ordering of required signers for the transaction.
* if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees.
* the payer must be a tx signer (and thus have signed this field in AuthInfo).
* setting this field does *not* change the ordering of required signers for the transaction.
*/
payer: string;
/**
* if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used
* to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does
* not support fee grants, this will fail
* if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used
* to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does
* not support fee grants, this will fail
*/
granter: string;
}
const baseTx: object = {};
const baseTxRaw: object = {};
const baseSignDoc: object = {
chainId: "",
accountNumber: Long.UZERO,
};
const baseTxBody: object = {
memo: "",
timeoutHeight: Long.UZERO,
};
const baseAuthInfo: object = {};
const baseSignerInfo: object = {
sequence: Long.UZERO,
};
const baseModeInfo: object = {};
const baseModeInfo_Single: object = {
mode: 0,
};
const baseModeInfo_Multi: object = {};
const baseFee: object = {
gasLimit: Long.UZERO,
payer: "",
granter: "",
};
export const protobufPackage = "cosmos.tx.v1beta1";
export const Tx = {
encode(message: Tx, writer: Writer = Writer.create()): Writer {
if (message.body !== undefined && message.body !== undefined) {
@ -280,7 +222,8 @@ export const Tx = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Tx {
decode(input: Reader | Uint8Array, length?: number): Tx {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseTx } as Tx;
@ -304,6 +247,7 @@ export const Tx = {
}
return message;
},
fromJSON(object: any): Tx {
const message = { ...baseTx } as Tx;
message.signatures = [];
@ -324,6 +268,7 @@ export const Tx = {
}
return message;
},
fromPartial(object: DeepPartial<Tx>): Tx {
const message = { ...baseTx } as Tx;
message.signatures = [];
@ -344,6 +289,7 @@ export const Tx = {
}
return message;
},
toJSON(message: Tx): unknown {
const obj: any = {};
message.body !== undefined && (obj.body = message.body ? TxBody.toJSON(message.body) : undefined);
@ -358,6 +304,8 @@ export const Tx = {
},
};
const baseTxRaw: object = {};
export const TxRaw = {
encode(message: TxRaw, writer: Writer = Writer.create()): Writer {
writer.uint32(10).bytes(message.bodyBytes);
@ -367,7 +315,8 @@ export const TxRaw = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): TxRaw {
decode(input: Reader | Uint8Array, length?: number): TxRaw {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseTxRaw } as TxRaw;
@ -391,6 +340,7 @@ export const TxRaw = {
}
return message;
},
fromJSON(object: any): TxRaw {
const message = { ...baseTxRaw } as TxRaw;
message.signatures = [];
@ -407,6 +357,7 @@ export const TxRaw = {
}
return message;
},
fromPartial(object: DeepPartial<TxRaw>): TxRaw {
const message = { ...baseTxRaw } as TxRaw;
message.signatures = [];
@ -427,6 +378,7 @@ export const TxRaw = {
}
return message;
},
toJSON(message: TxRaw): unknown {
const obj: any = {};
message.bodyBytes !== undefined &&
@ -446,6 +398,8 @@ export const TxRaw = {
},
};
const baseSignDoc: object = { chainId: "", accountNumber: Long.UZERO };
export const SignDoc = {
encode(message: SignDoc, writer: Writer = Writer.create()): Writer {
writer.uint32(10).bytes(message.bodyBytes);
@ -454,7 +408,8 @@ export const SignDoc = {
writer.uint32(32).uint64(message.accountNumber);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): SignDoc {
decode(input: Reader | Uint8Array, length?: number): SignDoc {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseSignDoc } as SignDoc;
@ -480,6 +435,7 @@ export const SignDoc = {
}
return message;
},
fromJSON(object: any): SignDoc {
const message = { ...baseSignDoc } as SignDoc;
if (object.bodyBytes !== undefined && object.bodyBytes !== null) {
@ -500,6 +456,7 @@ export const SignDoc = {
}
return message;
},
fromPartial(object: DeepPartial<SignDoc>): SignDoc {
const message = { ...baseSignDoc } as SignDoc;
if (object.bodyBytes !== undefined && object.bodyBytes !== null) {
@ -524,6 +481,7 @@ export const SignDoc = {
}
return message;
},
toJSON(message: SignDoc): unknown {
const obj: any = {};
message.bodyBytes !== undefined &&
@ -541,6 +499,8 @@ export const SignDoc = {
},
};
const baseTxBody: object = { memo: "", timeoutHeight: Long.UZERO };
export const TxBody = {
encode(message: TxBody, writer: Writer = Writer.create()): Writer {
for (const v of message.messages) {
@ -556,7 +516,8 @@ export const TxBody = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): TxBody {
decode(input: Reader | Uint8Array, length?: number): TxBody {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseTxBody } as TxBody;
@ -588,6 +549,7 @@ export const TxBody = {
}
return message;
},
fromJSON(object: any): TxBody {
const message = { ...baseTxBody } as TxBody;
message.messages = [];
@ -620,6 +582,7 @@ export const TxBody = {
}
return message;
},
fromPartial(object: DeepPartial<TxBody>): TxBody {
const message = { ...baseTxBody } as TxBody;
message.messages = [];
@ -652,6 +615,7 @@ export const TxBody = {
}
return message;
},
toJSON(message: TxBody): unknown {
const obj: any = {};
if (message.messages) {
@ -678,6 +642,8 @@ export const TxBody = {
},
};
const baseAuthInfo: object = {};
export const AuthInfo = {
encode(message: AuthInfo, writer: Writer = Writer.create()): Writer {
for (const v of message.signerInfos) {
@ -688,7 +654,8 @@ export const AuthInfo = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): AuthInfo {
decode(input: Reader | Uint8Array, length?: number): AuthInfo {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseAuthInfo } as AuthInfo;
@ -709,6 +676,7 @@ export const AuthInfo = {
}
return message;
},
fromJSON(object: any): AuthInfo {
const message = { ...baseAuthInfo } as AuthInfo;
message.signerInfos = [];
@ -724,6 +692,7 @@ export const AuthInfo = {
}
return message;
},
fromPartial(object: DeepPartial<AuthInfo>): AuthInfo {
const message = { ...baseAuthInfo } as AuthInfo;
message.signerInfos = [];
@ -739,6 +708,7 @@ export const AuthInfo = {
}
return message;
},
toJSON(message: AuthInfo): unknown {
const obj: any = {};
if (message.signerInfos) {
@ -751,6 +721,8 @@ export const AuthInfo = {
},
};
const baseSignerInfo: object = { sequence: Long.UZERO };
export const SignerInfo = {
encode(message: SignerInfo, writer: Writer = Writer.create()): Writer {
if (message.publicKey !== undefined && message.publicKey !== undefined) {
@ -762,7 +734,8 @@ export const SignerInfo = {
writer.uint32(24).uint64(message.sequence);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): SignerInfo {
decode(input: Reader | Uint8Array, length?: number): SignerInfo {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseSignerInfo } as SignerInfo;
@ -785,6 +758,7 @@ export const SignerInfo = {
}
return message;
},
fromJSON(object: any): SignerInfo {
const message = { ...baseSignerInfo } as SignerInfo;
if (object.publicKey !== undefined && object.publicKey !== null) {
@ -804,6 +778,7 @@ export const SignerInfo = {
}
return message;
},
fromPartial(object: DeepPartial<SignerInfo>): SignerInfo {
const message = { ...baseSignerInfo } as SignerInfo;
if (object.publicKey !== undefined && object.publicKey !== null) {
@ -823,6 +798,7 @@ export const SignerInfo = {
}
return message;
},
toJSON(message: SignerInfo): unknown {
const obj: any = {};
message.publicKey !== undefined &&
@ -834,6 +810,8 @@ export const SignerInfo = {
},
};
const baseModeInfo: object = {};
export const ModeInfo = {
encode(message: ModeInfo, writer: Writer = Writer.create()): Writer {
if (message.single !== undefined) {
@ -844,7 +822,8 @@ export const ModeInfo = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ModeInfo {
decode(input: Reader | Uint8Array, length?: number): ModeInfo {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseModeInfo } as ModeInfo;
@ -864,6 +843,7 @@ export const ModeInfo = {
}
return message;
},
fromJSON(object: any): ModeInfo {
const message = { ...baseModeInfo } as ModeInfo;
if (object.single !== undefined && object.single !== null) {
@ -878,6 +858,7 @@ export const ModeInfo = {
}
return message;
},
fromPartial(object: DeepPartial<ModeInfo>): ModeInfo {
const message = { ...baseModeInfo } as ModeInfo;
if (object.single !== undefined && object.single !== null) {
@ -892,6 +873,7 @@ export const ModeInfo = {
}
return message;
},
toJSON(message: ModeInfo): unknown {
const obj: any = {};
message.single !== undefined &&
@ -902,12 +884,15 @@ export const ModeInfo = {
},
};
const baseModeInfo_Single: object = { mode: 0 };
export const ModeInfo_Single = {
encode(message: ModeInfo_Single, writer: Writer = Writer.create()): Writer {
writer.uint32(8).int32(message.mode);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ModeInfo_Single {
decode(input: Reader | Uint8Array, length?: number): ModeInfo_Single {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseModeInfo_Single } as ModeInfo_Single;
@ -924,6 +909,7 @@ export const ModeInfo_Single = {
}
return message;
},
fromJSON(object: any): ModeInfo_Single {
const message = { ...baseModeInfo_Single } as ModeInfo_Single;
if (object.mode !== undefined && object.mode !== null) {
@ -933,6 +919,7 @@ export const ModeInfo_Single = {
}
return message;
},
fromPartial(object: DeepPartial<ModeInfo_Single>): ModeInfo_Single {
const message = { ...baseModeInfo_Single } as ModeInfo_Single;
if (object.mode !== undefined && object.mode !== null) {
@ -942,6 +929,7 @@ export const ModeInfo_Single = {
}
return message;
},
toJSON(message: ModeInfo_Single): unknown {
const obj: any = {};
message.mode !== undefined && (obj.mode = signModeToJSON(message.mode));
@ -949,6 +937,8 @@ export const ModeInfo_Single = {
},
};
const baseModeInfo_Multi: object = {};
export const ModeInfo_Multi = {
encode(message: ModeInfo_Multi, writer: Writer = Writer.create()): Writer {
if (message.bitarray !== undefined && message.bitarray !== undefined) {
@ -959,7 +949,8 @@ export const ModeInfo_Multi = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ModeInfo_Multi {
decode(input: Reader | Uint8Array, length?: number): ModeInfo_Multi {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseModeInfo_Multi } as ModeInfo_Multi;
@ -980,6 +971,7 @@ export const ModeInfo_Multi = {
}
return message;
},
fromJSON(object: any): ModeInfo_Multi {
const message = { ...baseModeInfo_Multi } as ModeInfo_Multi;
message.modeInfos = [];
@ -995,6 +987,7 @@ export const ModeInfo_Multi = {
}
return message;
},
fromPartial(object: DeepPartial<ModeInfo_Multi>): ModeInfo_Multi {
const message = { ...baseModeInfo_Multi } as ModeInfo_Multi;
message.modeInfos = [];
@ -1010,6 +1003,7 @@ export const ModeInfo_Multi = {
}
return message;
},
toJSON(message: ModeInfo_Multi): unknown {
const obj: any = {};
message.bitarray !== undefined &&
@ -1023,6 +1017,8 @@ export const ModeInfo_Multi = {
},
};
const baseFee: object = { gasLimit: Long.UZERO, payer: "", granter: "" };
export const Fee = {
encode(message: Fee, writer: Writer = Writer.create()): Writer {
for (const v of message.amount) {
@ -1033,7 +1029,8 @@ export const Fee = {
writer.uint32(34).string(message.granter);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Fee {
decode(input: Reader | Uint8Array, length?: number): Fee {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseFee } as Fee;
@ -1060,6 +1057,7 @@ export const Fee = {
}
return message;
},
fromJSON(object: any): Fee {
const message = { ...baseFee } as Fee;
message.amount = [];
@ -1085,6 +1083,7 @@ export const Fee = {
}
return message;
},
fromPartial(object: DeepPartial<Fee>): Fee {
const message = { ...baseFee } as Fee;
message.amount = [];
@ -1110,6 +1109,7 @@ export const Fee = {
}
return message;
},
toJSON(message: Fee): unknown {
const obj: any = {};
if (message.amount) {
@ -1124,15 +1124,18 @@ export const Fee = {
},
};
interface WindowBase64 {
atob(b64: string): string;
btoa(bin: string): string;
}
const windowBase64 = (globalThis as unknown) as WindowBase64;
const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary"));
const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64"));
declare var self: any | undefined;
declare var window: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw new Error("Unable to locate global object");
})();
const atob: (b64: string) => string =
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64: string): Uint8Array {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@ -1142,6 +1145,8 @@ function bytesFromBase64(b64: string): Uint8Array {
return arr;
}
const btoa: (bin: string) => string =
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr: Uint8Array): string {
const bin: string[] = [];
for (let i = 0; i < arr.byteLength; ++i) {
@ -1149,7 +1154,8 @@ function base64FromBytes(arr: Uint8Array): string {
}
return btoa(bin.join(""));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -1,3 +1,2 @@
/* eslint-disable */
export const protobufPackage = "cosmos_proto";

View File

@ -1,3 +1,2 @@
/* eslint-disable */
export const protobufPackage = "gogoproto";

View File

@ -1,3 +1,2 @@
/* eslint-disable */
export const protobufPackage = "google.api";

View File

@ -1,333 +1,305 @@
/* eslint-disable */
import { Writer, Reader } from "protobufjs/minimal";
import * as Long from "long";
export const protobufPackage = "google.api";
/**
* Defines the HTTP configuration for an API service. It contains a list of
* [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
* to one or more HTTP REST API methods.
* Defines the HTTP configuration for an API service. It contains a list of
* [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
* to one or more HTTP REST API methods.
*/
export interface Http {
/**
* A list of HTTP configuration rules that apply to individual API methods.
* A list of HTTP configuration rules that apply to individual API methods.
*
* **NOTE:** All service configuration rules follow "last one wins" order.
* **NOTE:** All service configuration rules follow "last one wins" order.
*/
rules: HttpRule[];
/**
* When set to true, URL path parmeters will be fully URI-decoded except in
* cases of single segment matches in reserved expansion, where "%2F" will be
* left encoded.
* When set to true, URL path parmeters will be fully URI-decoded except in
* cases of single segment matches in reserved expansion, where "%2F" will be
* left encoded.
*
* The default behavior is to not decode RFC 6570 reserved characters in multi
* segment matches.
* The default behavior is to not decode RFC 6570 reserved characters in multi
* segment matches.
*/
fullyDecodeReservedExpansion: boolean;
}
/**
* `HttpRule` defines the mapping of an RPC method to one or more HTTP
* REST API methods. The mapping specifies how different portions of the RPC
* request message are mapped to URL path, URL query parameters, and
* HTTP request body. The mapping is typically specified as an
* `google.api.http` annotation on the RPC method,
* see "google/api/annotations.proto" for details.
* `HttpRule` defines the mapping of an RPC method to one or more HTTP
* REST API methods. The mapping specifies how different portions of the RPC
* request message are mapped to URL path, URL query parameters, and
* HTTP request body. The mapping is typically specified as an
* `google.api.http` annotation on the RPC method,
* see "google/api/annotations.proto" for details.
*
* The mapping consists of a field specifying the path template and
* method kind. The path template can refer to fields in the request
* message, as in the example below which describes a REST GET
* operation on a resource collection of messages:
* The mapping consists of a field specifying the path template and
* method kind. The path template can refer to fields in the request
* message, as in the example below which describes a REST GET
* operation on a resource collection of messages:
*
*
* service Messaging {
* rpc GetMessage(GetMessageRequest) returns (Message) {
* option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}";
* }
* }
* message GetMessageRequest {
* message SubMessage {
* string subfield = 1;
* }
* string message_id = 1; // mapped to the URL
* SubMessage sub = 2; // `sub.subfield` is url-mapped
* }
* message Message {
* string text = 1; // content of the resource
* }
* service Messaging {
* rpc GetMessage(GetMessageRequest) returns (Message) {
* option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}";
* }
* }
* message GetMessageRequest {
* message SubMessage {
* string subfield = 1;
* }
* string message_id = 1; // mapped to the URL
* SubMessage sub = 2; // `sub.subfield` is url-mapped
* }
* message Message {
* string text = 1; // content of the resource
* }
*
* The same http annotation can alternatively be expressed inside the
* `GRPC API Configuration` YAML file.
* The same http annotation can alternatively be expressed inside the
* `GRPC API Configuration` YAML file.
*
* http:
* rules:
* - selector: <proto_package_name>.Messaging.GetMessage
* get: /v1/messages/{message_id}/{sub.subfield}
* http:
* rules:
* - selector: <proto_package_name>.Messaging.GetMessage
* get: /v1/messages/{message_id}/{sub.subfield}
*
* This definition enables an automatic, bidrectional mapping of HTTP
* JSON to RPC. Example:
* This definition enables an automatic, bidrectional mapping of HTTP
* JSON to RPC. Example:
*
* HTTP | RPC
* -----|-----
* `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))`
* HTTP | RPC
* -----|-----
* `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))`
*
* In general, not only fields but also field paths can be referenced
* from a path pattern. Fields mapped to the path pattern cannot be
* repeated and must have a primitive (non-message) type.
* In general, not only fields but also field paths can be referenced
* from a path pattern. Fields mapped to the path pattern cannot be
* repeated and must have a primitive (non-message) type.
*
* Any fields in the request message which are not bound by the path
* pattern automatically become (optional) HTTP query
* parameters. Assume the following definition of the request message:
* Any fields in the request message which are not bound by the path
* pattern automatically become (optional) HTTP query
* parameters. Assume the following definition of the request message:
*
*
* service Messaging {
* rpc GetMessage(GetMessageRequest) returns (Message) {
* option (google.api.http).get = "/v1/messages/{message_id}";
* }
* }
* message GetMessageRequest {
* message SubMessage {
* string subfield = 1;
* }
* string message_id = 1; // mapped to the URL
* int64 revision = 2; // becomes a parameter
* SubMessage sub = 3; // `sub.subfield` becomes a parameter
* }
* service Messaging {
* rpc GetMessage(GetMessageRequest) returns (Message) {
* option (google.api.http).get = "/v1/messages/{message_id}";
* }
* }
* message GetMessageRequest {
* message SubMessage {
* string subfield = 1;
* }
* string message_id = 1; // mapped to the URL
* int64 revision = 2; // becomes a parameter
* SubMessage sub = 3; // `sub.subfield` becomes a parameter
* }
*
*
* This enables a HTTP JSON to RPC mapping as below:
* This enables a HTTP JSON to RPC mapping as below:
*
* HTTP | RPC
* -----|-----
* `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))`
* HTTP | RPC
* -----|-----
* `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))`
*
* Note that fields which are mapped to HTTP parameters must have a
* primitive type or a repeated primitive type. Message types are not
* allowed. In the case of a repeated type, the parameter can be
* repeated in the URL, as in `...?param=A&param=B`.
* Note that fields which are mapped to HTTP parameters must have a
* primitive type or a repeated primitive type. Message types are not
* allowed. In the case of a repeated type, the parameter can be
* repeated in the URL, as in `...?param=A&param=B`.
*
* For HTTP method kinds which allow a request body, the `body` field
* specifies the mapping. Consider a REST update method on the
* message resource collection:
* For HTTP method kinds which allow a request body, the `body` field
* specifies the mapping. Consider a REST update method on the
* message resource collection:
*
*
* service Messaging {
* rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
* option (google.api.http) = {
* put: "/v1/messages/{message_id}"
* body: "message"
* };
* }
* }
* message UpdateMessageRequest {
* string message_id = 1; // mapped to the URL
* Message message = 2; // mapped to the body
* }
* service Messaging {
* rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
* option (google.api.http) = {
* put: "/v1/messages/{message_id}"
* body: "message"
* };
* }
* }
* message UpdateMessageRequest {
* string message_id = 1; // mapped to the URL
* Message message = 2; // mapped to the body
* }
*
*
* The following HTTP JSON to RPC mapping is enabled, where the
* representation of the JSON in the request body is determined by
* protos JSON encoding:
* The following HTTP JSON to RPC mapping is enabled, where the
* representation of the JSON in the request body is determined by
* protos JSON encoding:
*
* HTTP | RPC
* -----|-----
* `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
* HTTP | RPC
* -----|-----
* `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
*
* The special name `*` can be used in the body mapping to define that
* every field not bound by the path template should be mapped to the
* request body. This enables the following alternative definition of
* the update method:
* The special name `*` can be used in the body mapping to define that
* every field not bound by the path template should be mapped to the
* request body. This enables the following alternative definition of
* the update method:
*
* service Messaging {
* rpc UpdateMessage(Message) returns (Message) {
* option (google.api.http) = {
* put: "/v1/messages/{message_id}"
* body: "*"
* };
* }
* }
* message Message {
* string message_id = 1;
* string text = 2;
* }
* service Messaging {
* rpc UpdateMessage(Message) returns (Message) {
* option (google.api.http) = {
* put: "/v1/messages/{message_id}"
* body: "*"
* };
* }
* }
* message Message {
* string message_id = 1;
* string text = 2;
* }
*
*
* The following HTTP JSON to RPC mapping is enabled:
* The following HTTP JSON to RPC mapping is enabled:
*
* HTTP | RPC
* -----|-----
* `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")`
* HTTP | RPC
* -----|-----
* `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")`
*
* Note that when using `*` in the body mapping, it is not possible to
* have HTTP parameters, as all fields not bound by the path end in
* the body. This makes this option more rarely used in practice of
* defining REST APIs. The common usage of `*` is in custom methods
* which don't use the URL at all for transferring data.
* Note that when using `*` in the body mapping, it is not possible to
* have HTTP parameters, as all fields not bound by the path end in
* the body. This makes this option more rarely used in practice of
* defining REST APIs. The common usage of `*` is in custom methods
* which don't use the URL at all for transferring data.
*
* It is possible to define multiple HTTP methods for one RPC by using
* the `additional_bindings` option. Example:
* It is possible to define multiple HTTP methods for one RPC by using
* the `additional_bindings` option. Example:
*
* service Messaging {
* rpc GetMessage(GetMessageRequest) returns (Message) {
* option (google.api.http) = {
* get: "/v1/messages/{message_id}"
* additional_bindings {
* get: "/v1/users/{user_id}/messages/{message_id}"
* }
* };
* }
* }
* message GetMessageRequest {
* string message_id = 1;
* string user_id = 2;
* }
* service Messaging {
* rpc GetMessage(GetMessageRequest) returns (Message) {
* option (google.api.http) = {
* get: "/v1/messages/{message_id}"
* additional_bindings {
* get: "/v1/users/{user_id}/messages/{message_id}"
* }
* };
* }
* }
* message GetMessageRequest {
* string message_id = 1;
* string user_id = 2;
* }
*
*
* This enables the following two alternative HTTP JSON to RPC
* mappings:
* This enables the following two alternative HTTP JSON to RPC
* mappings:
*
* HTTP | RPC
* -----|-----
* `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
* `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")`
* HTTP | RPC
* -----|-----
* `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
* `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")`
*
* # Rules for HTTP mapping
* # Rules for HTTP mapping
*
* The rules for mapping HTTP path, query parameters, and body fields
* to the request message are as follows:
* The rules for mapping HTTP path, query parameters, and body fields
* to the request message are as follows:
*
* 1. The `body` field specifies either `*` or a field path, or is
* omitted. If omitted, it indicates there is no HTTP request body.
* 2. Leaf fields (recursive expansion of nested messages in the
* request) can be classified into three types:
* (a) Matched in the URL template.
* (b) Covered by body (if body is `*`, everything except (a) fields;
* else everything under the body field)
* (c) All other fields.
* 3. URL query parameters found in the HTTP request are mapped to (c) fields.
* 4. Any body sent with an HTTP request can contain only (b) fields.
* 1. The `body` field specifies either `*` or a field path, or is
* omitted. If omitted, it indicates there is no HTTP request body.
* 2. Leaf fields (recursive expansion of nested messages in the
* request) can be classified into three types:
* (a) Matched in the URL template.
* (b) Covered by body (if body is `*`, everything except (a) fields;
* else everything under the body field)
* (c) All other fields.
* 3. URL query parameters found in the HTTP request are mapped to (c) fields.
* 4. Any body sent with an HTTP request can contain only (b) fields.
*
* The syntax of the path template is as follows:
* The syntax of the path template is as follows:
*
* Template = "/" Segments [ Verb ] ;
* Segments = Segment { "/" Segment } ;
* Segment = "*" | "**" | LITERAL | Variable ;
* Variable = "{" FieldPath [ "=" Segments ] "}" ;
* FieldPath = IDENT { "." IDENT } ;
* Verb = ":" LITERAL ;
* Template = "/" Segments [ Verb ] ;
* Segments = Segment { "/" Segment } ;
* Segment = "*" | "**" | LITERAL | Variable ;
* Variable = "{" FieldPath [ "=" Segments ] "}" ;
* FieldPath = IDENT { "." IDENT } ;
* Verb = ":" LITERAL ;
*
* The syntax `*` matches a single path segment. The syntax `**` matches zero
* or more path segments, which must be the last part of the path except the
* `Verb`. The syntax `LITERAL` matches literal text in the path.
* The syntax `*` matches a single path segment. The syntax `**` matches zero
* or more path segments, which must be the last part of the path except the
* `Verb`. The syntax `LITERAL` matches literal text in the path.
*
* The syntax `Variable` matches part of the URL path as specified by its
* template. A variable template must not contain other variables. If a variable
* matches a single path segment, its template may be omitted, e.g. `{var}`
* is equivalent to `{var=*}`.
* The syntax `Variable` matches part of the URL path as specified by its
* template. A variable template must not contain other variables. If a variable
* matches a single path segment, its template may be omitted, e.g. `{var}`
* is equivalent to `{var=*}`.
*
* If a variable contains exactly one path segment, such as `"{var}"` or
* `"{var=*}"`, when such a variable is expanded into a URL path, all characters
* except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the
* Discovery Document as `{var}`.
* If a variable contains exactly one path segment, such as `"{var}"` or
* `"{var=*}"`, when such a variable is expanded into a URL path, all characters
* except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the
* Discovery Document as `{var}`.
*
* If a variable contains one or more path segments, such as `"{var=foo/*}"`
* or `"{var=**}"`, when such a variable is expanded into a URL path, all
* characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables
* show up in the Discovery Document as `{+var}`.
* If a variable contains one or more path segments, such as `"{var=foo/*}"`
* or `"{var=**}"`, when such a variable is expanded into a URL path, all
* characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables
* show up in the Discovery Document as `{+var}`.
*
* NOTE: While the single segment variable matches the semantics of
* [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2
* Simple String Expansion, the multi segment variable **does not** match
* RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion
* does not expand special characters like `?` and `#`, which would lead
* to invalid URLs.
* NOTE: While the single segment variable matches the semantics of
* [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2
* Simple String Expansion, the multi segment variable **does not** match
* RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion
* does not expand special characters like `?` and `#`, which would lead
* to invalid URLs.
*
* NOTE: the field paths in variables and in the `body` must not refer to
* repeated fields or map fields.
* NOTE: the field paths in variables and in the `body` must not refer to
* repeated fields or map fields.
*/
export interface HttpRule {
/**
* Selects methods to which this rule applies.
* Selects methods to which this rule applies.
*
* Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
* Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
*/
selector: string;
/**
* Used for listing and getting information about resources.
*/
/** Used for listing and getting information about resources. */
get: string | undefined;
/**
* Used for updating a resource.
*/
/** Used for updating a resource. */
put: string | undefined;
/**
* Used for creating a resource.
*/
/** Used for creating a resource. */
post: string | undefined;
/**
* Used for deleting a resource.
*/
/** Used for deleting a resource. */
delete: string | undefined;
/**
* Used for updating a resource.
*/
/** Used for updating a resource. */
patch: string | undefined;
/**
* The custom pattern is used for specifying an HTTP method that is not
* included in the `pattern` field, such as HEAD, or "*" to leave the
* HTTP method unspecified for this rule. The wild-card rule is useful
* for services that provide content to Web (HTML) clients.
* The custom pattern is used for specifying an HTTP method that is not
* included in the `pattern` field, such as HEAD, or "*" to leave the
* HTTP method unspecified for this rule. The wild-card rule is useful
* for services that provide content to Web (HTML) clients.
*/
custom?: CustomHttpPattern | undefined;
/**
* The name of the request field whose value is mapped to the HTTP body, or
* `*` for mapping all fields not captured by the path pattern to the HTTP
* body. NOTE: the referred field must not be a repeated field and must be
* present at the top-level of request message type.
* The name of the request field whose value is mapped to the HTTP body, or
* `*` for mapping all fields not captured by the path pattern to the HTTP
* body. NOTE: the referred field must not be a repeated field and must be
* present at the top-level of request message type.
*/
body: string;
/**
* Optional. The name of the response field whose value is mapped to the HTTP
* body of response. Other response fields are ignored. When
* not set, the response message will be used as HTTP body of response.
* Optional. The name of the response field whose value is mapped to the HTTP
* body of response. Other response fields are ignored. When
* not set, the response message will be used as HTTP body of response.
*/
responseBody: string;
/**
* Additional HTTP bindings for the selector. Nested bindings must
* not contain an `additional_bindings` field themselves (that is,
* the nesting may only be one level deep).
* Additional HTTP bindings for the selector. Nested bindings must
* not contain an `additional_bindings` field themselves (that is,
* the nesting may only be one level deep).
*/
additionalBindings: HttpRule[];
}
/**
* A custom pattern is used for defining custom HTTP verb.
*/
/** A custom pattern is used for defining custom HTTP verb. */
export interface CustomHttpPattern {
/**
* The name of this custom HTTP verb.
*/
/** The name of this custom HTTP verb. */
kind: string;
/**
* The path matched by this custom verb.
*/
/** The path matched by this custom verb. */
path: string;
}
const baseHttp: object = {
fullyDecodeReservedExpansion: false,
};
const baseHttpRule: object = {
selector: "",
body: "",
responseBody: "",
};
const baseCustomHttpPattern: object = {
kind: "",
path: "",
};
export const protobufPackage = "google.api";
const baseHttp: object = { fullyDecodeReservedExpansion: false };
export const Http = {
encode(message: Http, writer: Writer = Writer.create()): Writer {
@ -337,7 +309,8 @@ export const Http = {
writer.uint32(16).bool(message.fullyDecodeReservedExpansion);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Http {
decode(input: Reader | Uint8Array, length?: number): Http {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseHttp } as Http;
@ -358,6 +331,7 @@ export const Http = {
}
return message;
},
fromJSON(object: any): Http {
const message = { ...baseHttp } as Http;
message.rules = [];
@ -373,6 +347,7 @@ export const Http = {
}
return message;
},
fromPartial(object: DeepPartial<Http>): Http {
const message = { ...baseHttp } as Http;
message.rules = [];
@ -388,6 +363,7 @@ export const Http = {
}
return message;
},
toJSON(message: Http): unknown {
const obj: any = {};
if (message.rules) {
@ -401,6 +377,8 @@ export const Http = {
},
};
const baseHttpRule: object = { selector: "", body: "", responseBody: "" };
export const HttpRule = {
encode(message: HttpRule, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.selector);
@ -429,7 +407,8 @@ export const HttpRule = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): HttpRule {
decode(input: Reader | Uint8Array, length?: number): HttpRule {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseHttpRule } as HttpRule;
@ -474,6 +453,7 @@ export const HttpRule = {
}
return message;
},
fromJSON(object: any): HttpRule {
const message = { ...baseHttpRule } as HttpRule;
message.additionalBindings = [];
@ -529,6 +509,7 @@ export const HttpRule = {
}
return message;
},
fromPartial(object: DeepPartial<HttpRule>): HttpRule {
const message = { ...baseHttpRule } as HttpRule;
message.additionalBindings = [];
@ -584,6 +565,7 @@ export const HttpRule = {
}
return message;
},
toJSON(message: HttpRule): unknown {
const obj: any = {};
message.selector !== undefined && (obj.selector = message.selector);
@ -605,13 +587,16 @@ export const HttpRule = {
},
};
const baseCustomHttpPattern: object = { kind: "", path: "" };
export const CustomHttpPattern = {
encode(message: CustomHttpPattern, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.kind);
writer.uint32(18).string(message.path);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): CustomHttpPattern {
decode(input: Reader | Uint8Array, length?: number): CustomHttpPattern {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseCustomHttpPattern } as CustomHttpPattern;
@ -631,6 +616,7 @@ export const CustomHttpPattern = {
}
return message;
},
fromJSON(object: any): CustomHttpPattern {
const message = { ...baseCustomHttpPattern } as CustomHttpPattern;
if (object.kind !== undefined && object.kind !== null) {
@ -645,6 +631,7 @@ export const CustomHttpPattern = {
}
return message;
},
fromPartial(object: DeepPartial<CustomHttpPattern>): CustomHttpPattern {
const message = { ...baseCustomHttpPattern } as CustomHttpPattern;
if (object.kind !== undefined && object.kind !== null) {
@ -659,6 +646,7 @@ export const CustomHttpPattern = {
}
return message;
},
toJSON(message: CustomHttpPattern): unknown {
const obj: any = {};
message.kind !== undefined && (obj.kind = message.kind);
@ -667,7 +655,7 @@ export const CustomHttpPattern = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -1,131 +1,126 @@
/* eslint-disable */
import { Writer, Reader } from "protobufjs/minimal";
import * as Long from "long";
export const protobufPackage = "google.protobuf";
/**
* `Any` contains an arbitrary serialized protocol buffer message along with a
* URL that describes the type of the serialized message.
* `Any` contains an arbitrary serialized protocol buffer message along with a
* URL that describes the type of the serialized message.
*
* Protobuf library provides support to pack/unpack Any values in the form
* of utility functions or additional generated methods of the Any type.
* Protobuf library provides support to pack/unpack Any values in the form
* of utility functions or additional generated methods of the Any type.
*
* Example 1: Pack and unpack a message in C++.
* Example 1: Pack and unpack a message in C++.
*
* Foo foo = ...;
* Any any;
* any.PackFrom(foo);
* ...
* if (any.UnpackTo(&foo)) {
* ...
* }
*
* Example 2: Pack and unpack a message in Java.
*
* Foo foo = ...;
* Any any = Any.pack(foo);
* ...
* if (any.is(Foo.class)) {
* foo = any.unpack(Foo.class);
* }
*
* Example 3: Pack and unpack a message in Python.
*
* foo = Foo(...)
* any = Any()
* any.Pack(foo)
* ...
* if any.Is(Foo.DESCRIPTOR):
* any.Unpack(foo)
* ...
*
* Example 4: Pack and unpack a message in Go
*
* foo := &pb.Foo{...}
* any, err := ptypes.MarshalAny(foo)
* Foo foo = ...;
* Any any;
* any.PackFrom(foo);
* ...
* if (any.UnpackTo(&foo)) {
* ...
* foo := &pb.Foo{}
* if err := ptypes.UnmarshalAny(any, foo); err != nil {
* ...
* }
* }
*
* The pack methods provided by protobuf library will by default use
* 'type.googleapis.com/full.type.name' as the type URL and the unpack
* methods only use the fully qualified type name after the last '/'
* in the type URL, for example "foo.bar.com/x/y.z" will yield type
* name "y.z".
* Example 2: Pack and unpack a message in Java.
*
* Foo foo = ...;
* Any any = Any.pack(foo);
* ...
* if (any.is(Foo.class)) {
* foo = any.unpack(Foo.class);
* }
*
* JSON
* ====
* The JSON representation of an `Any` value uses the regular
* representation of the deserialized, embedded message, with an
* additional field `@type` which contains the type URL. Example:
* Example 3: Pack and unpack a message in Python.
*
* package google.profile;
* message Person {
* string first_name = 1;
* string last_name = 2;
* foo = Foo(...)
* any = Any()
* any.Pack(foo)
* ...
* if any.Is(Foo.DESCRIPTOR):
* any.Unpack(foo)
* ...
*
* Example 4: Pack and unpack a message in Go
*
* foo := &pb.Foo{...}
* any, err := ptypes.MarshalAny(foo)
* ...
* foo := &pb.Foo{}
* if err := ptypes.UnmarshalAny(any, foo); err != nil {
* ...
* }
*
* {
* "@type": "type.googleapis.com/google.profile.Person",
* "firstName": <string>,
* "lastName": <string>
* }
* The pack methods provided by protobuf library will by default use
* 'type.googleapis.com/full.type.name' as the type URL and the unpack
* methods only use the fully qualified type name after the last '/'
* in the type URL, for example "foo.bar.com/x/y.z" will yield type
* name "y.z".
*
* If the embedded message type is well-known and has a custom JSON
* representation, that representation will be embedded adding a field
* `value` which holds the custom JSON in addition to the `@type`
* field. Example (for message [google.protobuf.Duration][]):
*
* {
* "@type": "type.googleapis.com/google.protobuf.Duration",
* "value": "1.212s"
* }
* JSON
* ====
* The JSON representation of an `Any` value uses the regular
* representation of the deserialized, embedded message, with an
* additional field `@type` which contains the type URL. Example:
*
* package google.profile;
* message Person {
* string first_name = 1;
* string last_name = 2;
* }
*
* {
* "@type": "type.googleapis.com/google.profile.Person",
* "firstName": <string>,
* "lastName": <string>
* }
*
* If the embedded message type is well-known and has a custom JSON
* representation, that representation will be embedded adding a field
* `value` which holds the custom JSON in addition to the `@type`
* field. Example (for message [google.protobuf.Duration][]):
*
* {
* "@type": "type.googleapis.com/google.protobuf.Duration",
* "value": "1.212s"
* }
*/
export interface Any {
/**
* A URL/resource name that uniquely identifies the type of the serialized
* protocol buffer message. This string must contain at least
* one "/" character. The last segment of the URL's path must represent
* the fully qualified name of the type (as in
* `path/google.protobuf.Duration`). The name should be in a canonical form
* (e.g., leading "." is not accepted).
* A URL/resource name that uniquely identifies the type of the serialized
* protocol buffer message. This string must contain at least
* one "/" character. The last segment of the URL's path must represent
* the fully qualified name of the type (as in
* `path/google.protobuf.Duration`). The name should be in a canonical form
* (e.g., leading "." is not accepted).
*
* In practice, teams usually precompile into the binary all types that they
* expect it to use in the context of Any. However, for URLs which use the
* scheme `http`, `https`, or no scheme, one can optionally set up a type
* server that maps type URLs to message definitions as follows:
* In practice, teams usually precompile into the binary all types that they
* expect it to use in the context of Any. However, for URLs which use the
* scheme `http`, `https`, or no scheme, one can optionally set up a type
* server that maps type URLs to message definitions as follows:
*
* * If no scheme is provided, `https` is assumed.
* * An HTTP GET on the URL must yield a [google.protobuf.Type][]
* value in binary format, or produce an error.
* * Applications are allowed to cache lookup results based on the
* URL, or have them precompiled into a binary to avoid any
* lookup. Therefore, binary compatibility needs to be preserved
* on changes to types. (Use versioned type names to manage
* breaking changes.)
* * If no scheme is provided, `https` is assumed.
* * An HTTP GET on the URL must yield a [google.protobuf.Type][]
* value in binary format, or produce an error.
* * Applications are allowed to cache lookup results based on the
* URL, or have them precompiled into a binary to avoid any
* lookup. Therefore, binary compatibility needs to be preserved
* on changes to types. (Use versioned type names to manage
* breaking changes.)
*
* Note: this functionality is not currently available in the official
* protobuf release, and it is not used for type URLs beginning with
* type.googleapis.com.
*
* Schemes other than `http`, `https` (or the empty scheme) might be
* used with implementation specific semantics.
* Note: this functionality is not currently available in the official
* protobuf release, and it is not used for type URLs beginning with
* type.googleapis.com.
*
* Schemes other than `http`, `https` (or the empty scheme) might be
* used with implementation specific semantics.
*/
typeUrl: string;
/**
* Must be a valid serialized protocol buffer of the above specified type.
*/
/** Must be a valid serialized protocol buffer of the above specified type. */
value: Uint8Array;
}
const baseAny: object = {
typeUrl: "",
};
export const protobufPackage = "google.protobuf";
const baseAny: object = { typeUrl: "" };
export const Any = {
encode(message: Any, writer: Writer = Writer.create()): Writer {
@ -133,7 +128,8 @@ export const Any = {
writer.uint32(18).bytes(message.value);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Any {
decode(input: Reader | Uint8Array, length?: number): Any {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseAny } as Any;
@ -153,6 +149,7 @@ export const Any = {
}
return message;
},
fromJSON(object: any): Any {
const message = { ...baseAny } as Any;
if (object.typeUrl !== undefined && object.typeUrl !== null) {
@ -165,6 +162,7 @@ export const Any = {
}
return message;
},
fromPartial(object: DeepPartial<Any>): Any {
const message = { ...baseAny } as Any;
if (object.typeUrl !== undefined && object.typeUrl !== null) {
@ -179,6 +177,7 @@ export const Any = {
}
return message;
},
toJSON(message: Any): unknown {
const obj: any = {};
message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl);
@ -188,15 +187,18 @@ export const Any = {
},
};
interface WindowBase64 {
atob(b64: string): string;
btoa(bin: string): string;
}
const windowBase64 = (globalThis as unknown) as WindowBase64;
const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary"));
const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64"));
declare var self: any | undefined;
declare var window: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw new Error("Unable to locate global object");
})();
const atob: (b64: string) => string =
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64: string): Uint8Array {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@ -206,6 +208,8 @@ function bytesFromBase64(b64: string): Uint8Array {
return arr;
}
const btoa: (bin: string) => string =
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr: Uint8Array): string {
const bin: string[] = [];
for (let i = 0; i < arr.byteLength; ++i) {
@ -213,7 +217,8 @@ function base64FromBytes(arr: Uint8Array): string {
}
return btoa(bin.join(""));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

File diff suppressed because it is too large Load Diff

View File

@ -2,92 +2,87 @@
import * as Long from "long";
import { Writer, Reader } from "protobufjs/minimal";
export const protobufPackage = "google.protobuf";
/**
* A Duration represents a signed, fixed-length span of time represented
* as a count of seconds and fractions of seconds at nanosecond
* resolution. It is independent of any calendar and concepts like "day"
* or "month". It is related to Timestamp in that the difference between
* two Timestamp values is a Duration and it can be added or subtracted
* from a Timestamp. Range is approximately +-10,000 years.
* A Duration represents a signed, fixed-length span of time represented
* as a count of seconds and fractions of seconds at nanosecond
* resolution. It is independent of any calendar and concepts like "day"
* or "month". It is related to Timestamp in that the difference between
* two Timestamp values is a Duration and it can be added or subtracted
* from a Timestamp. Range is approximately +-10,000 years.
*
* # Examples
* # Examples
*
* Example 1: Compute Duration from two Timestamps in pseudo code.
* Example 1: Compute Duration from two Timestamps in pseudo code.
*
* Timestamp start = ...;
* Timestamp end = ...;
* Duration duration = ...;
* Timestamp start = ...;
* Timestamp end = ...;
* Duration duration = ...;
*
* duration.seconds = end.seconds - start.seconds;
* duration.nanos = end.nanos - start.nanos;
* duration.seconds = end.seconds - start.seconds;
* duration.nanos = end.nanos - start.nanos;
*
* if (duration.seconds < 0 && duration.nanos > 0) {
* duration.seconds += 1;
* duration.nanos -= 1000000000;
* } else if (duration.seconds > 0 && duration.nanos < 0) {
* duration.seconds -= 1;
* duration.nanos += 1000000000;
* }
* if (duration.seconds < 0 && duration.nanos > 0) {
* duration.seconds += 1;
* duration.nanos -= 1000000000;
* } else if (duration.seconds > 0 && duration.nanos < 0) {
* duration.seconds -= 1;
* duration.nanos += 1000000000;
* }
*
* Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
* Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
*
* Timestamp start = ...;
* Duration duration = ...;
* Timestamp end = ...;
* Timestamp start = ...;
* Duration duration = ...;
* Timestamp end = ...;
*
* end.seconds = start.seconds + duration.seconds;
* end.nanos = start.nanos + duration.nanos;
* end.seconds = start.seconds + duration.seconds;
* end.nanos = start.nanos + duration.nanos;
*
* if (end.nanos < 0) {
* end.seconds -= 1;
* end.nanos += 1000000000;
* } else if (end.nanos >= 1000000000) {
* end.seconds += 1;
* end.nanos -= 1000000000;
* }
* if (end.nanos < 0) {
* end.seconds -= 1;
* end.nanos += 1000000000;
* } else if (end.nanos >= 1000000000) {
* end.seconds += 1;
* end.nanos -= 1000000000;
* }
*
* Example 3: Compute Duration from datetime.timedelta in Python.
* Example 3: Compute Duration from datetime.timedelta in Python.
*
* td = datetime.timedelta(days=3, minutes=10)
* duration = Duration()
* duration.FromTimedelta(td)
*
* # JSON Mapping
*
* In JSON format, the Duration type is encoded as a string rather than an
* object, where the string ends in the suffix "s" (indicating seconds) and
* is preceded by the number of seconds, with nanoseconds expressed as
* fractional seconds. For example, 3 seconds with 0 nanoseconds should be
* encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
* be expressed in JSON format as "3.000000001s", and 3 seconds and 1
* microsecond should be expressed in JSON format as "3.000001s".
* td = datetime.timedelta(days=3, minutes=10)
* duration = Duration()
* duration.FromTimedelta(td)
*
* # JSON Mapping
*
* In JSON format, the Duration type is encoded as a string rather than an
* object, where the string ends in the suffix "s" (indicating seconds) and
* is preceded by the number of seconds, with nanoseconds expressed as
* fractional seconds. For example, 3 seconds with 0 nanoseconds should be
* encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
* be expressed in JSON format as "3.000000001s", and 3 seconds and 1
* microsecond should be expressed in JSON format as "3.000001s".
*/
export interface Duration {
/**
* Signed seconds of the span of time. Must be from -315,576,000,000
* to +315,576,000,000 inclusive. Note: these bounds are computed from:
* 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
* Signed seconds of the span of time. Must be from -315,576,000,000
* to +315,576,000,000 inclusive. Note: these bounds are computed from:
* 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
*/
seconds: Long;
/**
* Signed fractions of a second at nanosecond resolution of the span
* of time. Durations less than one second are represented with a 0
* `seconds` field and a positive or negative `nanos` field. For durations
* of one second or more, a non-zero value for the `nanos` field must be
* of the same sign as the `seconds` field. Must be from -999,999,999
* to +999,999,999 inclusive.
* Signed fractions of a second at nanosecond resolution of the span
* of time. Durations less than one second are represented with a 0
* `seconds` field and a positive or negative `nanos` field. For durations
* of one second or more, a non-zero value for the `nanos` field must be
* of the same sign as the `seconds` field. Must be from -999,999,999
* to +999,999,999 inclusive.
*/
nanos: number;
}
const baseDuration: object = {
seconds: Long.ZERO,
nanos: 0,
};
export const protobufPackage = "google.protobuf";
const baseDuration: object = { seconds: Long.ZERO, nanos: 0 };
export const Duration = {
encode(message: Duration, writer: Writer = Writer.create()): Writer {
@ -95,7 +90,8 @@ export const Duration = {
writer.uint32(16).int32(message.nanos);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Duration {
decode(input: Reader | Uint8Array, length?: number): Duration {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseDuration } as Duration;
@ -115,6 +111,7 @@ export const Duration = {
}
return message;
},
fromJSON(object: any): Duration {
const message = { ...baseDuration } as Duration;
if (object.seconds !== undefined && object.seconds !== null) {
@ -129,6 +126,7 @@ export const Duration = {
}
return message;
},
fromPartial(object: DeepPartial<Duration>): Duration {
const message = { ...baseDuration } as Duration;
if (object.seconds !== undefined && object.seconds !== null) {
@ -143,6 +141,7 @@ export const Duration = {
}
return message;
},
toJSON(message: Duration): unknown {
const obj: any = {};
message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString());
@ -151,7 +150,7 @@ export const Duration = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -2,114 +2,118 @@
import * as Long from "long";
import { Writer, Reader } from "protobufjs/minimal";
export const protobufPackage = "google.protobuf";
/**
* A Timestamp represents a point in time independent of any time zone or local
* calendar, encoded as a count of seconds and fractions of seconds at
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
* January 1, 1970, in the proleptic Gregorian calendar which extends the
* Gregorian calendar backwards to year one.
* A Timestamp represents a point in time independent of any time zone or local
* calendar, encoded as a count of seconds and fractions of seconds at
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
* January 1, 1970, in the proleptic Gregorian calendar which extends the
* Gregorian calendar backwards to year one.
*
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
* second table is needed for interpretation, using a [24-hour linear
* smear](https://developers.google.com/time/smear).
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
* second table is needed for interpretation, using a [24-hour linear
* smear](https://developers.google.com/time/smear).
*
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
* restricting to that range, we ensure that we can convert to and from [RFC
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
* restricting to that range, we ensure that we can convert to and from [RFC
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
*
* # Examples
* # Examples
*
* Example 1: Compute Timestamp from POSIX `time()`.
* Example 1: Compute Timestamp from POSIX `time()`.
*
* Timestamp timestamp;
* timestamp.set_seconds(time(NULL));
* timestamp.set_nanos(0);
* Timestamp timestamp;
* timestamp.set_seconds(time(NULL));
* timestamp.set_nanos(0);
*
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
*
* struct timeval tv;
* gettimeofday(&tv, NULL);
* struct timeval tv;
* gettimeofday(&tv, NULL);
*
* Timestamp timestamp;
* timestamp.set_seconds(tv.tv_sec);
* timestamp.set_nanos(tv.tv_usec * 1000);
* Timestamp timestamp;
* timestamp.set_seconds(tv.tv_sec);
* timestamp.set_nanos(tv.tv_usec * 1000);
*
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
*
* FILETIME ft;
* GetSystemTimeAsFileTime(&ft);
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
* FILETIME ft;
* GetSystemTimeAsFileTime(&ft);
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
*
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
* Timestamp timestamp;
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
* Timestamp timestamp;
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
*
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
*
* long millis = System.currentTimeMillis();
* long millis = System.currentTimeMillis();
*
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
* .setNanos((int) ((millis % 1000) * 1000000)).build();
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
* .setNanos((int) ((millis % 1000) * 1000000)).build();
*
*
* Example 5: Compute Timestamp from current time in Python.
* Example 5: Compute Timestamp from Java `Instant.now()`.
*
* timestamp = Timestamp()
* timestamp.GetCurrentTime()
* Instant now = Instant.now();
*
* # JSON Mapping
*
* In JSON format, the Timestamp type is encoded as a string in the
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
* where {year} is always expressed using four digits while {month}, {day},
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
* is required. A proto3 JSON serializer should always use UTC (as indicated by
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
* able to accept both UTC and other timezones (as indicated by an offset).
*
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
* 01:30 UTC on January 15, 2017.
*
* In JavaScript, one can convert a Date object to this format using the
* standard
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
* method. In Python, a standard `datetime.datetime` object can be converted
* to this format using
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
* ) to obtain a formatter capable of generating timestamps in this format.
* Timestamp timestamp =
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
* .setNanos(now.getNano()).build();
*
*
* Example 6: Compute Timestamp from current time in Python.
*
* timestamp = Timestamp()
* timestamp.GetCurrentTime()
*
* # JSON Mapping
*
* In JSON format, the Timestamp type is encoded as a string in the
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
* where {year} is always expressed using four digits while {month}, {day},
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
* is required. A proto3 JSON serializer should always use UTC (as indicated by
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
* able to accept both UTC and other timezones (as indicated by an offset).
*
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
* 01:30 UTC on January 15, 2017.
*
* In JavaScript, one can convert a Date object to this format using the
* standard
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
* method. In Python, a standard `datetime.datetime` object can be converted
* to this format using
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
* ) to obtain a formatter capable of generating timestamps in this format.
*/
export interface Timestamp {
/**
* Represents seconds of UTC time since Unix epoch
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
* 9999-12-31T23:59:59Z inclusive.
* Represents seconds of UTC time since Unix epoch
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
* 9999-12-31T23:59:59Z inclusive.
*/
seconds: Long;
/**
* Non-negative fractions of a second at nanosecond resolution. Negative
* second values with fractions must still have non-negative nanos values
* that count forward in time. Must be from 0 to 999,999,999
* inclusive.
* Non-negative fractions of a second at nanosecond resolution. Negative
* second values with fractions must still have non-negative nanos values
* that count forward in time. Must be from 0 to 999,999,999
* inclusive.
*/
nanos: number;
}
const baseTimestamp: object = {
seconds: Long.ZERO,
nanos: 0,
};
export const protobufPackage = "google.protobuf";
const baseTimestamp: object = { seconds: Long.ZERO, nanos: 0 };
export const Timestamp = {
encode(message: Timestamp, writer: Writer = Writer.create()): Writer {
@ -117,7 +121,8 @@ export const Timestamp = {
writer.uint32(16).int32(message.nanos);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Timestamp {
decode(input: Reader | Uint8Array, length?: number): Timestamp {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseTimestamp } as Timestamp;
@ -137,6 +142,7 @@ export const Timestamp = {
}
return message;
},
fromJSON(object: any): Timestamp {
const message = { ...baseTimestamp } as Timestamp;
if (object.seconds !== undefined && object.seconds !== null) {
@ -151,6 +157,7 @@ export const Timestamp = {
}
return message;
},
fromPartial(object: DeepPartial<Timestamp>): Timestamp {
const message = { ...baseTimestamp } as Timestamp;
if (object.seconds !== undefined && object.seconds !== null) {
@ -165,6 +172,7 @@ export const Timestamp = {
}
return message;
},
toJSON(message: Timestamp): unknown {
const obj: any = {};
message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString());
@ -173,7 +181,7 @@ export const Timestamp = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -3,223 +3,27 @@ import * as Long from "long";
import { Height } from "../../../../ibc/core/client/v1/client";
import { Writer, Reader } from "protobufjs/minimal";
/**
* Channel defines pipeline for exactly-once packet delivery between specific
* modules on separate blockchains, which has at least one end capable of
* sending packets and one end capable of receiving packets.
*/
export interface Channel {
/**
* current state of the channel end
*/
state: State;
/**
* whether the channel is ordered or unordered
*/
ordering: Order;
/**
* counterparty channel end
*/
counterparty?: Counterparty;
/**
* list of connection identifiers, in order, along which packets sent on
* this channel will travel
*/
connectionHops: string[];
/**
* opaque channel version, which is agreed upon during the handshake
*/
version: string;
}
/**
* IdentifiedChannel defines a channel with additional port and channel
* identifier fields.
*/
export interface IdentifiedChannel {
/**
* current state of the channel end
*/
state: State;
/**
* whether the channel is ordered or unordered
*/
ordering: Order;
/**
* counterparty channel end
*/
counterparty?: Counterparty;
/**
* list of connection identifiers, in order, along which packets sent on
* this channel will travel
*/
connectionHops: string[];
/**
* opaque channel version, which is agreed upon during the handshake
*/
version: string;
/**
* port identifier
*/
portId: string;
/**
* channel identifier
*/
channelId: string;
}
/**
* Counterparty defines a channel end counterparty
*/
export interface Counterparty {
/**
* port on the counterparty chain which owns the other end of the channel.
*/
portId: string;
/**
* channel end on the counterparty chain
*/
channelId: string;
}
/**
* Packet defines a type that carries data across different chains through IBC
*/
export interface Packet {
/**
* number corresponds to the order of sends and receives, where a Packet
* with an earlier sequence number must be sent and received before a Packet
* with a later sequence number.
*/
sequence: Long;
/**
* identifies the port on the sending chain.
*/
sourcePort: string;
/**
* identifies the channel end on the sending chain.
*/
sourceChannel: string;
/**
* identifies the port on the receiving chain.
*/
destinationPort: string;
/**
* identifies the channel end on the receiving chain.
*/
destinationChannel: string;
/**
* actual opaque bytes transferred directly to the application module
*/
data: Uint8Array;
/**
* block height after which the packet times out
*/
timeoutHeight?: Height;
/**
* block timestamp (in nanoseconds) after which the packet times out
*/
timeoutTimestamp: Long;
}
/**
* PacketState defines the generic type necessary to retrieve and store
* packet commitments, acknowledgements, and receipts.
* Caller is responsible for knowing the context necessary to interpret this
* state as a commitment, acknowledgement, or a receipt.
*/
export interface PacketState {
/**
* channel port identifier.
*/
portId: string;
/**
* channel unique identifier.
*/
channelId: string;
/**
* packet sequence.
*/
sequence: Long;
/**
* embedded data that represents packet state.
*/
data: Uint8Array;
}
/**
* Acknowledgement is the recommended acknowledgement format to be used by
* app-specific protocols.
* NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental
* conflicts with other protobuf message formats used for acknowledgements.
* The first byte of any message with this format will be the non-ASCII values
* `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS:
* https://github.com/cosmos/ics/tree/master/spec/ics-004-channel-and-packet-semantics#acknowledgement-envelope
*/
export interface Acknowledgement {
result: Uint8Array | undefined;
error: string | undefined;
}
const baseChannel: object = {
state: 0,
ordering: 0,
connectionHops: "",
version: "",
};
const baseIdentifiedChannel: object = {
state: 0,
ordering: 0,
connectionHops: "",
version: "",
portId: "",
channelId: "",
};
const baseCounterparty: object = {
portId: "",
channelId: "",
};
const basePacket: object = {
sequence: Long.UZERO,
sourcePort: "",
sourceChannel: "",
destinationPort: "",
destinationChannel: "",
timeoutTimestamp: Long.UZERO,
};
const basePacketState: object = {
portId: "",
channelId: "",
sequence: Long.UZERO,
};
const baseAcknowledgement: object = {};
export const protobufPackage = "ibc.core.channel.v1";
/** State defines if a channel is in one of the following states:
CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED.
/**
* State defines if a channel is in one of the following states:
* CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED.
*/
export enum State {
/** STATE_UNINITIALIZED_UNSPECIFIED - Default State
*/
/** STATE_UNINITIALIZED_UNSPECIFIED - Default State */
STATE_UNINITIALIZED_UNSPECIFIED = 0,
/** STATE_INIT - A channel has just started the opening handshake.
*/
/** STATE_INIT - A channel has just started the opening handshake. */
STATE_INIT = 1,
/** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain.
*/
/** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain. */
STATE_TRYOPEN = 2,
/** STATE_OPEN - A channel has completed the handshake. Open channels are
ready to send and receive packets.
/**
* STATE_OPEN - A channel has completed the handshake. Open channels are
* ready to send and receive packets.
*/
STATE_OPEN = 3,
/** STATE_CLOSED - A channel has been closed and can no longer be used to send or receive
packets.
/**
* STATE_CLOSED - A channel has been closed and can no longer be used to send or receive
* packets.
*/
STATE_CLOSED = 4,
UNRECOGNIZED = -1,
@ -266,18 +70,16 @@ export function stateToJSON(object: State): string {
}
}
/** Order defines if a channel is ORDERED or UNORDERED
*/
/** Order defines if a channel is ORDERED or UNORDERED */
export enum Order {
/** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering
*/
/** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering */
ORDER_NONE_UNSPECIFIED = 0,
/** ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in
which they were sent.
/**
* ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in
* which they were sent.
*/
ORDER_UNORDERED = 1,
/** ORDER_ORDERED - packets are delivered exactly in the order which they were sent
*/
/** ORDER_ORDERED - packets are delivered exactly in the order which they were sent */
ORDER_ORDERED = 2,
UNRECOGNIZED = -1,
}
@ -313,6 +115,116 @@ export function orderToJSON(object: Order): string {
}
}
/**
* Channel defines pipeline for exactly-once packet delivery between specific
* modules on separate blockchains, which has at least one end capable of
* sending packets and one end capable of receiving packets.
*/
export interface Channel {
/** current state of the channel end */
state: State;
/** whether the channel is ordered or unordered */
ordering: Order;
/** counterparty channel end */
counterparty?: Counterparty;
/**
* list of connection identifiers, in order, along which packets sent on
* this channel will travel
*/
connectionHops: string[];
/** opaque channel version, which is agreed upon during the handshake */
version: string;
}
/**
* IdentifiedChannel defines a channel with additional port and channel
* identifier fields.
*/
export interface IdentifiedChannel {
/** current state of the channel end */
state: State;
/** whether the channel is ordered or unordered */
ordering: Order;
/** counterparty channel end */
counterparty?: Counterparty;
/**
* list of connection identifiers, in order, along which packets sent on
* this channel will travel
*/
connectionHops: string[];
/** opaque channel version, which is agreed upon during the handshake */
version: string;
/** port identifier */
portId: string;
/** channel identifier */
channelId: string;
}
/** Counterparty defines a channel end counterparty */
export interface Counterparty {
/** port on the counterparty chain which owns the other end of the channel. */
portId: string;
/** channel end on the counterparty chain */
channelId: string;
}
/** Packet defines a type that carries data across different chains through IBC */
export interface Packet {
/**
* number corresponds to the order of sends and receives, where a Packet
* with an earlier sequence number must be sent and received before a Packet
* with a later sequence number.
*/
sequence: Long;
/** identifies the port on the sending chain. */
sourcePort: string;
/** identifies the channel end on the sending chain. */
sourceChannel: string;
/** identifies the port on the receiving chain. */
destinationPort: string;
/** identifies the channel end on the receiving chain. */
destinationChannel: string;
/** actual opaque bytes transferred directly to the application module */
data: Uint8Array;
/** block height after which the packet times out */
timeoutHeight?: Height;
/** block timestamp (in nanoseconds) after which the packet times out */
timeoutTimestamp: Long;
}
/**
* PacketState defines the generic type necessary to retrieve and store
* packet commitments, acknowledgements, and receipts.
* Caller is responsible for knowing the context necessary to interpret this
* state as a commitment, acknowledgement, or a receipt.
*/
export interface PacketState {
/** channel port identifier. */
portId: string;
/** channel unique identifier. */
channelId: string;
/** packet sequence. */
sequence: Long;
/** embedded data that represents packet state. */
data: Uint8Array;
}
/**
* Acknowledgement is the recommended acknowledgement format to be used by
* app-specific protocols.
* NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental
* conflicts with other protobuf message formats used for acknowledgements.
* The first byte of any message with this format will be the non-ASCII values
* `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS:
* https://github.com/cosmos/ics/tree/master/spec/ics-004-channel-and-packet-semantics#acknowledgement-envelope
*/
export interface Acknowledgement {
result: Uint8Array | undefined;
error: string | undefined;
}
const baseChannel: object = { state: 0, ordering: 0, connectionHops: "", version: "" };
export const Channel = {
encode(message: Channel, writer: Writer = Writer.create()): Writer {
writer.uint32(8).int32(message.state);
@ -326,7 +238,8 @@ export const Channel = {
writer.uint32(42).string(message.version);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Channel {
decode(input: Reader | Uint8Array, length?: number): Channel {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseChannel } as Channel;
@ -356,6 +269,7 @@ export const Channel = {
}
return message;
},
fromJSON(object: any): Channel {
const message = { ...baseChannel } as Channel;
message.connectionHops = [];
@ -386,6 +300,7 @@ export const Channel = {
}
return message;
},
fromPartial(object: DeepPartial<Channel>): Channel {
const message = { ...baseChannel } as Channel;
message.connectionHops = [];
@ -416,6 +331,7 @@ export const Channel = {
}
return message;
},
toJSON(message: Channel): unknown {
const obj: any = {};
message.state !== undefined && (obj.state = stateToJSON(message.state));
@ -432,6 +348,15 @@ export const Channel = {
},
};
const baseIdentifiedChannel: object = {
state: 0,
ordering: 0,
connectionHops: "",
version: "",
portId: "",
channelId: "",
};
export const IdentifiedChannel = {
encode(message: IdentifiedChannel, writer: Writer = Writer.create()): Writer {
writer.uint32(8).int32(message.state);
@ -447,7 +372,8 @@ export const IdentifiedChannel = {
writer.uint32(58).string(message.channelId);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): IdentifiedChannel {
decode(input: Reader | Uint8Array, length?: number): IdentifiedChannel {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseIdentifiedChannel } as IdentifiedChannel;
@ -483,6 +409,7 @@ export const IdentifiedChannel = {
}
return message;
},
fromJSON(object: any): IdentifiedChannel {
const message = { ...baseIdentifiedChannel } as IdentifiedChannel;
message.connectionHops = [];
@ -523,6 +450,7 @@ export const IdentifiedChannel = {
}
return message;
},
fromPartial(object: DeepPartial<IdentifiedChannel>): IdentifiedChannel {
const message = { ...baseIdentifiedChannel } as IdentifiedChannel;
message.connectionHops = [];
@ -563,6 +491,7 @@ export const IdentifiedChannel = {
}
return message;
},
toJSON(message: IdentifiedChannel): unknown {
const obj: any = {};
message.state !== undefined && (obj.state = stateToJSON(message.state));
@ -581,13 +510,16 @@ export const IdentifiedChannel = {
},
};
const baseCounterparty: object = { portId: "", channelId: "" };
export const Counterparty = {
encode(message: Counterparty, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.portId);
writer.uint32(18).string(message.channelId);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Counterparty {
decode(input: Reader | Uint8Array, length?: number): Counterparty {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseCounterparty } as Counterparty;
@ -607,6 +539,7 @@ export const Counterparty = {
}
return message;
},
fromJSON(object: any): Counterparty {
const message = { ...baseCounterparty } as Counterparty;
if (object.portId !== undefined && object.portId !== null) {
@ -621,6 +554,7 @@ export const Counterparty = {
}
return message;
},
fromPartial(object: DeepPartial<Counterparty>): Counterparty {
const message = { ...baseCounterparty } as Counterparty;
if (object.portId !== undefined && object.portId !== null) {
@ -635,6 +569,7 @@ export const Counterparty = {
}
return message;
},
toJSON(message: Counterparty): unknown {
const obj: any = {};
message.portId !== undefined && (obj.portId = message.portId);
@ -643,6 +578,15 @@ export const Counterparty = {
},
};
const basePacket: object = {
sequence: Long.UZERO,
sourcePort: "",
sourceChannel: "",
destinationPort: "",
destinationChannel: "",
timeoutTimestamp: Long.UZERO,
};
export const Packet = {
encode(message: Packet, writer: Writer = Writer.create()): Writer {
writer.uint32(8).uint64(message.sequence);
@ -657,7 +601,8 @@ export const Packet = {
writer.uint32(64).uint64(message.timeoutTimestamp);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Packet {
decode(input: Reader | Uint8Array, length?: number): Packet {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...basePacket } as Packet;
@ -695,6 +640,7 @@ export const Packet = {
}
return message;
},
fromJSON(object: any): Packet {
const message = { ...basePacket } as Packet;
if (object.sequence !== undefined && object.sequence !== null) {
@ -737,6 +683,7 @@ export const Packet = {
}
return message;
},
fromPartial(object: DeepPartial<Packet>): Packet {
const message = { ...basePacket } as Packet;
if (object.sequence !== undefined && object.sequence !== null) {
@ -781,6 +728,7 @@ export const Packet = {
}
return message;
},
toJSON(message: Packet): unknown {
const obj: any = {};
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
@ -798,6 +746,8 @@ export const Packet = {
},
};
const basePacketState: object = { portId: "", channelId: "", sequence: Long.UZERO };
export const PacketState = {
encode(message: PacketState, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.portId);
@ -806,7 +756,8 @@ export const PacketState = {
writer.uint32(34).bytes(message.data);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): PacketState {
decode(input: Reader | Uint8Array, length?: number): PacketState {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...basePacketState } as PacketState;
@ -832,6 +783,7 @@ export const PacketState = {
}
return message;
},
fromJSON(object: any): PacketState {
const message = { ...basePacketState } as PacketState;
if (object.portId !== undefined && object.portId !== null) {
@ -854,6 +806,7 @@ export const PacketState = {
}
return message;
},
fromPartial(object: DeepPartial<PacketState>): PacketState {
const message = { ...basePacketState } as PacketState;
if (object.portId !== undefined && object.portId !== null) {
@ -878,6 +831,7 @@ export const PacketState = {
}
return message;
},
toJSON(message: PacketState): unknown {
const obj: any = {};
message.portId !== undefined && (obj.portId = message.portId);
@ -889,6 +843,8 @@ export const PacketState = {
},
};
const baseAcknowledgement: object = {};
export const Acknowledgement = {
encode(message: Acknowledgement, writer: Writer = Writer.create()): Writer {
if (message.result !== undefined) {
@ -899,7 +855,8 @@ export const Acknowledgement = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Acknowledgement {
decode(input: Reader | Uint8Array, length?: number): Acknowledgement {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseAcknowledgement } as Acknowledgement;
@ -919,6 +876,7 @@ export const Acknowledgement = {
}
return message;
},
fromJSON(object: any): Acknowledgement {
const message = { ...baseAcknowledgement } as Acknowledgement;
if (object.result !== undefined && object.result !== null) {
@ -931,6 +889,7 @@ export const Acknowledgement = {
}
return message;
},
fromPartial(object: DeepPartial<Acknowledgement>): Acknowledgement {
const message = { ...baseAcknowledgement } as Acknowledgement;
if (object.result !== undefined && object.result !== null) {
@ -945,6 +904,7 @@ export const Acknowledgement = {
}
return message;
},
toJSON(message: Acknowledgement): unknown {
const obj: any = {};
message.result !== undefined &&
@ -954,15 +914,18 @@ export const Acknowledgement = {
},
};
interface WindowBase64 {
atob(b64: string): string;
btoa(bin: string): string;
}
const windowBase64 = (globalThis as unknown) as WindowBase64;
const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary"));
const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64"));
declare var self: any | undefined;
declare var window: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw new Error("Unable to locate global object");
})();
const atob: (b64: string) => string =
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64: string): Uint8Array {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@ -972,6 +935,8 @@ function bytesFromBase64(b64: string): Uint8Array {
return arr;
}
const btoa: (bin: string) => string =
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr: Uint8Array): string {
const bin: string[] = [];
for (let i = 0; i < arr.byteLength; ++i) {
@ -979,7 +944,8 @@ function base64FromBytes(arr: Uint8Array): string {
}
return btoa(bin.join(""));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

File diff suppressed because it is too large Load Diff

View File

@ -3,132 +3,79 @@ import { Any } from "../../../../google/protobuf/any";
import * as Long from "long";
import { Writer, Reader } from "protobufjs/minimal";
export const protobufPackage = "ibc.core.client.v1";
/**
* IdentifiedClientState defines a client state with an additional client
* identifier field.
* IdentifiedClientState defines a client state with an additional client
* identifier field.
*/
export interface IdentifiedClientState {
/**
* client identifier
*/
/** client identifier */
clientId: string;
/**
* client state
*/
/** client state */
clientState?: Any;
}
/**
* ConsensusStateWithHeight defines a consensus state with an additional height field.
*/
/** ConsensusStateWithHeight defines a consensus state with an additional height field. */
export interface ConsensusStateWithHeight {
/**
* consensus state height
*/
/** consensus state height */
height?: Height;
/**
* consensus state
*/
/** consensus state */
consensusState?: Any;
}
/**
* ClientConsensusStates defines all the stored consensus states for a given
* client.
* ClientConsensusStates defines all the stored consensus states for a given
* client.
*/
export interface ClientConsensusStates {
/**
* client identifier
*/
/** client identifier */
clientId: string;
/**
* consensus states and their heights associated with the client
*/
/** consensus states and their heights associated with the client */
consensusStates: ConsensusStateWithHeight[];
}
/**
* ClientUpdateProposal is a governance proposal. If it passes, the client is
* updated with the provided header. The update may fail if the header is not
* valid given certain conditions specified by the client implementation.
* ClientUpdateProposal is a governance proposal. If it passes, the client is
* updated with the provided header. The update may fail if the header is not
* valid given certain conditions specified by the client implementation.
*/
export interface ClientUpdateProposal {
/**
* the title of the update proposal
*/
/** the title of the update proposal */
title: string;
/**
* the description of the proposal
*/
/** the description of the proposal */
description: string;
/**
* the client identifier for the client to be updated if the proposal passes
*/
/** the client identifier for the client to be updated if the proposal passes */
clientId: string;
/**
* the header used to update the client if the proposal passes
*/
/** the header used to update the client if the proposal passes */
header?: Any;
}
/**
* Height is a monotonically increasing data type
* that can be compared against another Height for the purposes of updating and
* freezing clients
* Height is a monotonically increasing data type
* that can be compared against another Height for the purposes of updating and
* freezing clients
*
* Normally the RevisionHeight is incremented at each height while keeping RevisionNumber
* the same. However some consensus algorithms may choose to reset the
* height in certain conditions e.g. hard forks, state-machine breaking changes
* In these cases, the RevisionNumber is incremented so that height continues to
* be monitonically increasing even as the RevisionHeight gets reset
* Normally the RevisionHeight is incremented at each height while keeping RevisionNumber
* the same. However some consensus algorithms may choose to reset the
* height in certain conditions e.g. hard forks, state-machine breaking changes
* In these cases, the RevisionNumber is incremented so that height continues to
* be monitonically increasing even as the RevisionHeight gets reset
*/
export interface Height {
/**
* the revision that the client is currently on
*/
/** the revision that the client is currently on */
revisionNumber: Long;
/**
* the height within the given revision
*/
/** the height within the given revision */
revisionHeight: Long;
}
/**
* Params defines the set of IBC light client parameters.
*/
/** Params defines the set of IBC light client parameters. */
export interface Params {
/**
* allowed_clients defines the list of allowed client state types.
*/
/** allowed_clients defines the list of allowed client state types. */
allowedClients: string[];
}
const baseIdentifiedClientState: object = {
clientId: "",
};
const baseConsensusStateWithHeight: object = {};
const baseClientConsensusStates: object = {
clientId: "",
};
const baseClientUpdateProposal: object = {
title: "",
description: "",
clientId: "",
};
const baseHeight: object = {
revisionNumber: Long.UZERO,
revisionHeight: Long.UZERO,
};
const baseParams: object = {
allowedClients: "",
};
export const protobufPackage = "ibc.core.client.v1";
const baseIdentifiedClientState: object = { clientId: "" };
export const IdentifiedClientState = {
encode(message: IdentifiedClientState, writer: Writer = Writer.create()): Writer {
@ -138,7 +85,8 @@ export const IdentifiedClientState = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): IdentifiedClientState {
decode(input: Reader | Uint8Array, length?: number): IdentifiedClientState {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseIdentifiedClientState } as IdentifiedClientState;
@ -158,6 +106,7 @@ export const IdentifiedClientState = {
}
return message;
},
fromJSON(object: any): IdentifiedClientState {
const message = { ...baseIdentifiedClientState } as IdentifiedClientState;
if (object.clientId !== undefined && object.clientId !== null) {
@ -172,6 +121,7 @@ export const IdentifiedClientState = {
}
return message;
},
fromPartial(object: DeepPartial<IdentifiedClientState>): IdentifiedClientState {
const message = { ...baseIdentifiedClientState } as IdentifiedClientState;
if (object.clientId !== undefined && object.clientId !== null) {
@ -186,6 +136,7 @@ export const IdentifiedClientState = {
}
return message;
},
toJSON(message: IdentifiedClientState): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
@ -195,6 +146,8 @@ export const IdentifiedClientState = {
},
};
const baseConsensusStateWithHeight: object = {};
export const ConsensusStateWithHeight = {
encode(message: ConsensusStateWithHeight, writer: Writer = Writer.create()): Writer {
if (message.height !== undefined && message.height !== undefined) {
@ -205,7 +158,8 @@ export const ConsensusStateWithHeight = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ConsensusStateWithHeight {
decode(input: Reader | Uint8Array, length?: number): ConsensusStateWithHeight {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseConsensusStateWithHeight } as ConsensusStateWithHeight;
@ -225,6 +179,7 @@ export const ConsensusStateWithHeight = {
}
return message;
},
fromJSON(object: any): ConsensusStateWithHeight {
const message = { ...baseConsensusStateWithHeight } as ConsensusStateWithHeight;
if (object.height !== undefined && object.height !== null) {
@ -239,6 +194,7 @@ export const ConsensusStateWithHeight = {
}
return message;
},
fromPartial(object: DeepPartial<ConsensusStateWithHeight>): ConsensusStateWithHeight {
const message = { ...baseConsensusStateWithHeight } as ConsensusStateWithHeight;
if (object.height !== undefined && object.height !== null) {
@ -253,6 +209,7 @@ export const ConsensusStateWithHeight = {
}
return message;
},
toJSON(message: ConsensusStateWithHeight): unknown {
const obj: any = {};
message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined);
@ -262,6 +219,8 @@ export const ConsensusStateWithHeight = {
},
};
const baseClientConsensusStates: object = { clientId: "" };
export const ClientConsensusStates = {
encode(message: ClientConsensusStates, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.clientId);
@ -270,7 +229,8 @@ export const ClientConsensusStates = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ClientConsensusStates {
decode(input: Reader | Uint8Array, length?: number): ClientConsensusStates {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseClientConsensusStates } as ClientConsensusStates;
@ -291,6 +251,7 @@ export const ClientConsensusStates = {
}
return message;
},
fromJSON(object: any): ClientConsensusStates {
const message = { ...baseClientConsensusStates } as ClientConsensusStates;
message.consensusStates = [];
@ -306,6 +267,7 @@ export const ClientConsensusStates = {
}
return message;
},
fromPartial(object: DeepPartial<ClientConsensusStates>): ClientConsensusStates {
const message = { ...baseClientConsensusStates } as ClientConsensusStates;
message.consensusStates = [];
@ -321,6 +283,7 @@ export const ClientConsensusStates = {
}
return message;
},
toJSON(message: ClientConsensusStates): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
@ -335,6 +298,8 @@ export const ClientConsensusStates = {
},
};
const baseClientUpdateProposal: object = { title: "", description: "", clientId: "" };
export const ClientUpdateProposal = {
encode(message: ClientUpdateProposal, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.title);
@ -345,7 +310,8 @@ export const ClientUpdateProposal = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ClientUpdateProposal {
decode(input: Reader | Uint8Array, length?: number): ClientUpdateProposal {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseClientUpdateProposal } as ClientUpdateProposal;
@ -371,6 +337,7 @@ export const ClientUpdateProposal = {
}
return message;
},
fromJSON(object: any): ClientUpdateProposal {
const message = { ...baseClientUpdateProposal } as ClientUpdateProposal;
if (object.title !== undefined && object.title !== null) {
@ -395,6 +362,7 @@ export const ClientUpdateProposal = {
}
return message;
},
fromPartial(object: DeepPartial<ClientUpdateProposal>): ClientUpdateProposal {
const message = { ...baseClientUpdateProposal } as ClientUpdateProposal;
if (object.title !== undefined && object.title !== null) {
@ -419,6 +387,7 @@ export const ClientUpdateProposal = {
}
return message;
},
toJSON(message: ClientUpdateProposal): unknown {
const obj: any = {};
message.title !== undefined && (obj.title = message.title);
@ -429,13 +398,16 @@ export const ClientUpdateProposal = {
},
};
const baseHeight: object = { revisionNumber: Long.UZERO, revisionHeight: Long.UZERO };
export const Height = {
encode(message: Height, writer: Writer = Writer.create()): Writer {
writer.uint32(8).uint64(message.revisionNumber);
writer.uint32(16).uint64(message.revisionHeight);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Height {
decode(input: Reader | Uint8Array, length?: number): Height {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseHeight } as Height;
@ -455,6 +427,7 @@ export const Height = {
}
return message;
},
fromJSON(object: any): Height {
const message = { ...baseHeight } as Height;
if (object.revisionNumber !== undefined && object.revisionNumber !== null) {
@ -469,6 +442,7 @@ export const Height = {
}
return message;
},
fromPartial(object: DeepPartial<Height>): Height {
const message = { ...baseHeight } as Height;
if (object.revisionNumber !== undefined && object.revisionNumber !== null) {
@ -483,6 +457,7 @@ export const Height = {
}
return message;
},
toJSON(message: Height): unknown {
const obj: any = {};
message.revisionNumber !== undefined &&
@ -493,6 +468,8 @@ export const Height = {
},
};
const baseParams: object = { allowedClients: "" };
export const Params = {
encode(message: Params, writer: Writer = Writer.create()): Writer {
for (const v of message.allowedClients) {
@ -500,7 +477,8 @@ export const Params = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Params {
decode(input: Reader | Uint8Array, length?: number): Params {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseParams } as Params;
@ -518,6 +496,7 @@ export const Params = {
}
return message;
},
fromJSON(object: any): Params {
const message = { ...baseParams } as Params;
message.allowedClients = [];
@ -528,6 +507,7 @@ export const Params = {
}
return message;
},
fromPartial(object: DeepPartial<Params>): Params {
const message = { ...baseParams } as Params;
message.allowedClients = [];
@ -538,6 +518,7 @@ export const Params = {
}
return message;
},
toJSON(message: Params): unknown {
const obj: any = {};
if (message.allowedClients) {
@ -549,7 +530,7 @@ export const Params = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -1,39 +1,42 @@
/* eslint-disable */
import { CommitmentProof } from "../../../../confio/proofs";
import { Writer, Reader } from "protobufjs/minimal";
import * as Long from "long";
export const protobufPackage = "ibc.core.commitment.v1";
/**
* MerkleRoot defines a merkle root hash.
* In the Cosmos SDK, the AppHash of a block header becomes the root.
* MerkleRoot defines a merkle root hash.
* In the Cosmos SDK, the AppHash of a block header becomes the root.
*/
export interface MerkleRoot {
hash: Uint8Array;
}
/**
* MerklePrefix is merkle path prefixed to the key.
* The constructed key from the Path and the key will be append(Path.KeyPath,
* append(Path.KeyPrefix, key...))
* MerklePrefix is merkle path prefixed to the key.
* The constructed key from the Path and the key will be append(Path.KeyPath,
* append(Path.KeyPrefix, key...))
*/
export interface MerklePrefix {
keyPrefix: Uint8Array;
}
/**
* MerklePath is the path used to verify commitment proofs, which can be an
* arbitrary structured object (defined by a commitment type).
* MerklePath is represented from root-to-leaf
* MerklePath is the path used to verify commitment proofs, which can be an
* arbitrary structured object (defined by a commitment type).
* MerklePath is represented from root-to-leaf
*/
export interface MerklePath {
keyPath: string[];
}
/**
* MerkleProof is a wrapper type over a chain of CommitmentProofs.
* It demonstrates membership or non-membership for an element or set of
* elements, verifiable in conjunction with a known commitment root. Proofs
* should be succinct.
* MerkleProofs are ordered from leaf-to-root
* MerkleProof is a wrapper type over a chain of CommitmentProofs.
* It demonstrates membership or non-membership for an element or set of
* elements, verifiable in conjunction with a known commitment root. Proofs
* should be succinct.
* MerkleProofs are ordered from leaf-to-root
*/
export interface MerkleProof {
proofs: CommitmentProof[];
@ -41,22 +44,13 @@ export interface MerkleProof {
const baseMerkleRoot: object = {};
const baseMerklePrefix: object = {};
const baseMerklePath: object = {
keyPath: "",
};
const baseMerkleProof: object = {};
export const protobufPackage = "ibc.core.commitment.v1";
export const MerkleRoot = {
encode(message: MerkleRoot, writer: Writer = Writer.create()): Writer {
writer.uint32(10).bytes(message.hash);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MerkleRoot {
decode(input: Reader | Uint8Array, length?: number): MerkleRoot {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMerkleRoot } as MerkleRoot;
@ -73,6 +67,7 @@ export const MerkleRoot = {
}
return message;
},
fromJSON(object: any): MerkleRoot {
const message = { ...baseMerkleRoot } as MerkleRoot;
if (object.hash !== undefined && object.hash !== null) {
@ -80,6 +75,7 @@ export const MerkleRoot = {
}
return message;
},
fromPartial(object: DeepPartial<MerkleRoot>): MerkleRoot {
const message = { ...baseMerkleRoot } as MerkleRoot;
if (object.hash !== undefined && object.hash !== null) {
@ -89,6 +85,7 @@ export const MerkleRoot = {
}
return message;
},
toJSON(message: MerkleRoot): unknown {
const obj: any = {};
message.hash !== undefined &&
@ -97,12 +94,15 @@ export const MerkleRoot = {
},
};
const baseMerklePrefix: object = {};
export const MerklePrefix = {
encode(message: MerklePrefix, writer: Writer = Writer.create()): Writer {
writer.uint32(10).bytes(message.keyPrefix);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MerklePrefix {
decode(input: Reader | Uint8Array, length?: number): MerklePrefix {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMerklePrefix } as MerklePrefix;
@ -119,6 +119,7 @@ export const MerklePrefix = {
}
return message;
},
fromJSON(object: any): MerklePrefix {
const message = { ...baseMerklePrefix } as MerklePrefix;
if (object.keyPrefix !== undefined && object.keyPrefix !== null) {
@ -126,6 +127,7 @@ export const MerklePrefix = {
}
return message;
},
fromPartial(object: DeepPartial<MerklePrefix>): MerklePrefix {
const message = { ...baseMerklePrefix } as MerklePrefix;
if (object.keyPrefix !== undefined && object.keyPrefix !== null) {
@ -135,6 +137,7 @@ export const MerklePrefix = {
}
return message;
},
toJSON(message: MerklePrefix): unknown {
const obj: any = {};
message.keyPrefix !== undefined &&
@ -145,6 +148,8 @@ export const MerklePrefix = {
},
};
const baseMerklePath: object = { keyPath: "" };
export const MerklePath = {
encode(message: MerklePath, writer: Writer = Writer.create()): Writer {
for (const v of message.keyPath) {
@ -152,7 +157,8 @@ export const MerklePath = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MerklePath {
decode(input: Reader | Uint8Array, length?: number): MerklePath {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMerklePath } as MerklePath;
@ -170,6 +176,7 @@ export const MerklePath = {
}
return message;
},
fromJSON(object: any): MerklePath {
const message = { ...baseMerklePath } as MerklePath;
message.keyPath = [];
@ -180,6 +187,7 @@ export const MerklePath = {
}
return message;
},
fromPartial(object: DeepPartial<MerklePath>): MerklePath {
const message = { ...baseMerklePath } as MerklePath;
message.keyPath = [];
@ -190,6 +198,7 @@ export const MerklePath = {
}
return message;
},
toJSON(message: MerklePath): unknown {
const obj: any = {};
if (message.keyPath) {
@ -201,6 +210,8 @@ export const MerklePath = {
},
};
const baseMerkleProof: object = {};
export const MerkleProof = {
encode(message: MerkleProof, writer: Writer = Writer.create()): Writer {
for (const v of message.proofs) {
@ -208,7 +219,8 @@ export const MerkleProof = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): MerkleProof {
decode(input: Reader | Uint8Array, length?: number): MerkleProof {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseMerkleProof } as MerkleProof;
@ -226,6 +238,7 @@ export const MerkleProof = {
}
return message;
},
fromJSON(object: any): MerkleProof {
const message = { ...baseMerkleProof } as MerkleProof;
message.proofs = [];
@ -236,6 +249,7 @@ export const MerkleProof = {
}
return message;
},
fromPartial(object: DeepPartial<MerkleProof>): MerkleProof {
const message = { ...baseMerkleProof } as MerkleProof;
message.proofs = [];
@ -246,6 +260,7 @@ export const MerkleProof = {
}
return message;
},
toJSON(message: MerkleProof): unknown {
const obj: any = {};
if (message.proofs) {
@ -257,15 +272,18 @@ export const MerkleProof = {
},
};
interface WindowBase64 {
atob(b64: string): string;
btoa(bin: string): string;
}
const windowBase64 = (globalThis as unknown) as WindowBase64;
const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary"));
const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64"));
declare var self: any | undefined;
declare var window: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw new Error("Unable to locate global object");
})();
const atob: (b64: string) => string =
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64: string): Uint8Array {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@ -275,6 +293,8 @@ function bytesFromBase64(b64: string): Uint8Array {
return arr;
}
const btoa: (bin: string) => string =
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr: Uint8Array): string {
const bin: string[] = [];
for (let i = 0; i < arr.byteLength; ++i) {
@ -282,7 +302,8 @@ function base64FromBytes(arr: Uint8Array): string {
}
return btoa(bin.join(""));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -3,178 +3,23 @@ import * as Long from "long";
import { MerklePrefix } from "../../../../ibc/core/commitment/v1/commitment";
import { Writer, Reader } from "protobufjs/minimal";
/**
* ConnectionEnd defines a stateful object on a chain connected to another
* separate one.
* NOTE: there must only be 2 defined ConnectionEnds to establish
* a connection between two chains.
*/
export interface ConnectionEnd {
/**
* client associated with this connection.
*/
clientId: string;
/**
* IBC version which can be utilised to determine encodings or protocols for
* channels or packets utilising this connection.
*/
versions: Version[];
/**
* current state of the connection end.
*/
state: State;
/**
* counterparty chain associated with this connection.
*/
counterparty?: Counterparty;
/**
* delay period that must pass before a consensus state can be used for packet-verification
* NOTE: delay period logic is only implemented by some clients.
*/
delayPeriod: Long;
}
/**
* IdentifiedConnection defines a connection with additional connection
* identifier field.
*/
export interface IdentifiedConnection {
/**
* connection identifier.
*/
id: string;
/**
* client associated with this connection.
*/
clientId: string;
/**
* IBC version which can be utilised to determine encodings or protocols for
* channels or packets utilising this connection
*/
versions: Version[];
/**
* current state of the connection end.
*/
state: State;
/**
* counterparty chain associated with this connection.
*/
counterparty?: Counterparty;
/**
* delay period associated with this connection.
*/
delayPeriod: Long;
}
/**
* Counterparty defines the counterparty chain associated with a connection end.
*/
export interface Counterparty {
/**
* identifies the client on the counterparty chain associated with a given
* connection.
*/
clientId: string;
/**
* identifies the connection end on the counterparty chain associated with a
* given connection.
*/
connectionId: string;
/**
* commitment merkle prefix of the counterparty chain.
*/
prefix?: MerklePrefix;
}
/**
* ClientPaths define all the connection paths for a client state.
*/
export interface ClientPaths {
/**
* list of connection paths
*/
paths: string[];
}
/**
* ConnectionPaths define all the connection paths for a given client state.
*/
export interface ConnectionPaths {
/**
* client state unique identifier
*/
clientId: string;
/**
* list of connection paths
*/
paths: string[];
}
/**
* Version defines the versioning scheme used to negotiate the IBC verison in
* the connection handshake.
*/
export interface Version {
/**
* unique version identifier
*/
identifier: string;
/**
* list of features compatible with the specified identifier
*/
features: string[];
}
const baseConnectionEnd: object = {
clientId: "",
state: 0,
delayPeriod: Long.UZERO,
};
const baseIdentifiedConnection: object = {
id: "",
clientId: "",
state: 0,
delayPeriod: Long.UZERO,
};
const baseCounterparty: object = {
clientId: "",
connectionId: "",
};
const baseClientPaths: object = {
paths: "",
};
const baseConnectionPaths: object = {
clientId: "",
paths: "",
};
const baseVersion: object = {
identifier: "",
features: "",
};
export const protobufPackage = "ibc.core.connection.v1";
/** State defines if a connection is in one of the following states:
INIT, TRYOPEN, OPEN or UNINITIALIZED.
/**
* State defines if a connection is in one of the following states:
* INIT, TRYOPEN, OPEN or UNINITIALIZED.
*/
export enum State {
/** STATE_UNINITIALIZED_UNSPECIFIED - Default State
*/
/** STATE_UNINITIALIZED_UNSPECIFIED - Default State */
STATE_UNINITIALIZED_UNSPECIFIED = 0,
/** STATE_INIT - A connection end has just started the opening handshake.
*/
/** STATE_INIT - A connection end has just started the opening handshake. */
STATE_INIT = 1,
/** STATE_TRYOPEN - A connection end has acknowledged the handshake step on the counterparty
chain.
/**
* STATE_TRYOPEN - A connection end has acknowledged the handshake step on the counterparty
* chain.
*/
STATE_TRYOPEN = 2,
/** STATE_OPEN - A connection end has completed the handshake.
*/
/** STATE_OPEN - A connection end has completed the handshake. */
STATE_OPEN = 3,
UNRECOGNIZED = -1,
}
@ -215,6 +60,96 @@ export function stateToJSON(object: State): string {
}
}
/**
* ConnectionEnd defines a stateful object on a chain connected to another
* separate one.
* NOTE: there must only be 2 defined ConnectionEnds to establish
* a connection between two chains.
*/
export interface ConnectionEnd {
/** client associated with this connection. */
clientId: string;
/**
* IBC version which can be utilised to determine encodings or protocols for
* channels or packets utilising this connection.
*/
versions: Version[];
/** current state of the connection end. */
state: State;
/** counterparty chain associated with this connection. */
counterparty?: Counterparty;
/**
* delay period that must pass before a consensus state can be used for packet-verification
* NOTE: delay period logic is only implemented by some clients.
*/
delayPeriod: Long;
}
/**
* IdentifiedConnection defines a connection with additional connection
* identifier field.
*/
export interface IdentifiedConnection {
/** connection identifier. */
id: string;
/** client associated with this connection. */
clientId: string;
/**
* IBC version which can be utilised to determine encodings or protocols for
* channels or packets utilising this connection
*/
versions: Version[];
/** current state of the connection end. */
state: State;
/** counterparty chain associated with this connection. */
counterparty?: Counterparty;
/** delay period associated with this connection. */
delayPeriod: Long;
}
/** Counterparty defines the counterparty chain associated with a connection end. */
export interface Counterparty {
/**
* identifies the client on the counterparty chain associated with a given
* connection.
*/
clientId: string;
/**
* identifies the connection end on the counterparty chain associated with a
* given connection.
*/
connectionId: string;
/** commitment merkle prefix of the counterparty chain. */
prefix?: MerklePrefix;
}
/** ClientPaths define all the connection paths for a client state. */
export interface ClientPaths {
/** list of connection paths */
paths: string[];
}
/** ConnectionPaths define all the connection paths for a given client state. */
export interface ConnectionPaths {
/** client state unique identifier */
clientId: string;
/** list of connection paths */
paths: string[];
}
/**
* Version defines the versioning scheme used to negotiate the IBC verison in
* the connection handshake.
*/
export interface Version {
/** unique version identifier */
identifier: string;
/** list of features compatible with the specified identifier */
features: string[];
}
const baseConnectionEnd: object = { clientId: "", state: 0, delayPeriod: Long.UZERO };
export const ConnectionEnd = {
encode(message: ConnectionEnd, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.clientId);
@ -228,7 +163,8 @@ export const ConnectionEnd = {
writer.uint32(40).uint64(message.delayPeriod);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ConnectionEnd {
decode(input: Reader | Uint8Array, length?: number): ConnectionEnd {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseConnectionEnd } as ConnectionEnd;
@ -258,6 +194,7 @@ export const ConnectionEnd = {
}
return message;
},
fromJSON(object: any): ConnectionEnd {
const message = { ...baseConnectionEnd } as ConnectionEnd;
message.versions = [];
@ -288,6 +225,7 @@ export const ConnectionEnd = {
}
return message;
},
fromPartial(object: DeepPartial<ConnectionEnd>): ConnectionEnd {
const message = { ...baseConnectionEnd } as ConnectionEnd;
message.versions = [];
@ -318,6 +256,7 @@ export const ConnectionEnd = {
}
return message;
},
toJSON(message: ConnectionEnd): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
@ -334,6 +273,8 @@ export const ConnectionEnd = {
},
};
const baseIdentifiedConnection: object = { id: "", clientId: "", state: 0, delayPeriod: Long.UZERO };
export const IdentifiedConnection = {
encode(message: IdentifiedConnection, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.id);
@ -348,7 +289,8 @@ export const IdentifiedConnection = {
writer.uint32(48).uint64(message.delayPeriod);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): IdentifiedConnection {
decode(input: Reader | Uint8Array, length?: number): IdentifiedConnection {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseIdentifiedConnection } as IdentifiedConnection;
@ -381,6 +323,7 @@ export const IdentifiedConnection = {
}
return message;
},
fromJSON(object: any): IdentifiedConnection {
const message = { ...baseIdentifiedConnection } as IdentifiedConnection;
message.versions = [];
@ -416,6 +359,7 @@ export const IdentifiedConnection = {
}
return message;
},
fromPartial(object: DeepPartial<IdentifiedConnection>): IdentifiedConnection {
const message = { ...baseIdentifiedConnection } as IdentifiedConnection;
message.versions = [];
@ -451,6 +395,7 @@ export const IdentifiedConnection = {
}
return message;
},
toJSON(message: IdentifiedConnection): unknown {
const obj: any = {};
message.id !== undefined && (obj.id = message.id);
@ -468,6 +413,8 @@ export const IdentifiedConnection = {
},
};
const baseCounterparty: object = { clientId: "", connectionId: "" };
export const Counterparty = {
encode(message: Counterparty, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.clientId);
@ -477,7 +424,8 @@ export const Counterparty = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Counterparty {
decode(input: Reader | Uint8Array, length?: number): Counterparty {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseCounterparty } as Counterparty;
@ -500,6 +448,7 @@ export const Counterparty = {
}
return message;
},
fromJSON(object: any): Counterparty {
const message = { ...baseCounterparty } as Counterparty;
if (object.clientId !== undefined && object.clientId !== null) {
@ -519,6 +468,7 @@ export const Counterparty = {
}
return message;
},
fromPartial(object: DeepPartial<Counterparty>): Counterparty {
const message = { ...baseCounterparty } as Counterparty;
if (object.clientId !== undefined && object.clientId !== null) {
@ -538,6 +488,7 @@ export const Counterparty = {
}
return message;
},
toJSON(message: Counterparty): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
@ -548,6 +499,8 @@ export const Counterparty = {
},
};
const baseClientPaths: object = { paths: "" };
export const ClientPaths = {
encode(message: ClientPaths, writer: Writer = Writer.create()): Writer {
for (const v of message.paths) {
@ -555,7 +508,8 @@ export const ClientPaths = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ClientPaths {
decode(input: Reader | Uint8Array, length?: number): ClientPaths {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseClientPaths } as ClientPaths;
@ -573,6 +527,7 @@ export const ClientPaths = {
}
return message;
},
fromJSON(object: any): ClientPaths {
const message = { ...baseClientPaths } as ClientPaths;
message.paths = [];
@ -583,6 +538,7 @@ export const ClientPaths = {
}
return message;
},
fromPartial(object: DeepPartial<ClientPaths>): ClientPaths {
const message = { ...baseClientPaths } as ClientPaths;
message.paths = [];
@ -593,6 +549,7 @@ export const ClientPaths = {
}
return message;
},
toJSON(message: ClientPaths): unknown {
const obj: any = {};
if (message.paths) {
@ -604,6 +561,8 @@ export const ClientPaths = {
},
};
const baseConnectionPaths: object = { clientId: "", paths: "" };
export const ConnectionPaths = {
encode(message: ConnectionPaths, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.clientId);
@ -612,7 +571,8 @@ export const ConnectionPaths = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ConnectionPaths {
decode(input: Reader | Uint8Array, length?: number): ConnectionPaths {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseConnectionPaths } as ConnectionPaths;
@ -633,6 +593,7 @@ export const ConnectionPaths = {
}
return message;
},
fromJSON(object: any): ConnectionPaths {
const message = { ...baseConnectionPaths } as ConnectionPaths;
message.paths = [];
@ -648,6 +609,7 @@ export const ConnectionPaths = {
}
return message;
},
fromPartial(object: DeepPartial<ConnectionPaths>): ConnectionPaths {
const message = { ...baseConnectionPaths } as ConnectionPaths;
message.paths = [];
@ -663,6 +625,7 @@ export const ConnectionPaths = {
}
return message;
},
toJSON(message: ConnectionPaths): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
@ -675,6 +638,8 @@ export const ConnectionPaths = {
},
};
const baseVersion: object = { identifier: "", features: "" };
export const Version = {
encode(message: Version, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.identifier);
@ -683,7 +648,8 @@ export const Version = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Version {
decode(input: Reader | Uint8Array, length?: number): Version {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseVersion } as Version;
@ -704,6 +670,7 @@ export const Version = {
}
return message;
},
fromJSON(object: any): Version {
const message = { ...baseVersion } as Version;
message.features = [];
@ -719,6 +686,7 @@ export const Version = {
}
return message;
},
fromPartial(object: DeepPartial<Version>): Version {
const message = { ...baseVersion } as Version;
message.features = [];
@ -734,6 +702,7 @@ export const Version = {
}
return message;
},
toJSON(message: Version): unknown {
const obj: any = {};
message.identifier !== undefined && (obj.identifier = message.identifier);
@ -746,7 +715,7 @@ export const Version = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -6,285 +6,131 @@ import * as Long from "long";
import { Any } from "../../../../google/protobuf/any";
import { Reader, Writer } from "protobufjs/minimal";
export const protobufPackage = "ibc.core.connection.v1";
/**
* QueryConnectionRequest is the request type for the Query/Connection RPC
* method
* QueryConnectionRequest is the request type for the Query/Connection RPC
* method
*/
export interface QueryConnectionRequest {
/**
* connection unique identifier
*/
/** connection unique identifier */
connectionId: string;
}
/**
* QueryConnectionResponse is the response type for the Query/Connection RPC
* method. Besides the connection end, it includes a proof and the height from
* which the proof was retrieved.
* QueryConnectionResponse is the response type for the Query/Connection RPC
* method. Besides the connection end, it includes a proof and the height from
* which the proof was retrieved.
*/
export interface QueryConnectionResponse {
/**
* connection associated with the request identifier
*/
/** connection associated with the request identifier */
connection?: ConnectionEnd;
/**
* merkle proof of existence
*/
/** merkle proof of existence */
proof: Uint8Array;
/**
* height at which the proof was retrieved
*/
/** height at which the proof was retrieved */
proofHeight?: Height;
}
/**
* QueryConnectionsRequest is the request type for the Query/Connections RPC
* method
* QueryConnectionsRequest is the request type for the Query/Connections RPC
* method
*/
export interface QueryConnectionsRequest {
pagination?: PageRequest;
}
/**
* QueryConnectionsResponse is the response type for the Query/Connections RPC
* method.
* QueryConnectionsResponse is the response type for the Query/Connections RPC
* method.
*/
export interface QueryConnectionsResponse {
/**
* list of stored connections of the chain.
*/
/** list of stored connections of the chain. */
connections: IdentifiedConnection[];
/**
* pagination response
*/
/** pagination response */
pagination?: PageResponse;
/**
* query block height
*/
/** query block height */
height?: Height;
}
/**
* QueryClientConnectionsRequest is the request type for the
* Query/ClientConnections RPC method
* QueryClientConnectionsRequest is the request type for the
* Query/ClientConnections RPC method
*/
export interface QueryClientConnectionsRequest {
/**
* client identifier associated with a connection
*/
/** client identifier associated with a connection */
clientId: string;
}
/**
* QueryClientConnectionsResponse is the response type for the
* Query/ClientConnections RPC method
* QueryClientConnectionsResponse is the response type for the
* Query/ClientConnections RPC method
*/
export interface QueryClientConnectionsResponse {
/**
* slice of all the connection paths associated with a client.
*/
/** slice of all the connection paths associated with a client. */
connectionPaths: string[];
/**
* merkle proof of existence
*/
/** merkle proof of existence */
proof: Uint8Array;
/**
* height at which the proof was generated
*/
/** height at which the proof was generated */
proofHeight?: Height;
}
/**
* QueryConnectionClientStateRequest is the request type for the
* Query/ConnectionClientState RPC method
* QueryConnectionClientStateRequest is the request type for the
* Query/ConnectionClientState RPC method
*/
export interface QueryConnectionClientStateRequest {
/**
* connection identifier
*/
/** connection identifier */
connectionId: string;
}
/**
* QueryConnectionClientStateResponse is the response type for the
* Query/ConnectionClientState RPC method
* QueryConnectionClientStateResponse is the response type for the
* Query/ConnectionClientState RPC method
*/
export interface QueryConnectionClientStateResponse {
/**
* client state associated with the channel
*/
/** client state associated with the channel */
identifiedClientState?: IdentifiedClientState;
/**
* merkle proof of existence
*/
/** merkle proof of existence */
proof: Uint8Array;
/**
* height at which the proof was retrieved
*/
/** height at which the proof was retrieved */
proofHeight?: Height;
}
/**
* QueryConnectionConsensusStateRequest is the request type for the
* Query/ConnectionConsensusState RPC method
* QueryConnectionConsensusStateRequest is the request type for the
* Query/ConnectionConsensusState RPC method
*/
export interface QueryConnectionConsensusStateRequest {
/**
* connection identifier
*/
/** connection identifier */
connectionId: string;
revisionNumber: Long;
revisionHeight: Long;
}
/**
* QueryConnectionConsensusStateResponse is the response type for the
* Query/ConnectionConsensusState RPC method
* QueryConnectionConsensusStateResponse is the response type for the
* Query/ConnectionConsensusState RPC method
*/
export interface QueryConnectionConsensusStateResponse {
/**
* consensus state associated with the channel
*/
/** consensus state associated with the channel */
consensusState?: Any;
/**
* client ID associated with the consensus state
*/
/** client ID associated with the consensus state */
clientId: string;
/**
* merkle proof of existence
*/
/** merkle proof of existence */
proof: Uint8Array;
/**
* height at which the proof was retrieved
*/
/** height at which the proof was retrieved */
proofHeight?: Height;
}
const baseQueryConnectionRequest: object = {
connectionId: "",
};
const baseQueryConnectionResponse: object = {};
const baseQueryConnectionsRequest: object = {};
const baseQueryConnectionsResponse: object = {};
const baseQueryClientConnectionsRequest: object = {
clientId: "",
};
const baseQueryClientConnectionsResponse: object = {
connectionPaths: "",
};
const baseQueryConnectionClientStateRequest: object = {
connectionId: "",
};
const baseQueryConnectionClientStateResponse: object = {};
const baseQueryConnectionConsensusStateRequest: object = {
connectionId: "",
revisionNumber: Long.UZERO,
revisionHeight: Long.UZERO,
};
const baseQueryConnectionConsensusStateResponse: object = {
clientId: "",
};
/**
* Query provides defines the gRPC querier service
*/
export interface Query {
/**
* Connection queries an IBC connection end.
*/
Connection(request: QueryConnectionRequest): Promise<QueryConnectionResponse>;
/**
* Connections queries all the IBC connections of a chain.
*/
Connections(request: QueryConnectionsRequest): Promise<QueryConnectionsResponse>;
/**
* ClientConnections queries the connection paths associated with a client
* state.
*/
ClientConnections(request: QueryClientConnectionsRequest): Promise<QueryClientConnectionsResponse>;
/**
* ConnectionClientState queries the client state associated with the
* connection.
*/
ConnectionClientState(
request: QueryConnectionClientStateRequest,
): Promise<QueryConnectionClientStateResponse>;
/**
* ConnectionConsensusState queries the consensus state associated with the
* connection.
*/
ConnectionConsensusState(
request: QueryConnectionConsensusStateRequest,
): Promise<QueryConnectionConsensusStateResponse>;
}
export class QueryClientImpl implements Query {
private readonly rpc: Rpc;
constructor(rpc: Rpc) {
this.rpc = rpc;
}
Connection(request: QueryConnectionRequest): Promise<QueryConnectionResponse> {
const data = QueryConnectionRequest.encode(request).finish();
const promise = this.rpc.request("ibc.core.connection.v1.Query", "Connection", data);
return promise.then((data) => QueryConnectionResponse.decode(new Reader(data)));
}
Connections(request: QueryConnectionsRequest): Promise<QueryConnectionsResponse> {
const data = QueryConnectionsRequest.encode(request).finish();
const promise = this.rpc.request("ibc.core.connection.v1.Query", "Connections", data);
return promise.then((data) => QueryConnectionsResponse.decode(new Reader(data)));
}
ClientConnections(request: QueryClientConnectionsRequest): Promise<QueryClientConnectionsResponse> {
const data = QueryClientConnectionsRequest.encode(request).finish();
const promise = this.rpc.request("ibc.core.connection.v1.Query", "ClientConnections", data);
return promise.then((data) => QueryClientConnectionsResponse.decode(new Reader(data)));
}
ConnectionClientState(
request: QueryConnectionClientStateRequest,
): Promise<QueryConnectionClientStateResponse> {
const data = QueryConnectionClientStateRequest.encode(request).finish();
const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionClientState", data);
return promise.then((data) => QueryConnectionClientStateResponse.decode(new Reader(data)));
}
ConnectionConsensusState(
request: QueryConnectionConsensusStateRequest,
): Promise<QueryConnectionConsensusStateResponse> {
const data = QueryConnectionConsensusStateRequest.encode(request).finish();
const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionConsensusState", data);
return promise.then((data) => QueryConnectionConsensusStateResponse.decode(new Reader(data)));
}
}
interface Rpc {
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
}
export const protobufPackage = "ibc.core.connection.v1";
const baseQueryConnectionRequest: object = { connectionId: "" };
export const QueryConnectionRequest = {
encode(message: QueryConnectionRequest, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.connectionId);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryConnectionRequest {
decode(input: Reader | Uint8Array, length?: number): QueryConnectionRequest {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest;
@ -301,6 +147,7 @@ export const QueryConnectionRequest = {
}
return message;
},
fromJSON(object: any): QueryConnectionRequest {
const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest;
if (object.connectionId !== undefined && object.connectionId !== null) {
@ -310,6 +157,7 @@ export const QueryConnectionRequest = {
}
return message;
},
fromPartial(object: DeepPartial<QueryConnectionRequest>): QueryConnectionRequest {
const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest;
if (object.connectionId !== undefined && object.connectionId !== null) {
@ -319,6 +167,7 @@ export const QueryConnectionRequest = {
}
return message;
},
toJSON(message: QueryConnectionRequest): unknown {
const obj: any = {};
message.connectionId !== undefined && (obj.connectionId = message.connectionId);
@ -326,6 +175,8 @@ export const QueryConnectionRequest = {
},
};
const baseQueryConnectionResponse: object = {};
export const QueryConnectionResponse = {
encode(message: QueryConnectionResponse, writer: Writer = Writer.create()): Writer {
if (message.connection !== undefined && message.connection !== undefined) {
@ -337,7 +188,8 @@ export const QueryConnectionResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryConnectionResponse {
decode(input: Reader | Uint8Array, length?: number): QueryConnectionResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryConnectionResponse } as QueryConnectionResponse;
@ -360,6 +212,7 @@ export const QueryConnectionResponse = {
}
return message;
},
fromJSON(object: any): QueryConnectionResponse {
const message = { ...baseQueryConnectionResponse } as QueryConnectionResponse;
if (object.connection !== undefined && object.connection !== null) {
@ -377,6 +230,7 @@ export const QueryConnectionResponse = {
}
return message;
},
fromPartial(object: DeepPartial<QueryConnectionResponse>): QueryConnectionResponse {
const message = { ...baseQueryConnectionResponse } as QueryConnectionResponse;
if (object.connection !== undefined && object.connection !== null) {
@ -396,6 +250,7 @@ export const QueryConnectionResponse = {
}
return message;
},
toJSON(message: QueryConnectionResponse): unknown {
const obj: any = {};
message.connection !== undefined &&
@ -408,6 +263,8 @@ export const QueryConnectionResponse = {
},
};
const baseQueryConnectionsRequest: object = {};
export const QueryConnectionsRequest = {
encode(message: QueryConnectionsRequest, writer: Writer = Writer.create()): Writer {
if (message.pagination !== undefined && message.pagination !== undefined) {
@ -415,7 +272,8 @@ export const QueryConnectionsRequest = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryConnectionsRequest {
decode(input: Reader | Uint8Array, length?: number): QueryConnectionsRequest {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryConnectionsRequest } as QueryConnectionsRequest;
@ -432,6 +290,7 @@ export const QueryConnectionsRequest = {
}
return message;
},
fromJSON(object: any): QueryConnectionsRequest {
const message = { ...baseQueryConnectionsRequest } as QueryConnectionsRequest;
if (object.pagination !== undefined && object.pagination !== null) {
@ -441,6 +300,7 @@ export const QueryConnectionsRequest = {
}
return message;
},
fromPartial(object: DeepPartial<QueryConnectionsRequest>): QueryConnectionsRequest {
const message = { ...baseQueryConnectionsRequest } as QueryConnectionsRequest;
if (object.pagination !== undefined && object.pagination !== null) {
@ -450,6 +310,7 @@ export const QueryConnectionsRequest = {
}
return message;
},
toJSON(message: QueryConnectionsRequest): unknown {
const obj: any = {};
message.pagination !== undefined &&
@ -458,6 +319,8 @@ export const QueryConnectionsRequest = {
},
};
const baseQueryConnectionsResponse: object = {};
export const QueryConnectionsResponse = {
encode(message: QueryConnectionsResponse, writer: Writer = Writer.create()): Writer {
for (const v of message.connections) {
@ -471,7 +334,8 @@ export const QueryConnectionsResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryConnectionsResponse {
decode(input: Reader | Uint8Array, length?: number): QueryConnectionsResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryConnectionsResponse } as QueryConnectionsResponse;
@ -495,6 +359,7 @@ export const QueryConnectionsResponse = {
}
return message;
},
fromJSON(object: any): QueryConnectionsResponse {
const message = { ...baseQueryConnectionsResponse } as QueryConnectionsResponse;
message.connections = [];
@ -515,6 +380,7 @@ export const QueryConnectionsResponse = {
}
return message;
},
fromPartial(object: DeepPartial<QueryConnectionsResponse>): QueryConnectionsResponse {
const message = { ...baseQueryConnectionsResponse } as QueryConnectionsResponse;
message.connections = [];
@ -535,6 +401,7 @@ export const QueryConnectionsResponse = {
}
return message;
},
toJSON(message: QueryConnectionsResponse): unknown {
const obj: any = {};
if (message.connections) {
@ -549,12 +416,15 @@ export const QueryConnectionsResponse = {
},
};
const baseQueryClientConnectionsRequest: object = { clientId: "" };
export const QueryClientConnectionsRequest = {
encode(message: QueryClientConnectionsRequest, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.clientId);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryClientConnectionsRequest {
decode(input: Reader | Uint8Array, length?: number): QueryClientConnectionsRequest {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest;
@ -571,6 +441,7 @@ export const QueryClientConnectionsRequest = {
}
return message;
},
fromJSON(object: any): QueryClientConnectionsRequest {
const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest;
if (object.clientId !== undefined && object.clientId !== null) {
@ -580,6 +451,7 @@ export const QueryClientConnectionsRequest = {
}
return message;
},
fromPartial(object: DeepPartial<QueryClientConnectionsRequest>): QueryClientConnectionsRequest {
const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest;
if (object.clientId !== undefined && object.clientId !== null) {
@ -589,6 +461,7 @@ export const QueryClientConnectionsRequest = {
}
return message;
},
toJSON(message: QueryClientConnectionsRequest): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
@ -596,6 +469,8 @@ export const QueryClientConnectionsRequest = {
},
};
const baseQueryClientConnectionsResponse: object = { connectionPaths: "" };
export const QueryClientConnectionsResponse = {
encode(message: QueryClientConnectionsResponse, writer: Writer = Writer.create()): Writer {
for (const v of message.connectionPaths) {
@ -607,7 +482,8 @@ export const QueryClientConnectionsResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryClientConnectionsResponse {
decode(input: Reader | Uint8Array, length?: number): QueryClientConnectionsResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryClientConnectionsResponse } as QueryClientConnectionsResponse;
@ -631,6 +507,7 @@ export const QueryClientConnectionsResponse = {
}
return message;
},
fromJSON(object: any): QueryClientConnectionsResponse {
const message = { ...baseQueryClientConnectionsResponse } as QueryClientConnectionsResponse;
message.connectionPaths = [];
@ -649,6 +526,7 @@ export const QueryClientConnectionsResponse = {
}
return message;
},
fromPartial(object: DeepPartial<QueryClientConnectionsResponse>): QueryClientConnectionsResponse {
const message = { ...baseQueryClientConnectionsResponse } as QueryClientConnectionsResponse;
message.connectionPaths = [];
@ -669,6 +547,7 @@ export const QueryClientConnectionsResponse = {
}
return message;
},
toJSON(message: QueryClientConnectionsResponse): unknown {
const obj: any = {};
if (message.connectionPaths) {
@ -684,12 +563,15 @@ export const QueryClientConnectionsResponse = {
},
};
const baseQueryConnectionClientStateRequest: object = { connectionId: "" };
export const QueryConnectionClientStateRequest = {
encode(message: QueryConnectionClientStateRequest, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.connectionId);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryConnectionClientStateRequest {
decode(input: Reader | Uint8Array, length?: number): QueryConnectionClientStateRequest {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest;
@ -706,6 +588,7 @@ export const QueryConnectionClientStateRequest = {
}
return message;
},
fromJSON(object: any): QueryConnectionClientStateRequest {
const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest;
if (object.connectionId !== undefined && object.connectionId !== null) {
@ -715,6 +598,7 @@ export const QueryConnectionClientStateRequest = {
}
return message;
},
fromPartial(object: DeepPartial<QueryConnectionClientStateRequest>): QueryConnectionClientStateRequest {
const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest;
if (object.connectionId !== undefined && object.connectionId !== null) {
@ -724,6 +608,7 @@ export const QueryConnectionClientStateRequest = {
}
return message;
},
toJSON(message: QueryConnectionClientStateRequest): unknown {
const obj: any = {};
message.connectionId !== undefined && (obj.connectionId = message.connectionId);
@ -731,6 +616,8 @@ export const QueryConnectionClientStateRequest = {
},
};
const baseQueryConnectionClientStateResponse: object = {};
export const QueryConnectionClientStateResponse = {
encode(message: QueryConnectionClientStateResponse, writer: Writer = Writer.create()): Writer {
if (message.identifiedClientState !== undefined && message.identifiedClientState !== undefined) {
@ -742,7 +629,8 @@ export const QueryConnectionClientStateResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryConnectionClientStateResponse {
decode(input: Reader | Uint8Array, length?: number): QueryConnectionClientStateResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryConnectionClientStateResponse } as QueryConnectionClientStateResponse;
@ -765,6 +653,7 @@ export const QueryConnectionClientStateResponse = {
}
return message;
},
fromJSON(object: any): QueryConnectionClientStateResponse {
const message = { ...baseQueryConnectionClientStateResponse } as QueryConnectionClientStateResponse;
if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) {
@ -782,6 +671,7 @@ export const QueryConnectionClientStateResponse = {
}
return message;
},
fromPartial(object: DeepPartial<QueryConnectionClientStateResponse>): QueryConnectionClientStateResponse {
const message = { ...baseQueryConnectionClientStateResponse } as QueryConnectionClientStateResponse;
if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) {
@ -801,6 +691,7 @@ export const QueryConnectionClientStateResponse = {
}
return message;
},
toJSON(message: QueryConnectionClientStateResponse): unknown {
const obj: any = {};
message.identifiedClientState !== undefined &&
@ -815,6 +706,12 @@ export const QueryConnectionClientStateResponse = {
},
};
const baseQueryConnectionConsensusStateRequest: object = {
connectionId: "",
revisionNumber: Long.UZERO,
revisionHeight: Long.UZERO,
};
export const QueryConnectionConsensusStateRequest = {
encode(message: QueryConnectionConsensusStateRequest, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.connectionId);
@ -822,7 +719,8 @@ export const QueryConnectionConsensusStateRequest = {
writer.uint32(24).uint64(message.revisionHeight);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryConnectionConsensusStateRequest {
decode(input: Reader | Uint8Array, length?: number): QueryConnectionConsensusStateRequest {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryConnectionConsensusStateRequest } as QueryConnectionConsensusStateRequest;
@ -845,6 +743,7 @@ export const QueryConnectionConsensusStateRequest = {
}
return message;
},
fromJSON(object: any): QueryConnectionConsensusStateRequest {
const message = { ...baseQueryConnectionConsensusStateRequest } as QueryConnectionConsensusStateRequest;
if (object.connectionId !== undefined && object.connectionId !== null) {
@ -864,6 +763,7 @@ export const QueryConnectionConsensusStateRequest = {
}
return message;
},
fromPartial(
object: DeepPartial<QueryConnectionConsensusStateRequest>,
): QueryConnectionConsensusStateRequest {
@ -885,6 +785,7 @@ export const QueryConnectionConsensusStateRequest = {
}
return message;
},
toJSON(message: QueryConnectionConsensusStateRequest): unknown {
const obj: any = {};
message.connectionId !== undefined && (obj.connectionId = message.connectionId);
@ -896,6 +797,8 @@ export const QueryConnectionConsensusStateRequest = {
},
};
const baseQueryConnectionConsensusStateResponse: object = { clientId: "" };
export const QueryConnectionConsensusStateResponse = {
encode(message: QueryConnectionConsensusStateResponse, writer: Writer = Writer.create()): Writer {
if (message.consensusState !== undefined && message.consensusState !== undefined) {
@ -908,7 +811,8 @@ export const QueryConnectionConsensusStateResponse = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): QueryConnectionConsensusStateResponse {
decode(input: Reader | Uint8Array, length?: number): QueryConnectionConsensusStateResponse {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseQueryConnectionConsensusStateResponse } as QueryConnectionConsensusStateResponse;
@ -934,6 +838,7 @@ export const QueryConnectionConsensusStateResponse = {
}
return message;
},
fromJSON(object: any): QueryConnectionConsensusStateResponse {
const message = { ...baseQueryConnectionConsensusStateResponse } as QueryConnectionConsensusStateResponse;
if (object.consensusState !== undefined && object.consensusState !== null) {
@ -956,6 +861,7 @@ export const QueryConnectionConsensusStateResponse = {
}
return message;
},
fromPartial(
object: DeepPartial<QueryConnectionConsensusStateResponse>,
): QueryConnectionConsensusStateResponse {
@ -982,6 +888,7 @@ export const QueryConnectionConsensusStateResponse = {
}
return message;
},
toJSON(message: QueryConnectionConsensusStateResponse): unknown {
const obj: any = {};
message.consensusState !== undefined &&
@ -995,15 +902,89 @@ export const QueryConnectionConsensusStateResponse = {
},
};
interface WindowBase64 {
atob(b64: string): string;
btoa(bin: string): string;
/** Query provides defines the gRPC querier service */
export interface Query {
/** Connection queries an IBC connection end. */
Connection(request: QueryConnectionRequest): Promise<QueryConnectionResponse>;
/** Connections queries all the IBC connections of a chain. */
Connections(request: QueryConnectionsRequest): Promise<QueryConnectionsResponse>;
/**
* ClientConnections queries the connection paths associated with a client
* state.
*/
ClientConnections(request: QueryClientConnectionsRequest): Promise<QueryClientConnectionsResponse>;
/**
* ConnectionClientState queries the client state associated with the
* connection.
*/
ConnectionClientState(
request: QueryConnectionClientStateRequest,
): Promise<QueryConnectionClientStateResponse>;
/**
* ConnectionConsensusState queries the consensus state associated with the
* connection.
*/
ConnectionConsensusState(
request: QueryConnectionConsensusStateRequest,
): Promise<QueryConnectionConsensusStateResponse>;
}
const windowBase64 = (globalThis as unknown) as WindowBase64;
const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary"));
const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64"));
export class QueryClientImpl implements Query {
private readonly rpc: Rpc;
constructor(rpc: Rpc) {
this.rpc = rpc;
}
Connection(request: QueryConnectionRequest): Promise<QueryConnectionResponse> {
const data = QueryConnectionRequest.encode(request).finish();
const promise = this.rpc.request("ibc.core.connection.v1.Query", "methodDesc.name", data);
return promise.then((data) => QueryConnectionResponse.decode(new Reader(data)));
}
Connections(request: QueryConnectionsRequest): Promise<QueryConnectionsResponse> {
const data = QueryConnectionsRequest.encode(request).finish();
const promise = this.rpc.request("ibc.core.connection.v1.Query", "methodDesc.name", data);
return promise.then((data) => QueryConnectionsResponse.decode(new Reader(data)));
}
ClientConnections(request: QueryClientConnectionsRequest): Promise<QueryClientConnectionsResponse> {
const data = QueryClientConnectionsRequest.encode(request).finish();
const promise = this.rpc.request("ibc.core.connection.v1.Query", "methodDesc.name", data);
return promise.then((data) => QueryClientConnectionsResponse.decode(new Reader(data)));
}
ConnectionClientState(
request: QueryConnectionClientStateRequest,
): Promise<QueryConnectionClientStateResponse> {
const data = QueryConnectionClientStateRequest.encode(request).finish();
const promise = this.rpc.request("ibc.core.connection.v1.Query", "methodDesc.name", data);
return promise.then((data) => QueryConnectionClientStateResponse.decode(new Reader(data)));
}
ConnectionConsensusState(
request: QueryConnectionConsensusStateRequest,
): Promise<QueryConnectionConsensusStateResponse> {
const data = QueryConnectionConsensusStateRequest.encode(request).finish();
const promise = this.rpc.request("ibc.core.connection.v1.Query", "methodDesc.name", data);
return promise.then((data) => QueryConnectionConsensusStateResponse.decode(new Reader(data)));
}
}
interface Rpc {
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
}
declare var self: any | undefined;
declare var window: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw new Error("Unable to locate global object");
})();
const atob: (b64: string) => string =
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64: string): Uint8Array {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@ -1013,6 +994,8 @@ function bytesFromBase64(b64: string): Uint8Array {
return arr;
}
const btoa: (bin: string) => string =
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr: Uint8Array): string {
const bin: string[] = [];
for (let i = 0; i < arr.byteLength; ++i) {
@ -1020,7 +1003,8 @@ function base64FromBytes(arr: Uint8Array): string {
}
return btoa(bin.join(""));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,10 @@
/* eslint-disable */
import { Writer, Reader } from "protobufjs/minimal";
import * as Long from "long";
/**
* PublicKey defines the keys available for use with Tendermint Validators
*/
export const protobufPackage = "tendermint.crypto";
/** PublicKey defines the keys available for use with Tendermint Validators */
export interface PublicKey {
ed25519: Uint8Array | undefined;
secp256k1: Uint8Array | undefined;
@ -11,8 +12,6 @@ export interface PublicKey {
const basePublicKey: object = {};
export const protobufPackage = "tendermint.crypto";
export const PublicKey = {
encode(message: PublicKey, writer: Writer = Writer.create()): Writer {
if (message.ed25519 !== undefined) {
@ -23,7 +22,8 @@ export const PublicKey = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): PublicKey {
decode(input: Reader | Uint8Array, length?: number): PublicKey {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...basePublicKey } as PublicKey;
@ -43,6 +43,7 @@ export const PublicKey = {
}
return message;
},
fromJSON(object: any): PublicKey {
const message = { ...basePublicKey } as PublicKey;
if (object.ed25519 !== undefined && object.ed25519 !== null) {
@ -53,6 +54,7 @@ export const PublicKey = {
}
return message;
},
fromPartial(object: DeepPartial<PublicKey>): PublicKey {
const message = { ...basePublicKey } as PublicKey;
if (object.ed25519 !== undefined && object.ed25519 !== null) {
@ -67,6 +69,7 @@ export const PublicKey = {
}
return message;
},
toJSON(message: PublicKey): unknown {
const obj: any = {};
message.ed25519 !== undefined &&
@ -77,15 +80,18 @@ export const PublicKey = {
},
};
interface WindowBase64 {
atob(b64: string): string;
btoa(bin: string): string;
}
const windowBase64 = (globalThis as unknown) as WindowBase64;
const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary"));
const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64"));
declare var self: any | undefined;
declare var window: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw new Error("Unable to locate global object");
})();
const atob: (b64: string) => string =
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64: string): Uint8Array {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@ -95,6 +101,8 @@ function bytesFromBase64(b64: string): Uint8Array {
return arr;
}
const btoa: (bin: string) => string =
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr: Uint8Array): string {
const bin: string[] = [];
for (let i = 0; i < arr.byteLength; ++i) {
@ -102,7 +110,8 @@ function base64FromBytes(arr: Uint8Array): string {
}
return btoa(bin.join(""));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -2,6 +2,8 @@
import * as Long from "long";
import { Writer, Reader } from "protobufjs/minimal";
export const protobufPackage = "tendermint.crypto";
export interface Proof {
total: Long;
index: Long;
@ -10,13 +12,9 @@ export interface Proof {
}
export interface ValueOp {
/**
* Encoded in ProofOp.Key.
*/
/** Encoded in ProofOp.Key. */
key: Uint8Array;
/**
* To encode in ProofOp.Data
*/
/** To encode in ProofOp.Data */
proof?: Proof;
}
@ -27,9 +25,9 @@ export interface DominoOp {
}
/**
* ProofOp defines an operation used for calculating Merkle root
* The data could be arbitrary format, providing nessecary data
* for example neighbouring node hash
* ProofOp defines an operation used for calculating Merkle root
* The data could be arbitrary format, providing nessecary data
* for example neighbouring node hash
*/
export interface ProofOp {
type: string;
@ -37,33 +35,12 @@ export interface ProofOp {
data: Uint8Array;
}
/**
* ProofOps is Merkle proof defined by the list of ProofOps
*/
/** ProofOps is Merkle proof defined by the list of ProofOps */
export interface ProofOps {
ops: ProofOp[];
}
const baseProof: object = {
total: Long.ZERO,
index: Long.ZERO,
};
const baseValueOp: object = {};
const baseDominoOp: object = {
key: "",
input: "",
output: "",
};
const baseProofOp: object = {
type: "",
};
const baseProofOps: object = {};
export const protobufPackage = "tendermint.crypto";
const baseProof: object = { total: Long.ZERO, index: Long.ZERO };
export const Proof = {
encode(message: Proof, writer: Writer = Writer.create()): Writer {
@ -75,7 +52,8 @@ export const Proof = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Proof {
decode(input: Reader | Uint8Array, length?: number): Proof {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseProof } as Proof;
@ -102,6 +80,7 @@ export const Proof = {
}
return message;
},
fromJSON(object: any): Proof {
const message = { ...baseProof } as Proof;
message.aunts = [];
@ -125,6 +104,7 @@ export const Proof = {
}
return message;
},
fromPartial(object: DeepPartial<Proof>): Proof {
const message = { ...baseProof } as Proof;
message.aunts = [];
@ -150,6 +130,7 @@ export const Proof = {
}
return message;
},
toJSON(message: Proof): unknown {
const obj: any = {};
message.total !== undefined && (obj.total = (message.total || Long.ZERO).toString());
@ -165,6 +146,8 @@ export const Proof = {
},
};
const baseValueOp: object = {};
export const ValueOp = {
encode(message: ValueOp, writer: Writer = Writer.create()): Writer {
writer.uint32(10).bytes(message.key);
@ -173,7 +156,8 @@ export const ValueOp = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ValueOp {
decode(input: Reader | Uint8Array, length?: number): ValueOp {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseValueOp } as ValueOp;
@ -193,6 +177,7 @@ export const ValueOp = {
}
return message;
},
fromJSON(object: any): ValueOp {
const message = { ...baseValueOp } as ValueOp;
if (object.key !== undefined && object.key !== null) {
@ -205,6 +190,7 @@ export const ValueOp = {
}
return message;
},
fromPartial(object: DeepPartial<ValueOp>): ValueOp {
const message = { ...baseValueOp } as ValueOp;
if (object.key !== undefined && object.key !== null) {
@ -219,6 +205,7 @@ export const ValueOp = {
}
return message;
},
toJSON(message: ValueOp): unknown {
const obj: any = {};
message.key !== undefined &&
@ -228,6 +215,8 @@ export const ValueOp = {
},
};
const baseDominoOp: object = { key: "", input: "", output: "" };
export const DominoOp = {
encode(message: DominoOp, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.key);
@ -235,7 +224,8 @@ export const DominoOp = {
writer.uint32(26).string(message.output);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): DominoOp {
decode(input: Reader | Uint8Array, length?: number): DominoOp {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseDominoOp } as DominoOp;
@ -258,6 +248,7 @@ export const DominoOp = {
}
return message;
},
fromJSON(object: any): DominoOp {
const message = { ...baseDominoOp } as DominoOp;
if (object.key !== undefined && object.key !== null) {
@ -277,6 +268,7 @@ export const DominoOp = {
}
return message;
},
fromPartial(object: DeepPartial<DominoOp>): DominoOp {
const message = { ...baseDominoOp } as DominoOp;
if (object.key !== undefined && object.key !== null) {
@ -296,6 +288,7 @@ export const DominoOp = {
}
return message;
},
toJSON(message: DominoOp): unknown {
const obj: any = {};
message.key !== undefined && (obj.key = message.key);
@ -305,6 +298,8 @@ export const DominoOp = {
},
};
const baseProofOp: object = { type: "" };
export const ProofOp = {
encode(message: ProofOp, writer: Writer = Writer.create()): Writer {
writer.uint32(10).string(message.type);
@ -312,7 +307,8 @@ export const ProofOp = {
writer.uint32(26).bytes(message.data);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ProofOp {
decode(input: Reader | Uint8Array, length?: number): ProofOp {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseProofOp } as ProofOp;
@ -335,6 +331,7 @@ export const ProofOp = {
}
return message;
},
fromJSON(object: any): ProofOp {
const message = { ...baseProofOp } as ProofOp;
if (object.type !== undefined && object.type !== null) {
@ -350,6 +347,7 @@ export const ProofOp = {
}
return message;
},
fromPartial(object: DeepPartial<ProofOp>): ProofOp {
const message = { ...baseProofOp } as ProofOp;
if (object.type !== undefined && object.type !== null) {
@ -369,6 +367,7 @@ export const ProofOp = {
}
return message;
},
toJSON(message: ProofOp): unknown {
const obj: any = {};
message.type !== undefined && (obj.type = message.type);
@ -380,6 +379,8 @@ export const ProofOp = {
},
};
const baseProofOps: object = {};
export const ProofOps = {
encode(message: ProofOps, writer: Writer = Writer.create()): Writer {
for (const v of message.ops) {
@ -387,7 +388,8 @@ export const ProofOps = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ProofOps {
decode(input: Reader | Uint8Array, length?: number): ProofOps {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseProofOps } as ProofOps;
@ -405,6 +407,7 @@ export const ProofOps = {
}
return message;
},
fromJSON(object: any): ProofOps {
const message = { ...baseProofOps } as ProofOps;
message.ops = [];
@ -415,6 +418,7 @@ export const ProofOps = {
}
return message;
},
fromPartial(object: DeepPartial<ProofOps>): ProofOps {
const message = { ...baseProofOps } as ProofOps;
message.ops = [];
@ -425,6 +429,7 @@ export const ProofOps = {
}
return message;
},
toJSON(message: ProofOps): unknown {
const obj: any = {};
if (message.ops) {
@ -436,15 +441,18 @@ export const ProofOps = {
},
};
interface WindowBase64 {
atob(b64: string): string;
btoa(bin: string): string;
}
const windowBase64 = (globalThis as unknown) as WindowBase64;
const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary"));
const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64"));
declare var self: any | undefined;
declare var window: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw new Error("Unable to locate global object");
})();
const atob: (b64: string) => string =
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64: string): Uint8Array {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@ -454,6 +462,8 @@ function bytesFromBase64(b64: string): Uint8Array {
return arr;
}
const btoa: (bin: string) => string =
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr: Uint8Array): string {
const bin: string[] = [];
for (let i = 0; i < arr.byteLength; ++i) {
@ -461,7 +471,8 @@ function base64FromBytes(arr: Uint8Array): string {
}
return btoa(bin.join(""));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -2,17 +2,14 @@
import * as Long from "long";
import { Writer, Reader } from "protobufjs/minimal";
export const protobufPackage = "tendermint.libs.bits";
export interface BitArray {
bits: Long;
elems: Long[];
}
const baseBitArray: object = {
bits: Long.ZERO,
elems: Long.UZERO,
};
export const protobufPackage = "tendermint.libs.bits";
const baseBitArray: object = { bits: Long.ZERO, elems: Long.UZERO };
export const BitArray = {
encode(message: BitArray, writer: Writer = Writer.create()): Writer {
@ -24,7 +21,8 @@ export const BitArray = {
writer.ldelim();
return writer;
},
decode(input: Uint8Array | Reader, length?: number): BitArray {
decode(input: Reader | Uint8Array, length?: number): BitArray {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseBitArray } as BitArray;
@ -52,6 +50,7 @@ export const BitArray = {
}
return message;
},
fromJSON(object: any): BitArray {
const message = { ...baseBitArray } as BitArray;
message.elems = [];
@ -67,6 +66,7 @@ export const BitArray = {
}
return message;
},
fromPartial(object: DeepPartial<BitArray>): BitArray {
const message = { ...baseBitArray } as BitArray;
message.elems = [];
@ -82,6 +82,7 @@ export const BitArray = {
}
return message;
},
toJSON(message: BitArray): unknown {
const obj: any = {};
message.bits !== undefined && (obj.bits = (message.bits || Long.ZERO).toString());
@ -94,7 +95,7 @@ export const BitArray = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -3,9 +3,11 @@ import * as Long from "long";
import { Duration } from "../../google/protobuf/duration";
import { Writer, Reader } from "protobufjs/minimal";
export const protobufPackage = "tendermint.types";
/**
* ConsensusParams contains consensus critical parameters that determine the
* validity of blocks.
* ConsensusParams contains consensus critical parameters that determine the
* validity of blocks.
*/
export interface ConsensusParams {
block?: BlockParams;
@ -14,75 +16,69 @@ export interface ConsensusParams {
version?: VersionParams;
}
/**
* BlockParams contains limits on the block size.
*/
/** BlockParams contains limits on the block size. */
export interface BlockParams {
/**
* Max block size, in bytes.
* Note: must be greater than 0
* Max block size, in bytes.
* Note: must be greater than 0
*/
maxBytes: Long;
/**
* Max gas per block.
* Note: must be greater or equal to -1
* Max gas per block.
* Note: must be greater or equal to -1
*/
maxGas: Long;
/**
* Minimum time increment between consecutive blocks (in milliseconds) If the
* block header timestamp is ahead of the system clock, decrease this value.
* Minimum time increment between consecutive blocks (in milliseconds) If the
* block header timestamp is ahead of the system clock, decrease this value.
*
* Not exposed to the application.
* Not exposed to the application.
*/
timeIotaMs: Long;
}
/**
* EvidenceParams determine how we handle evidence of malfeasance.
*/
/** EvidenceParams determine how we handle evidence of malfeasance. */
export interface EvidenceParams {
/**
* Max age of evidence, in blocks.
* Max age of evidence, in blocks.
*
* The basic formula for calculating this is: MaxAgeDuration / {average block
* time}.
* The basic formula for calculating this is: MaxAgeDuration / {average block
* time}.
*/
maxAgeNumBlocks: Long;
/**
* Max age of evidence, in time.
* Max age of evidence, in time.
*
* It should correspond with an app's "unbonding period" or other similar
* mechanism for handling [Nothing-At-Stake
* attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed).
* It should correspond with an app's "unbonding period" or other similar
* mechanism for handling [Nothing-At-Stake
* attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed).
*/
maxAgeDuration?: Duration;
/**
* This sets the maximum size of total evidence in bytes that can be committed in a single block.
* and should fall comfortably under the max block bytes.
* Default is 1048576 or 1MB
* This sets the maximum size of total evidence in bytes that can be committed in a single block.
* and should fall comfortably under the max block bytes.
* Default is 1048576 or 1MB
*/
maxBytes: Long;
}
/**
* ValidatorParams restrict the public key types validators can use.
* NOTE: uses ABCI pubkey naming, not Amino names.
* ValidatorParams restrict the public key types validators can use.
* NOTE: uses ABCI pubkey naming, not Amino names.
*/
export interface ValidatorParams {
pubKeyTypes: string[];
}
/**
* VersionParams contains the ABCI application version.
*/
/** VersionParams contains the ABCI application version. */
export interface VersionParams {
appVersion: Long;
}
/**
* HashedParams is a subset of ConsensusParams.
* HashedParams is a subset of ConsensusParams.
*
* It is hashed into the Header.ConsensusHash.
* It is hashed into the Header.ConsensusHash.
*/
export interface HashedParams {
blockMaxBytes: Long;
@ -91,32 +87,6 @@ export interface HashedParams {
const baseConsensusParams: object = {};
const baseBlockParams: object = {
maxBytes: Long.ZERO,
maxGas: Long.ZERO,
timeIotaMs: Long.ZERO,
};
const baseEvidenceParams: object = {
maxAgeNumBlocks: Long.ZERO,
maxBytes: Long.ZERO,
};
const baseValidatorParams: object = {
pubKeyTypes: "",
};
const baseVersionParams: object = {
appVersion: Long.UZERO,
};
const baseHashedParams: object = {
blockMaxBytes: Long.ZERO,
blockMaxGas: Long.ZERO,
};
export const protobufPackage = "tendermint.types";
export const ConsensusParams = {
encode(message: ConsensusParams, writer: Writer = Writer.create()): Writer {
if (message.block !== undefined && message.block !== undefined) {
@ -133,7 +103,8 @@ export const ConsensusParams = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ConsensusParams {
decode(input: Reader | Uint8Array, length?: number): ConsensusParams {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseConsensusParams } as ConsensusParams;
@ -159,6 +130,7 @@ export const ConsensusParams = {
}
return message;
},
fromJSON(object: any): ConsensusParams {
const message = { ...baseConsensusParams } as ConsensusParams;
if (object.block !== undefined && object.block !== null) {
@ -183,6 +155,7 @@ export const ConsensusParams = {
}
return message;
},
fromPartial(object: DeepPartial<ConsensusParams>): ConsensusParams {
const message = { ...baseConsensusParams } as ConsensusParams;
if (object.block !== undefined && object.block !== null) {
@ -207,6 +180,7 @@ export const ConsensusParams = {
}
return message;
},
toJSON(message: ConsensusParams): unknown {
const obj: any = {};
message.block !== undefined &&
@ -221,6 +195,8 @@ export const ConsensusParams = {
},
};
const baseBlockParams: object = { maxBytes: Long.ZERO, maxGas: Long.ZERO, timeIotaMs: Long.ZERO };
export const BlockParams = {
encode(message: BlockParams, writer: Writer = Writer.create()): Writer {
writer.uint32(8).int64(message.maxBytes);
@ -228,7 +204,8 @@ export const BlockParams = {
writer.uint32(24).int64(message.timeIotaMs);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): BlockParams {
decode(input: Reader | Uint8Array, length?: number): BlockParams {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseBlockParams } as BlockParams;
@ -251,6 +228,7 @@ export const BlockParams = {
}
return message;
},
fromJSON(object: any): BlockParams {
const message = { ...baseBlockParams } as BlockParams;
if (object.maxBytes !== undefined && object.maxBytes !== null) {
@ -270,6 +248,7 @@ export const BlockParams = {
}
return message;
},
fromPartial(object: DeepPartial<BlockParams>): BlockParams {
const message = { ...baseBlockParams } as BlockParams;
if (object.maxBytes !== undefined && object.maxBytes !== null) {
@ -289,6 +268,7 @@ export const BlockParams = {
}
return message;
},
toJSON(message: BlockParams): unknown {
const obj: any = {};
message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString());
@ -298,6 +278,8 @@ export const BlockParams = {
},
};
const baseEvidenceParams: object = { maxAgeNumBlocks: Long.ZERO, maxBytes: Long.ZERO };
export const EvidenceParams = {
encode(message: EvidenceParams, writer: Writer = Writer.create()): Writer {
writer.uint32(8).int64(message.maxAgeNumBlocks);
@ -307,7 +289,8 @@ export const EvidenceParams = {
writer.uint32(24).int64(message.maxBytes);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): EvidenceParams {
decode(input: Reader | Uint8Array, length?: number): EvidenceParams {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseEvidenceParams } as EvidenceParams;
@ -330,6 +313,7 @@ export const EvidenceParams = {
}
return message;
},
fromJSON(object: any): EvidenceParams {
const message = { ...baseEvidenceParams } as EvidenceParams;
if (object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null) {
@ -349,6 +333,7 @@ export const EvidenceParams = {
}
return message;
},
fromPartial(object: DeepPartial<EvidenceParams>): EvidenceParams {
const message = { ...baseEvidenceParams } as EvidenceParams;
if (object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null) {
@ -368,6 +353,7 @@ export const EvidenceParams = {
}
return message;
},
toJSON(message: EvidenceParams): unknown {
const obj: any = {};
message.maxAgeNumBlocks !== undefined &&
@ -379,6 +365,8 @@ export const EvidenceParams = {
},
};
const baseValidatorParams: object = { pubKeyTypes: "" };
export const ValidatorParams = {
encode(message: ValidatorParams, writer: Writer = Writer.create()): Writer {
for (const v of message.pubKeyTypes) {
@ -386,7 +374,8 @@ export const ValidatorParams = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ValidatorParams {
decode(input: Reader | Uint8Array, length?: number): ValidatorParams {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseValidatorParams } as ValidatorParams;
@ -404,6 +393,7 @@ export const ValidatorParams = {
}
return message;
},
fromJSON(object: any): ValidatorParams {
const message = { ...baseValidatorParams } as ValidatorParams;
message.pubKeyTypes = [];
@ -414,6 +404,7 @@ export const ValidatorParams = {
}
return message;
},
fromPartial(object: DeepPartial<ValidatorParams>): ValidatorParams {
const message = { ...baseValidatorParams } as ValidatorParams;
message.pubKeyTypes = [];
@ -424,6 +415,7 @@ export const ValidatorParams = {
}
return message;
},
toJSON(message: ValidatorParams): unknown {
const obj: any = {};
if (message.pubKeyTypes) {
@ -435,12 +427,15 @@ export const ValidatorParams = {
},
};
const baseVersionParams: object = { appVersion: Long.UZERO };
export const VersionParams = {
encode(message: VersionParams, writer: Writer = Writer.create()): Writer {
writer.uint32(8).uint64(message.appVersion);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): VersionParams {
decode(input: Reader | Uint8Array, length?: number): VersionParams {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseVersionParams } as VersionParams;
@ -457,6 +452,7 @@ export const VersionParams = {
}
return message;
},
fromJSON(object: any): VersionParams {
const message = { ...baseVersionParams } as VersionParams;
if (object.appVersion !== undefined && object.appVersion !== null) {
@ -466,6 +462,7 @@ export const VersionParams = {
}
return message;
},
fromPartial(object: DeepPartial<VersionParams>): VersionParams {
const message = { ...baseVersionParams } as VersionParams;
if (object.appVersion !== undefined && object.appVersion !== null) {
@ -475,6 +472,7 @@ export const VersionParams = {
}
return message;
},
toJSON(message: VersionParams): unknown {
const obj: any = {};
message.appVersion !== undefined && (obj.appVersion = (message.appVersion || Long.UZERO).toString());
@ -482,13 +480,16 @@ export const VersionParams = {
},
};
const baseHashedParams: object = { blockMaxBytes: Long.ZERO, blockMaxGas: Long.ZERO };
export const HashedParams = {
encode(message: HashedParams, writer: Writer = Writer.create()): Writer {
writer.uint32(8).int64(message.blockMaxBytes);
writer.uint32(16).int64(message.blockMaxGas);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): HashedParams {
decode(input: Reader | Uint8Array, length?: number): HashedParams {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseHashedParams } as HashedParams;
@ -508,6 +509,7 @@ export const HashedParams = {
}
return message;
},
fromJSON(object: any): HashedParams {
const message = { ...baseHashedParams } as HashedParams;
if (object.blockMaxBytes !== undefined && object.blockMaxBytes !== null) {
@ -522,6 +524,7 @@ export const HashedParams = {
}
return message;
},
fromPartial(object: DeepPartial<HashedParams>): HashedParams {
const message = { ...baseHashedParams } as HashedParams;
if (object.blockMaxBytes !== undefined && object.blockMaxBytes !== null) {
@ -536,6 +539,7 @@ export const HashedParams = {
}
return message;
},
toJSON(message: HashedParams): unknown {
const obj: any = {};
message.blockMaxBytes !== undefined &&
@ -545,7 +549,7 @@ export const HashedParams = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -4,250 +4,11 @@ import { Consensus } from "../../tendermint/version/types";
import * as Long from "long";
import { ValidatorSet } from "../../tendermint/types/validator";
import { Timestamp } from "../../google/protobuf/timestamp";
import { Writer, Reader, util, configure } from "protobufjs/minimal";
/**
* PartsetHeader
*/
export interface PartSetHeader {
total: number;
hash: Uint8Array;
}
export interface Part {
index: number;
bytes: Uint8Array;
proof?: Proof;
}
/**
* BlockID
*/
export interface BlockID {
hash: Uint8Array;
partSetHeader?: PartSetHeader;
}
/**
* Header defines the structure of a Tendermint block header.
*/
export interface Header {
/**
* basic block info
*/
version?: Consensus;
chainId: string;
height: Long;
time?: Date;
/**
* prev block info
*/
lastBlockId?: BlockID;
/**
* hashes of block data
*/
lastCommitHash: Uint8Array;
/**
* transactions
*/
dataHash: Uint8Array;
/**
* hashes from the app output from the prev block
*/
validatorsHash: Uint8Array;
/**
* validators for the next block
*/
nextValidatorsHash: Uint8Array;
/**
* consensus params for current block
*/
consensusHash: Uint8Array;
/**
* state after txs from the previous block
*/
appHash: Uint8Array;
/**
* root hash of all results from the txs from the previous block
*/
lastResultsHash: Uint8Array;
/**
* consensus info
*/
evidenceHash: Uint8Array;
/**
* original proposer of the block
*/
proposerAddress: Uint8Array;
}
/**
* Data contains the set of transactions included in the block
*/
export interface Data {
/**
* Txs that will be applied by state @ block.Height+1.
* NOTE: not all txs here are valid. We're just agreeing on the order first.
* This means that block.AppHash does not include these txs.
*/
txs: Uint8Array[];
}
/**
* Vote represents a prevote, precommit, or commit vote from validators for
* consensus.
*/
export interface Vote {
type: SignedMsgType;
height: Long;
round: number;
/**
* zero if vote is nil.
*/
blockId?: BlockID;
timestamp?: Date;
validatorAddress: Uint8Array;
validatorIndex: number;
signature: Uint8Array;
}
/**
* Commit contains the evidence that a block was committed by a set of validators.
*/
export interface Commit {
height: Long;
round: number;
blockId?: BlockID;
signatures: CommitSig[];
}
/**
* CommitSig is a part of the Vote included in a Commit.
*/
export interface CommitSig {
blockIdFlag: BlockIDFlag;
validatorAddress: Uint8Array;
timestamp?: Date;
signature: Uint8Array;
}
export interface Proposal {
type: SignedMsgType;
height: Long;
round: number;
polRound: number;
blockId?: BlockID;
timestamp?: Date;
signature: Uint8Array;
}
export interface SignedHeader {
header?: Header;
commit?: Commit;
}
export interface LightBlock {
signedHeader?: SignedHeader;
validatorSet?: ValidatorSet;
}
export interface BlockMeta {
blockId?: BlockID;
blockSize: Long;
header?: Header;
numTxs: Long;
}
/**
* TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
*/
export interface TxProof {
rootHash: Uint8Array;
data: Uint8Array;
proof?: Proof;
}
const basePartSetHeader: object = {
total: 0,
};
const basePart: object = {
index: 0,
};
const baseBlockID: object = {};
const baseHeader: object = {
chainId: "",
height: Long.ZERO,
};
const baseData: object = {};
const baseVote: object = {
type: 0,
height: Long.ZERO,
round: 0,
validatorIndex: 0,
};
const baseCommit: object = {
height: Long.ZERO,
round: 0,
};
const baseCommitSig: object = {
blockIdFlag: 0,
};
const baseProposal: object = {
type: 0,
height: Long.ZERO,
round: 0,
polRound: 0,
};
const baseSignedHeader: object = {};
const baseLightBlock: object = {};
const baseBlockMeta: object = {
blockSize: Long.ZERO,
numTxs: Long.ZERO,
};
const baseTxProof: object = {};
function fromJsonTimestamp(o: any): Date {
if (o instanceof Date) {
return o;
} else if (typeof o === "string") {
return new Date(o);
} else {
return fromTimestamp(Timestamp.fromJSON(o));
}
}
function toTimestamp(date: Date): Timestamp {
const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
let millis = t.seconds.toNumber() * 1_000;
millis += t.nanos / 1_000_000;
return new Date(millis);
}
function numberToLong(number: number) {
return Long.fromNumber(number);
}
import { util, configure, Writer, Reader } from "protobufjs/minimal";
export const protobufPackage = "tendermint.types";
/** BlockIdFlag indicates which BlcokID the signature is for
*/
/** BlockIdFlag indicates which BlcokID the signature is for */
export enum BlockIDFlag {
BLOCK_ID_FLAG_UNKNOWN = 0,
BLOCK_ID_FLAG_ABSENT = 1,
@ -292,16 +53,13 @@ export function blockIDFlagToJSON(object: BlockIDFlag): string {
}
}
/** SignedMsgType is a type of signed message in the consensus.
*/
/** SignedMsgType is a type of signed message in the consensus. */
export enum SignedMsgType {
SIGNED_MSG_TYPE_UNKNOWN = 0,
/** SIGNED_MSG_TYPE_PREVOTE - Votes
*/
/** SIGNED_MSG_TYPE_PREVOTE - Votes */
SIGNED_MSG_TYPE_PREVOTE = 1,
SIGNED_MSG_TYPE_PRECOMMIT = 2,
/** SIGNED_MSG_TYPE_PROPOSAL - Proposals
*/
/** SIGNED_MSG_TYPE_PROPOSAL - Proposals */
SIGNED_MSG_TYPE_PROPOSAL = 32,
UNRECOGNIZED = -1,
}
@ -342,13 +100,139 @@ export function signedMsgTypeToJSON(object: SignedMsgType): string {
}
}
/** PartsetHeader */
export interface PartSetHeader {
total: number;
hash: Uint8Array;
}
export interface Part {
index: number;
bytes: Uint8Array;
proof?: Proof;
}
/** BlockID */
export interface BlockID {
hash: Uint8Array;
partSetHeader?: PartSetHeader;
}
/** Header defines the structure of a Tendermint block header. */
export interface Header {
/** basic block info */
version?: Consensus;
chainId: string;
height: Long;
time?: Date;
/** prev block info */
lastBlockId?: BlockID;
/** hashes of block data */
lastCommitHash: Uint8Array;
/** transactions */
dataHash: Uint8Array;
/** hashes from the app output from the prev block */
validatorsHash: Uint8Array;
/** validators for the next block */
nextValidatorsHash: Uint8Array;
/** consensus params for current block */
consensusHash: Uint8Array;
/** state after txs from the previous block */
appHash: Uint8Array;
/** root hash of all results from the txs from the previous block */
lastResultsHash: Uint8Array;
/** consensus info */
evidenceHash: Uint8Array;
/** original proposer of the block */
proposerAddress: Uint8Array;
}
/** Data contains the set of transactions included in the block */
export interface Data {
/**
* Txs that will be applied by state @ block.Height+1.
* NOTE: not all txs here are valid. We're just agreeing on the order first.
* This means that block.AppHash does not include these txs.
*/
txs: Uint8Array[];
}
/**
* Vote represents a prevote, precommit, or commit vote from validators for
* consensus.
*/
export interface Vote {
type: SignedMsgType;
height: Long;
round: number;
/** zero if vote is nil. */
blockId?: BlockID;
timestamp?: Date;
validatorAddress: Uint8Array;
validatorIndex: number;
signature: Uint8Array;
}
/** Commit contains the evidence that a block was committed by a set of validators. */
export interface Commit {
height: Long;
round: number;
blockId?: BlockID;
signatures: CommitSig[];
}
/** CommitSig is a part of the Vote included in a Commit. */
export interface CommitSig {
blockIdFlag: BlockIDFlag;
validatorAddress: Uint8Array;
timestamp?: Date;
signature: Uint8Array;
}
export interface Proposal {
type: SignedMsgType;
height: Long;
round: number;
polRound: number;
blockId?: BlockID;
timestamp?: Date;
signature: Uint8Array;
}
export interface SignedHeader {
header?: Header;
commit?: Commit;
}
export interface LightBlock {
signedHeader?: SignedHeader;
validatorSet?: ValidatorSet;
}
export interface BlockMeta {
blockId?: BlockID;
blockSize: Long;
header?: Header;
numTxs: Long;
}
/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */
export interface TxProof {
rootHash: Uint8Array;
data: Uint8Array;
proof?: Proof;
}
const basePartSetHeader: object = { total: 0 };
export const PartSetHeader = {
encode(message: PartSetHeader, writer: Writer = Writer.create()): Writer {
writer.uint32(8).uint32(message.total);
writer.uint32(18).bytes(message.hash);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): PartSetHeader {
decode(input: Reader | Uint8Array, length?: number): PartSetHeader {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...basePartSetHeader } as PartSetHeader;
@ -368,6 +252,7 @@ export const PartSetHeader = {
}
return message;
},
fromJSON(object: any): PartSetHeader {
const message = { ...basePartSetHeader } as PartSetHeader;
if (object.total !== undefined && object.total !== null) {
@ -380,6 +265,7 @@ export const PartSetHeader = {
}
return message;
},
fromPartial(object: DeepPartial<PartSetHeader>): PartSetHeader {
const message = { ...basePartSetHeader } as PartSetHeader;
if (object.total !== undefined && object.total !== null) {
@ -394,6 +280,7 @@ export const PartSetHeader = {
}
return message;
},
toJSON(message: PartSetHeader): unknown {
const obj: any = {};
message.total !== undefined && (obj.total = message.total);
@ -403,6 +290,8 @@ export const PartSetHeader = {
},
};
const basePart: object = { index: 0 };
export const Part = {
encode(message: Part, writer: Writer = Writer.create()): Writer {
writer.uint32(8).uint32(message.index);
@ -412,7 +301,8 @@ export const Part = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Part {
decode(input: Reader | Uint8Array, length?: number): Part {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...basePart } as Part;
@ -435,6 +325,7 @@ export const Part = {
}
return message;
},
fromJSON(object: any): Part {
const message = { ...basePart } as Part;
if (object.index !== undefined && object.index !== null) {
@ -452,6 +343,7 @@ export const Part = {
}
return message;
},
fromPartial(object: DeepPartial<Part>): Part {
const message = { ...basePart } as Part;
if (object.index !== undefined && object.index !== null) {
@ -471,6 +363,7 @@ export const Part = {
}
return message;
},
toJSON(message: Part): unknown {
const obj: any = {};
message.index !== undefined && (obj.index = message.index);
@ -481,6 +374,8 @@ export const Part = {
},
};
const baseBlockID: object = {};
export const BlockID = {
encode(message: BlockID, writer: Writer = Writer.create()): Writer {
writer.uint32(10).bytes(message.hash);
@ -489,7 +384,8 @@ export const BlockID = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): BlockID {
decode(input: Reader | Uint8Array, length?: number): BlockID {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseBlockID } as BlockID;
@ -509,6 +405,7 @@ export const BlockID = {
}
return message;
},
fromJSON(object: any): BlockID {
const message = { ...baseBlockID } as BlockID;
if (object.hash !== undefined && object.hash !== null) {
@ -521,6 +418,7 @@ export const BlockID = {
}
return message;
},
fromPartial(object: DeepPartial<BlockID>): BlockID {
const message = { ...baseBlockID } as BlockID;
if (object.hash !== undefined && object.hash !== null) {
@ -535,6 +433,7 @@ export const BlockID = {
}
return message;
},
toJSON(message: BlockID): unknown {
const obj: any = {};
message.hash !== undefined &&
@ -545,6 +444,8 @@ export const BlockID = {
},
};
const baseHeader: object = { chainId: "", height: Long.ZERO };
export const Header = {
encode(message: Header, writer: Writer = Writer.create()): Writer {
if (message.version !== undefined && message.version !== undefined) {
@ -569,7 +470,8 @@ export const Header = {
writer.uint32(114).bytes(message.proposerAddress);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Header {
decode(input: Reader | Uint8Array, length?: number): Header {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseHeader } as Header;
@ -625,6 +527,7 @@ export const Header = {
}
return message;
},
fromJSON(object: any): Header {
const message = { ...baseHeader } as Header;
if (object.version !== undefined && object.version !== null) {
@ -681,6 +584,7 @@ export const Header = {
}
return message;
},
fromPartial(object: DeepPartial<Header>): Header {
const message = { ...baseHeader } as Header;
if (object.version !== undefined && object.version !== null) {
@ -755,6 +659,7 @@ export const Header = {
}
return message;
},
toJSON(message: Header): unknown {
const obj: any = {};
message.version !== undefined &&
@ -800,6 +705,8 @@ export const Header = {
},
};
const baseData: object = {};
export const Data = {
encode(message: Data, writer: Writer = Writer.create()): Writer {
for (const v of message.txs) {
@ -807,7 +714,8 @@ export const Data = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Data {
decode(input: Reader | Uint8Array, length?: number): Data {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseData } as Data;
@ -825,6 +733,7 @@ export const Data = {
}
return message;
},
fromJSON(object: any): Data {
const message = { ...baseData } as Data;
message.txs = [];
@ -835,6 +744,7 @@ export const Data = {
}
return message;
},
fromPartial(object: DeepPartial<Data>): Data {
const message = { ...baseData } as Data;
message.txs = [];
@ -845,6 +755,7 @@ export const Data = {
}
return message;
},
toJSON(message: Data): unknown {
const obj: any = {};
if (message.txs) {
@ -856,6 +767,8 @@ export const Data = {
},
};
const baseVote: object = { type: 0, height: Long.ZERO, round: 0, validatorIndex: 0 };
export const Vote = {
encode(message: Vote, writer: Writer = Writer.create()): Writer {
writer.uint32(8).int32(message.type);
@ -872,7 +785,8 @@ export const Vote = {
writer.uint32(66).bytes(message.signature);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Vote {
decode(input: Reader | Uint8Array, length?: number): Vote {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseVote } as Vote;
@ -910,6 +824,7 @@ export const Vote = {
}
return message;
},
fromJSON(object: any): Vote {
const message = { ...baseVote } as Vote;
if (object.type !== undefined && object.type !== null) {
@ -950,6 +865,7 @@ export const Vote = {
}
return message;
},
fromPartial(object: DeepPartial<Vote>): Vote {
const message = { ...baseVote } as Vote;
if (object.type !== undefined && object.type !== null) {
@ -994,6 +910,7 @@ export const Vote = {
}
return message;
},
toJSON(message: Vote): unknown {
const obj: any = {};
message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type));
@ -1016,6 +933,8 @@ export const Vote = {
},
};
const baseCommit: object = { height: Long.ZERO, round: 0 };
export const Commit = {
encode(message: Commit, writer: Writer = Writer.create()): Writer {
writer.uint32(8).int64(message.height);
@ -1028,7 +947,8 @@ export const Commit = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Commit {
decode(input: Reader | Uint8Array, length?: number): Commit {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseCommit } as Commit;
@ -1055,6 +975,7 @@ export const Commit = {
}
return message;
},
fromJSON(object: any): Commit {
const message = { ...baseCommit } as Commit;
message.signatures = [];
@ -1080,6 +1001,7 @@ export const Commit = {
}
return message;
},
fromPartial(object: DeepPartial<Commit>): Commit {
const message = { ...baseCommit } as Commit;
message.signatures = [];
@ -1105,6 +1027,7 @@ export const Commit = {
}
return message;
},
toJSON(message: Commit): unknown {
const obj: any = {};
message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString());
@ -1120,6 +1043,8 @@ export const Commit = {
},
};
const baseCommitSig: object = { blockIdFlag: 0 };
export const CommitSig = {
encode(message: CommitSig, writer: Writer = Writer.create()): Writer {
writer.uint32(8).int32(message.blockIdFlag);
@ -1130,7 +1055,8 @@ export const CommitSig = {
writer.uint32(34).bytes(message.signature);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): CommitSig {
decode(input: Reader | Uint8Array, length?: number): CommitSig {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseCommitSig } as CommitSig;
@ -1156,6 +1082,7 @@ export const CommitSig = {
}
return message;
},
fromJSON(object: any): CommitSig {
const message = { ...baseCommitSig } as CommitSig;
if (object.blockIdFlag !== undefined && object.blockIdFlag !== null) {
@ -1176,6 +1103,7 @@ export const CommitSig = {
}
return message;
},
fromPartial(object: DeepPartial<CommitSig>): CommitSig {
const message = { ...baseCommitSig } as CommitSig;
if (object.blockIdFlag !== undefined && object.blockIdFlag !== null) {
@ -1200,6 +1128,7 @@ export const CommitSig = {
}
return message;
},
toJSON(message: CommitSig): unknown {
const obj: any = {};
message.blockIdFlag !== undefined && (obj.blockIdFlag = blockIDFlagToJSON(message.blockIdFlag));
@ -1217,6 +1146,8 @@ export const CommitSig = {
},
};
const baseProposal: object = { type: 0, height: Long.ZERO, round: 0, polRound: 0 };
export const Proposal = {
encode(message: Proposal, writer: Writer = Writer.create()): Writer {
writer.uint32(8).int32(message.type);
@ -1232,7 +1163,8 @@ export const Proposal = {
writer.uint32(58).bytes(message.signature);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Proposal {
decode(input: Reader | Uint8Array, length?: number): Proposal {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseProposal } as Proposal;
@ -1267,6 +1199,7 @@ export const Proposal = {
}
return message;
},
fromJSON(object: any): Proposal {
const message = { ...baseProposal } as Proposal;
if (object.type !== undefined && object.type !== null) {
@ -1304,6 +1237,7 @@ export const Proposal = {
}
return message;
},
fromPartial(object: DeepPartial<Proposal>): Proposal {
const message = { ...baseProposal } as Proposal;
if (object.type !== undefined && object.type !== null) {
@ -1343,6 +1277,7 @@ export const Proposal = {
}
return message;
},
toJSON(message: Proposal): unknown {
const obj: any = {};
message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type));
@ -1361,6 +1296,8 @@ export const Proposal = {
},
};
const baseSignedHeader: object = {};
export const SignedHeader = {
encode(message: SignedHeader, writer: Writer = Writer.create()): Writer {
if (message.header !== undefined && message.header !== undefined) {
@ -1371,7 +1308,8 @@ export const SignedHeader = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): SignedHeader {
decode(input: Reader | Uint8Array, length?: number): SignedHeader {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseSignedHeader } as SignedHeader;
@ -1391,6 +1329,7 @@ export const SignedHeader = {
}
return message;
},
fromJSON(object: any): SignedHeader {
const message = { ...baseSignedHeader } as SignedHeader;
if (object.header !== undefined && object.header !== null) {
@ -1405,6 +1344,7 @@ export const SignedHeader = {
}
return message;
},
fromPartial(object: DeepPartial<SignedHeader>): SignedHeader {
const message = { ...baseSignedHeader } as SignedHeader;
if (object.header !== undefined && object.header !== null) {
@ -1419,6 +1359,7 @@ export const SignedHeader = {
}
return message;
},
toJSON(message: SignedHeader): unknown {
const obj: any = {};
message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined);
@ -1427,6 +1368,8 @@ export const SignedHeader = {
},
};
const baseLightBlock: object = {};
export const LightBlock = {
encode(message: LightBlock, writer: Writer = Writer.create()): Writer {
if (message.signedHeader !== undefined && message.signedHeader !== undefined) {
@ -1437,7 +1380,8 @@ export const LightBlock = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): LightBlock {
decode(input: Reader | Uint8Array, length?: number): LightBlock {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseLightBlock } as LightBlock;
@ -1457,6 +1401,7 @@ export const LightBlock = {
}
return message;
},
fromJSON(object: any): LightBlock {
const message = { ...baseLightBlock } as LightBlock;
if (object.signedHeader !== undefined && object.signedHeader !== null) {
@ -1471,6 +1416,7 @@ export const LightBlock = {
}
return message;
},
fromPartial(object: DeepPartial<LightBlock>): LightBlock {
const message = { ...baseLightBlock } as LightBlock;
if (object.signedHeader !== undefined && object.signedHeader !== null) {
@ -1485,6 +1431,7 @@ export const LightBlock = {
}
return message;
},
toJSON(message: LightBlock): unknown {
const obj: any = {};
message.signedHeader !== undefined &&
@ -1495,6 +1442,8 @@ export const LightBlock = {
},
};
const baseBlockMeta: object = { blockSize: Long.ZERO, numTxs: Long.ZERO };
export const BlockMeta = {
encode(message: BlockMeta, writer: Writer = Writer.create()): Writer {
if (message.blockId !== undefined && message.blockId !== undefined) {
@ -1507,7 +1456,8 @@ export const BlockMeta = {
writer.uint32(32).int64(message.numTxs);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): BlockMeta {
decode(input: Reader | Uint8Array, length?: number): BlockMeta {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseBlockMeta } as BlockMeta;
@ -1533,6 +1483,7 @@ export const BlockMeta = {
}
return message;
},
fromJSON(object: any): BlockMeta {
const message = { ...baseBlockMeta } as BlockMeta;
if (object.blockId !== undefined && object.blockId !== null) {
@ -1557,6 +1508,7 @@ export const BlockMeta = {
}
return message;
},
fromPartial(object: DeepPartial<BlockMeta>): BlockMeta {
const message = { ...baseBlockMeta } as BlockMeta;
if (object.blockId !== undefined && object.blockId !== null) {
@ -1581,6 +1533,7 @@ export const BlockMeta = {
}
return message;
},
toJSON(message: BlockMeta): unknown {
const obj: any = {};
message.blockId !== undefined &&
@ -1592,6 +1545,8 @@ export const BlockMeta = {
},
};
const baseTxProof: object = {};
export const TxProof = {
encode(message: TxProof, writer: Writer = Writer.create()): Writer {
writer.uint32(10).bytes(message.rootHash);
@ -1601,7 +1556,8 @@ export const TxProof = {
}
return writer;
},
decode(input: Uint8Array | Reader, length?: number): TxProof {
decode(input: Reader | Uint8Array, length?: number): TxProof {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseTxProof } as TxProof;
@ -1624,6 +1580,7 @@ export const TxProof = {
}
return message;
},
fromJSON(object: any): TxProof {
const message = { ...baseTxProof } as TxProof;
if (object.rootHash !== undefined && object.rootHash !== null) {
@ -1639,6 +1596,7 @@ export const TxProof = {
}
return message;
},
fromPartial(object: DeepPartial<TxProof>): TxProof {
const message = { ...baseTxProof } as TxProof;
if (object.rootHash !== undefined && object.rootHash !== null) {
@ -1658,6 +1616,7 @@ export const TxProof = {
}
return message;
},
toJSON(message: TxProof): unknown {
const obj: any = {};
message.rootHash !== undefined &&
@ -1669,20 +1628,18 @@ export const TxProof = {
},
};
if (util.Long !== (Long as any)) {
util.Long = Long as any;
configure();
}
interface WindowBase64 {
atob(b64: string): string;
btoa(bin: string): string;
}
const windowBase64 = (globalThis as unknown) as WindowBase64;
const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary"));
const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64"));
declare var self: any | undefined;
declare var window: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw new Error("Unable to locate global object");
})();
const atob: (b64: string) => string =
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64: string): Uint8Array {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@ -1692,6 +1649,8 @@ function bytesFromBase64(b64: string): Uint8Array {
return arr;
}
const btoa: (bin: string) => string =
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr: Uint8Array): string {
const bin: string[] = [];
for (let i = 0; i < arr.byteLength; ++i) {
@ -1699,7 +1658,8 @@ function base64FromBytes(arr: Uint8Array): string {
}
return btoa(bin.join(""));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>
@ -1709,3 +1669,34 @@ export type DeepPartial<T> = T extends Builtin
: T extends {}
? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
function toTimestamp(date: Date): Timestamp {
const seconds = numberToLong(date.getTime() / 1_000);
const nanos = (date.getTime() % 1_000) * 1_000_000;
return { seconds, nanos };
}
function fromTimestamp(t: Timestamp): Date {
let millis = t.seconds.toNumber() * 1_000;
millis += t.nanos / 1_000_000;
return new Date(millis);
}
function fromJsonTimestamp(o: any): Date {
if (o instanceof Date) {
return o;
} else if (typeof o === "string") {
return new Date(o);
} else {
return fromTimestamp(Timestamp.fromJSON(o));
}
}
function numberToLong(number: number) {
return Long.fromNumber(number);
}
if (util.Long !== Long) {
util.Long = Long as any;
configure();
}

View File

@ -3,6 +3,8 @@ import * as Long from "long";
import { PublicKey } from "../../tendermint/crypto/keys";
import { Writer, Reader } from "protobufjs/minimal";
export const protobufPackage = "tendermint.types";
export interface ValidatorSet {
validators: Validator[];
proposer?: Validator;
@ -21,20 +23,7 @@ export interface SimpleValidator {
votingPower: Long;
}
const baseValidatorSet: object = {
totalVotingPower: Long.ZERO,
};
const baseValidator: object = {
votingPower: Long.ZERO,
proposerPriority: Long.ZERO,
};
const baseSimpleValidator: object = {
votingPower: Long.ZERO,
};
export const protobufPackage = "tendermint.types";
const baseValidatorSet: object = { totalVotingPower: Long.ZERO };
export const ValidatorSet = {
encode(message: ValidatorSet, writer: Writer = Writer.create()): Writer {
@ -47,7 +36,8 @@ export const ValidatorSet = {
writer.uint32(24).int64(message.totalVotingPower);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): ValidatorSet {
decode(input: Reader | Uint8Array, length?: number): ValidatorSet {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseValidatorSet } as ValidatorSet;
@ -71,6 +61,7 @@ export const ValidatorSet = {
}
return message;
},
fromJSON(object: any): ValidatorSet {
const message = { ...baseValidatorSet } as ValidatorSet;
message.validators = [];
@ -91,6 +82,7 @@ export const ValidatorSet = {
}
return message;
},
fromPartial(object: DeepPartial<ValidatorSet>): ValidatorSet {
const message = { ...baseValidatorSet } as ValidatorSet;
message.validators = [];
@ -111,6 +103,7 @@ export const ValidatorSet = {
}
return message;
},
toJSON(message: ValidatorSet): unknown {
const obj: any = {};
if (message.validators) {
@ -126,6 +119,8 @@ export const ValidatorSet = {
},
};
const baseValidator: object = { votingPower: Long.ZERO, proposerPriority: Long.ZERO };
export const Validator = {
encode(message: Validator, writer: Writer = Writer.create()): Writer {
writer.uint32(10).bytes(message.address);
@ -136,7 +131,8 @@ export const Validator = {
writer.uint32(32).int64(message.proposerPriority);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Validator {
decode(input: Reader | Uint8Array, length?: number): Validator {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseValidator } as Validator;
@ -162,6 +158,7 @@ export const Validator = {
}
return message;
},
fromJSON(object: any): Validator {
const message = { ...baseValidator } as Validator;
if (object.address !== undefined && object.address !== null) {
@ -184,6 +181,7 @@ export const Validator = {
}
return message;
},
fromPartial(object: DeepPartial<Validator>): Validator {
const message = { ...baseValidator } as Validator;
if (object.address !== undefined && object.address !== null) {
@ -208,6 +206,7 @@ export const Validator = {
}
return message;
},
toJSON(message: Validator): unknown {
const obj: any = {};
message.address !== undefined &&
@ -221,6 +220,8 @@ export const Validator = {
},
};
const baseSimpleValidator: object = { votingPower: Long.ZERO };
export const SimpleValidator = {
encode(message: SimpleValidator, writer: Writer = Writer.create()): Writer {
if (message.pubKey !== undefined && message.pubKey !== undefined) {
@ -229,7 +230,8 @@ export const SimpleValidator = {
writer.uint32(16).int64(message.votingPower);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): SimpleValidator {
decode(input: Reader | Uint8Array, length?: number): SimpleValidator {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseSimpleValidator } as SimpleValidator;
@ -249,6 +251,7 @@ export const SimpleValidator = {
}
return message;
},
fromJSON(object: any): SimpleValidator {
const message = { ...baseSimpleValidator } as SimpleValidator;
if (object.pubKey !== undefined && object.pubKey !== null) {
@ -263,6 +266,7 @@ export const SimpleValidator = {
}
return message;
},
fromPartial(object: DeepPartial<SimpleValidator>): SimpleValidator {
const message = { ...baseSimpleValidator } as SimpleValidator;
if (object.pubKey !== undefined && object.pubKey !== null) {
@ -277,6 +281,7 @@ export const SimpleValidator = {
}
return message;
},
toJSON(message: SimpleValidator): unknown {
const obj: any = {};
message.pubKey !== undefined &&
@ -286,15 +291,18 @@ export const SimpleValidator = {
},
};
interface WindowBase64 {
atob(b64: string): string;
btoa(bin: string): string;
}
const windowBase64 = (globalThis as unknown) as WindowBase64;
const atob = windowBase64.atob || ((b64: string) => Buffer.from(b64, "base64").toString("binary"));
const btoa = windowBase64.btoa || ((bin: string) => Buffer.from(bin, "binary").toString("base64"));
declare var self: any | undefined;
declare var window: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw new Error("Unable to locate global object");
})();
const atob: (b64: string) => string =
globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
function bytesFromBase64(b64: string): Uint8Array {
const bin = atob(b64);
const arr = new Uint8Array(bin.length);
@ -304,6 +312,8 @@ function bytesFromBase64(b64: string): Uint8Array {
return arr;
}
const btoa: (bin: string) => string =
globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
function base64FromBytes(arr: Uint8Array): string {
const bin: string[] = [];
for (let i = 0; i < arr.byteLength; ++i) {
@ -311,7 +321,8 @@ function base64FromBytes(arr: Uint8Array): string {
}
return btoa(bin.join(""));
}
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

View File

@ -2,10 +2,12 @@
import * as Long from "long";
import { Writer, Reader } from "protobufjs/minimal";
export const protobufPackage = "tendermint.version";
/**
* App includes the protocol and software version for the application.
* This information is included in ResponseInfo. The App.Protocol can be
* updated in ResponseEndBlock.
* App includes the protocol and software version for the application.
* This information is included in ResponseInfo. The App.Protocol can be
* updated in ResponseEndBlock.
*/
export interface App {
protocol: Long;
@ -13,26 +15,16 @@ export interface App {
}
/**
* Consensus captures the consensus rules for processing a block in the blockchain,
* including all blockchain data structures and the rules of the application's
* state transition machine.
* Consensus captures the consensus rules for processing a block in the blockchain,
* including all blockchain data structures and the rules of the application's
* state transition machine.
*/
export interface Consensus {
block: Long;
app: Long;
}
const baseApp: object = {
protocol: Long.UZERO,
software: "",
};
const baseConsensus: object = {
block: Long.UZERO,
app: Long.UZERO,
};
export const protobufPackage = "tendermint.version";
const baseApp: object = { protocol: Long.UZERO, software: "" };
export const App = {
encode(message: App, writer: Writer = Writer.create()): Writer {
@ -40,7 +32,8 @@ export const App = {
writer.uint32(18).string(message.software);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): App {
decode(input: Reader | Uint8Array, length?: number): App {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseApp } as App;
@ -60,6 +53,7 @@ export const App = {
}
return message;
},
fromJSON(object: any): App {
const message = { ...baseApp } as App;
if (object.protocol !== undefined && object.protocol !== null) {
@ -74,6 +68,7 @@ export const App = {
}
return message;
},
fromPartial(object: DeepPartial<App>): App {
const message = { ...baseApp } as App;
if (object.protocol !== undefined && object.protocol !== null) {
@ -88,6 +83,7 @@ export const App = {
}
return message;
},
toJSON(message: App): unknown {
const obj: any = {};
message.protocol !== undefined && (obj.protocol = (message.protocol || Long.UZERO).toString());
@ -96,13 +92,16 @@ export const App = {
},
};
const baseConsensus: object = { block: Long.UZERO, app: Long.UZERO };
export const Consensus = {
encode(message: Consensus, writer: Writer = Writer.create()): Writer {
writer.uint32(8).uint64(message.block);
writer.uint32(16).uint64(message.app);
return writer;
},
decode(input: Uint8Array | Reader, length?: number): Consensus {
decode(input: Reader | Uint8Array, length?: number): Consensus {
const reader = input instanceof Uint8Array ? new Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseConsensus } as Consensus;
@ -122,6 +121,7 @@ export const Consensus = {
}
return message;
},
fromJSON(object: any): Consensus {
const message = { ...baseConsensus } as Consensus;
if (object.block !== undefined && object.block !== null) {
@ -136,6 +136,7 @@ export const Consensus = {
}
return message;
},
fromPartial(object: DeepPartial<Consensus>): Consensus {
const message = { ...baseConsensus } as Consensus;
if (object.block !== undefined && object.block !== null) {
@ -150,6 +151,7 @@ export const Consensus = {
}
return message;
},
toJSON(message: Consensus): unknown {
const obj: any = {};
message.block !== undefined && (obj.block = (message.block || Long.UZERO).toString());
@ -158,7 +160,7 @@ export const Consensus = {
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined;
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;
export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
/**
* This codec is derived from the Cosmos SDK protocol buffer definitions and can change at any time.
* @packageDocumentation
*/
export * from "./generated/codecimpl";