Upgrade ts-proto to 1.67.0 and regenerate

This commit is contained in:
Simon Warta 2021-02-21 10:34:39 +01:00
parent 84a5b9b399
commit 122bb2b8c7
53 changed files with 7460 additions and 6198 deletions

View File

@ -59,7 +59,7 @@
"ses": "^0.11.0",
"shx": "^0.3.2",
"source-map-support": "^0.5.19",
"ts-proto": "=1.61.0",
"ts-proto": "^1.67.0",
"typedoc": "^0.19",
"typescript": "~4.0",
"webpack": "^4.43.0",

View File

@ -66,17 +66,25 @@ const basePageRequest: object = { offset: Long.UZERO, limit: Long.UZERO, countTo
export const PageRequest = {
encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.key);
writer.uint32(16).uint64(message.offset);
writer.uint32(24).uint64(message.limit);
writer.uint32(32).bool(message.countTotal);
if (message.key.length !== 0) {
writer.uint32(10).bytes(message.key);
}
if (!message.offset.isZero()) {
writer.uint32(16).uint64(message.offset);
}
if (!message.limit.isZero()) {
writer.uint32(24).uint64(message.limit);
}
if (message.countTotal === true) {
writer.uint32(32).bool(message.countTotal);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): PageRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(basePageRequest) as PageRequest;
const message = { ...basePageRequest } as PageRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -101,7 +109,7 @@ export const PageRequest = {
},
fromJSON(object: any): PageRequest {
const message = Object.create(basePageRequest) as PageRequest;
const message = { ...basePageRequest } as PageRequest;
if (object.key !== undefined && object.key !== null) {
message.key = bytesFromBase64(object.key);
}
@ -123,6 +131,16 @@ export const PageRequest = {
return message;
},
toJSON(message: PageRequest): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.offset !== undefined && (obj.offset = (message.offset || Long.UZERO).toString());
message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString());
message.countTotal !== undefined && (obj.countTotal = message.countTotal);
return obj;
},
fromPartial(object: DeepPartial<PageRequest>): PageRequest {
const message = { ...basePageRequest } as PageRequest;
if (object.key !== undefined && object.key !== null) {
@ -147,31 +165,25 @@ export const PageRequest = {
}
return message;
},
toJSON(message: PageRequest): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.offset !== undefined && (obj.offset = (message.offset || Long.UZERO).toString());
message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString());
message.countTotal !== undefined && (obj.countTotal = message.countTotal);
return obj;
},
};
const basePageResponse: object = { total: Long.UZERO };
export const PageResponse = {
encode(message: PageResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.nextKey);
writer.uint32(16).uint64(message.total);
if (message.nextKey.length !== 0) {
writer.uint32(10).bytes(message.nextKey);
}
if (!message.total.isZero()) {
writer.uint32(16).uint64(message.total);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): PageResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(basePageResponse) as PageResponse;
const message = { ...basePageResponse } as PageResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -190,7 +202,7 @@ export const PageResponse = {
},
fromJSON(object: any): PageResponse {
const message = Object.create(basePageResponse) as PageResponse;
const message = { ...basePageResponse } as PageResponse;
if (object.nextKey !== undefined && object.nextKey !== null) {
message.nextKey = bytesFromBase64(object.nextKey);
}
@ -202,6 +214,14 @@ export const PageResponse = {
return message;
},
toJSON(message: PageResponse): unknown {
const obj: any = {};
message.nextKey !== undefined &&
(obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array()));
message.total !== undefined && (obj.total = (message.total || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<PageResponse>): PageResponse {
const message = { ...basePageResponse } as PageResponse;
if (object.nextKey !== undefined && object.nextKey !== null) {
@ -216,14 +236,6 @@ export const PageResponse = {
}
return message;
},
toJSON(message: PageResponse): unknown {
const obj: any = {};
message.nextKey !== undefined &&
(obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array()));
message.total !== undefined && (obj.total = (message.total || Long.UZERO).toString());
return obj;
},
};
declare var self: any | undefined;
@ -233,7 +245,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -40,15 +40,19 @@ const baseCoin: object = { denom: "", amount: "" };
export const Coin = {
encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.denom);
writer.uint32(18).string(message.amount);
if (message.denom !== "") {
writer.uint32(10).string(message.denom);
}
if (message.amount !== "") {
writer.uint32(18).string(message.amount);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Coin {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCoin) as Coin;
const message = { ...baseCoin } as Coin;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -67,7 +71,7 @@ export const Coin = {
},
fromJSON(object: any): Coin {
const message = Object.create(baseCoin) as Coin;
const message = { ...baseCoin } as Coin;
if (object.denom !== undefined && object.denom !== null) {
message.denom = String(object.denom);
} else {
@ -81,6 +85,13 @@ export const Coin = {
return message;
},
toJSON(message: Coin): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.amount !== undefined && (obj.amount = message.amount);
return obj;
},
fromPartial(object: DeepPartial<Coin>): Coin {
const message = { ...baseCoin } as Coin;
if (object.denom !== undefined && object.denom !== null) {
@ -95,28 +106,25 @@ export const Coin = {
}
return message;
},
toJSON(message: Coin): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.amount !== undefined && (obj.amount = message.amount);
return obj;
},
};
const baseDecCoin: object = { denom: "", amount: "" };
export const DecCoin = {
encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.denom);
writer.uint32(18).string(message.amount);
if (message.denom !== "") {
writer.uint32(10).string(message.denom);
}
if (message.amount !== "") {
writer.uint32(18).string(message.amount);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): DecCoin {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseDecCoin) as DecCoin;
const message = { ...baseDecCoin } as DecCoin;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -135,7 +143,7 @@ export const DecCoin = {
},
fromJSON(object: any): DecCoin {
const message = Object.create(baseDecCoin) as DecCoin;
const message = { ...baseDecCoin } as DecCoin;
if (object.denom !== undefined && object.denom !== null) {
message.denom = String(object.denom);
} else {
@ -149,6 +157,13 @@ export const DecCoin = {
return message;
},
toJSON(message: DecCoin): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.amount !== undefined && (obj.amount = message.amount);
return obj;
},
fromPartial(object: DeepPartial<DecCoin>): DecCoin {
const message = { ...baseDecCoin } as DecCoin;
if (object.denom !== undefined && object.denom !== null) {
@ -163,27 +178,22 @@ export const DecCoin = {
}
return message;
},
toJSON(message: DecCoin): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.amount !== undefined && (obj.amount = message.amount);
return obj;
},
};
const baseIntProto: object = { int: "" };
export const IntProto = {
encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.int);
if (message.int !== "") {
writer.uint32(10).string(message.int);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): IntProto {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseIntProto) as IntProto;
const message = { ...baseIntProto } as IntProto;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -199,19 +209,9 @@ export const IntProto = {
},
fromJSON(object: any): IntProto {
const message = Object.create(baseIntProto) as IntProto;
if (object.int !== undefined && object.int !== null) {
message.int = String(object.int);
} else {
message.int = "";
}
return message;
},
fromPartial(object: DeepPartial<IntProto>): IntProto {
const message = { ...baseIntProto } as IntProto;
if (object.int !== undefined && object.int !== null) {
message.int = object.int;
message.int = String(object.int);
} else {
message.int = "";
}
@ -223,20 +223,32 @@ export const IntProto = {
message.int !== undefined && (obj.int = message.int);
return obj;
},
fromPartial(object: DeepPartial<IntProto>): IntProto {
const message = { ...baseIntProto } as IntProto;
if (object.int !== undefined && object.int !== null) {
message.int = object.int;
} else {
message.int = "";
}
return message;
},
};
const baseDecProto: object = { dec: "" };
export const DecProto = {
encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.dec);
if (message.dec !== "") {
writer.uint32(10).string(message.dec);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): DecProto {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseDecProto) as DecProto;
const message = { ...baseDecProto } as DecProto;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -252,19 +264,9 @@ export const DecProto = {
},
fromJSON(object: any): DecProto {
const message = Object.create(baseDecProto) as DecProto;
if (object.dec !== undefined && object.dec !== null) {
message.dec = String(object.dec);
} else {
message.dec = "";
}
return message;
},
fromPartial(object: DeepPartial<DecProto>): DecProto {
const message = { ...baseDecProto } as DecProto;
if (object.dec !== undefined && object.dec !== null) {
message.dec = object.dec;
message.dec = String(object.dec);
} else {
message.dec = "";
}
@ -276,6 +278,16 @@ export const DecProto = {
message.dec !== undefined && (obj.dec = message.dec);
return obj;
},
fromPartial(object: DeepPartial<DecProto>): DecProto {
const message = { ...baseDecProto } as DecProto;
if (object.dec !== undefined && object.dec !== null) {
message.dec = object.dec;
} else {
message.dec = "";
}
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;

View File

@ -115,10 +115,18 @@ const baseMsgStoreCode: object = { sender: "", source: "", builder: "" };
export const MsgStoreCode = {
encode(message: MsgStoreCode, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.sender);
writer.uint32(18).bytes(message.wasmByteCode);
writer.uint32(26).string(message.source);
writer.uint32(34).string(message.builder);
if (message.sender !== "") {
writer.uint32(10).string(message.sender);
}
if (message.wasmByteCode.length !== 0) {
writer.uint32(18).bytes(message.wasmByteCode);
}
if (message.source !== "") {
writer.uint32(26).string(message.source);
}
if (message.builder !== "") {
writer.uint32(34).string(message.builder);
}
if (message.instantiatePermission !== undefined) {
AccessConfig.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim();
}
@ -128,7 +136,7 @@ export const MsgStoreCode = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreCode {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgStoreCode) as MsgStoreCode;
const message = { ...baseMsgStoreCode } as MsgStoreCode;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -156,7 +164,7 @@ export const MsgStoreCode = {
},
fromJSON(object: any): MsgStoreCode {
const message = Object.create(baseMsgStoreCode) as MsgStoreCode;
const message = { ...baseMsgStoreCode } as MsgStoreCode;
if (object.sender !== undefined && object.sender !== null) {
message.sender = String(object.sender);
} else {
@ -183,6 +191,22 @@ export const MsgStoreCode = {
return message;
},
toJSON(message: MsgStoreCode): unknown {
const obj: any = {};
message.sender !== undefined && (obj.sender = message.sender);
message.wasmByteCode !== undefined &&
(obj.wasmByteCode = base64FromBytes(
message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array(),
));
message.source !== undefined && (obj.source = message.source);
message.builder !== undefined && (obj.builder = message.builder);
message.instantiatePermission !== undefined &&
(obj.instantiatePermission = message.instantiatePermission
? AccessConfig.toJSON(message.instantiatePermission)
: undefined);
return obj;
},
fromPartial(object: DeepPartial<MsgStoreCode>): MsgStoreCode {
const message = { ...baseMsgStoreCode } as MsgStoreCode;
if (object.sender !== undefined && object.sender !== null) {
@ -212,36 +236,22 @@ export const MsgStoreCode = {
}
return message;
},
toJSON(message: MsgStoreCode): unknown {
const obj: any = {};
message.sender !== undefined && (obj.sender = message.sender);
message.wasmByteCode !== undefined &&
(obj.wasmByteCode = base64FromBytes(
message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array(),
));
message.source !== undefined && (obj.source = message.source);
message.builder !== undefined && (obj.builder = message.builder);
message.instantiatePermission !== undefined &&
(obj.instantiatePermission = message.instantiatePermission
? AccessConfig.toJSON(message.instantiatePermission)
: undefined);
return obj;
},
};
const baseMsgStoreCodeResponse: object = { codeId: Long.UZERO };
export const MsgStoreCodeResponse = {
encode(message: MsgStoreCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint64(message.codeId);
if (!message.codeId.isZero()) {
writer.uint32(8).uint64(message.codeId);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreCodeResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgStoreCodeResponse) as MsgStoreCodeResponse;
const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -257,19 +267,9 @@ export const MsgStoreCodeResponse = {
},
fromJSON(object: any): MsgStoreCodeResponse {
const message = Object.create(baseMsgStoreCodeResponse) as MsgStoreCodeResponse;
if (object.codeId !== undefined && object.codeId !== null) {
message.codeId = Long.fromString(object.codeId);
} else {
message.codeId = Long.UZERO;
}
return message;
},
fromPartial(object: DeepPartial<MsgStoreCodeResponse>): MsgStoreCodeResponse {
const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse;
if (object.codeId !== undefined && object.codeId !== null) {
message.codeId = object.codeId as Long;
message.codeId = Long.fromString(object.codeId);
} else {
message.codeId = Long.UZERO;
}
@ -281,17 +281,37 @@ export const MsgStoreCodeResponse = {
message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<MsgStoreCodeResponse>): MsgStoreCodeResponse {
const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse;
if (object.codeId !== undefined && object.codeId !== null) {
message.codeId = object.codeId as Long;
} else {
message.codeId = Long.UZERO;
}
return message;
},
};
const baseMsgInstantiateContract: object = { sender: "", admin: "", codeId: Long.UZERO, label: "" };
export const MsgInstantiateContract = {
encode(message: MsgInstantiateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.sender);
writer.uint32(18).string(message.admin);
writer.uint32(24).uint64(message.codeId);
writer.uint32(34).string(message.label);
writer.uint32(42).bytes(message.initMsg);
if (message.sender !== "") {
writer.uint32(10).string(message.sender);
}
if (message.admin !== "") {
writer.uint32(18).string(message.admin);
}
if (!message.codeId.isZero()) {
writer.uint32(24).uint64(message.codeId);
}
if (message.label !== "") {
writer.uint32(34).string(message.label);
}
if (message.initMsg.length !== 0) {
writer.uint32(42).bytes(message.initMsg);
}
for (const v of message.initFunds) {
Coin.encode(v!, writer.uint32(50).fork()).ldelim();
}
@ -301,7 +321,7 @@ export const MsgInstantiateContract = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContract {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgInstantiateContract) as MsgInstantiateContract;
const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract;
message.initFunds = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -333,7 +353,7 @@ export const MsgInstantiateContract = {
},
fromJSON(object: any): MsgInstantiateContract {
const message = Object.create(baseMsgInstantiateContract) as MsgInstantiateContract;
const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract;
message.initFunds = [];
if (object.sender !== undefined && object.sender !== null) {
message.sender = String(object.sender);
@ -366,6 +386,22 @@ export const MsgInstantiateContract = {
return message;
},
toJSON(message: MsgInstantiateContract): unknown {
const obj: any = {};
message.sender !== undefined && (obj.sender = message.sender);
message.admin !== undefined && (obj.admin = message.admin);
message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString());
message.label !== undefined && (obj.label = message.label);
message.initMsg !== undefined &&
(obj.initMsg = base64FromBytes(message.initMsg !== undefined ? message.initMsg : new Uint8Array()));
if (message.initFunds) {
obj.initFunds = message.initFunds.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.initFunds = [];
}
return obj;
},
fromPartial(object: DeepPartial<MsgInstantiateContract>): MsgInstantiateContract {
const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract;
message.initFunds = [];
@ -401,36 +437,22 @@ export const MsgInstantiateContract = {
}
return message;
},
toJSON(message: MsgInstantiateContract): unknown {
const obj: any = {};
message.sender !== undefined && (obj.sender = message.sender);
message.admin !== undefined && (obj.admin = message.admin);
message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString());
message.label !== undefined && (obj.label = message.label);
message.initMsg !== undefined &&
(obj.initMsg = base64FromBytes(message.initMsg !== undefined ? message.initMsg : new Uint8Array()));
if (message.initFunds) {
obj.initFunds = message.initFunds.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.initFunds = [];
}
return obj;
},
};
const baseMsgInstantiateContractResponse: object = { address: "" };
export const MsgInstantiateContractResponse = {
encode(message: MsgInstantiateContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.address);
if (message.address !== "") {
writer.uint32(10).string(message.address);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContractResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgInstantiateContractResponse) as MsgInstantiateContractResponse;
const message = { ...baseMsgInstantiateContractResponse } as MsgInstantiateContractResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -446,19 +468,9 @@ export const MsgInstantiateContractResponse = {
},
fromJSON(object: any): MsgInstantiateContractResponse {
const message = Object.create(baseMsgInstantiateContractResponse) as MsgInstantiateContractResponse;
if (object.address !== undefined && object.address !== null) {
message.address = String(object.address);
} else {
message.address = "";
}
return message;
},
fromPartial(object: DeepPartial<MsgInstantiateContractResponse>): MsgInstantiateContractResponse {
const message = { ...baseMsgInstantiateContractResponse } as MsgInstantiateContractResponse;
if (object.address !== undefined && object.address !== null) {
message.address = object.address;
message.address = String(object.address);
} else {
message.address = "";
}
@ -470,15 +482,31 @@ export const MsgInstantiateContractResponse = {
message.address !== undefined && (obj.address = message.address);
return obj;
},
fromPartial(object: DeepPartial<MsgInstantiateContractResponse>): MsgInstantiateContractResponse {
const message = { ...baseMsgInstantiateContractResponse } as MsgInstantiateContractResponse;
if (object.address !== undefined && object.address !== null) {
message.address = object.address;
} else {
message.address = "";
}
return message;
},
};
const baseMsgExecuteContract: object = { sender: "", contract: "" };
export const MsgExecuteContract = {
encode(message: MsgExecuteContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.sender);
writer.uint32(18).string(message.contract);
writer.uint32(26).bytes(message.msg);
if (message.sender !== "") {
writer.uint32(10).string(message.sender);
}
if (message.contract !== "") {
writer.uint32(18).string(message.contract);
}
if (message.msg.length !== 0) {
writer.uint32(26).bytes(message.msg);
}
for (const v of message.sentFunds) {
Coin.encode(v!, writer.uint32(42).fork()).ldelim();
}
@ -488,7 +516,7 @@ export const MsgExecuteContract = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecuteContract {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgExecuteContract) as MsgExecuteContract;
const message = { ...baseMsgExecuteContract } as MsgExecuteContract;
message.sentFunds = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -514,7 +542,7 @@ export const MsgExecuteContract = {
},
fromJSON(object: any): MsgExecuteContract {
const message = Object.create(baseMsgExecuteContract) as MsgExecuteContract;
const message = { ...baseMsgExecuteContract } as MsgExecuteContract;
message.sentFunds = [];
if (object.sender !== undefined && object.sender !== null) {
message.sender = String(object.sender);
@ -537,6 +565,20 @@ export const MsgExecuteContract = {
return message;
},
toJSON(message: MsgExecuteContract): unknown {
const obj: any = {};
message.sender !== undefined && (obj.sender = message.sender);
message.contract !== undefined && (obj.contract = message.contract);
message.msg !== undefined &&
(obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array()));
if (message.sentFunds) {
obj.sentFunds = message.sentFunds.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.sentFunds = [];
}
return obj;
},
fromPartial(object: DeepPartial<MsgExecuteContract>): MsgExecuteContract {
const message = { ...baseMsgExecuteContract } as MsgExecuteContract;
message.sentFunds = [];
@ -562,34 +604,22 @@ export const MsgExecuteContract = {
}
return message;
},
toJSON(message: MsgExecuteContract): unknown {
const obj: any = {};
message.sender !== undefined && (obj.sender = message.sender);
message.contract !== undefined && (obj.contract = message.contract);
message.msg !== undefined &&
(obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array()));
if (message.sentFunds) {
obj.sentFunds = message.sentFunds.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.sentFunds = [];
}
return obj;
},
};
const baseMsgExecuteContractResponse: object = {};
export const MsgExecuteContractResponse = {
encode(message: MsgExecuteContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.data);
if (message.data.length !== 0) {
writer.uint32(10).bytes(message.data);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecuteContractResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgExecuteContractResponse) as MsgExecuteContractResponse;
const message = { ...baseMsgExecuteContractResponse } as MsgExecuteContractResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -605,13 +635,20 @@ export const MsgExecuteContractResponse = {
},
fromJSON(object: any): MsgExecuteContractResponse {
const message = Object.create(baseMsgExecuteContractResponse) as MsgExecuteContractResponse;
const message = { ...baseMsgExecuteContractResponse } as MsgExecuteContractResponse;
if (object.data !== undefined && object.data !== null) {
message.data = bytesFromBase64(object.data);
}
return message;
},
toJSON(message: MsgExecuteContractResponse): unknown {
const obj: any = {};
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<MsgExecuteContractResponse>): MsgExecuteContractResponse {
const message = { ...baseMsgExecuteContractResponse } as MsgExecuteContractResponse;
if (object.data !== undefined && object.data !== null) {
@ -621,30 +658,31 @@ export const MsgExecuteContractResponse = {
}
return message;
},
toJSON(message: MsgExecuteContractResponse): unknown {
const obj: any = {};
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
return obj;
},
};
const baseMsgMigrateContract: object = { sender: "", contract: "", codeId: Long.UZERO };
export const MsgMigrateContract = {
encode(message: MsgMigrateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.sender);
writer.uint32(18).string(message.contract);
writer.uint32(24).uint64(message.codeId);
writer.uint32(34).bytes(message.migrateMsg);
if (message.sender !== "") {
writer.uint32(10).string(message.sender);
}
if (message.contract !== "") {
writer.uint32(18).string(message.contract);
}
if (!message.codeId.isZero()) {
writer.uint32(24).uint64(message.codeId);
}
if (message.migrateMsg.length !== 0) {
writer.uint32(34).bytes(message.migrateMsg);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgMigrateContract {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgMigrateContract) as MsgMigrateContract;
const message = { ...baseMsgMigrateContract } as MsgMigrateContract;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -669,7 +707,7 @@ export const MsgMigrateContract = {
},
fromJSON(object: any): MsgMigrateContract {
const message = Object.create(baseMsgMigrateContract) as MsgMigrateContract;
const message = { ...baseMsgMigrateContract } as MsgMigrateContract;
if (object.sender !== undefined && object.sender !== null) {
message.sender = String(object.sender);
} else {
@ -691,6 +729,18 @@ export const MsgMigrateContract = {
return message;
},
toJSON(message: MsgMigrateContract): unknown {
const obj: any = {};
message.sender !== undefined && (obj.sender = message.sender);
message.contract !== undefined && (obj.contract = message.contract);
message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString());
message.migrateMsg !== undefined &&
(obj.migrateMsg = base64FromBytes(
message.migrateMsg !== undefined ? message.migrateMsg : new Uint8Array(),
));
return obj;
},
fromPartial(object: DeepPartial<MsgMigrateContract>): MsgMigrateContract {
const message = { ...baseMsgMigrateContract } as MsgMigrateContract;
if (object.sender !== undefined && object.sender !== null) {
@ -715,32 +765,22 @@ export const MsgMigrateContract = {
}
return message;
},
toJSON(message: MsgMigrateContract): unknown {
const obj: any = {};
message.sender !== undefined && (obj.sender = message.sender);
message.contract !== undefined && (obj.contract = message.contract);
message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString());
message.migrateMsg !== undefined &&
(obj.migrateMsg = base64FromBytes(
message.migrateMsg !== undefined ? message.migrateMsg : new Uint8Array(),
));
return obj;
},
};
const baseMsgMigrateContractResponse: object = {};
export const MsgMigrateContractResponse = {
encode(message: MsgMigrateContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.data);
if (message.data.length !== 0) {
writer.uint32(10).bytes(message.data);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgMigrateContractResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgMigrateContractResponse) as MsgMigrateContractResponse;
const message = { ...baseMsgMigrateContractResponse } as MsgMigrateContractResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -756,13 +796,20 @@ export const MsgMigrateContractResponse = {
},
fromJSON(object: any): MsgMigrateContractResponse {
const message = Object.create(baseMsgMigrateContractResponse) as MsgMigrateContractResponse;
const message = { ...baseMsgMigrateContractResponse } as MsgMigrateContractResponse;
if (object.data !== undefined && object.data !== null) {
message.data = bytesFromBase64(object.data);
}
return message;
},
toJSON(message: MsgMigrateContractResponse): unknown {
const obj: any = {};
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<MsgMigrateContractResponse>): MsgMigrateContractResponse {
const message = { ...baseMsgMigrateContractResponse } as MsgMigrateContractResponse;
if (object.data !== undefined && object.data !== null) {
@ -772,29 +819,28 @@ export const MsgMigrateContractResponse = {
}
return message;
},
toJSON(message: MsgMigrateContractResponse): unknown {
const obj: any = {};
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
return obj;
},
};
const baseMsgUpdateAdmin: object = { sender: "", newAdmin: "", contract: "" };
export const MsgUpdateAdmin = {
encode(message: MsgUpdateAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.sender);
writer.uint32(18).string(message.newAdmin);
writer.uint32(26).string(message.contract);
if (message.sender !== "") {
writer.uint32(10).string(message.sender);
}
if (message.newAdmin !== "") {
writer.uint32(18).string(message.newAdmin);
}
if (message.contract !== "") {
writer.uint32(26).string(message.contract);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAdmin {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgUpdateAdmin) as MsgUpdateAdmin;
const message = { ...baseMsgUpdateAdmin } as MsgUpdateAdmin;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -816,7 +862,7 @@ export const MsgUpdateAdmin = {
},
fromJSON(object: any): MsgUpdateAdmin {
const message = Object.create(baseMsgUpdateAdmin) as MsgUpdateAdmin;
const message = { ...baseMsgUpdateAdmin } as MsgUpdateAdmin;
if (object.sender !== undefined && object.sender !== null) {
message.sender = String(object.sender);
} else {
@ -835,6 +881,14 @@ export const MsgUpdateAdmin = {
return message;
},
toJSON(message: MsgUpdateAdmin): unknown {
const obj: any = {};
message.sender !== undefined && (obj.sender = message.sender);
message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin);
message.contract !== undefined && (obj.contract = message.contract);
return obj;
},
fromPartial(object: DeepPartial<MsgUpdateAdmin>): MsgUpdateAdmin {
const message = { ...baseMsgUpdateAdmin } as MsgUpdateAdmin;
if (object.sender !== undefined && object.sender !== null) {
@ -854,14 +908,6 @@ export const MsgUpdateAdmin = {
}
return message;
},
toJSON(message: MsgUpdateAdmin): unknown {
const obj: any = {};
message.sender !== undefined && (obj.sender = message.sender);
message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin);
message.contract !== undefined && (obj.contract = message.contract);
return obj;
},
};
const baseMsgUpdateAdminResponse: object = {};
@ -874,7 +920,7 @@ export const MsgUpdateAdminResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAdminResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgUpdateAdminResponse) as MsgUpdateAdminResponse;
const message = { ...baseMsgUpdateAdminResponse } as MsgUpdateAdminResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -887,11 +933,6 @@ export const MsgUpdateAdminResponse = {
},
fromJSON(_: any): MsgUpdateAdminResponse {
const message = Object.create(baseMsgUpdateAdminResponse) as MsgUpdateAdminResponse;
return message;
},
fromPartial(_: DeepPartial<MsgUpdateAdminResponse>): MsgUpdateAdminResponse {
const message = { ...baseMsgUpdateAdminResponse } as MsgUpdateAdminResponse;
return message;
},
@ -900,21 +941,30 @@ export const MsgUpdateAdminResponse = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<MsgUpdateAdminResponse>): MsgUpdateAdminResponse {
const message = { ...baseMsgUpdateAdminResponse } as MsgUpdateAdminResponse;
return message;
},
};
const baseMsgClearAdmin: object = { sender: "", contract: "" };
export const MsgClearAdmin = {
encode(message: MsgClearAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.sender);
writer.uint32(26).string(message.contract);
if (message.sender !== "") {
writer.uint32(10).string(message.sender);
}
if (message.contract !== "") {
writer.uint32(26).string(message.contract);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgClearAdmin {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgClearAdmin) as MsgClearAdmin;
const message = { ...baseMsgClearAdmin } as MsgClearAdmin;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -933,7 +983,7 @@ export const MsgClearAdmin = {
},
fromJSON(object: any): MsgClearAdmin {
const message = Object.create(baseMsgClearAdmin) as MsgClearAdmin;
const message = { ...baseMsgClearAdmin } as MsgClearAdmin;
if (object.sender !== undefined && object.sender !== null) {
message.sender = String(object.sender);
} else {
@ -947,6 +997,13 @@ export const MsgClearAdmin = {
return message;
},
toJSON(message: MsgClearAdmin): unknown {
const obj: any = {};
message.sender !== undefined && (obj.sender = message.sender);
message.contract !== undefined && (obj.contract = message.contract);
return obj;
},
fromPartial(object: DeepPartial<MsgClearAdmin>): MsgClearAdmin {
const message = { ...baseMsgClearAdmin } as MsgClearAdmin;
if (object.sender !== undefined && object.sender !== null) {
@ -961,13 +1018,6 @@ export const MsgClearAdmin = {
}
return message;
},
toJSON(message: MsgClearAdmin): unknown {
const obj: any = {};
message.sender !== undefined && (obj.sender = message.sender);
message.contract !== undefined && (obj.contract = message.contract);
return obj;
},
};
const baseMsgClearAdminResponse: object = {};
@ -980,7 +1030,7 @@ export const MsgClearAdminResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgClearAdminResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgClearAdminResponse) as MsgClearAdminResponse;
const message = { ...baseMsgClearAdminResponse } as MsgClearAdminResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -993,11 +1043,6 @@ export const MsgClearAdminResponse = {
},
fromJSON(_: any): MsgClearAdminResponse {
const message = Object.create(baseMsgClearAdminResponse) as MsgClearAdminResponse;
return message;
},
fromPartial(_: DeepPartial<MsgClearAdminResponse>): MsgClearAdminResponse {
const message = { ...baseMsgClearAdminResponse } as MsgClearAdminResponse;
return message;
},
@ -1006,6 +1051,11 @@ export const MsgClearAdminResponse = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<MsgClearAdminResponse>): MsgClearAdminResponse {
const message = { ...baseMsgClearAdminResponse } as MsgClearAdminResponse;
return message;
},
};
/** Msg defines the wasm Msg service. */
@ -1077,7 +1127,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -181,14 +181,16 @@ const baseAccessTypeParam: object = { value: 0 };
export const AccessTypeParam = {
encode(message: AccessTypeParam, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int32(message.value);
if (message.value !== 0) {
writer.uint32(8).int32(message.value);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): AccessTypeParam {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseAccessTypeParam) as AccessTypeParam;
const message = { ...baseAccessTypeParam } as AccessTypeParam;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -204,19 +206,9 @@ export const AccessTypeParam = {
},
fromJSON(object: any): AccessTypeParam {
const message = Object.create(baseAccessTypeParam) as AccessTypeParam;
if (object.value !== undefined && object.value !== null) {
message.value = accessTypeFromJSON(object.value);
} else {
message.value = 0;
}
return message;
},
fromPartial(object: DeepPartial<AccessTypeParam>): AccessTypeParam {
const message = { ...baseAccessTypeParam } as AccessTypeParam;
if (object.value !== undefined && object.value !== null) {
message.value = object.value;
message.value = accessTypeFromJSON(object.value);
} else {
message.value = 0;
}
@ -228,21 +220,35 @@ export const AccessTypeParam = {
message.value !== undefined && (obj.value = accessTypeToJSON(message.value));
return obj;
},
fromPartial(object: DeepPartial<AccessTypeParam>): AccessTypeParam {
const message = { ...baseAccessTypeParam } as AccessTypeParam;
if (object.value !== undefined && object.value !== null) {
message.value = object.value;
} else {
message.value = 0;
}
return message;
},
};
const baseAccessConfig: object = { permission: 0, address: "" };
export const AccessConfig = {
encode(message: AccessConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int32(message.permission);
writer.uint32(18).string(message.address);
if (message.permission !== 0) {
writer.uint32(8).int32(message.permission);
}
if (message.address !== "") {
writer.uint32(18).string(message.address);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): AccessConfig {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseAccessConfig) as AccessConfig;
const message = { ...baseAccessConfig } as AccessConfig;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -261,7 +267,7 @@ export const AccessConfig = {
},
fromJSON(object: any): AccessConfig {
const message = Object.create(baseAccessConfig) as AccessConfig;
const message = { ...baseAccessConfig } as AccessConfig;
if (object.permission !== undefined && object.permission !== null) {
message.permission = accessTypeFromJSON(object.permission);
} else {
@ -275,6 +281,13 @@ export const AccessConfig = {
return message;
},
toJSON(message: AccessConfig): unknown {
const obj: any = {};
message.permission !== undefined && (obj.permission = accessTypeToJSON(message.permission));
message.address !== undefined && (obj.address = message.address);
return obj;
},
fromPartial(object: DeepPartial<AccessConfig>): AccessConfig {
const message = { ...baseAccessConfig } as AccessConfig;
if (object.permission !== undefined && object.permission !== null) {
@ -289,13 +302,6 @@ export const AccessConfig = {
}
return message;
},
toJSON(message: AccessConfig): unknown {
const obj: any = {};
message.permission !== undefined && (obj.permission = accessTypeToJSON(message.permission));
message.address !== undefined && (obj.address = message.address);
return obj;
},
};
const baseParams: object = { instantiateDefaultPermission: 0, maxWasmCodeSize: Long.UZERO };
@ -305,15 +311,19 @@ export const Params = {
if (message.codeUploadAccess !== undefined) {
AccessConfig.encode(message.codeUploadAccess, writer.uint32(10).fork()).ldelim();
}
writer.uint32(16).int32(message.instantiateDefaultPermission);
writer.uint32(24).uint64(message.maxWasmCodeSize);
if (message.instantiateDefaultPermission !== 0) {
writer.uint32(16).int32(message.instantiateDefaultPermission);
}
if (!message.maxWasmCodeSize.isZero()) {
writer.uint32(24).uint64(message.maxWasmCodeSize);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Params {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseParams) as Params;
const message = { ...baseParams } as Params;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -335,7 +345,7 @@ export const Params = {
},
fromJSON(object: any): Params {
const message = Object.create(baseParams) as Params;
const message = { ...baseParams } as Params;
if (object.codeUploadAccess !== undefined && object.codeUploadAccess !== null) {
message.codeUploadAccess = AccessConfig.fromJSON(object.codeUploadAccess);
} else {
@ -354,6 +364,19 @@ export const Params = {
return message;
},
toJSON(message: Params): unknown {
const obj: any = {};
message.codeUploadAccess !== undefined &&
(obj.codeUploadAccess = message.codeUploadAccess
? AccessConfig.toJSON(message.codeUploadAccess)
: undefined);
message.instantiateDefaultPermission !== undefined &&
(obj.instantiateDefaultPermission = accessTypeToJSON(message.instantiateDefaultPermission));
message.maxWasmCodeSize !== undefined &&
(obj.maxWasmCodeSize = (message.maxWasmCodeSize || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<Params>): Params {
const message = { ...baseParams } as Params;
if (object.codeUploadAccess !== undefined && object.codeUploadAccess !== null) {
@ -373,29 +396,24 @@ export const Params = {
}
return message;
},
toJSON(message: Params): unknown {
const obj: any = {};
message.codeUploadAccess !== undefined &&
(obj.codeUploadAccess = message.codeUploadAccess
? AccessConfig.toJSON(message.codeUploadAccess)
: undefined);
message.instantiateDefaultPermission !== undefined &&
(obj.instantiateDefaultPermission = accessTypeToJSON(message.instantiateDefaultPermission));
message.maxWasmCodeSize !== undefined &&
(obj.maxWasmCodeSize = (message.maxWasmCodeSize || Long.UZERO).toString());
return obj;
},
};
const baseCodeInfo: object = { creator: "", source: "", builder: "" };
export const CodeInfo = {
encode(message: CodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.codeHash);
writer.uint32(18).string(message.creator);
writer.uint32(26).string(message.source);
writer.uint32(34).string(message.builder);
if (message.codeHash.length !== 0) {
writer.uint32(10).bytes(message.codeHash);
}
if (message.creator !== "") {
writer.uint32(18).string(message.creator);
}
if (message.source !== "") {
writer.uint32(26).string(message.source);
}
if (message.builder !== "") {
writer.uint32(34).string(message.builder);
}
if (message.instantiateConfig !== undefined) {
AccessConfig.encode(message.instantiateConfig, writer.uint32(42).fork()).ldelim();
}
@ -405,7 +423,7 @@ export const CodeInfo = {
decode(input: _m0.Reader | Uint8Array, length?: number): CodeInfo {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCodeInfo) as CodeInfo;
const message = { ...baseCodeInfo } as CodeInfo;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -433,7 +451,7 @@ export const CodeInfo = {
},
fromJSON(object: any): CodeInfo {
const message = Object.create(baseCodeInfo) as CodeInfo;
const message = { ...baseCodeInfo } as CodeInfo;
if (object.codeHash !== undefined && object.codeHash !== null) {
message.codeHash = bytesFromBase64(object.codeHash);
}
@ -460,6 +478,20 @@ export const CodeInfo = {
return message;
},
toJSON(message: CodeInfo): unknown {
const obj: any = {};
message.codeHash !== undefined &&
(obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array()));
message.creator !== undefined && (obj.creator = message.creator);
message.source !== undefined && (obj.source = message.source);
message.builder !== undefined && (obj.builder = message.builder);
message.instantiateConfig !== undefined &&
(obj.instantiateConfig = message.instantiateConfig
? AccessConfig.toJSON(message.instantiateConfig)
: undefined);
return obj;
},
fromPartial(object: DeepPartial<CodeInfo>): CodeInfo {
const message = { ...baseCodeInfo } as CodeInfo;
if (object.codeHash !== undefined && object.codeHash !== null) {
@ -489,30 +521,24 @@ export const CodeInfo = {
}
return message;
},
toJSON(message: CodeInfo): unknown {
const obj: any = {};
message.codeHash !== undefined &&
(obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array()));
message.creator !== undefined && (obj.creator = message.creator);
message.source !== undefined && (obj.source = message.source);
message.builder !== undefined && (obj.builder = message.builder);
message.instantiateConfig !== undefined &&
(obj.instantiateConfig = message.instantiateConfig
? AccessConfig.toJSON(message.instantiateConfig)
: undefined);
return obj;
},
};
const baseContractInfo: object = { codeId: Long.UZERO, creator: "", admin: "", label: "" };
export const ContractInfo = {
encode(message: ContractInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint64(message.codeId);
writer.uint32(18).string(message.creator);
writer.uint32(26).string(message.admin);
writer.uint32(34).string(message.label);
if (!message.codeId.isZero()) {
writer.uint32(8).uint64(message.codeId);
}
if (message.creator !== "") {
writer.uint32(18).string(message.creator);
}
if (message.admin !== "") {
writer.uint32(26).string(message.admin);
}
if (message.label !== "") {
writer.uint32(34).string(message.label);
}
if (message.created !== undefined) {
AbsoluteTxPosition.encode(message.created, writer.uint32(42).fork()).ldelim();
}
@ -522,7 +548,7 @@ export const ContractInfo = {
decode(input: _m0.Reader | Uint8Array, length?: number): ContractInfo {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseContractInfo) as ContractInfo;
const message = { ...baseContractInfo } as ContractInfo;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -550,7 +576,7 @@ export const ContractInfo = {
},
fromJSON(object: any): ContractInfo {
const message = Object.create(baseContractInfo) as ContractInfo;
const message = { ...baseContractInfo } as ContractInfo;
if (object.codeId !== undefined && object.codeId !== null) {
message.codeId = Long.fromString(object.codeId);
} else {
@ -579,6 +605,17 @@ export const ContractInfo = {
return message;
},
toJSON(message: ContractInfo): unknown {
const obj: any = {};
message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString());
message.creator !== undefined && (obj.creator = message.creator);
message.admin !== undefined && (obj.admin = message.admin);
message.label !== undefined && (obj.label = message.label);
message.created !== undefined &&
(obj.created = message.created ? AbsoluteTxPosition.toJSON(message.created) : undefined);
return obj;
},
fromPartial(object: DeepPartial<ContractInfo>): ContractInfo {
const message = { ...baseContractInfo } as ContractInfo;
if (object.codeId !== undefined && object.codeId !== null) {
@ -608,36 +645,31 @@ export const ContractInfo = {
}
return message;
},
toJSON(message: ContractInfo): unknown {
const obj: any = {};
message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString());
message.creator !== undefined && (obj.creator = message.creator);
message.admin !== undefined && (obj.admin = message.admin);
message.label !== undefined && (obj.label = message.label);
message.created !== undefined &&
(obj.created = message.created ? AbsoluteTxPosition.toJSON(message.created) : undefined);
return obj;
},
};
const baseContractCodeHistoryEntry: object = { operation: 0, codeId: Long.UZERO };
export const ContractCodeHistoryEntry = {
encode(message: ContractCodeHistoryEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int32(message.operation);
writer.uint32(16).uint64(message.codeId);
if (message.operation !== 0) {
writer.uint32(8).int32(message.operation);
}
if (!message.codeId.isZero()) {
writer.uint32(16).uint64(message.codeId);
}
if (message.updated !== undefined) {
AbsoluteTxPosition.encode(message.updated, writer.uint32(26).fork()).ldelim();
}
writer.uint32(34).bytes(message.msg);
if (message.msg.length !== 0) {
writer.uint32(34).bytes(message.msg);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): ContractCodeHistoryEntry {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseContractCodeHistoryEntry) as ContractCodeHistoryEntry;
const message = { ...baseContractCodeHistoryEntry } as ContractCodeHistoryEntry;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -662,7 +694,7 @@ export const ContractCodeHistoryEntry = {
},
fromJSON(object: any): ContractCodeHistoryEntry {
const message = Object.create(baseContractCodeHistoryEntry) as ContractCodeHistoryEntry;
const message = { ...baseContractCodeHistoryEntry } as ContractCodeHistoryEntry;
if (object.operation !== undefined && object.operation !== null) {
message.operation = contractCodeHistoryOperationTypeFromJSON(object.operation);
} else {
@ -684,6 +716,18 @@ export const ContractCodeHistoryEntry = {
return message;
},
toJSON(message: ContractCodeHistoryEntry): unknown {
const obj: any = {};
message.operation !== undefined &&
(obj.operation = contractCodeHistoryOperationTypeToJSON(message.operation));
message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString());
message.updated !== undefined &&
(obj.updated = message.updated ? AbsoluteTxPosition.toJSON(message.updated) : undefined);
message.msg !== undefined &&
(obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<ContractCodeHistoryEntry>): ContractCodeHistoryEntry {
const message = { ...baseContractCodeHistoryEntry } as ContractCodeHistoryEntry;
if (object.operation !== undefined && object.operation !== null) {
@ -708,33 +752,25 @@ export const ContractCodeHistoryEntry = {
}
return message;
},
toJSON(message: ContractCodeHistoryEntry): unknown {
const obj: any = {};
message.operation !== undefined &&
(obj.operation = contractCodeHistoryOperationTypeToJSON(message.operation));
message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString());
message.updated !== undefined &&
(obj.updated = message.updated ? AbsoluteTxPosition.toJSON(message.updated) : undefined);
message.msg !== undefined &&
(obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array()));
return obj;
},
};
const baseAbsoluteTxPosition: object = { blockHeight: Long.UZERO, txIndex: Long.UZERO };
export const AbsoluteTxPosition = {
encode(message: AbsoluteTxPosition, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint64(message.blockHeight);
writer.uint32(16).uint64(message.txIndex);
if (!message.blockHeight.isZero()) {
writer.uint32(8).uint64(message.blockHeight);
}
if (!message.txIndex.isZero()) {
writer.uint32(16).uint64(message.txIndex);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): AbsoluteTxPosition {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseAbsoluteTxPosition) as AbsoluteTxPosition;
const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -753,7 +789,7 @@ export const AbsoluteTxPosition = {
},
fromJSON(object: any): AbsoluteTxPosition {
const message = Object.create(baseAbsoluteTxPosition) as AbsoluteTxPosition;
const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition;
if (object.blockHeight !== undefined && object.blockHeight !== null) {
message.blockHeight = Long.fromString(object.blockHeight);
} else {
@ -767,6 +803,13 @@ export const AbsoluteTxPosition = {
return message;
},
toJSON(message: AbsoluteTxPosition): unknown {
const obj: any = {};
message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.UZERO).toString());
message.txIndex !== undefined && (obj.txIndex = (message.txIndex || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<AbsoluteTxPosition>): AbsoluteTxPosition {
const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition;
if (object.blockHeight !== undefined && object.blockHeight !== null) {
@ -781,28 +824,25 @@ export const AbsoluteTxPosition = {
}
return message;
},
toJSON(message: AbsoluteTxPosition): unknown {
const obj: any = {};
message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.UZERO).toString());
message.txIndex !== undefined && (obj.txIndex = (message.txIndex || Long.UZERO).toString());
return obj;
},
};
const baseModel: object = {};
export const Model = {
encode(message: Model, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.key);
writer.uint32(18).bytes(message.value);
if (message.key.length !== 0) {
writer.uint32(10).bytes(message.key);
}
if (message.value.length !== 0) {
writer.uint32(18).bytes(message.value);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Model {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseModel) as Model;
const message = { ...baseModel } as Model;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -821,7 +861,7 @@ export const Model = {
},
fromJSON(object: any): Model {
const message = Object.create(baseModel) as Model;
const message = { ...baseModel } as Model;
if (object.key !== undefined && object.key !== null) {
message.key = bytesFromBase64(object.key);
}
@ -831,6 +871,15 @@ export const Model = {
return message;
},
toJSON(message: Model): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.value !== undefined &&
(obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<Model>): Model {
const message = { ...baseModel } as Model;
if (object.key !== undefined && object.key !== null) {
@ -845,15 +894,6 @@ export const Model = {
}
return message;
},
toJSON(message: Model): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.value !== undefined &&
(obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
return obj;
},
};
declare var self: any | undefined;
@ -863,7 +903,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -83,14 +83,16 @@ export const Params = {
for (const v of message.sendEnabled) {
SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim();
}
writer.uint32(16).bool(message.defaultSendEnabled);
if (message.defaultSendEnabled === true) {
writer.uint32(16).bool(message.defaultSendEnabled);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Params {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseParams) as Params;
const message = { ...baseParams } as Params;
message.sendEnabled = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -110,7 +112,7 @@ export const Params = {
},
fromJSON(object: any): Params {
const message = Object.create(baseParams) as Params;
const message = { ...baseParams } as Params;
message.sendEnabled = [];
if (object.sendEnabled !== undefined && object.sendEnabled !== null) {
for (const e of object.sendEnabled) {
@ -125,6 +127,17 @@ export const Params = {
return message;
},
toJSON(message: Params): unknown {
const obj: any = {};
if (message.sendEnabled) {
obj.sendEnabled = message.sendEnabled.map((e) => (e ? SendEnabled.toJSON(e) : undefined));
} else {
obj.sendEnabled = [];
}
message.defaultSendEnabled !== undefined && (obj.defaultSendEnabled = message.defaultSendEnabled);
return obj;
},
fromPartial(object: DeepPartial<Params>): Params {
const message = { ...baseParams } as Params;
message.sendEnabled = [];
@ -140,32 +153,25 @@ export const Params = {
}
return message;
},
toJSON(message: Params): unknown {
const obj: any = {};
if (message.sendEnabled) {
obj.sendEnabled = message.sendEnabled.map((e) => (e ? SendEnabled.toJSON(e) : undefined));
} else {
obj.sendEnabled = [];
}
message.defaultSendEnabled !== undefined && (obj.defaultSendEnabled = message.defaultSendEnabled);
return obj;
},
};
const baseSendEnabled: object = { denom: "", enabled: false };
export const SendEnabled = {
encode(message: SendEnabled, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.denom);
writer.uint32(16).bool(message.enabled);
if (message.denom !== "") {
writer.uint32(10).string(message.denom);
}
if (message.enabled === true) {
writer.uint32(16).bool(message.enabled);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): SendEnabled {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSendEnabled) as SendEnabled;
const message = { ...baseSendEnabled } as SendEnabled;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -184,7 +190,7 @@ export const SendEnabled = {
},
fromJSON(object: any): SendEnabled {
const message = Object.create(baseSendEnabled) as SendEnabled;
const message = { ...baseSendEnabled } as SendEnabled;
if (object.denom !== undefined && object.denom !== null) {
message.denom = String(object.denom);
} else {
@ -198,6 +204,13 @@ export const SendEnabled = {
return message;
},
toJSON(message: SendEnabled): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.enabled !== undefined && (obj.enabled = message.enabled);
return obj;
},
fromPartial(object: DeepPartial<SendEnabled>): SendEnabled {
const message = { ...baseSendEnabled } as SendEnabled;
if (object.denom !== undefined && object.denom !== null) {
@ -212,20 +225,15 @@ export const SendEnabled = {
}
return message;
},
toJSON(message: SendEnabled): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.enabled !== undefined && (obj.enabled = message.enabled);
return obj;
},
};
const baseInput: object = { address: "" };
export const Input = {
encode(message: Input, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.address);
if (message.address !== "") {
writer.uint32(10).string(message.address);
}
for (const v of message.coins) {
Coin.encode(v!, writer.uint32(18).fork()).ldelim();
}
@ -235,7 +243,7 @@ export const Input = {
decode(input: _m0.Reader | Uint8Array, length?: number): Input {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseInput) as Input;
const message = { ...baseInput } as Input;
message.coins = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -255,7 +263,7 @@ export const Input = {
},
fromJSON(object: any): Input {
const message = Object.create(baseInput) as Input;
const message = { ...baseInput } as Input;
message.coins = [];
if (object.address !== undefined && object.address !== null) {
message.address = String(object.address);
@ -270,6 +278,17 @@ export const Input = {
return message;
},
toJSON(message: Input): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
if (message.coins) {
obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.coins = [];
}
return obj;
},
fromPartial(object: DeepPartial<Input>): Input {
const message = { ...baseInput } as Input;
message.coins = [];
@ -285,24 +304,15 @@ export const Input = {
}
return message;
},
toJSON(message: Input): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
if (message.coins) {
obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.coins = [];
}
return obj;
},
};
const baseOutput: object = { address: "" };
export const Output = {
encode(message: Output, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.address);
if (message.address !== "") {
writer.uint32(10).string(message.address);
}
for (const v of message.coins) {
Coin.encode(v!, writer.uint32(18).fork()).ldelim();
}
@ -312,7 +322,7 @@ export const Output = {
decode(input: _m0.Reader | Uint8Array, length?: number): Output {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseOutput) as Output;
const message = { ...baseOutput } as Output;
message.coins = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -332,7 +342,7 @@ export const Output = {
},
fromJSON(object: any): Output {
const message = Object.create(baseOutput) as Output;
const message = { ...baseOutput } as Output;
message.coins = [];
if (object.address !== undefined && object.address !== null) {
message.address = String(object.address);
@ -347,6 +357,17 @@ export const Output = {
return message;
},
toJSON(message: Output): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
if (message.coins) {
obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.coins = [];
}
return obj;
},
fromPartial(object: DeepPartial<Output>): Output {
const message = { ...baseOutput } as Output;
message.coins = [];
@ -362,17 +383,6 @@ export const Output = {
}
return message;
},
toJSON(message: Output): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
if (message.coins) {
obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.coins = [];
}
return obj;
},
};
const baseSupply: object = {};
@ -388,7 +398,7 @@ export const Supply = {
decode(input: _m0.Reader | Uint8Array, length?: number): Supply {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSupply) as Supply;
const message = { ...baseSupply } as Supply;
message.total = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -405,22 +415,11 @@ export const Supply = {
},
fromJSON(object: any): Supply {
const message = Object.create(baseSupply) as Supply;
message.total = [];
if (object.total !== undefined && object.total !== null) {
for (const e of object.total) {
message.total.push(Coin.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<Supply>): Supply {
const message = { ...baseSupply } as Supply;
message.total = [];
if (object.total !== undefined && object.total !== null) {
for (const e of object.total) {
message.total.push(Coin.fromPartial(e));
message.total.push(Coin.fromJSON(e));
}
}
return message;
@ -435,14 +434,29 @@ export const Supply = {
}
return obj;
},
fromPartial(object: DeepPartial<Supply>): Supply {
const message = { ...baseSupply } as Supply;
message.total = [];
if (object.total !== undefined && object.total !== null) {
for (const e of object.total) {
message.total.push(Coin.fromPartial(e));
}
}
return message;
},
};
const baseDenomUnit: object = { denom: "", exponent: 0, aliases: "" };
export const DenomUnit = {
encode(message: DenomUnit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.denom);
writer.uint32(16).uint32(message.exponent);
if (message.denom !== "") {
writer.uint32(10).string(message.denom);
}
if (message.exponent !== 0) {
writer.uint32(16).uint32(message.exponent);
}
for (const v of message.aliases) {
writer.uint32(26).string(v!);
}
@ -452,7 +466,7 @@ export const DenomUnit = {
decode(input: _m0.Reader | Uint8Array, length?: number): DenomUnit {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseDenomUnit) as DenomUnit;
const message = { ...baseDenomUnit } as DenomUnit;
message.aliases = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -475,7 +489,7 @@ export const DenomUnit = {
},
fromJSON(object: any): DenomUnit {
const message = Object.create(baseDenomUnit) as DenomUnit;
const message = { ...baseDenomUnit } as DenomUnit;
message.aliases = [];
if (object.denom !== undefined && object.denom !== null) {
message.denom = String(object.denom);
@ -495,6 +509,18 @@ export const DenomUnit = {
return message;
},
toJSON(message: DenomUnit): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.exponent !== undefined && (obj.exponent = message.exponent);
if (message.aliases) {
obj.aliases = message.aliases.map((e) => e);
} else {
obj.aliases = [];
}
return obj;
},
fromPartial(object: DeepPartial<DenomUnit>): DenomUnit {
const message = { ...baseDenomUnit } as DenomUnit;
message.aliases = [];
@ -515,37 +541,31 @@ export const DenomUnit = {
}
return message;
},
toJSON(message: DenomUnit): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.exponent !== undefined && (obj.exponent = message.exponent);
if (message.aliases) {
obj.aliases = message.aliases.map((e) => e);
} else {
obj.aliases = [];
}
return obj;
},
};
const baseMetadata: object = { description: "", base: "", display: "" };
export const Metadata = {
encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.description);
if (message.description !== "") {
writer.uint32(10).string(message.description);
}
for (const v of message.denomUnits) {
DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim();
}
writer.uint32(26).string(message.base);
writer.uint32(34).string(message.display);
if (message.base !== "") {
writer.uint32(26).string(message.base);
}
if (message.display !== "") {
writer.uint32(34).string(message.display);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Metadata {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMetadata) as Metadata;
const message = { ...baseMetadata } as Metadata;
message.denomUnits = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -571,7 +591,7 @@ export const Metadata = {
},
fromJSON(object: any): Metadata {
const message = Object.create(baseMetadata) as Metadata;
const message = { ...baseMetadata } as Metadata;
message.denomUnits = [];
if (object.description !== undefined && object.description !== null) {
message.description = String(object.description);
@ -596,6 +616,19 @@ export const Metadata = {
return message;
},
toJSON(message: Metadata): unknown {
const obj: any = {};
message.description !== undefined && (obj.description = message.description);
if (message.denomUnits) {
obj.denomUnits = message.denomUnits.map((e) => (e ? DenomUnit.toJSON(e) : undefined));
} else {
obj.denomUnits = [];
}
message.base !== undefined && (obj.base = message.base);
message.display !== undefined && (obj.display = message.display);
return obj;
},
fromPartial(object: DeepPartial<Metadata>): Metadata {
const message = { ...baseMetadata } as Metadata;
message.denomUnits = [];
@ -621,19 +654,6 @@ export const Metadata = {
}
return message;
},
toJSON(message: Metadata): unknown {
const obj: any = {};
message.description !== undefined && (obj.description = message.description);
if (message.denomUnits) {
obj.denomUnits = message.denomUnits.map((e) => (e ? DenomUnit.toJSON(e) : undefined));
} else {
obj.denomUnits = [];
}
message.base !== undefined && (obj.base = message.base);
message.display !== undefined && (obj.display = message.display);
return obj;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;

View File

@ -29,8 +29,12 @@ const baseMsgSend: object = { fromAddress: "", toAddress: "" };
export const MsgSend = {
encode(message: MsgSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.fromAddress);
writer.uint32(18).string(message.toAddress);
if (message.fromAddress !== "") {
writer.uint32(10).string(message.fromAddress);
}
if (message.toAddress !== "") {
writer.uint32(18).string(message.toAddress);
}
for (const v of message.amount) {
Coin.encode(v!, writer.uint32(26).fork()).ldelim();
}
@ -40,7 +44,7 @@ export const MsgSend = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgSend) as MsgSend;
const message = { ...baseMsgSend } as MsgSend;
message.amount = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -63,7 +67,7 @@ export const MsgSend = {
},
fromJSON(object: any): MsgSend {
const message = Object.create(baseMsgSend) as MsgSend;
const message = { ...baseMsgSend } as MsgSend;
message.amount = [];
if (object.fromAddress !== undefined && object.fromAddress !== null) {
message.fromAddress = String(object.fromAddress);
@ -83,6 +87,18 @@ export const MsgSend = {
return message;
},
toJSON(message: MsgSend): unknown {
const obj: any = {};
message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress);
message.toAddress !== undefined && (obj.toAddress = message.toAddress);
if (message.amount) {
obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.amount = [];
}
return obj;
},
fromPartial(object: DeepPartial<MsgSend>): MsgSend {
const message = { ...baseMsgSend } as MsgSend;
message.amount = [];
@ -103,18 +119,6 @@ export const MsgSend = {
}
return message;
},
toJSON(message: MsgSend): unknown {
const obj: any = {};
message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress);
message.toAddress !== undefined && (obj.toAddress = message.toAddress);
if (message.amount) {
obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.amount = [];
}
return obj;
},
};
const baseMsgSendResponse: object = {};
@ -127,7 +131,7 @@ export const MsgSendResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgSendResponse) as MsgSendResponse;
const message = { ...baseMsgSendResponse } as MsgSendResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -140,11 +144,6 @@ export const MsgSendResponse = {
},
fromJSON(_: any): MsgSendResponse {
const message = Object.create(baseMsgSendResponse) as MsgSendResponse;
return message;
},
fromPartial(_: DeepPartial<MsgSendResponse>): MsgSendResponse {
const message = { ...baseMsgSendResponse } as MsgSendResponse;
return message;
},
@ -153,6 +152,11 @@ export const MsgSendResponse = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<MsgSendResponse>): MsgSendResponse {
const message = { ...baseMsgSendResponse } as MsgSendResponse;
return message;
},
};
const baseMsgMultiSend: object = {};
@ -171,7 +175,7 @@ export const MsgMultiSend = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiSend {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgMultiSend) as MsgMultiSend;
const message = { ...baseMsgMultiSend } as MsgMultiSend;
message.inputs = [];
message.outputs = [];
while (reader.pos < end) {
@ -192,7 +196,7 @@ export const MsgMultiSend = {
},
fromJSON(object: any): MsgMultiSend {
const message = Object.create(baseMsgMultiSend) as MsgMultiSend;
const message = { ...baseMsgMultiSend } as MsgMultiSend;
message.inputs = [];
message.outputs = [];
if (object.inputs !== undefined && object.inputs !== null) {
@ -208,23 +212,6 @@ export const MsgMultiSend = {
return message;
},
fromPartial(object: DeepPartial<MsgMultiSend>): MsgMultiSend {
const message = { ...baseMsgMultiSend } as MsgMultiSend;
message.inputs = [];
message.outputs = [];
if (object.inputs !== undefined && object.inputs !== null) {
for (const e of object.inputs) {
message.inputs.push(Input.fromPartial(e));
}
}
if (object.outputs !== undefined && object.outputs !== null) {
for (const e of object.outputs) {
message.outputs.push(Output.fromPartial(e));
}
}
return message;
},
toJSON(message: MsgMultiSend): unknown {
const obj: any = {};
if (message.inputs) {
@ -239,6 +226,23 @@ export const MsgMultiSend = {
}
return obj;
},
fromPartial(object: DeepPartial<MsgMultiSend>): MsgMultiSend {
const message = { ...baseMsgMultiSend } as MsgMultiSend;
message.inputs = [];
message.outputs = [];
if (object.inputs !== undefined && object.inputs !== null) {
for (const e of object.inputs) {
message.inputs.push(Input.fromPartial(e));
}
}
if (object.outputs !== undefined && object.outputs !== null) {
for (const e of object.outputs) {
message.outputs.push(Output.fromPartial(e));
}
}
return message;
},
};
const baseMsgMultiSendResponse: object = {};
@ -251,7 +255,7 @@ export const MsgMultiSendResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiSendResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgMultiSendResponse) as MsgMultiSendResponse;
const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -264,11 +268,6 @@ export const MsgMultiSendResponse = {
},
fromJSON(_: any): MsgMultiSendResponse {
const message = Object.create(baseMsgMultiSendResponse) as MsgMultiSendResponse;
return message;
},
fromPartial(_: DeepPartial<MsgMultiSendResponse>): MsgMultiSendResponse {
const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse;
return message;
},
@ -277,6 +276,11 @@ export const MsgMultiSendResponse = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<MsgMultiSendResponse>): MsgMultiSendResponse {
const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse;
return message;
},
};
/** Msg defines the bank Msg service. */

View File

@ -40,15 +40,19 @@ const baseCoin: object = { denom: "", amount: "" };
export const Coin = {
encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.denom);
writer.uint32(18).string(message.amount);
if (message.denom !== "") {
writer.uint32(10).string(message.denom);
}
if (message.amount !== "") {
writer.uint32(18).string(message.amount);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Coin {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCoin) as Coin;
const message = { ...baseCoin } as Coin;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -67,7 +71,7 @@ export const Coin = {
},
fromJSON(object: any): Coin {
const message = Object.create(baseCoin) as Coin;
const message = { ...baseCoin } as Coin;
if (object.denom !== undefined && object.denom !== null) {
message.denom = String(object.denom);
} else {
@ -81,6 +85,13 @@ export const Coin = {
return message;
},
toJSON(message: Coin): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.amount !== undefined && (obj.amount = message.amount);
return obj;
},
fromPartial(object: DeepPartial<Coin>): Coin {
const message = { ...baseCoin } as Coin;
if (object.denom !== undefined && object.denom !== null) {
@ -95,28 +106,25 @@ export const Coin = {
}
return message;
},
toJSON(message: Coin): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.amount !== undefined && (obj.amount = message.amount);
return obj;
},
};
const baseDecCoin: object = { denom: "", amount: "" };
export const DecCoin = {
encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.denom);
writer.uint32(18).string(message.amount);
if (message.denom !== "") {
writer.uint32(10).string(message.denom);
}
if (message.amount !== "") {
writer.uint32(18).string(message.amount);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): DecCoin {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseDecCoin) as DecCoin;
const message = { ...baseDecCoin } as DecCoin;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -135,7 +143,7 @@ export const DecCoin = {
},
fromJSON(object: any): DecCoin {
const message = Object.create(baseDecCoin) as DecCoin;
const message = { ...baseDecCoin } as DecCoin;
if (object.denom !== undefined && object.denom !== null) {
message.denom = String(object.denom);
} else {
@ -149,6 +157,13 @@ export const DecCoin = {
return message;
},
toJSON(message: DecCoin): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.amount !== undefined && (obj.amount = message.amount);
return obj;
},
fromPartial(object: DeepPartial<DecCoin>): DecCoin {
const message = { ...baseDecCoin } as DecCoin;
if (object.denom !== undefined && object.denom !== null) {
@ -163,27 +178,22 @@ export const DecCoin = {
}
return message;
},
toJSON(message: DecCoin): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.amount !== undefined && (obj.amount = message.amount);
return obj;
},
};
const baseIntProto: object = { int: "" };
export const IntProto = {
encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.int);
if (message.int !== "") {
writer.uint32(10).string(message.int);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): IntProto {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseIntProto) as IntProto;
const message = { ...baseIntProto } as IntProto;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -199,19 +209,9 @@ export const IntProto = {
},
fromJSON(object: any): IntProto {
const message = Object.create(baseIntProto) as IntProto;
if (object.int !== undefined && object.int !== null) {
message.int = String(object.int);
} else {
message.int = "";
}
return message;
},
fromPartial(object: DeepPartial<IntProto>): IntProto {
const message = { ...baseIntProto } as IntProto;
if (object.int !== undefined && object.int !== null) {
message.int = object.int;
message.int = String(object.int);
} else {
message.int = "";
}
@ -223,20 +223,32 @@ export const IntProto = {
message.int !== undefined && (obj.int = message.int);
return obj;
},
fromPartial(object: DeepPartial<IntProto>): IntProto {
const message = { ...baseIntProto } as IntProto;
if (object.int !== undefined && object.int !== null) {
message.int = object.int;
} else {
message.int = "";
}
return message;
},
};
const baseDecProto: object = { dec: "" };
export const DecProto = {
encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.dec);
if (message.dec !== "") {
writer.uint32(10).string(message.dec);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): DecProto {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseDecProto) as DecProto;
const message = { ...baseDecProto } as DecProto;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -252,19 +264,9 @@ export const DecProto = {
},
fromJSON(object: any): DecProto {
const message = Object.create(baseDecProto) as DecProto;
if (object.dec !== undefined && object.dec !== null) {
message.dec = String(object.dec);
} else {
message.dec = "";
}
return message;
},
fromPartial(object: DeepPartial<DecProto>): DecProto {
const message = { ...baseDecProto } as DecProto;
if (object.dec !== undefined && object.dec !== null) {
message.dec = object.dec;
message.dec = String(object.dec);
} else {
message.dec = "";
}
@ -276,6 +278,16 @@ export const DecProto = {
message.dec !== undefined && (obj.dec = message.dec);
return obj;
},
fromPartial(object: DeepPartial<DecProto>): DecProto {
const message = { ...baseDecProto } as DecProto;
if (object.dec !== undefined && object.dec !== null) {
message.dec = object.dec;
} else {
message.dec = "";
}
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;

View File

@ -37,7 +37,7 @@ export const MultiSignature = {
decode(input: _m0.Reader | Uint8Array, length?: number): MultiSignature {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMultiSignature) as MultiSignature;
const message = { ...baseMultiSignature } as MultiSignature;
message.signatures = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -54,22 +54,11 @@ export const MultiSignature = {
},
fromJSON(object: any): MultiSignature {
const message = Object.create(baseMultiSignature) as MultiSignature;
message.signatures = [];
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(bytesFromBase64(e));
}
}
return message;
},
fromPartial(object: DeepPartial<MultiSignature>): MultiSignature {
const message = { ...baseMultiSignature } as MultiSignature;
message.signatures = [];
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(e);
message.signatures.push(bytesFromBase64(e));
}
}
return message;
@ -84,21 +73,36 @@ export const MultiSignature = {
}
return obj;
},
fromPartial(object: DeepPartial<MultiSignature>): MultiSignature {
const message = { ...baseMultiSignature } as MultiSignature;
message.signatures = [];
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(e);
}
}
return message;
},
};
const baseCompactBitArray: object = { extraBitsStored: 0 };
export const CompactBitArray = {
encode(message: CompactBitArray, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint32(message.extraBitsStored);
writer.uint32(18).bytes(message.elems);
if (message.extraBitsStored !== 0) {
writer.uint32(8).uint32(message.extraBitsStored);
}
if (message.elems.length !== 0) {
writer.uint32(18).bytes(message.elems);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): CompactBitArray {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCompactBitArray) as CompactBitArray;
const message = { ...baseCompactBitArray } as CompactBitArray;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -117,7 +121,7 @@ export const CompactBitArray = {
},
fromJSON(object: any): CompactBitArray {
const message = Object.create(baseCompactBitArray) as CompactBitArray;
const message = { ...baseCompactBitArray } as CompactBitArray;
if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) {
message.extraBitsStored = Number(object.extraBitsStored);
} else {
@ -129,6 +133,14 @@ export const CompactBitArray = {
return message;
},
toJSON(message: CompactBitArray): unknown {
const obj: any = {};
message.extraBitsStored !== undefined && (obj.extraBitsStored = message.extraBitsStored);
message.elems !== undefined &&
(obj.elems = base64FromBytes(message.elems !== undefined ? message.elems : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<CompactBitArray>): CompactBitArray {
const message = { ...baseCompactBitArray } as CompactBitArray;
if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) {
@ -143,14 +155,6 @@ export const CompactBitArray = {
}
return message;
},
toJSON(message: CompactBitArray): unknown {
const obj: any = {};
message.extraBitsStored !== undefined && (obj.extraBitsStored = message.extraBitsStored);
message.elems !== undefined &&
(obj.elems = base64FromBytes(message.elems !== undefined ? message.elems : new Uint8Array()));
return obj;
},
};
declare var self: any | undefined;
@ -160,7 +164,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -24,14 +24,16 @@ const basePubKey: object = {};
export const PubKey = {
encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.key);
if (message.key.length !== 0) {
writer.uint32(10).bytes(message.key);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): PubKey {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(basePubKey) as PubKey;
const message = { ...basePubKey } as PubKey;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -47,13 +49,20 @@ export const PubKey = {
},
fromJSON(object: any): PubKey {
const message = Object.create(basePubKey) as PubKey;
const message = { ...basePubKey } as PubKey;
if (object.key !== undefined && object.key !== null) {
message.key = bytesFromBase64(object.key);
}
return message;
},
toJSON(message: PubKey): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<PubKey>): PubKey {
const message = { ...basePubKey } as PubKey;
if (object.key !== undefined && object.key !== null) {
@ -63,27 +72,22 @@ export const PubKey = {
}
return message;
},
toJSON(message: PubKey): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
return obj;
},
};
const basePrivKey: object = {};
export const PrivKey = {
encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.key);
if (message.key.length !== 0) {
writer.uint32(10).bytes(message.key);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(basePrivKey) as PrivKey;
const message = { ...basePrivKey } as PrivKey;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -99,13 +103,20 @@ export const PrivKey = {
},
fromJSON(object: any): PrivKey {
const message = Object.create(basePrivKey) as PrivKey;
const message = { ...basePrivKey } as PrivKey;
if (object.key !== undefined && object.key !== null) {
message.key = bytesFromBase64(object.key);
}
return message;
},
toJSON(message: PrivKey): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<PrivKey>): PrivKey {
const message = { ...basePrivKey } as PrivKey;
if (object.key !== undefined && object.key !== null) {
@ -115,13 +126,6 @@ export const PrivKey = {
}
return message;
},
toJSON(message: PrivKey): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
return obj;
},
};
declare var self: any | undefined;
@ -131,7 +135,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -129,7 +129,7 @@ export const SignatureDescriptors = {
decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptors {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignatureDescriptors) as SignatureDescriptors;
const message = { ...baseSignatureDescriptors } as SignatureDescriptors;
message.signatures = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -146,22 +146,11 @@ export const SignatureDescriptors = {
},
fromJSON(object: any): SignatureDescriptors {
const message = Object.create(baseSignatureDescriptors) as SignatureDescriptors;
message.signatures = [];
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(SignatureDescriptor.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<SignatureDescriptors>): SignatureDescriptors {
const message = { ...baseSignatureDescriptors } as SignatureDescriptors;
message.signatures = [];
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(SignatureDescriptor.fromPartial(e));
message.signatures.push(SignatureDescriptor.fromJSON(e));
}
}
return message;
@ -176,6 +165,17 @@ export const SignatureDescriptors = {
}
return obj;
},
fromPartial(object: DeepPartial<SignatureDescriptors>): SignatureDescriptors {
const message = { ...baseSignatureDescriptors } as SignatureDescriptors;
message.signatures = [];
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(SignatureDescriptor.fromPartial(e));
}
}
return message;
},
};
const baseSignatureDescriptor: object = { sequence: Long.UZERO };
@ -188,14 +188,16 @@ export const SignatureDescriptor = {
if (message.data !== undefined) {
SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim();
}
writer.uint32(24).uint64(message.sequence);
if (!message.sequence.isZero()) {
writer.uint32(24).uint64(message.sequence);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignatureDescriptor) as SignatureDescriptor;
const message = { ...baseSignatureDescriptor } as SignatureDescriptor;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -217,7 +219,7 @@ export const SignatureDescriptor = {
},
fromJSON(object: any): SignatureDescriptor {
const message = Object.create(baseSignatureDescriptor) as SignatureDescriptor;
const message = { ...baseSignatureDescriptor } as SignatureDescriptor;
if (object.publicKey !== undefined && object.publicKey !== null) {
message.publicKey = Any.fromJSON(object.publicKey);
} else {
@ -236,6 +238,16 @@ export const SignatureDescriptor = {
return message;
},
toJSON(message: SignatureDescriptor): unknown {
const obj: any = {};
message.publicKey !== undefined &&
(obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined);
message.data !== undefined &&
(obj.data = message.data ? SignatureDescriptor_Data.toJSON(message.data) : undefined);
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<SignatureDescriptor>): SignatureDescriptor {
const message = { ...baseSignatureDescriptor } as SignatureDescriptor;
if (object.publicKey !== undefined && object.publicKey !== null) {
@ -255,16 +267,6 @@ export const SignatureDescriptor = {
}
return message;
},
toJSON(message: SignatureDescriptor): unknown {
const obj: any = {};
message.publicKey !== undefined &&
(obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined);
message.data !== undefined &&
(obj.data = message.data ? SignatureDescriptor_Data.toJSON(message.data) : undefined);
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
return obj;
},
};
const baseSignatureDescriptor_Data: object = {};
@ -283,7 +285,7 @@ export const SignatureDescriptor_Data = {
decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignatureDescriptor_Data) as SignatureDescriptor_Data;
const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -302,7 +304,7 @@ export const SignatureDescriptor_Data = {
},
fromJSON(object: any): SignatureDescriptor_Data {
const message = Object.create(baseSignatureDescriptor_Data) as SignatureDescriptor_Data;
const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data;
if (object.single !== undefined && object.single !== null) {
message.single = SignatureDescriptor_Data_Single.fromJSON(object.single);
} else {
@ -316,6 +318,15 @@ export const SignatureDescriptor_Data = {
return message;
},
toJSON(message: SignatureDescriptor_Data): unknown {
const obj: any = {};
message.single !== undefined &&
(obj.single = message.single ? SignatureDescriptor_Data_Single.toJSON(message.single) : undefined);
message.multi !== undefined &&
(obj.multi = message.multi ? SignatureDescriptor_Data_Multi.toJSON(message.multi) : undefined);
return obj;
},
fromPartial(object: DeepPartial<SignatureDescriptor_Data>): SignatureDescriptor_Data {
const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data;
if (object.single !== undefined && object.single !== null) {
@ -330,30 +341,25 @@ export const SignatureDescriptor_Data = {
}
return message;
},
toJSON(message: SignatureDescriptor_Data): unknown {
const obj: any = {};
message.single !== undefined &&
(obj.single = message.single ? SignatureDescriptor_Data_Single.toJSON(message.single) : undefined);
message.multi !== undefined &&
(obj.multi = message.multi ? SignatureDescriptor_Data_Multi.toJSON(message.multi) : undefined);
return obj;
},
};
const baseSignatureDescriptor_Data_Single: object = { mode: 0 };
export const SignatureDescriptor_Data_Single = {
encode(message: SignatureDescriptor_Data_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int32(message.mode);
writer.uint32(18).bytes(message.signature);
if (message.mode !== 0) {
writer.uint32(8).int32(message.mode);
}
if (message.signature.length !== 0) {
writer.uint32(18).bytes(message.signature);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Single {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignatureDescriptor_Data_Single) as SignatureDescriptor_Data_Single;
const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -372,7 +378,7 @@ export const SignatureDescriptor_Data_Single = {
},
fromJSON(object: any): SignatureDescriptor_Data_Single {
const message = Object.create(baseSignatureDescriptor_Data_Single) as SignatureDescriptor_Data_Single;
const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single;
if (object.mode !== undefined && object.mode !== null) {
message.mode = signModeFromJSON(object.mode);
} else {
@ -384,6 +390,16 @@ export const SignatureDescriptor_Data_Single = {
return message;
},
toJSON(message: SignatureDescriptor_Data_Single): unknown {
const obj: any = {};
message.mode !== undefined && (obj.mode = signModeToJSON(message.mode));
message.signature !== undefined &&
(obj.signature = base64FromBytes(
message.signature !== undefined ? message.signature : new Uint8Array(),
));
return obj;
},
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) {
@ -398,16 +414,6 @@ export const SignatureDescriptor_Data_Single = {
}
return message;
},
toJSON(message: SignatureDescriptor_Data_Single): unknown {
const obj: any = {};
message.mode !== undefined && (obj.mode = signModeToJSON(message.mode));
message.signature !== undefined &&
(obj.signature = base64FromBytes(
message.signature !== undefined ? message.signature : new Uint8Array(),
));
return obj;
},
};
const baseSignatureDescriptor_Data_Multi: object = {};
@ -426,7 +432,7 @@ export const SignatureDescriptor_Data_Multi = {
decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignatureDescriptor_Data_Multi) as SignatureDescriptor_Data_Multi;
const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi;
message.signatures = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -446,7 +452,7 @@ export const SignatureDescriptor_Data_Multi = {
},
fromJSON(object: any): SignatureDescriptor_Data_Multi {
const message = Object.create(baseSignatureDescriptor_Data_Multi) as SignatureDescriptor_Data_Multi;
const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi;
message.signatures = [];
if (object.bitarray !== undefined && object.bitarray !== null) {
message.bitarray = CompactBitArray.fromJSON(object.bitarray);
@ -461,6 +467,18 @@ export const SignatureDescriptor_Data_Multi = {
return message;
},
toJSON(message: SignatureDescriptor_Data_Multi): unknown {
const obj: any = {};
message.bitarray !== undefined &&
(obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined);
if (message.signatures) {
obj.signatures = message.signatures.map((e) => (e ? SignatureDescriptor_Data.toJSON(e) : undefined));
} else {
obj.signatures = [];
}
return obj;
},
fromPartial(object: DeepPartial<SignatureDescriptor_Data_Multi>): SignatureDescriptor_Data_Multi {
const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi;
message.signatures = [];
@ -476,18 +494,6 @@ export const SignatureDescriptor_Data_Multi = {
}
return message;
},
toJSON(message: SignatureDescriptor_Data_Multi): unknown {
const obj: any = {};
message.bitarray !== undefined &&
(obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined);
if (message.signatures) {
obj.signatures = message.signatures.map((e) => (e ? SignatureDescriptor_Data.toJSON(e) : undefined));
} else {
obj.signatures = [];
}
return obj;
},
};
declare var self: any | undefined;
@ -497,7 +503,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -226,7 +226,7 @@ export const Tx = {
decode(input: _m0.Reader | Uint8Array, length?: number): Tx {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseTx) as Tx;
const message = { ...baseTx } as Tx;
message.signatures = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -249,7 +249,7 @@ export const Tx = {
},
fromJSON(object: any): Tx {
const message = Object.create(baseTx) as Tx;
const message = { ...baseTx } as Tx;
message.signatures = [];
if (object.body !== undefined && object.body !== null) {
message.body = TxBody.fromJSON(object.body);
@ -269,6 +269,19 @@ export const Tx = {
return message;
},
toJSON(message: Tx): unknown {
const obj: any = {};
message.body !== undefined && (obj.body = message.body ? TxBody.toJSON(message.body) : undefined);
message.authInfo !== undefined &&
(obj.authInfo = message.authInfo ? AuthInfo.toJSON(message.authInfo) : undefined);
if (message.signatures) {
obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));
} else {
obj.signatures = [];
}
return obj;
},
fromPartial(object: DeepPartial<Tx>): Tx {
const message = { ...baseTx } as Tx;
message.signatures = [];
@ -289,27 +302,18 @@ export const Tx = {
}
return message;
},
toJSON(message: Tx): unknown {
const obj: any = {};
message.body !== undefined && (obj.body = message.body ? TxBody.toJSON(message.body) : undefined);
message.authInfo !== undefined &&
(obj.authInfo = message.authInfo ? AuthInfo.toJSON(message.authInfo) : undefined);
if (message.signatures) {
obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));
} else {
obj.signatures = [];
}
return obj;
},
};
const baseTxRaw: object = {};
export const TxRaw = {
encode(message: TxRaw, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.bodyBytes);
writer.uint32(18).bytes(message.authInfoBytes);
if (message.bodyBytes.length !== 0) {
writer.uint32(10).bytes(message.bodyBytes);
}
if (message.authInfoBytes.length !== 0) {
writer.uint32(18).bytes(message.authInfoBytes);
}
for (const v of message.signatures) {
writer.uint32(26).bytes(v!);
}
@ -319,7 +323,7 @@ export const TxRaw = {
decode(input: _m0.Reader | Uint8Array, length?: number): TxRaw {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseTxRaw) as TxRaw;
const message = { ...baseTxRaw } as TxRaw;
message.signatures = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -342,7 +346,7 @@ export const TxRaw = {
},
fromJSON(object: any): TxRaw {
const message = Object.create(baseTxRaw) as TxRaw;
const message = { ...baseTxRaw } as TxRaw;
message.signatures = [];
if (object.bodyBytes !== undefined && object.bodyBytes !== null) {
message.bodyBytes = bytesFromBase64(object.bodyBytes);
@ -358,27 +362,6 @@ export const TxRaw = {
return message;
},
fromPartial(object: DeepPartial<TxRaw>): TxRaw {
const message = { ...baseTxRaw } as TxRaw;
message.signatures = [];
if (object.bodyBytes !== undefined && object.bodyBytes !== null) {
message.bodyBytes = object.bodyBytes;
} else {
message.bodyBytes = new Uint8Array();
}
if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) {
message.authInfoBytes = object.authInfoBytes;
} else {
message.authInfoBytes = new Uint8Array();
}
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(e);
}
}
return message;
},
toJSON(message: TxRaw): unknown {
const obj: any = {};
message.bodyBytes !== undefined &&
@ -396,23 +379,52 @@ export const TxRaw = {
}
return obj;
},
fromPartial(object: DeepPartial<TxRaw>): TxRaw {
const message = { ...baseTxRaw } as TxRaw;
message.signatures = [];
if (object.bodyBytes !== undefined && object.bodyBytes !== null) {
message.bodyBytes = object.bodyBytes;
} else {
message.bodyBytes = new Uint8Array();
}
if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) {
message.authInfoBytes = object.authInfoBytes;
} else {
message.authInfoBytes = new Uint8Array();
}
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(e);
}
}
return message;
},
};
const baseSignDoc: object = { chainId: "", accountNumber: Long.UZERO };
export const SignDoc = {
encode(message: SignDoc, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.bodyBytes);
writer.uint32(18).bytes(message.authInfoBytes);
writer.uint32(26).string(message.chainId);
writer.uint32(32).uint64(message.accountNumber);
if (message.bodyBytes.length !== 0) {
writer.uint32(10).bytes(message.bodyBytes);
}
if (message.authInfoBytes.length !== 0) {
writer.uint32(18).bytes(message.authInfoBytes);
}
if (message.chainId !== "") {
writer.uint32(26).string(message.chainId);
}
if (!message.accountNumber.isZero()) {
writer.uint32(32).uint64(message.accountNumber);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): SignDoc {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignDoc) as SignDoc;
const message = { ...baseSignDoc } as SignDoc;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -437,7 +449,7 @@ export const SignDoc = {
},
fromJSON(object: any): SignDoc {
const message = Object.create(baseSignDoc) as SignDoc;
const message = { ...baseSignDoc } as SignDoc;
if (object.bodyBytes !== undefined && object.bodyBytes !== null) {
message.bodyBytes = bytesFromBase64(object.bodyBytes);
}
@ -457,6 +469,22 @@ export const SignDoc = {
return message;
},
toJSON(message: SignDoc): unknown {
const obj: any = {};
message.bodyBytes !== undefined &&
(obj.bodyBytes = base64FromBytes(
message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array(),
));
message.authInfoBytes !== undefined &&
(obj.authInfoBytes = base64FromBytes(
message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array(),
));
message.chainId !== undefined && (obj.chainId = message.chainId);
message.accountNumber !== undefined &&
(obj.accountNumber = (message.accountNumber || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<SignDoc>): SignDoc {
const message = { ...baseSignDoc } as SignDoc;
if (object.bodyBytes !== undefined && object.bodyBytes !== null) {
@ -481,22 +509,6 @@ export const SignDoc = {
}
return message;
},
toJSON(message: SignDoc): unknown {
const obj: any = {};
message.bodyBytes !== undefined &&
(obj.bodyBytes = base64FromBytes(
message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array(),
));
message.authInfoBytes !== undefined &&
(obj.authInfoBytes = base64FromBytes(
message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array(),
));
message.chainId !== undefined && (obj.chainId = message.chainId);
message.accountNumber !== undefined &&
(obj.accountNumber = (message.accountNumber || Long.UZERO).toString());
return obj;
},
};
const baseTxBody: object = { memo: "", timeoutHeight: Long.UZERO };
@ -506,8 +518,12 @@ export const TxBody = {
for (const v of message.messages) {
Any.encode(v!, writer.uint32(10).fork()).ldelim();
}
writer.uint32(18).string(message.memo);
writer.uint32(24).uint64(message.timeoutHeight);
if (message.memo !== "") {
writer.uint32(18).string(message.memo);
}
if (!message.timeoutHeight.isZero()) {
writer.uint32(24).uint64(message.timeoutHeight);
}
for (const v of message.extensionOptions) {
Any.encode(v!, writer.uint32(8186).fork()).ldelim();
}
@ -520,7 +536,7 @@ export const TxBody = {
decode(input: _m0.Reader | Uint8Array, length?: number): TxBody {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseTxBody) as TxBody;
const message = { ...baseTxBody } as TxBody;
message.messages = [];
message.extensionOptions = [];
message.nonCriticalExtensionOptions = [];
@ -551,7 +567,7 @@ export const TxBody = {
},
fromJSON(object: any): TxBody {
const message = Object.create(baseTxBody) as TxBody;
const message = { ...baseTxBody } as TxBody;
message.messages = [];
message.extensionOptions = [];
message.nonCriticalExtensionOptions = [];
@ -583,6 +599,31 @@ export const TxBody = {
return message;
},
toJSON(message: TxBody): unknown {
const obj: any = {};
if (message.messages) {
obj.messages = message.messages.map((e) => (e ? Any.toJSON(e) : undefined));
} else {
obj.messages = [];
}
message.memo !== undefined && (obj.memo = message.memo);
message.timeoutHeight !== undefined &&
(obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString());
if (message.extensionOptions) {
obj.extensionOptions = message.extensionOptions.map((e) => (e ? Any.toJSON(e) : undefined));
} else {
obj.extensionOptions = [];
}
if (message.nonCriticalExtensionOptions) {
obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map((e) =>
e ? Any.toJSON(e) : undefined,
);
} else {
obj.nonCriticalExtensionOptions = [];
}
return obj;
},
fromPartial(object: DeepPartial<TxBody>): TxBody {
const message = { ...baseTxBody } as TxBody;
message.messages = [];
@ -615,31 +656,6 @@ export const TxBody = {
}
return message;
},
toJSON(message: TxBody): unknown {
const obj: any = {};
if (message.messages) {
obj.messages = message.messages.map((e) => (e ? Any.toJSON(e) : undefined));
} else {
obj.messages = [];
}
message.memo !== undefined && (obj.memo = message.memo);
message.timeoutHeight !== undefined &&
(obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString());
if (message.extensionOptions) {
obj.extensionOptions = message.extensionOptions.map((e) => (e ? Any.toJSON(e) : undefined));
} else {
obj.extensionOptions = [];
}
if (message.nonCriticalExtensionOptions) {
obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map((e) =>
e ? Any.toJSON(e) : undefined,
);
} else {
obj.nonCriticalExtensionOptions = [];
}
return obj;
},
};
const baseAuthInfo: object = {};
@ -658,7 +674,7 @@ export const AuthInfo = {
decode(input: _m0.Reader | Uint8Array, length?: number): AuthInfo {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseAuthInfo) as AuthInfo;
const message = { ...baseAuthInfo } as AuthInfo;
message.signerInfos = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -678,7 +694,7 @@ export const AuthInfo = {
},
fromJSON(object: any): AuthInfo {
const message = Object.create(baseAuthInfo) as AuthInfo;
const message = { ...baseAuthInfo } as AuthInfo;
message.signerInfos = [];
if (object.signerInfos !== undefined && object.signerInfos !== null) {
for (const e of object.signerInfos) {
@ -693,6 +709,17 @@ export const AuthInfo = {
return message;
},
toJSON(message: AuthInfo): unknown {
const obj: any = {};
if (message.signerInfos) {
obj.signerInfos = message.signerInfos.map((e) => (e ? SignerInfo.toJSON(e) : undefined));
} else {
obj.signerInfos = [];
}
message.fee !== undefined && (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined);
return obj;
},
fromPartial(object: DeepPartial<AuthInfo>): AuthInfo {
const message = { ...baseAuthInfo } as AuthInfo;
message.signerInfos = [];
@ -708,17 +735,6 @@ export const AuthInfo = {
}
return message;
},
toJSON(message: AuthInfo): unknown {
const obj: any = {};
if (message.signerInfos) {
obj.signerInfos = message.signerInfos.map((e) => (e ? SignerInfo.toJSON(e) : undefined));
} else {
obj.signerInfos = [];
}
message.fee !== undefined && (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined);
return obj;
},
};
const baseSignerInfo: object = { sequence: Long.UZERO };
@ -731,14 +747,16 @@ export const SignerInfo = {
if (message.modeInfo !== undefined) {
ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim();
}
writer.uint32(24).uint64(message.sequence);
if (!message.sequence.isZero()) {
writer.uint32(24).uint64(message.sequence);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): SignerInfo {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignerInfo) as SignerInfo;
const message = { ...baseSignerInfo } as SignerInfo;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -760,7 +778,7 @@ export const SignerInfo = {
},
fromJSON(object: any): SignerInfo {
const message = Object.create(baseSignerInfo) as SignerInfo;
const message = { ...baseSignerInfo } as SignerInfo;
if (object.publicKey !== undefined && object.publicKey !== null) {
message.publicKey = Any.fromJSON(object.publicKey);
} else {
@ -779,6 +797,16 @@ export const SignerInfo = {
return message;
},
toJSON(message: SignerInfo): unknown {
const obj: any = {};
message.publicKey !== undefined &&
(obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined);
message.modeInfo !== undefined &&
(obj.modeInfo = message.modeInfo ? ModeInfo.toJSON(message.modeInfo) : undefined);
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<SignerInfo>): SignerInfo {
const message = { ...baseSignerInfo } as SignerInfo;
if (object.publicKey !== undefined && object.publicKey !== null) {
@ -798,16 +826,6 @@ export const SignerInfo = {
}
return message;
},
toJSON(message: SignerInfo): unknown {
const obj: any = {};
message.publicKey !== undefined &&
(obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined);
message.modeInfo !== undefined &&
(obj.modeInfo = message.modeInfo ? ModeInfo.toJSON(message.modeInfo) : undefined);
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
return obj;
},
};
const baseModeInfo: object = {};
@ -826,7 +844,7 @@ export const ModeInfo = {
decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseModeInfo) as ModeInfo;
const message = { ...baseModeInfo } as ModeInfo;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -845,7 +863,7 @@ export const ModeInfo = {
},
fromJSON(object: any): ModeInfo {
const message = Object.create(baseModeInfo) as ModeInfo;
const message = { ...baseModeInfo } as ModeInfo;
if (object.single !== undefined && object.single !== null) {
message.single = ModeInfo_Single.fromJSON(object.single);
} else {
@ -859,6 +877,15 @@ export const ModeInfo = {
return message;
},
toJSON(message: ModeInfo): unknown {
const obj: any = {};
message.single !== undefined &&
(obj.single = message.single ? ModeInfo_Single.toJSON(message.single) : undefined);
message.multi !== undefined &&
(obj.multi = message.multi ? ModeInfo_Multi.toJSON(message.multi) : undefined);
return obj;
},
fromPartial(object: DeepPartial<ModeInfo>): ModeInfo {
const message = { ...baseModeInfo } as ModeInfo;
if (object.single !== undefined && object.single !== null) {
@ -873,29 +900,22 @@ export const ModeInfo = {
}
return message;
},
toJSON(message: ModeInfo): unknown {
const obj: any = {};
message.single !== undefined &&
(obj.single = message.single ? ModeInfo_Single.toJSON(message.single) : undefined);
message.multi !== undefined &&
(obj.multi = message.multi ? ModeInfo_Multi.toJSON(message.multi) : undefined);
return obj;
},
};
const baseModeInfo_Single: object = { mode: 0 };
export const ModeInfo_Single = {
encode(message: ModeInfo_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int32(message.mode);
if (message.mode !== 0) {
writer.uint32(8).int32(message.mode);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Single {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseModeInfo_Single) as ModeInfo_Single;
const message = { ...baseModeInfo_Single } as ModeInfo_Single;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -911,19 +931,9 @@ export const ModeInfo_Single = {
},
fromJSON(object: any): ModeInfo_Single {
const message = Object.create(baseModeInfo_Single) as ModeInfo_Single;
if (object.mode !== undefined && object.mode !== null) {
message.mode = signModeFromJSON(object.mode);
} else {
message.mode = 0;
}
return message;
},
fromPartial(object: DeepPartial<ModeInfo_Single>): ModeInfo_Single {
const message = { ...baseModeInfo_Single } as ModeInfo_Single;
if (object.mode !== undefined && object.mode !== null) {
message.mode = object.mode;
message.mode = signModeFromJSON(object.mode);
} else {
message.mode = 0;
}
@ -935,6 +945,16 @@ export const ModeInfo_Single = {
message.mode !== undefined && (obj.mode = signModeToJSON(message.mode));
return obj;
},
fromPartial(object: DeepPartial<ModeInfo_Single>): ModeInfo_Single {
const message = { ...baseModeInfo_Single } as ModeInfo_Single;
if (object.mode !== undefined && object.mode !== null) {
message.mode = object.mode;
} else {
message.mode = 0;
}
return message;
},
};
const baseModeInfo_Multi: object = {};
@ -953,7 +973,7 @@ export const ModeInfo_Multi = {
decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Multi {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseModeInfo_Multi) as ModeInfo_Multi;
const message = { ...baseModeInfo_Multi } as ModeInfo_Multi;
message.modeInfos = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -973,7 +993,7 @@ export const ModeInfo_Multi = {
},
fromJSON(object: any): ModeInfo_Multi {
const message = Object.create(baseModeInfo_Multi) as ModeInfo_Multi;
const message = { ...baseModeInfo_Multi } as ModeInfo_Multi;
message.modeInfos = [];
if (object.bitarray !== undefined && object.bitarray !== null) {
message.bitarray = CompactBitArray.fromJSON(object.bitarray);
@ -988,6 +1008,18 @@ export const ModeInfo_Multi = {
return message;
},
toJSON(message: ModeInfo_Multi): unknown {
const obj: any = {};
message.bitarray !== undefined &&
(obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined);
if (message.modeInfos) {
obj.modeInfos = message.modeInfos.map((e) => (e ? ModeInfo.toJSON(e) : undefined));
} else {
obj.modeInfos = [];
}
return obj;
},
fromPartial(object: DeepPartial<ModeInfo_Multi>): ModeInfo_Multi {
const message = { ...baseModeInfo_Multi } as ModeInfo_Multi;
message.modeInfos = [];
@ -1003,18 +1035,6 @@ export const ModeInfo_Multi = {
}
return message;
},
toJSON(message: ModeInfo_Multi): unknown {
const obj: any = {};
message.bitarray !== undefined &&
(obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined);
if (message.modeInfos) {
obj.modeInfos = message.modeInfos.map((e) => (e ? ModeInfo.toJSON(e) : undefined));
} else {
obj.modeInfos = [];
}
return obj;
},
};
const baseFee: object = { gasLimit: Long.UZERO, payer: "", granter: "" };
@ -1024,16 +1044,22 @@ export const Fee = {
for (const v of message.amount) {
Coin.encode(v!, writer.uint32(10).fork()).ldelim();
}
writer.uint32(16).uint64(message.gasLimit);
writer.uint32(26).string(message.payer);
writer.uint32(34).string(message.granter);
if (!message.gasLimit.isZero()) {
writer.uint32(16).uint64(message.gasLimit);
}
if (message.payer !== "") {
writer.uint32(26).string(message.payer);
}
if (message.granter !== "") {
writer.uint32(34).string(message.granter);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Fee {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseFee) as Fee;
const message = { ...baseFee } as Fee;
message.amount = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -1059,7 +1085,7 @@ export const Fee = {
},
fromJSON(object: any): Fee {
const message = Object.create(baseFee) as Fee;
const message = { ...baseFee } as Fee;
message.amount = [];
if (object.amount !== undefined && object.amount !== null) {
for (const e of object.amount) {
@ -1084,6 +1110,19 @@ export const Fee = {
return message;
},
toJSON(message: Fee): unknown {
const obj: any = {};
if (message.amount) {
obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.amount = [];
}
message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || Long.UZERO).toString());
message.payer !== undefined && (obj.payer = message.payer);
message.granter !== undefined && (obj.granter = message.granter);
return obj;
},
fromPartial(object: DeepPartial<Fee>): Fee {
const message = { ...baseFee } as Fee;
message.amount = [];
@ -1109,19 +1148,6 @@ export const Fee = {
}
return message;
},
toJSON(message: Fee): unknown {
const obj: any = {};
if (message.amount) {
obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.amount = [];
}
message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || Long.UZERO).toString());
message.payer !== undefined && (obj.payer = message.payer);
message.granter !== undefined && (obj.granter = message.granter);
return obj;
},
};
declare var self: any | undefined;
@ -1131,7 +1157,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -124,15 +124,19 @@ const baseAny: object = { typeUrl: "" };
export const Any = {
encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.typeUrl);
writer.uint32(18).bytes(message.value);
if (message.typeUrl !== "") {
writer.uint32(10).string(message.typeUrl);
}
if (message.value.length !== 0) {
writer.uint32(18).bytes(message.value);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Any {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseAny) as Any;
const message = { ...baseAny } as Any;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -151,7 +155,7 @@ export const Any = {
},
fromJSON(object: any): Any {
const message = Object.create(baseAny) as Any;
const message = { ...baseAny } as Any;
if (object.typeUrl !== undefined && object.typeUrl !== null) {
message.typeUrl = String(object.typeUrl);
} else {
@ -163,6 +167,14 @@ export const Any = {
return message;
},
toJSON(message: Any): unknown {
const obj: any = {};
message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl);
message.value !== undefined &&
(obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<Any>): Any {
const message = { ...baseAny } as Any;
if (object.typeUrl !== undefined && object.typeUrl !== null) {
@ -177,14 +189,6 @@ export const Any = {
}
return message;
},
toJSON(message: Any): unknown {
const obj: any = {};
message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl);
message.value !== undefined &&
(obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
return obj;
},
};
declare var self: any | undefined;
@ -194,7 +198,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,7 @@ export const PublicKey = {
decode(input: _m0.Reader | Uint8Array, length?: number): PublicKey {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(basePublicKey) as PublicKey;
const message = { ...basePublicKey } as PublicKey;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -45,7 +45,7 @@ export const PublicKey = {
},
fromJSON(object: any): PublicKey {
const message = Object.create(basePublicKey) as PublicKey;
const message = { ...basePublicKey } as PublicKey;
if (object.ed25519 !== undefined && object.ed25519 !== null) {
message.ed25519 = bytesFromBase64(object.ed25519);
}
@ -55,6 +55,15 @@ export const PublicKey = {
return message;
},
toJSON(message: PublicKey): unknown {
const obj: any = {};
message.ed25519 !== undefined &&
(obj.ed25519 = message.ed25519 !== undefined ? base64FromBytes(message.ed25519) : undefined);
message.secp256k1 !== undefined &&
(obj.secp256k1 = message.secp256k1 !== undefined ? base64FromBytes(message.secp256k1) : undefined);
return obj;
},
fromPartial(object: DeepPartial<PublicKey>): PublicKey {
const message = { ...basePublicKey } as PublicKey;
if (object.ed25519 !== undefined && object.ed25519 !== null) {
@ -69,15 +78,6 @@ export const PublicKey = {
}
return message;
},
toJSON(message: PublicKey): unknown {
const obj: any = {};
message.ed25519 !== undefined &&
(obj.ed25519 = message.ed25519 !== undefined ? base64FromBytes(message.ed25519) : undefined);
message.secp256k1 !== undefined &&
(obj.secp256k1 = message.secp256k1 !== undefined ? base64FromBytes(message.secp256k1) : undefined);
return obj;
},
};
declare var self: any | undefined;
@ -87,7 +87,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -342,8 +342,12 @@ const baseExistenceProof: object = {};
export const ExistenceProof = {
encode(message: ExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.key);
writer.uint32(18).bytes(message.value);
if (message.key.length !== 0) {
writer.uint32(10).bytes(message.key);
}
if (message.value.length !== 0) {
writer.uint32(18).bytes(message.value);
}
if (message.leaf !== undefined) {
LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim();
}
@ -356,7 +360,7 @@ export const ExistenceProof = {
decode(input: _m0.Reader | Uint8Array, length?: number): ExistenceProof {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseExistenceProof) as ExistenceProof;
const message = { ...baseExistenceProof } as ExistenceProof;
message.path = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -382,7 +386,7 @@ export const ExistenceProof = {
},
fromJSON(object: any): ExistenceProof {
const message = Object.create(baseExistenceProof) as ExistenceProof;
const message = { ...baseExistenceProof } as ExistenceProof;
message.path = [];
if (object.key !== undefined && object.key !== null) {
message.key = bytesFromBase64(object.key);
@ -403,6 +407,21 @@ export const ExistenceProof = {
return message;
},
toJSON(message: ExistenceProof): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.value !== undefined &&
(obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
message.leaf !== undefined && (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined);
if (message.path) {
obj.path = message.path.map((e) => (e ? InnerOp.toJSON(e) : undefined));
} else {
obj.path = [];
}
return obj;
},
fromPartial(object: DeepPartial<ExistenceProof>): ExistenceProof {
const message = { ...baseExistenceProof } as ExistenceProof;
message.path = [];
@ -428,28 +447,15 @@ export const ExistenceProof = {
}
return message;
},
toJSON(message: ExistenceProof): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.value !== undefined &&
(obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
message.leaf !== undefined && (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined);
if (message.path) {
obj.path = message.path.map((e) => (e ? InnerOp.toJSON(e) : undefined));
} else {
obj.path = [];
}
return obj;
},
};
const baseNonExistenceProof: object = {};
export const NonExistenceProof = {
encode(message: NonExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.key);
if (message.key.length !== 0) {
writer.uint32(10).bytes(message.key);
}
if (message.left !== undefined) {
ExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim();
}
@ -462,7 +468,7 @@ export const NonExistenceProof = {
decode(input: _m0.Reader | Uint8Array, length?: number): NonExistenceProof {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseNonExistenceProof) as NonExistenceProof;
const message = { ...baseNonExistenceProof } as NonExistenceProof;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -484,7 +490,7 @@ export const NonExistenceProof = {
},
fromJSON(object: any): NonExistenceProof {
const message = Object.create(baseNonExistenceProof) as NonExistenceProof;
const message = { ...baseNonExistenceProof } as NonExistenceProof;
if (object.key !== undefined && object.key !== null) {
message.key = bytesFromBase64(object.key);
}
@ -501,6 +507,16 @@ export const NonExistenceProof = {
return message;
},
toJSON(message: NonExistenceProof): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.left !== undefined && (obj.left = message.left ? ExistenceProof.toJSON(message.left) : undefined);
message.right !== undefined &&
(obj.right = message.right ? ExistenceProof.toJSON(message.right) : undefined);
return obj;
},
fromPartial(object: DeepPartial<NonExistenceProof>): NonExistenceProof {
const message = { ...baseNonExistenceProof } as NonExistenceProof;
if (object.key !== undefined && object.key !== null) {
@ -520,16 +536,6 @@ export const NonExistenceProof = {
}
return message;
},
toJSON(message: NonExistenceProof): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.left !== undefined && (obj.left = message.left ? ExistenceProof.toJSON(message.left) : undefined);
message.right !== undefined &&
(obj.right = message.right ? ExistenceProof.toJSON(message.right) : undefined);
return obj;
},
};
const baseCommitmentProof: object = {};
@ -554,7 +560,7 @@ export const CommitmentProof = {
decode(input: _m0.Reader | Uint8Array, length?: number): CommitmentProof {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCommitmentProof) as CommitmentProof;
const message = { ...baseCommitmentProof } as CommitmentProof;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -579,7 +585,7 @@ export const CommitmentProof = {
},
fromJSON(object: any): CommitmentProof {
const message = Object.create(baseCommitmentProof) as CommitmentProof;
const message = { ...baseCommitmentProof } as CommitmentProof;
if (object.exist !== undefined && object.exist !== null) {
message.exist = ExistenceProof.fromJSON(object.exist);
} else {
@ -603,6 +609,18 @@ export const CommitmentProof = {
return message;
},
toJSON(message: CommitmentProof): unknown {
const obj: any = {};
message.exist !== undefined &&
(obj.exist = message.exist ? ExistenceProof.toJSON(message.exist) : undefined);
message.nonexist !== undefined &&
(obj.nonexist = message.nonexist ? NonExistenceProof.toJSON(message.nonexist) : undefined);
message.batch !== undefined && (obj.batch = message.batch ? BatchProof.toJSON(message.batch) : undefined);
message.compressed !== undefined &&
(obj.compressed = message.compressed ? CompressedBatchProof.toJSON(message.compressed) : undefined);
return obj;
},
fromPartial(object: DeepPartial<CommitmentProof>): CommitmentProof {
const message = { ...baseCommitmentProof } as CommitmentProof;
if (object.exist !== undefined && object.exist !== null) {
@ -627,36 +645,34 @@ export const CommitmentProof = {
}
return message;
},
toJSON(message: CommitmentProof): unknown {
const obj: any = {};
message.exist !== undefined &&
(obj.exist = message.exist ? ExistenceProof.toJSON(message.exist) : undefined);
message.nonexist !== undefined &&
(obj.nonexist = message.nonexist ? NonExistenceProof.toJSON(message.nonexist) : undefined);
message.batch !== undefined && (obj.batch = message.batch ? BatchProof.toJSON(message.batch) : undefined);
message.compressed !== undefined &&
(obj.compressed = message.compressed ? CompressedBatchProof.toJSON(message.compressed) : undefined);
return obj;
},
};
const baseLeafOp: object = { hash: 0, prehashKey: 0, prehashValue: 0, length: 0 };
export const LeafOp = {
encode(message: LeafOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int32(message.hash);
writer.uint32(16).int32(message.prehashKey);
writer.uint32(24).int32(message.prehashValue);
writer.uint32(32).int32(message.length);
writer.uint32(42).bytes(message.prefix);
if (message.hash !== 0) {
writer.uint32(8).int32(message.hash);
}
if (message.prehashKey !== 0) {
writer.uint32(16).int32(message.prehashKey);
}
if (message.prehashValue !== 0) {
writer.uint32(24).int32(message.prehashValue);
}
if (message.length !== 0) {
writer.uint32(32).int32(message.length);
}
if (message.prefix.length !== 0) {
writer.uint32(42).bytes(message.prefix);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): LeafOp {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseLeafOp) as LeafOp;
const message = { ...baseLeafOp } as LeafOp;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -684,7 +700,7 @@ export const LeafOp = {
},
fromJSON(object: any): LeafOp {
const message = Object.create(baseLeafOp) as LeafOp;
const message = { ...baseLeafOp } as LeafOp;
if (object.hash !== undefined && object.hash !== null) {
message.hash = hashOpFromJSON(object.hash);
} else {
@ -711,6 +727,17 @@ export const LeafOp = {
return message;
},
toJSON(message: LeafOp): unknown {
const obj: any = {};
message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash));
message.prehashKey !== undefined && (obj.prehashKey = hashOpToJSON(message.prehashKey));
message.prehashValue !== undefined && (obj.prehashValue = hashOpToJSON(message.prehashValue));
message.length !== undefined && (obj.length = lengthOpToJSON(message.length));
message.prefix !== undefined &&
(obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<LeafOp>): LeafOp {
const message = { ...baseLeafOp } as LeafOp;
if (object.hash !== undefined && object.hash !== null) {
@ -740,33 +767,28 @@ export const LeafOp = {
}
return message;
},
toJSON(message: LeafOp): unknown {
const obj: any = {};
message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash));
message.prehashKey !== undefined && (obj.prehashKey = hashOpToJSON(message.prehashKey));
message.prehashValue !== undefined && (obj.prehashValue = hashOpToJSON(message.prehashValue));
message.length !== undefined && (obj.length = lengthOpToJSON(message.length));
message.prefix !== undefined &&
(obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array()));
return obj;
},
};
const baseInnerOp: object = { hash: 0 };
export const InnerOp = {
encode(message: InnerOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int32(message.hash);
writer.uint32(18).bytes(message.prefix);
writer.uint32(26).bytes(message.suffix);
if (message.hash !== 0) {
writer.uint32(8).int32(message.hash);
}
if (message.prefix.length !== 0) {
writer.uint32(18).bytes(message.prefix);
}
if (message.suffix.length !== 0) {
writer.uint32(26).bytes(message.suffix);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): InnerOp {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseInnerOp) as InnerOp;
const message = { ...baseInnerOp } as InnerOp;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -788,7 +810,7 @@ export const InnerOp = {
},
fromJSON(object: any): InnerOp {
const message = Object.create(baseInnerOp) as InnerOp;
const message = { ...baseInnerOp } as InnerOp;
if (object.hash !== undefined && object.hash !== null) {
message.hash = hashOpFromJSON(object.hash);
} else {
@ -803,6 +825,16 @@ export const InnerOp = {
return message;
},
toJSON(message: InnerOp): unknown {
const obj: any = {};
message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash));
message.prefix !== undefined &&
(obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array()));
message.suffix !== undefined &&
(obj.suffix = base64FromBytes(message.suffix !== undefined ? message.suffix : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<InnerOp>): InnerOp {
const message = { ...baseInnerOp } as InnerOp;
if (object.hash !== undefined && object.hash !== null) {
@ -822,16 +854,6 @@ export const InnerOp = {
}
return message;
},
toJSON(message: InnerOp): unknown {
const obj: any = {};
message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash));
message.prefix !== undefined &&
(obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array()));
message.suffix !== undefined &&
(obj.suffix = base64FromBytes(message.suffix !== undefined ? message.suffix : new Uint8Array()));
return obj;
},
};
const baseProofSpec: object = { maxDepth: 0, minDepth: 0 };
@ -844,15 +866,19 @@ export const ProofSpec = {
if (message.innerSpec !== undefined) {
InnerSpec.encode(message.innerSpec, writer.uint32(18).fork()).ldelim();
}
writer.uint32(24).int32(message.maxDepth);
writer.uint32(32).int32(message.minDepth);
if (message.maxDepth !== 0) {
writer.uint32(24).int32(message.maxDepth);
}
if (message.minDepth !== 0) {
writer.uint32(32).int32(message.minDepth);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): ProofSpec {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseProofSpec) as ProofSpec;
const message = { ...baseProofSpec } as ProofSpec;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -877,7 +903,7 @@ export const ProofSpec = {
},
fromJSON(object: any): ProofSpec {
const message = Object.create(baseProofSpec) as ProofSpec;
const message = { ...baseProofSpec } as ProofSpec;
if (object.leafSpec !== undefined && object.leafSpec !== null) {
message.leafSpec = LeafOp.fromJSON(object.leafSpec);
} else {
@ -901,6 +927,17 @@ export const ProofSpec = {
return message;
},
toJSON(message: ProofSpec): unknown {
const obj: any = {};
message.leafSpec !== undefined &&
(obj.leafSpec = message.leafSpec ? LeafOp.toJSON(message.leafSpec) : undefined);
message.innerSpec !== undefined &&
(obj.innerSpec = message.innerSpec ? InnerSpec.toJSON(message.innerSpec) : undefined);
message.maxDepth !== undefined && (obj.maxDepth = message.maxDepth);
message.minDepth !== undefined && (obj.minDepth = message.minDepth);
return obj;
},
fromPartial(object: DeepPartial<ProofSpec>): ProofSpec {
const message = { ...baseProofSpec } as ProofSpec;
if (object.leafSpec !== undefined && object.leafSpec !== null) {
@ -925,17 +962,6 @@ export const ProofSpec = {
}
return message;
},
toJSON(message: ProofSpec): unknown {
const obj: any = {};
message.leafSpec !== undefined &&
(obj.leafSpec = message.leafSpec ? LeafOp.toJSON(message.leafSpec) : undefined);
message.innerSpec !== undefined &&
(obj.innerSpec = message.innerSpec ? InnerSpec.toJSON(message.innerSpec) : undefined);
message.maxDepth !== undefined && (obj.maxDepth = message.maxDepth);
message.minDepth !== undefined && (obj.minDepth = message.minDepth);
return obj;
},
};
const baseInnerSpec: object = {
@ -953,18 +979,28 @@ export const InnerSpec = {
writer.int32(v);
}
writer.ldelim();
writer.uint32(16).int32(message.childSize);
writer.uint32(24).int32(message.minPrefixLength);
writer.uint32(32).int32(message.maxPrefixLength);
writer.uint32(42).bytes(message.emptyChild);
writer.uint32(48).int32(message.hash);
if (message.childSize !== 0) {
writer.uint32(16).int32(message.childSize);
}
if (message.minPrefixLength !== 0) {
writer.uint32(24).int32(message.minPrefixLength);
}
if (message.maxPrefixLength !== 0) {
writer.uint32(32).int32(message.maxPrefixLength);
}
if (message.emptyChild.length !== 0) {
writer.uint32(42).bytes(message.emptyChild);
}
if (message.hash !== 0) {
writer.uint32(48).int32(message.hash);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): InnerSpec {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseInnerSpec) as InnerSpec;
const message = { ...baseInnerSpec } as InnerSpec;
message.childOrder = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -1003,7 +1039,7 @@ export const InnerSpec = {
},
fromJSON(object: any): InnerSpec {
const message = Object.create(baseInnerSpec) as InnerSpec;
const message = { ...baseInnerSpec } as InnerSpec;
message.childOrder = [];
if (object.childOrder !== undefined && object.childOrder !== null) {
for (const e of object.childOrder) {
@ -1036,6 +1072,24 @@ export const InnerSpec = {
return message;
},
toJSON(message: InnerSpec): unknown {
const obj: any = {};
if (message.childOrder) {
obj.childOrder = message.childOrder.map((e) => e);
} else {
obj.childOrder = [];
}
message.childSize !== undefined && (obj.childSize = message.childSize);
message.minPrefixLength !== undefined && (obj.minPrefixLength = message.minPrefixLength);
message.maxPrefixLength !== undefined && (obj.maxPrefixLength = message.maxPrefixLength);
message.emptyChild !== undefined &&
(obj.emptyChild = base64FromBytes(
message.emptyChild !== undefined ? message.emptyChild : new Uint8Array(),
));
message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash));
return obj;
},
fromPartial(object: DeepPartial<InnerSpec>): InnerSpec {
const message = { ...baseInnerSpec } as InnerSpec;
message.childOrder = [];
@ -1071,24 +1125,6 @@ export const InnerSpec = {
}
return message;
},
toJSON(message: InnerSpec): unknown {
const obj: any = {};
if (message.childOrder) {
obj.childOrder = message.childOrder.map((e) => e);
} else {
obj.childOrder = [];
}
message.childSize !== undefined && (obj.childSize = message.childSize);
message.minPrefixLength !== undefined && (obj.minPrefixLength = message.minPrefixLength);
message.maxPrefixLength !== undefined && (obj.maxPrefixLength = message.maxPrefixLength);
message.emptyChild !== undefined &&
(obj.emptyChild = base64FromBytes(
message.emptyChild !== undefined ? message.emptyChild : new Uint8Array(),
));
message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash));
return obj;
},
};
const baseBatchProof: object = {};
@ -1104,7 +1140,7 @@ export const BatchProof = {
decode(input: _m0.Reader | Uint8Array, length?: number): BatchProof {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseBatchProof) as BatchProof;
const message = { ...baseBatchProof } as BatchProof;
message.entries = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -1121,22 +1157,11 @@ export const BatchProof = {
},
fromJSON(object: any): BatchProof {
const message = Object.create(baseBatchProof) as BatchProof;
message.entries = [];
if (object.entries !== undefined && object.entries !== null) {
for (const e of object.entries) {
message.entries.push(BatchEntry.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<BatchProof>): BatchProof {
const message = { ...baseBatchProof } as BatchProof;
message.entries = [];
if (object.entries !== undefined && object.entries !== null) {
for (const e of object.entries) {
message.entries.push(BatchEntry.fromPartial(e));
message.entries.push(BatchEntry.fromJSON(e));
}
}
return message;
@ -1151,6 +1176,17 @@ export const BatchProof = {
}
return obj;
},
fromPartial(object: DeepPartial<BatchProof>): BatchProof {
const message = { ...baseBatchProof } as BatchProof;
message.entries = [];
if (object.entries !== undefined && object.entries !== null) {
for (const e of object.entries) {
message.entries.push(BatchEntry.fromPartial(e));
}
}
return message;
},
};
const baseBatchEntry: object = {};
@ -1169,7 +1205,7 @@ export const BatchEntry = {
decode(input: _m0.Reader | Uint8Array, length?: number): BatchEntry {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseBatchEntry) as BatchEntry;
const message = { ...baseBatchEntry } as BatchEntry;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -1188,7 +1224,7 @@ export const BatchEntry = {
},
fromJSON(object: any): BatchEntry {
const message = Object.create(baseBatchEntry) as BatchEntry;
const message = { ...baseBatchEntry } as BatchEntry;
if (object.exist !== undefined && object.exist !== null) {
message.exist = ExistenceProof.fromJSON(object.exist);
} else {
@ -1202,6 +1238,15 @@ export const BatchEntry = {
return message;
},
toJSON(message: BatchEntry): unknown {
const obj: any = {};
message.exist !== undefined &&
(obj.exist = message.exist ? ExistenceProof.toJSON(message.exist) : undefined);
message.nonexist !== undefined &&
(obj.nonexist = message.nonexist ? NonExistenceProof.toJSON(message.nonexist) : undefined);
return obj;
},
fromPartial(object: DeepPartial<BatchEntry>): BatchEntry {
const message = { ...baseBatchEntry } as BatchEntry;
if (object.exist !== undefined && object.exist !== null) {
@ -1216,15 +1261,6 @@ export const BatchEntry = {
}
return message;
},
toJSON(message: BatchEntry): unknown {
const obj: any = {};
message.exist !== undefined &&
(obj.exist = message.exist ? ExistenceProof.toJSON(message.exist) : undefined);
message.nonexist !== undefined &&
(obj.nonexist = message.nonexist ? NonExistenceProof.toJSON(message.nonexist) : undefined);
return obj;
},
};
const baseCompressedBatchProof: object = {};
@ -1243,7 +1279,7 @@ export const CompressedBatchProof = {
decode(input: _m0.Reader | Uint8Array, length?: number): CompressedBatchProof {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCompressedBatchProof) as CompressedBatchProof;
const message = { ...baseCompressedBatchProof } as CompressedBatchProof;
message.entries = [];
message.lookupInners = [];
while (reader.pos < end) {
@ -1264,7 +1300,7 @@ export const CompressedBatchProof = {
},
fromJSON(object: any): CompressedBatchProof {
const message = Object.create(baseCompressedBatchProof) as CompressedBatchProof;
const message = { ...baseCompressedBatchProof } as CompressedBatchProof;
message.entries = [];
message.lookupInners = [];
if (object.entries !== undefined && object.entries !== null) {
@ -1280,23 +1316,6 @@ export const CompressedBatchProof = {
return message;
},
fromPartial(object: DeepPartial<CompressedBatchProof>): CompressedBatchProof {
const message = { ...baseCompressedBatchProof } as CompressedBatchProof;
message.entries = [];
message.lookupInners = [];
if (object.entries !== undefined && object.entries !== null) {
for (const e of object.entries) {
message.entries.push(CompressedBatchEntry.fromPartial(e));
}
}
if (object.lookupInners !== undefined && object.lookupInners !== null) {
for (const e of object.lookupInners) {
message.lookupInners.push(InnerOp.fromPartial(e));
}
}
return message;
},
toJSON(message: CompressedBatchProof): unknown {
const obj: any = {};
if (message.entries) {
@ -1311,6 +1330,23 @@ export const CompressedBatchProof = {
}
return obj;
},
fromPartial(object: DeepPartial<CompressedBatchProof>): CompressedBatchProof {
const message = { ...baseCompressedBatchProof } as CompressedBatchProof;
message.entries = [];
message.lookupInners = [];
if (object.entries !== undefined && object.entries !== null) {
for (const e of object.entries) {
message.entries.push(CompressedBatchEntry.fromPartial(e));
}
}
if (object.lookupInners !== undefined && object.lookupInners !== null) {
for (const e of object.lookupInners) {
message.lookupInners.push(InnerOp.fromPartial(e));
}
}
return message;
},
};
const baseCompressedBatchEntry: object = {};
@ -1329,7 +1365,7 @@ export const CompressedBatchEntry = {
decode(input: _m0.Reader | Uint8Array, length?: number): CompressedBatchEntry {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCompressedBatchEntry) as CompressedBatchEntry;
const message = { ...baseCompressedBatchEntry } as CompressedBatchEntry;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -1348,7 +1384,7 @@ export const CompressedBatchEntry = {
},
fromJSON(object: any): CompressedBatchEntry {
const message = Object.create(baseCompressedBatchEntry) as CompressedBatchEntry;
const message = { ...baseCompressedBatchEntry } as CompressedBatchEntry;
if (object.exist !== undefined && object.exist !== null) {
message.exist = CompressedExistenceProof.fromJSON(object.exist);
} else {
@ -1362,6 +1398,15 @@ export const CompressedBatchEntry = {
return message;
},
toJSON(message: CompressedBatchEntry): unknown {
const obj: any = {};
message.exist !== undefined &&
(obj.exist = message.exist ? CompressedExistenceProof.toJSON(message.exist) : undefined);
message.nonexist !== undefined &&
(obj.nonexist = message.nonexist ? CompressedNonExistenceProof.toJSON(message.nonexist) : undefined);
return obj;
},
fromPartial(object: DeepPartial<CompressedBatchEntry>): CompressedBatchEntry {
const message = { ...baseCompressedBatchEntry } as CompressedBatchEntry;
if (object.exist !== undefined && object.exist !== null) {
@ -1376,23 +1421,18 @@ export const CompressedBatchEntry = {
}
return message;
},
toJSON(message: CompressedBatchEntry): unknown {
const obj: any = {};
message.exist !== undefined &&
(obj.exist = message.exist ? CompressedExistenceProof.toJSON(message.exist) : undefined);
message.nonexist !== undefined &&
(obj.nonexist = message.nonexist ? CompressedNonExistenceProof.toJSON(message.nonexist) : undefined);
return obj;
},
};
const baseCompressedExistenceProof: object = { path: 0 };
export const CompressedExistenceProof = {
encode(message: CompressedExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.key);
writer.uint32(18).bytes(message.value);
if (message.key.length !== 0) {
writer.uint32(10).bytes(message.key);
}
if (message.value.length !== 0) {
writer.uint32(18).bytes(message.value);
}
if (message.leaf !== undefined) {
LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim();
}
@ -1407,7 +1447,7 @@ export const CompressedExistenceProof = {
decode(input: _m0.Reader | Uint8Array, length?: number): CompressedExistenceProof {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCompressedExistenceProof) as CompressedExistenceProof;
const message = { ...baseCompressedExistenceProof } as CompressedExistenceProof;
message.path = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -1440,7 +1480,7 @@ export const CompressedExistenceProof = {
},
fromJSON(object: any): CompressedExistenceProof {
const message = Object.create(baseCompressedExistenceProof) as CompressedExistenceProof;
const message = { ...baseCompressedExistenceProof } as CompressedExistenceProof;
message.path = [];
if (object.key !== undefined && object.key !== null) {
message.key = bytesFromBase64(object.key);
@ -1461,6 +1501,21 @@ export const CompressedExistenceProof = {
return message;
},
toJSON(message: CompressedExistenceProof): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.value !== undefined &&
(obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
message.leaf !== undefined && (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined);
if (message.path) {
obj.path = message.path.map((e) => e);
} else {
obj.path = [];
}
return obj;
},
fromPartial(object: DeepPartial<CompressedExistenceProof>): CompressedExistenceProof {
const message = { ...baseCompressedExistenceProof } as CompressedExistenceProof;
message.path = [];
@ -1486,28 +1541,15 @@ export const CompressedExistenceProof = {
}
return message;
},
toJSON(message: CompressedExistenceProof): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.value !== undefined &&
(obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
message.leaf !== undefined && (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined);
if (message.path) {
obj.path = message.path.map((e) => e);
} else {
obj.path = [];
}
return obj;
},
};
const baseCompressedNonExistenceProof: object = {};
export const CompressedNonExistenceProof = {
encode(message: CompressedNonExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.key);
if (message.key.length !== 0) {
writer.uint32(10).bytes(message.key);
}
if (message.left !== undefined) {
CompressedExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim();
}
@ -1520,7 +1562,7 @@ export const CompressedNonExistenceProof = {
decode(input: _m0.Reader | Uint8Array, length?: number): CompressedNonExistenceProof {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCompressedNonExistenceProof) as CompressedNonExistenceProof;
const message = { ...baseCompressedNonExistenceProof } as CompressedNonExistenceProof;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -1542,7 +1584,7 @@ export const CompressedNonExistenceProof = {
},
fromJSON(object: any): CompressedNonExistenceProof {
const message = Object.create(baseCompressedNonExistenceProof) as CompressedNonExistenceProof;
const message = { ...baseCompressedNonExistenceProof } as CompressedNonExistenceProof;
if (object.key !== undefined && object.key !== null) {
message.key = bytesFromBase64(object.key);
}
@ -1559,6 +1601,17 @@ export const CompressedNonExistenceProof = {
return message;
},
toJSON(message: CompressedNonExistenceProof): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.left !== undefined &&
(obj.left = message.left ? CompressedExistenceProof.toJSON(message.left) : undefined);
message.right !== undefined &&
(obj.right = message.right ? CompressedExistenceProof.toJSON(message.right) : undefined);
return obj;
},
fromPartial(object: DeepPartial<CompressedNonExistenceProof>): CompressedNonExistenceProof {
const message = { ...baseCompressedNonExistenceProof } as CompressedNonExistenceProof;
if (object.key !== undefined && object.key !== null) {
@ -1578,17 +1631,6 @@ export const CompressedNonExistenceProof = {
}
return message;
},
toJSON(message: CompressedNonExistenceProof): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.left !== undefined &&
(obj.left = message.left ? CompressedExistenceProof.toJSON(message.left) : undefined);
message.right !== undefined &&
(obj.right = message.right ? CompressedExistenceProof.toJSON(message.right) : undefined);
return obj;
},
};
declare var self: any | undefined;
@ -1598,7 +1640,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -37,19 +37,25 @@ const baseBaseAccount: object = { address: "", accountNumber: Long.UZERO, sequen
export const BaseAccount = {
encode(message: BaseAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.address);
if (message.address !== "") {
writer.uint32(10).string(message.address);
}
if (message.pubKey !== undefined) {
Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim();
}
writer.uint32(24).uint64(message.accountNumber);
writer.uint32(32).uint64(message.sequence);
if (!message.accountNumber.isZero()) {
writer.uint32(24).uint64(message.accountNumber);
}
if (!message.sequence.isZero()) {
writer.uint32(32).uint64(message.sequence);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): BaseAccount {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseBaseAccount) as BaseAccount;
const message = { ...baseBaseAccount } as BaseAccount;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -74,7 +80,7 @@ export const BaseAccount = {
},
fromJSON(object: any): BaseAccount {
const message = Object.create(baseBaseAccount) as BaseAccount;
const message = { ...baseBaseAccount } as BaseAccount;
if (object.address !== undefined && object.address !== null) {
message.address = String(object.address);
} else {
@ -98,6 +104,16 @@ export const BaseAccount = {
return message;
},
toJSON(message: BaseAccount): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined);
message.accountNumber !== undefined &&
(obj.accountNumber = (message.accountNumber || Long.UZERO).toString());
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<BaseAccount>): BaseAccount {
const message = { ...baseBaseAccount } as BaseAccount;
if (object.address !== undefined && object.address !== null) {
@ -122,16 +138,6 @@ export const BaseAccount = {
}
return message;
},
toJSON(message: BaseAccount): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined);
message.accountNumber !== undefined &&
(obj.accountNumber = (message.accountNumber || Long.UZERO).toString());
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
return obj;
},
};
const baseModuleAccount: object = { name: "", permissions: "" };
@ -141,7 +147,9 @@ export const ModuleAccount = {
if (message.baseAccount !== undefined) {
BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim();
}
writer.uint32(18).string(message.name);
if (message.name !== "") {
writer.uint32(18).string(message.name);
}
for (const v of message.permissions) {
writer.uint32(26).string(v!);
}
@ -151,7 +159,7 @@ export const ModuleAccount = {
decode(input: _m0.Reader | Uint8Array, length?: number): ModuleAccount {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseModuleAccount) as ModuleAccount;
const message = { ...baseModuleAccount } as ModuleAccount;
message.permissions = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -174,7 +182,7 @@ export const ModuleAccount = {
},
fromJSON(object: any): ModuleAccount {
const message = Object.create(baseModuleAccount) as ModuleAccount;
const message = { ...baseModuleAccount } as ModuleAccount;
message.permissions = [];
if (object.baseAccount !== undefined && object.baseAccount !== null) {
message.baseAccount = BaseAccount.fromJSON(object.baseAccount);
@ -194,6 +202,19 @@ export const ModuleAccount = {
return message;
},
toJSON(message: ModuleAccount): unknown {
const obj: any = {};
message.baseAccount !== undefined &&
(obj.baseAccount = message.baseAccount ? BaseAccount.toJSON(message.baseAccount) : undefined);
message.name !== undefined && (obj.name = message.name);
if (message.permissions) {
obj.permissions = message.permissions.map((e) => e);
} else {
obj.permissions = [];
}
return obj;
},
fromPartial(object: DeepPartial<ModuleAccount>): ModuleAccount {
const message = { ...baseModuleAccount } as ModuleAccount;
message.permissions = [];
@ -214,19 +235,6 @@ export const ModuleAccount = {
}
return message;
},
toJSON(message: ModuleAccount): unknown {
const obj: any = {};
message.baseAccount !== undefined &&
(obj.baseAccount = message.baseAccount ? BaseAccount.toJSON(message.baseAccount) : undefined);
message.name !== undefined && (obj.name = message.name);
if (message.permissions) {
obj.permissions = message.permissions.map((e) => e);
} else {
obj.permissions = [];
}
return obj;
},
};
const baseParams: object = {
@ -239,18 +247,28 @@ const baseParams: object = {
export const Params = {
encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint64(message.maxMemoCharacters);
writer.uint32(16).uint64(message.txSigLimit);
writer.uint32(24).uint64(message.txSizeCostPerByte);
writer.uint32(32).uint64(message.sigVerifyCostEd25519);
writer.uint32(40).uint64(message.sigVerifyCostSecp256k1);
if (!message.maxMemoCharacters.isZero()) {
writer.uint32(8).uint64(message.maxMemoCharacters);
}
if (!message.txSigLimit.isZero()) {
writer.uint32(16).uint64(message.txSigLimit);
}
if (!message.txSizeCostPerByte.isZero()) {
writer.uint32(24).uint64(message.txSizeCostPerByte);
}
if (!message.sigVerifyCostEd25519.isZero()) {
writer.uint32(32).uint64(message.sigVerifyCostEd25519);
}
if (!message.sigVerifyCostSecp256k1.isZero()) {
writer.uint32(40).uint64(message.sigVerifyCostSecp256k1);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Params {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseParams) as Params;
const message = { ...baseParams } as Params;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -278,7 +296,7 @@ export const Params = {
},
fromJSON(object: any): Params {
const message = Object.create(baseParams) as Params;
const message = { ...baseParams } as Params;
if (object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null) {
message.maxMemoCharacters = Long.fromString(object.maxMemoCharacters);
} else {
@ -307,6 +325,20 @@ export const Params = {
return message;
},
toJSON(message: Params): unknown {
const obj: any = {};
message.maxMemoCharacters !== undefined &&
(obj.maxMemoCharacters = (message.maxMemoCharacters || Long.UZERO).toString());
message.txSigLimit !== undefined && (obj.txSigLimit = (message.txSigLimit || Long.UZERO).toString());
message.txSizeCostPerByte !== undefined &&
(obj.txSizeCostPerByte = (message.txSizeCostPerByte || Long.UZERO).toString());
message.sigVerifyCostEd25519 !== undefined &&
(obj.sigVerifyCostEd25519 = (message.sigVerifyCostEd25519 || Long.UZERO).toString());
message.sigVerifyCostSecp256k1 !== undefined &&
(obj.sigVerifyCostSecp256k1 = (message.sigVerifyCostSecp256k1 || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<Params>): Params {
const message = { ...baseParams } as Params;
if (object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null) {
@ -336,20 +368,6 @@ export const Params = {
}
return message;
},
toJSON(message: Params): unknown {
const obj: any = {};
message.maxMemoCharacters !== undefined &&
(obj.maxMemoCharacters = (message.maxMemoCharacters || Long.UZERO).toString());
message.txSigLimit !== undefined && (obj.txSigLimit = (message.txSigLimit || Long.UZERO).toString());
message.txSizeCostPerByte !== undefined &&
(obj.txSizeCostPerByte = (message.txSizeCostPerByte || Long.UZERO).toString());
message.sigVerifyCostEd25519 !== undefined &&
(obj.sigVerifyCostEd25519 = (message.sigVerifyCostEd25519 || Long.UZERO).toString());
message.sigVerifyCostSecp256k1 !== undefined &&
(obj.sigVerifyCostSecp256k1 = (message.sigVerifyCostSecp256k1 || Long.UZERO).toString());
return obj;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;

View File

@ -31,14 +31,16 @@ const baseQueryAccountRequest: object = { address: "" };
export const QueryAccountRequest = {
encode(message: QueryAccountRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.address);
if (message.address !== "") {
writer.uint32(10).string(message.address);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryAccountRequest) as QueryAccountRequest;
const message = { ...baseQueryAccountRequest } as QueryAccountRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -54,19 +56,9 @@ export const QueryAccountRequest = {
},
fromJSON(object: any): QueryAccountRequest {
const message = Object.create(baseQueryAccountRequest) as QueryAccountRequest;
if (object.address !== undefined && object.address !== null) {
message.address = String(object.address);
} else {
message.address = "";
}
return message;
},
fromPartial(object: DeepPartial<QueryAccountRequest>): QueryAccountRequest {
const message = { ...baseQueryAccountRequest } as QueryAccountRequest;
if (object.address !== undefined && object.address !== null) {
message.address = object.address;
message.address = String(object.address);
} else {
message.address = "";
}
@ -78,6 +70,16 @@ export const QueryAccountRequest = {
message.address !== undefined && (obj.address = message.address);
return obj;
},
fromPartial(object: DeepPartial<QueryAccountRequest>): QueryAccountRequest {
const message = { ...baseQueryAccountRequest } as QueryAccountRequest;
if (object.address !== undefined && object.address !== null) {
message.address = object.address;
} else {
message.address = "";
}
return message;
},
};
const baseQueryAccountResponse: object = {};
@ -93,7 +95,7 @@ export const QueryAccountResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryAccountResponse) as QueryAccountResponse;
const message = { ...baseQueryAccountResponse } as QueryAccountResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -109,19 +111,9 @@ export const QueryAccountResponse = {
},
fromJSON(object: any): QueryAccountResponse {
const message = Object.create(baseQueryAccountResponse) as QueryAccountResponse;
if (object.account !== undefined && object.account !== null) {
message.account = Any.fromJSON(object.account);
} else {
message.account = undefined;
}
return message;
},
fromPartial(object: DeepPartial<QueryAccountResponse>): QueryAccountResponse {
const message = { ...baseQueryAccountResponse } as QueryAccountResponse;
if (object.account !== undefined && object.account !== null) {
message.account = Any.fromPartial(object.account);
message.account = Any.fromJSON(object.account);
} else {
message.account = undefined;
}
@ -134,6 +126,16 @@ export const QueryAccountResponse = {
(obj.account = message.account ? Any.toJSON(message.account) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryAccountResponse>): QueryAccountResponse {
const message = { ...baseQueryAccountResponse } as QueryAccountResponse;
if (object.account !== undefined && object.account !== null) {
message.account = Any.fromPartial(object.account);
} else {
message.account = undefined;
}
return message;
},
};
const baseQueryParamsRequest: object = {};
@ -146,7 +148,7 @@ export const QueryParamsRequest = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryParamsRequest) as QueryParamsRequest;
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -159,11 +161,6 @@ export const QueryParamsRequest = {
},
fromJSON(_: any): QueryParamsRequest {
const message = Object.create(baseQueryParamsRequest) as QueryParamsRequest;
return message;
},
fromPartial(_: DeepPartial<QueryParamsRequest>): QueryParamsRequest {
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
return message;
},
@ -172,6 +169,11 @@ export const QueryParamsRequest = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<QueryParamsRequest>): QueryParamsRequest {
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
return message;
},
};
const baseQueryParamsResponse: object = {};
@ -187,7 +189,7 @@ export const QueryParamsResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryParamsResponse) as QueryParamsResponse;
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -203,19 +205,9 @@ export const QueryParamsResponse = {
},
fromJSON(object: any): QueryParamsResponse {
const message = Object.create(baseQueryParamsResponse) as QueryParamsResponse;
if (object.params !== undefined && object.params !== null) {
message.params = Params.fromJSON(object.params);
} else {
message.params = undefined;
}
return message;
},
fromPartial(object: DeepPartial<QueryParamsResponse>): QueryParamsResponse {
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
if (object.params !== undefined && object.params !== null) {
message.params = Params.fromPartial(object.params);
message.params = Params.fromJSON(object.params);
} else {
message.params = undefined;
}
@ -227,6 +219,16 @@ export const QueryParamsResponse = {
message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryParamsResponse>): QueryParamsResponse {
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
if (object.params !== undefined && object.params !== null) {
message.params = Params.fromPartial(object.params);
} else {
message.params = undefined;
}
return message;
},
};
/** Query defines the gRPC querier service. */

View File

@ -83,14 +83,16 @@ export const Params = {
for (const v of message.sendEnabled) {
SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim();
}
writer.uint32(16).bool(message.defaultSendEnabled);
if (message.defaultSendEnabled === true) {
writer.uint32(16).bool(message.defaultSendEnabled);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Params {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseParams) as Params;
const message = { ...baseParams } as Params;
message.sendEnabled = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -110,7 +112,7 @@ export const Params = {
},
fromJSON(object: any): Params {
const message = Object.create(baseParams) as Params;
const message = { ...baseParams } as Params;
message.sendEnabled = [];
if (object.sendEnabled !== undefined && object.sendEnabled !== null) {
for (const e of object.sendEnabled) {
@ -125,6 +127,17 @@ export const Params = {
return message;
},
toJSON(message: Params): unknown {
const obj: any = {};
if (message.sendEnabled) {
obj.sendEnabled = message.sendEnabled.map((e) => (e ? SendEnabled.toJSON(e) : undefined));
} else {
obj.sendEnabled = [];
}
message.defaultSendEnabled !== undefined && (obj.defaultSendEnabled = message.defaultSendEnabled);
return obj;
},
fromPartial(object: DeepPartial<Params>): Params {
const message = { ...baseParams } as Params;
message.sendEnabled = [];
@ -140,32 +153,25 @@ export const Params = {
}
return message;
},
toJSON(message: Params): unknown {
const obj: any = {};
if (message.sendEnabled) {
obj.sendEnabled = message.sendEnabled.map((e) => (e ? SendEnabled.toJSON(e) : undefined));
} else {
obj.sendEnabled = [];
}
message.defaultSendEnabled !== undefined && (obj.defaultSendEnabled = message.defaultSendEnabled);
return obj;
},
};
const baseSendEnabled: object = { denom: "", enabled: false };
export const SendEnabled = {
encode(message: SendEnabled, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.denom);
writer.uint32(16).bool(message.enabled);
if (message.denom !== "") {
writer.uint32(10).string(message.denom);
}
if (message.enabled === true) {
writer.uint32(16).bool(message.enabled);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): SendEnabled {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSendEnabled) as SendEnabled;
const message = { ...baseSendEnabled } as SendEnabled;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -184,7 +190,7 @@ export const SendEnabled = {
},
fromJSON(object: any): SendEnabled {
const message = Object.create(baseSendEnabled) as SendEnabled;
const message = { ...baseSendEnabled } as SendEnabled;
if (object.denom !== undefined && object.denom !== null) {
message.denom = String(object.denom);
} else {
@ -198,6 +204,13 @@ export const SendEnabled = {
return message;
},
toJSON(message: SendEnabled): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.enabled !== undefined && (obj.enabled = message.enabled);
return obj;
},
fromPartial(object: DeepPartial<SendEnabled>): SendEnabled {
const message = { ...baseSendEnabled } as SendEnabled;
if (object.denom !== undefined && object.denom !== null) {
@ -212,20 +225,15 @@ export const SendEnabled = {
}
return message;
},
toJSON(message: SendEnabled): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.enabled !== undefined && (obj.enabled = message.enabled);
return obj;
},
};
const baseInput: object = { address: "" };
export const Input = {
encode(message: Input, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.address);
if (message.address !== "") {
writer.uint32(10).string(message.address);
}
for (const v of message.coins) {
Coin.encode(v!, writer.uint32(18).fork()).ldelim();
}
@ -235,7 +243,7 @@ export const Input = {
decode(input: _m0.Reader | Uint8Array, length?: number): Input {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseInput) as Input;
const message = { ...baseInput } as Input;
message.coins = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -255,7 +263,7 @@ export const Input = {
},
fromJSON(object: any): Input {
const message = Object.create(baseInput) as Input;
const message = { ...baseInput } as Input;
message.coins = [];
if (object.address !== undefined && object.address !== null) {
message.address = String(object.address);
@ -270,6 +278,17 @@ export const Input = {
return message;
},
toJSON(message: Input): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
if (message.coins) {
obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.coins = [];
}
return obj;
},
fromPartial(object: DeepPartial<Input>): Input {
const message = { ...baseInput } as Input;
message.coins = [];
@ -285,24 +304,15 @@ export const Input = {
}
return message;
},
toJSON(message: Input): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
if (message.coins) {
obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.coins = [];
}
return obj;
},
};
const baseOutput: object = { address: "" };
export const Output = {
encode(message: Output, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.address);
if (message.address !== "") {
writer.uint32(10).string(message.address);
}
for (const v of message.coins) {
Coin.encode(v!, writer.uint32(18).fork()).ldelim();
}
@ -312,7 +322,7 @@ export const Output = {
decode(input: _m0.Reader | Uint8Array, length?: number): Output {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseOutput) as Output;
const message = { ...baseOutput } as Output;
message.coins = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -332,7 +342,7 @@ export const Output = {
},
fromJSON(object: any): Output {
const message = Object.create(baseOutput) as Output;
const message = { ...baseOutput } as Output;
message.coins = [];
if (object.address !== undefined && object.address !== null) {
message.address = String(object.address);
@ -347,6 +357,17 @@ export const Output = {
return message;
},
toJSON(message: Output): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
if (message.coins) {
obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.coins = [];
}
return obj;
},
fromPartial(object: DeepPartial<Output>): Output {
const message = { ...baseOutput } as Output;
message.coins = [];
@ -362,17 +383,6 @@ export const Output = {
}
return message;
},
toJSON(message: Output): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
if (message.coins) {
obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.coins = [];
}
return obj;
},
};
const baseSupply: object = {};
@ -388,7 +398,7 @@ export const Supply = {
decode(input: _m0.Reader | Uint8Array, length?: number): Supply {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSupply) as Supply;
const message = { ...baseSupply } as Supply;
message.total = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -405,22 +415,11 @@ export const Supply = {
},
fromJSON(object: any): Supply {
const message = Object.create(baseSupply) as Supply;
message.total = [];
if (object.total !== undefined && object.total !== null) {
for (const e of object.total) {
message.total.push(Coin.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<Supply>): Supply {
const message = { ...baseSupply } as Supply;
message.total = [];
if (object.total !== undefined && object.total !== null) {
for (const e of object.total) {
message.total.push(Coin.fromPartial(e));
message.total.push(Coin.fromJSON(e));
}
}
return message;
@ -435,14 +434,29 @@ export const Supply = {
}
return obj;
},
fromPartial(object: DeepPartial<Supply>): Supply {
const message = { ...baseSupply } as Supply;
message.total = [];
if (object.total !== undefined && object.total !== null) {
for (const e of object.total) {
message.total.push(Coin.fromPartial(e));
}
}
return message;
},
};
const baseDenomUnit: object = { denom: "", exponent: 0, aliases: "" };
export const DenomUnit = {
encode(message: DenomUnit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.denom);
writer.uint32(16).uint32(message.exponent);
if (message.denom !== "") {
writer.uint32(10).string(message.denom);
}
if (message.exponent !== 0) {
writer.uint32(16).uint32(message.exponent);
}
for (const v of message.aliases) {
writer.uint32(26).string(v!);
}
@ -452,7 +466,7 @@ export const DenomUnit = {
decode(input: _m0.Reader | Uint8Array, length?: number): DenomUnit {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseDenomUnit) as DenomUnit;
const message = { ...baseDenomUnit } as DenomUnit;
message.aliases = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -475,7 +489,7 @@ export const DenomUnit = {
},
fromJSON(object: any): DenomUnit {
const message = Object.create(baseDenomUnit) as DenomUnit;
const message = { ...baseDenomUnit } as DenomUnit;
message.aliases = [];
if (object.denom !== undefined && object.denom !== null) {
message.denom = String(object.denom);
@ -495,6 +509,18 @@ export const DenomUnit = {
return message;
},
toJSON(message: DenomUnit): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.exponent !== undefined && (obj.exponent = message.exponent);
if (message.aliases) {
obj.aliases = message.aliases.map((e) => e);
} else {
obj.aliases = [];
}
return obj;
},
fromPartial(object: DeepPartial<DenomUnit>): DenomUnit {
const message = { ...baseDenomUnit } as DenomUnit;
message.aliases = [];
@ -515,37 +541,31 @@ export const DenomUnit = {
}
return message;
},
toJSON(message: DenomUnit): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.exponent !== undefined && (obj.exponent = message.exponent);
if (message.aliases) {
obj.aliases = message.aliases.map((e) => e);
} else {
obj.aliases = [];
}
return obj;
},
};
const baseMetadata: object = { description: "", base: "", display: "" };
export const Metadata = {
encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.description);
if (message.description !== "") {
writer.uint32(10).string(message.description);
}
for (const v of message.denomUnits) {
DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim();
}
writer.uint32(26).string(message.base);
writer.uint32(34).string(message.display);
if (message.base !== "") {
writer.uint32(26).string(message.base);
}
if (message.display !== "") {
writer.uint32(34).string(message.display);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Metadata {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMetadata) as Metadata;
const message = { ...baseMetadata } as Metadata;
message.denomUnits = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -571,7 +591,7 @@ export const Metadata = {
},
fromJSON(object: any): Metadata {
const message = Object.create(baseMetadata) as Metadata;
const message = { ...baseMetadata } as Metadata;
message.denomUnits = [];
if (object.description !== undefined && object.description !== null) {
message.description = String(object.description);
@ -596,6 +616,19 @@ export const Metadata = {
return message;
},
toJSON(message: Metadata): unknown {
const obj: any = {};
message.description !== undefined && (obj.description = message.description);
if (message.denomUnits) {
obj.denomUnits = message.denomUnits.map((e) => (e ? DenomUnit.toJSON(e) : undefined));
} else {
obj.denomUnits = [];
}
message.base !== undefined && (obj.base = message.base);
message.display !== undefined && (obj.display = message.display);
return obj;
},
fromPartial(object: DeepPartial<Metadata>): Metadata {
const message = { ...baseMetadata } as Metadata;
message.denomUnits = [];
@ -621,19 +654,6 @@ export const Metadata = {
}
return message;
},
toJSON(message: Metadata): unknown {
const obj: any = {};
message.description !== undefined && (obj.description = message.description);
if (message.denomUnits) {
obj.denomUnits = message.denomUnits.map((e) => (e ? DenomUnit.toJSON(e) : undefined));
} else {
obj.denomUnits = [];
}
message.base !== undefined && (obj.base = message.base);
message.display !== undefined && (obj.display = message.display);
return obj;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;

View File

@ -79,15 +79,19 @@ const baseQueryBalanceRequest: object = { address: "", denom: "" };
export const QueryBalanceRequest = {
encode(message: QueryBalanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.address);
writer.uint32(18).string(message.denom);
if (message.address !== "") {
writer.uint32(10).string(message.address);
}
if (message.denom !== "") {
writer.uint32(18).string(message.denom);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryBalanceRequest) as QueryBalanceRequest;
const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -106,7 +110,7 @@ export const QueryBalanceRequest = {
},
fromJSON(object: any): QueryBalanceRequest {
const message = Object.create(baseQueryBalanceRequest) as QueryBalanceRequest;
const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest;
if (object.address !== undefined && object.address !== null) {
message.address = String(object.address);
} else {
@ -120,6 +124,13 @@ export const QueryBalanceRequest = {
return message;
},
toJSON(message: QueryBalanceRequest): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
message.denom !== undefined && (obj.denom = message.denom);
return obj;
},
fromPartial(object: DeepPartial<QueryBalanceRequest>): QueryBalanceRequest {
const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest;
if (object.address !== undefined && object.address !== null) {
@ -134,13 +145,6 @@ export const QueryBalanceRequest = {
}
return message;
},
toJSON(message: QueryBalanceRequest): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
message.denom !== undefined && (obj.denom = message.denom);
return obj;
},
};
const baseQueryBalanceResponse: object = {};
@ -156,7 +160,7 @@ export const QueryBalanceResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryBalanceResponse) as QueryBalanceResponse;
const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -172,19 +176,9 @@ export const QueryBalanceResponse = {
},
fromJSON(object: any): QueryBalanceResponse {
const message = Object.create(baseQueryBalanceResponse) as QueryBalanceResponse;
if (object.balance !== undefined && object.balance !== null) {
message.balance = Coin.fromJSON(object.balance);
} else {
message.balance = undefined;
}
return message;
},
fromPartial(object: DeepPartial<QueryBalanceResponse>): QueryBalanceResponse {
const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse;
if (object.balance !== undefined && object.balance !== null) {
message.balance = Coin.fromPartial(object.balance);
message.balance = Coin.fromJSON(object.balance);
} else {
message.balance = undefined;
}
@ -197,13 +191,25 @@ export const QueryBalanceResponse = {
(obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryBalanceResponse>): QueryBalanceResponse {
const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse;
if (object.balance !== undefined && object.balance !== null) {
message.balance = Coin.fromPartial(object.balance);
} else {
message.balance = undefined;
}
return message;
},
};
const baseQueryAllBalancesRequest: object = { address: "" };
export const QueryAllBalancesRequest = {
encode(message: QueryAllBalancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.address);
if (message.address !== "") {
writer.uint32(10).string(message.address);
}
if (message.pagination !== undefined) {
PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim();
}
@ -213,7 +219,7 @@ export const QueryAllBalancesRequest = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllBalancesRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryAllBalancesRequest) as QueryAllBalancesRequest;
const message = { ...baseQueryAllBalancesRequest } as QueryAllBalancesRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -232,7 +238,7 @@ export const QueryAllBalancesRequest = {
},
fromJSON(object: any): QueryAllBalancesRequest {
const message = Object.create(baseQueryAllBalancesRequest) as QueryAllBalancesRequest;
const message = { ...baseQueryAllBalancesRequest } as QueryAllBalancesRequest;
if (object.address !== undefined && object.address !== null) {
message.address = String(object.address);
} else {
@ -246,6 +252,14 @@ export const QueryAllBalancesRequest = {
return message;
},
toJSON(message: QueryAllBalancesRequest): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
message.pagination !== undefined &&
(obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryAllBalancesRequest>): QueryAllBalancesRequest {
const message = { ...baseQueryAllBalancesRequest } as QueryAllBalancesRequest;
if (object.address !== undefined && object.address !== null) {
@ -260,14 +274,6 @@ export const QueryAllBalancesRequest = {
}
return message;
},
toJSON(message: QueryAllBalancesRequest): unknown {
const obj: any = {};
message.address !== undefined && (obj.address = message.address);
message.pagination !== undefined &&
(obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined);
return obj;
},
};
const baseQueryAllBalancesResponse: object = {};
@ -286,7 +292,7 @@ export const QueryAllBalancesResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllBalancesResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryAllBalancesResponse) as QueryAllBalancesResponse;
const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse;
message.balances = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -306,7 +312,7 @@ export const QueryAllBalancesResponse = {
},
fromJSON(object: any): QueryAllBalancesResponse {
const message = Object.create(baseQueryAllBalancesResponse) as QueryAllBalancesResponse;
const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse;
message.balances = [];
if (object.balances !== undefined && object.balances !== null) {
for (const e of object.balances) {
@ -321,22 +327,6 @@ export const QueryAllBalancesResponse = {
return message;
},
fromPartial(object: DeepPartial<QueryAllBalancesResponse>): QueryAllBalancesResponse {
const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse;
message.balances = [];
if (object.balances !== undefined && object.balances !== null) {
for (const e of object.balances) {
message.balances.push(Coin.fromPartial(e));
}
}
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageResponse.fromPartial(object.pagination);
} else {
message.pagination = undefined;
}
return message;
},
toJSON(message: QueryAllBalancesResponse): unknown {
const obj: any = {};
if (message.balances) {
@ -348,6 +338,22 @@ export const QueryAllBalancesResponse = {
(obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryAllBalancesResponse>): QueryAllBalancesResponse {
const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse;
message.balances = [];
if (object.balances !== undefined && object.balances !== null) {
for (const e of object.balances) {
message.balances.push(Coin.fromPartial(e));
}
}
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageResponse.fromPartial(object.pagination);
} else {
message.pagination = undefined;
}
return message;
},
};
const baseQueryTotalSupplyRequest: object = {};
@ -360,7 +366,7 @@ export const QueryTotalSupplyRequest = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSupplyRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryTotalSupplyRequest) as QueryTotalSupplyRequest;
const message = { ...baseQueryTotalSupplyRequest } as QueryTotalSupplyRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -373,11 +379,6 @@ export const QueryTotalSupplyRequest = {
},
fromJSON(_: any): QueryTotalSupplyRequest {
const message = Object.create(baseQueryTotalSupplyRequest) as QueryTotalSupplyRequest;
return message;
},
fromPartial(_: DeepPartial<QueryTotalSupplyRequest>): QueryTotalSupplyRequest {
const message = { ...baseQueryTotalSupplyRequest } as QueryTotalSupplyRequest;
return message;
},
@ -386,6 +387,11 @@ export const QueryTotalSupplyRequest = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<QueryTotalSupplyRequest>): QueryTotalSupplyRequest {
const message = { ...baseQueryTotalSupplyRequest } as QueryTotalSupplyRequest;
return message;
},
};
const baseQueryTotalSupplyResponse: object = {};
@ -401,7 +407,7 @@ export const QueryTotalSupplyResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSupplyResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryTotalSupplyResponse) as QueryTotalSupplyResponse;
const message = { ...baseQueryTotalSupplyResponse } as QueryTotalSupplyResponse;
message.supply = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -418,22 +424,11 @@ export const QueryTotalSupplyResponse = {
},
fromJSON(object: any): QueryTotalSupplyResponse {
const message = Object.create(baseQueryTotalSupplyResponse) as QueryTotalSupplyResponse;
message.supply = [];
if (object.supply !== undefined && object.supply !== null) {
for (const e of object.supply) {
message.supply.push(Coin.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<QueryTotalSupplyResponse>): QueryTotalSupplyResponse {
const message = { ...baseQueryTotalSupplyResponse } as QueryTotalSupplyResponse;
message.supply = [];
if (object.supply !== undefined && object.supply !== null) {
for (const e of object.supply) {
message.supply.push(Coin.fromPartial(e));
message.supply.push(Coin.fromJSON(e));
}
}
return message;
@ -448,20 +443,33 @@ export const QueryTotalSupplyResponse = {
}
return obj;
},
fromPartial(object: DeepPartial<QueryTotalSupplyResponse>): QueryTotalSupplyResponse {
const message = { ...baseQueryTotalSupplyResponse } as QueryTotalSupplyResponse;
message.supply = [];
if (object.supply !== undefined && object.supply !== null) {
for (const e of object.supply) {
message.supply.push(Coin.fromPartial(e));
}
}
return message;
},
};
const baseQuerySupplyOfRequest: object = { denom: "" };
export const QuerySupplyOfRequest = {
encode(message: QuerySupplyOfRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.denom);
if (message.denom !== "") {
writer.uint32(10).string(message.denom);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyOfRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQuerySupplyOfRequest) as QuerySupplyOfRequest;
const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -477,19 +485,9 @@ export const QuerySupplyOfRequest = {
},
fromJSON(object: any): QuerySupplyOfRequest {
const message = Object.create(baseQuerySupplyOfRequest) as QuerySupplyOfRequest;
if (object.denom !== undefined && object.denom !== null) {
message.denom = String(object.denom);
} else {
message.denom = "";
}
return message;
},
fromPartial(object: DeepPartial<QuerySupplyOfRequest>): QuerySupplyOfRequest {
const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest;
if (object.denom !== undefined && object.denom !== null) {
message.denom = object.denom;
message.denom = String(object.denom);
} else {
message.denom = "";
}
@ -501,6 +499,16 @@ export const QuerySupplyOfRequest = {
message.denom !== undefined && (obj.denom = message.denom);
return obj;
},
fromPartial(object: DeepPartial<QuerySupplyOfRequest>): QuerySupplyOfRequest {
const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest;
if (object.denom !== undefined && object.denom !== null) {
message.denom = object.denom;
} else {
message.denom = "";
}
return message;
},
};
const baseQuerySupplyOfResponse: object = {};
@ -516,7 +524,7 @@ export const QuerySupplyOfResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyOfResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQuerySupplyOfResponse) as QuerySupplyOfResponse;
const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -532,19 +540,9 @@ export const QuerySupplyOfResponse = {
},
fromJSON(object: any): QuerySupplyOfResponse {
const message = Object.create(baseQuerySupplyOfResponse) as QuerySupplyOfResponse;
if (object.amount !== undefined && object.amount !== null) {
message.amount = Coin.fromJSON(object.amount);
} else {
message.amount = undefined;
}
return message;
},
fromPartial(object: DeepPartial<QuerySupplyOfResponse>): QuerySupplyOfResponse {
const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse;
if (object.amount !== undefined && object.amount !== null) {
message.amount = Coin.fromPartial(object.amount);
message.amount = Coin.fromJSON(object.amount);
} else {
message.amount = undefined;
}
@ -556,6 +554,16 @@ export const QuerySupplyOfResponse = {
message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QuerySupplyOfResponse>): QuerySupplyOfResponse {
const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse;
if (object.amount !== undefined && object.amount !== null) {
message.amount = Coin.fromPartial(object.amount);
} else {
message.amount = undefined;
}
return message;
},
};
const baseQueryParamsRequest: object = {};
@ -568,7 +576,7 @@ export const QueryParamsRequest = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryParamsRequest) as QueryParamsRequest;
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -581,11 +589,6 @@ export const QueryParamsRequest = {
},
fromJSON(_: any): QueryParamsRequest {
const message = Object.create(baseQueryParamsRequest) as QueryParamsRequest;
return message;
},
fromPartial(_: DeepPartial<QueryParamsRequest>): QueryParamsRequest {
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
return message;
},
@ -594,6 +597,11 @@ export const QueryParamsRequest = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<QueryParamsRequest>): QueryParamsRequest {
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
return message;
},
};
const baseQueryParamsResponse: object = {};
@ -609,7 +617,7 @@ export const QueryParamsResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryParamsResponse) as QueryParamsResponse;
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -625,19 +633,9 @@ export const QueryParamsResponse = {
},
fromJSON(object: any): QueryParamsResponse {
const message = Object.create(baseQueryParamsResponse) as QueryParamsResponse;
if (object.params !== undefined && object.params !== null) {
message.params = Params.fromJSON(object.params);
} else {
message.params = undefined;
}
return message;
},
fromPartial(object: DeepPartial<QueryParamsResponse>): QueryParamsResponse {
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
if (object.params !== undefined && object.params !== null) {
message.params = Params.fromPartial(object.params);
message.params = Params.fromJSON(object.params);
} else {
message.params = undefined;
}
@ -649,6 +647,16 @@ export const QueryParamsResponse = {
message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryParamsResponse>): QueryParamsResponse {
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
if (object.params !== undefined && object.params !== null) {
message.params = Params.fromPartial(object.params);
} else {
message.params = undefined;
}
return message;
},
};
/** Query defines the gRPC querier service. */

View File

@ -29,8 +29,12 @@ const baseMsgSend: object = { fromAddress: "", toAddress: "" };
export const MsgSend = {
encode(message: MsgSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.fromAddress);
writer.uint32(18).string(message.toAddress);
if (message.fromAddress !== "") {
writer.uint32(10).string(message.fromAddress);
}
if (message.toAddress !== "") {
writer.uint32(18).string(message.toAddress);
}
for (const v of message.amount) {
Coin.encode(v!, writer.uint32(26).fork()).ldelim();
}
@ -40,7 +44,7 @@ export const MsgSend = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgSend) as MsgSend;
const message = { ...baseMsgSend } as MsgSend;
message.amount = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -63,7 +67,7 @@ export const MsgSend = {
},
fromJSON(object: any): MsgSend {
const message = Object.create(baseMsgSend) as MsgSend;
const message = { ...baseMsgSend } as MsgSend;
message.amount = [];
if (object.fromAddress !== undefined && object.fromAddress !== null) {
message.fromAddress = String(object.fromAddress);
@ -83,6 +87,18 @@ export const MsgSend = {
return message;
},
toJSON(message: MsgSend): unknown {
const obj: any = {};
message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress);
message.toAddress !== undefined && (obj.toAddress = message.toAddress);
if (message.amount) {
obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.amount = [];
}
return obj;
},
fromPartial(object: DeepPartial<MsgSend>): MsgSend {
const message = { ...baseMsgSend } as MsgSend;
message.amount = [];
@ -103,18 +119,6 @@ export const MsgSend = {
}
return message;
},
toJSON(message: MsgSend): unknown {
const obj: any = {};
message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress);
message.toAddress !== undefined && (obj.toAddress = message.toAddress);
if (message.amount) {
obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.amount = [];
}
return obj;
},
};
const baseMsgSendResponse: object = {};
@ -127,7 +131,7 @@ export const MsgSendResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgSendResponse) as MsgSendResponse;
const message = { ...baseMsgSendResponse } as MsgSendResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -140,11 +144,6 @@ export const MsgSendResponse = {
},
fromJSON(_: any): MsgSendResponse {
const message = Object.create(baseMsgSendResponse) as MsgSendResponse;
return message;
},
fromPartial(_: DeepPartial<MsgSendResponse>): MsgSendResponse {
const message = { ...baseMsgSendResponse } as MsgSendResponse;
return message;
},
@ -153,6 +152,11 @@ export const MsgSendResponse = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<MsgSendResponse>): MsgSendResponse {
const message = { ...baseMsgSendResponse } as MsgSendResponse;
return message;
},
};
const baseMsgMultiSend: object = {};
@ -171,7 +175,7 @@ export const MsgMultiSend = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiSend {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgMultiSend) as MsgMultiSend;
const message = { ...baseMsgMultiSend } as MsgMultiSend;
message.inputs = [];
message.outputs = [];
while (reader.pos < end) {
@ -192,7 +196,7 @@ export const MsgMultiSend = {
},
fromJSON(object: any): MsgMultiSend {
const message = Object.create(baseMsgMultiSend) as MsgMultiSend;
const message = { ...baseMsgMultiSend } as MsgMultiSend;
message.inputs = [];
message.outputs = [];
if (object.inputs !== undefined && object.inputs !== null) {
@ -208,23 +212,6 @@ export const MsgMultiSend = {
return message;
},
fromPartial(object: DeepPartial<MsgMultiSend>): MsgMultiSend {
const message = { ...baseMsgMultiSend } as MsgMultiSend;
message.inputs = [];
message.outputs = [];
if (object.inputs !== undefined && object.inputs !== null) {
for (const e of object.inputs) {
message.inputs.push(Input.fromPartial(e));
}
}
if (object.outputs !== undefined && object.outputs !== null) {
for (const e of object.outputs) {
message.outputs.push(Output.fromPartial(e));
}
}
return message;
},
toJSON(message: MsgMultiSend): unknown {
const obj: any = {};
if (message.inputs) {
@ -239,6 +226,23 @@ export const MsgMultiSend = {
}
return obj;
},
fromPartial(object: DeepPartial<MsgMultiSend>): MsgMultiSend {
const message = { ...baseMsgMultiSend } as MsgMultiSend;
message.inputs = [];
message.outputs = [];
if (object.inputs !== undefined && object.inputs !== null) {
for (const e of object.inputs) {
message.inputs.push(Input.fromPartial(e));
}
}
if (object.outputs !== undefined && object.outputs !== null) {
for (const e of object.outputs) {
message.outputs.push(Output.fromPartial(e));
}
}
return message;
},
};
const baseMsgMultiSendResponse: object = {};
@ -251,7 +255,7 @@ export const MsgMultiSendResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiSendResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgMultiSendResponse) as MsgMultiSendResponse;
const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -264,11 +268,6 @@ export const MsgMultiSendResponse = {
},
fromJSON(_: any): MsgMultiSendResponse {
const message = Object.create(baseMsgMultiSendResponse) as MsgMultiSendResponse;
return message;
},
fromPartial(_: DeepPartial<MsgMultiSendResponse>): MsgMultiSendResponse {
const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse;
return message;
},
@ -277,6 +276,11 @@ export const MsgMultiSendResponse = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<MsgMultiSendResponse>): MsgMultiSendResponse {
const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse;
return message;
},
};
/** Msg defines the bank Msg service. */

View File

@ -154,29 +154,49 @@ const baseTxResponse: object = {
export const TxResponse = {
encode(message: TxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int64(message.height);
writer.uint32(18).string(message.txhash);
writer.uint32(26).string(message.codespace);
writer.uint32(32).uint32(message.code);
writer.uint32(42).string(message.data);
writer.uint32(50).string(message.rawLog);
if (!message.height.isZero()) {
writer.uint32(8).int64(message.height);
}
if (message.txhash !== "") {
writer.uint32(18).string(message.txhash);
}
if (message.codespace !== "") {
writer.uint32(26).string(message.codespace);
}
if (message.code !== 0) {
writer.uint32(32).uint32(message.code);
}
if (message.data !== "") {
writer.uint32(42).string(message.data);
}
if (message.rawLog !== "") {
writer.uint32(50).string(message.rawLog);
}
for (const v of message.logs) {
ABCIMessageLog.encode(v!, writer.uint32(58).fork()).ldelim();
}
writer.uint32(66).string(message.info);
writer.uint32(72).int64(message.gasWanted);
writer.uint32(80).int64(message.gasUsed);
if (message.info !== "") {
writer.uint32(66).string(message.info);
}
if (!message.gasWanted.isZero()) {
writer.uint32(72).int64(message.gasWanted);
}
if (!message.gasUsed.isZero()) {
writer.uint32(80).int64(message.gasUsed);
}
if (message.tx !== undefined) {
Any.encode(message.tx, writer.uint32(90).fork()).ldelim();
}
writer.uint32(98).string(message.timestamp);
if (message.timestamp !== "") {
writer.uint32(98).string(message.timestamp);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): TxResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseTxResponse) as TxResponse;
const message = { ...baseTxResponse } as TxResponse;
message.logs = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -226,7 +246,7 @@ export const TxResponse = {
},
fromJSON(object: any): TxResponse {
const message = Object.create(baseTxResponse) as TxResponse;
const message = { ...baseTxResponse } as TxResponse;
message.logs = [];
if (object.height !== undefined && object.height !== null) {
message.height = Long.fromString(object.height);
@ -291,6 +311,27 @@ export const TxResponse = {
return message;
},
toJSON(message: TxResponse): unknown {
const obj: any = {};
message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString());
message.txhash !== undefined && (obj.txhash = message.txhash);
message.codespace !== undefined && (obj.codespace = message.codespace);
message.code !== undefined && (obj.code = message.code);
message.data !== undefined && (obj.data = message.data);
message.rawLog !== undefined && (obj.rawLog = message.rawLog);
if (message.logs) {
obj.logs = message.logs.map((e) => (e ? ABCIMessageLog.toJSON(e) : undefined));
} else {
obj.logs = [];
}
message.info !== undefined && (obj.info = message.info);
message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.ZERO).toString());
message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.ZERO).toString());
message.tx !== undefined && (obj.tx = message.tx ? Any.toJSON(message.tx) : undefined);
message.timestamp !== undefined && (obj.timestamp = message.timestamp);
return obj;
},
fromPartial(object: DeepPartial<TxResponse>): TxResponse {
const message = { ...baseTxResponse } as TxResponse;
message.logs = [];
@ -356,35 +397,18 @@ export const TxResponse = {
}
return message;
},
toJSON(message: TxResponse): unknown {
const obj: any = {};
message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString());
message.txhash !== undefined && (obj.txhash = message.txhash);
message.codespace !== undefined && (obj.codespace = message.codespace);
message.code !== undefined && (obj.code = message.code);
message.data !== undefined && (obj.data = message.data);
message.rawLog !== undefined && (obj.rawLog = message.rawLog);
if (message.logs) {
obj.logs = message.logs.map((e) => (e ? ABCIMessageLog.toJSON(e) : undefined));
} else {
obj.logs = [];
}
message.info !== undefined && (obj.info = message.info);
message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.ZERO).toString());
message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.ZERO).toString());
message.tx !== undefined && (obj.tx = message.tx ? Any.toJSON(message.tx) : undefined);
message.timestamp !== undefined && (obj.timestamp = message.timestamp);
return obj;
},
};
const baseABCIMessageLog: object = { msgIndex: 0, log: "" };
export const ABCIMessageLog = {
encode(message: ABCIMessageLog, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint32(message.msgIndex);
writer.uint32(18).string(message.log);
if (message.msgIndex !== 0) {
writer.uint32(8).uint32(message.msgIndex);
}
if (message.log !== "") {
writer.uint32(18).string(message.log);
}
for (const v of message.events) {
StringEvent.encode(v!, writer.uint32(26).fork()).ldelim();
}
@ -394,7 +418,7 @@ export const ABCIMessageLog = {
decode(input: _m0.Reader | Uint8Array, length?: number): ABCIMessageLog {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseABCIMessageLog) as ABCIMessageLog;
const message = { ...baseABCIMessageLog } as ABCIMessageLog;
message.events = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -417,7 +441,7 @@ export const ABCIMessageLog = {
},
fromJSON(object: any): ABCIMessageLog {
const message = Object.create(baseABCIMessageLog) as ABCIMessageLog;
const message = { ...baseABCIMessageLog } as ABCIMessageLog;
message.events = [];
if (object.msgIndex !== undefined && object.msgIndex !== null) {
message.msgIndex = Number(object.msgIndex);
@ -437,6 +461,18 @@ export const ABCIMessageLog = {
return message;
},
toJSON(message: ABCIMessageLog): unknown {
const obj: any = {};
message.msgIndex !== undefined && (obj.msgIndex = message.msgIndex);
message.log !== undefined && (obj.log = message.log);
if (message.events) {
obj.events = message.events.map((e) => (e ? StringEvent.toJSON(e) : undefined));
} else {
obj.events = [];
}
return obj;
},
fromPartial(object: DeepPartial<ABCIMessageLog>): ABCIMessageLog {
const message = { ...baseABCIMessageLog } as ABCIMessageLog;
message.events = [];
@ -457,25 +493,15 @@ export const ABCIMessageLog = {
}
return message;
},
toJSON(message: ABCIMessageLog): unknown {
const obj: any = {};
message.msgIndex !== undefined && (obj.msgIndex = message.msgIndex);
message.log !== undefined && (obj.log = message.log);
if (message.events) {
obj.events = message.events.map((e) => (e ? StringEvent.toJSON(e) : undefined));
} else {
obj.events = [];
}
return obj;
},
};
const baseStringEvent: object = { type: "" };
export const StringEvent = {
encode(message: StringEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.type);
if (message.type !== "") {
writer.uint32(10).string(message.type);
}
for (const v of message.attributes) {
Attribute.encode(v!, writer.uint32(18).fork()).ldelim();
}
@ -485,7 +511,7 @@ export const StringEvent = {
decode(input: _m0.Reader | Uint8Array, length?: number): StringEvent {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseStringEvent) as StringEvent;
const message = { ...baseStringEvent } as StringEvent;
message.attributes = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -505,7 +531,7 @@ export const StringEvent = {
},
fromJSON(object: any): StringEvent {
const message = Object.create(baseStringEvent) as StringEvent;
const message = { ...baseStringEvent } as StringEvent;
message.attributes = [];
if (object.type !== undefined && object.type !== null) {
message.type = String(object.type);
@ -520,6 +546,17 @@ export const StringEvent = {
return message;
},
toJSON(message: StringEvent): unknown {
const obj: any = {};
message.type !== undefined && (obj.type = message.type);
if (message.attributes) {
obj.attributes = message.attributes.map((e) => (e ? Attribute.toJSON(e) : undefined));
} else {
obj.attributes = [];
}
return obj;
},
fromPartial(object: DeepPartial<StringEvent>): StringEvent {
const message = { ...baseStringEvent } as StringEvent;
message.attributes = [];
@ -535,32 +572,25 @@ export const StringEvent = {
}
return message;
},
toJSON(message: StringEvent): unknown {
const obj: any = {};
message.type !== undefined && (obj.type = message.type);
if (message.attributes) {
obj.attributes = message.attributes.map((e) => (e ? Attribute.toJSON(e) : undefined));
} else {
obj.attributes = [];
}
return obj;
},
};
const baseAttribute: object = { key: "", value: "" };
export const Attribute = {
encode(message: Attribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.key);
writer.uint32(18).string(message.value);
if (message.key !== "") {
writer.uint32(10).string(message.key);
}
if (message.value !== "") {
writer.uint32(18).string(message.value);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Attribute {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseAttribute) as Attribute;
const message = { ...baseAttribute } as Attribute;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -579,7 +609,7 @@ export const Attribute = {
},
fromJSON(object: any): Attribute {
const message = Object.create(baseAttribute) as Attribute;
const message = { ...baseAttribute } as Attribute;
if (object.key !== undefined && object.key !== null) {
message.key = String(object.key);
} else {
@ -593,6 +623,13 @@ export const Attribute = {
return message;
},
toJSON(message: Attribute): unknown {
const obj: any = {};
message.key !== undefined && (obj.key = message.key);
message.value !== undefined && (obj.value = message.value);
return obj;
},
fromPartial(object: DeepPartial<Attribute>): Attribute {
const message = { ...baseAttribute } as Attribute;
if (object.key !== undefined && object.key !== null) {
@ -607,28 +644,25 @@ export const Attribute = {
}
return message;
},
toJSON(message: Attribute): unknown {
const obj: any = {};
message.key !== undefined && (obj.key = message.key);
message.value !== undefined && (obj.value = message.value);
return obj;
},
};
const baseGasInfo: object = { gasWanted: Long.UZERO, gasUsed: Long.UZERO };
export const GasInfo = {
encode(message: GasInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint64(message.gasWanted);
writer.uint32(16).uint64(message.gasUsed);
if (!message.gasWanted.isZero()) {
writer.uint32(8).uint64(message.gasWanted);
}
if (!message.gasUsed.isZero()) {
writer.uint32(16).uint64(message.gasUsed);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): GasInfo {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseGasInfo) as GasInfo;
const message = { ...baseGasInfo } as GasInfo;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -647,7 +681,7 @@ export const GasInfo = {
},
fromJSON(object: any): GasInfo {
const message = Object.create(baseGasInfo) as GasInfo;
const message = { ...baseGasInfo } as GasInfo;
if (object.gasWanted !== undefined && object.gasWanted !== null) {
message.gasWanted = Long.fromString(object.gasWanted);
} else {
@ -661,6 +695,13 @@ export const GasInfo = {
return message;
},
toJSON(message: GasInfo): unknown {
const obj: any = {};
message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.UZERO).toString());
message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<GasInfo>): GasInfo {
const message = { ...baseGasInfo } as GasInfo;
if (object.gasWanted !== undefined && object.gasWanted !== null) {
@ -675,21 +716,18 @@ export const GasInfo = {
}
return message;
},
toJSON(message: GasInfo): unknown {
const obj: any = {};
message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.UZERO).toString());
message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.UZERO).toString());
return obj;
},
};
const baseResult: object = { log: "" };
export const Result = {
encode(message: Result, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.data);
writer.uint32(18).string(message.log);
if (message.data.length !== 0) {
writer.uint32(10).bytes(message.data);
}
if (message.log !== "") {
writer.uint32(18).string(message.log);
}
for (const v of message.events) {
Event.encode(v!, writer.uint32(26).fork()).ldelim();
}
@ -699,7 +737,7 @@ export const Result = {
decode(input: _m0.Reader | Uint8Array, length?: number): Result {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseResult) as Result;
const message = { ...baseResult } as Result;
message.events = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -722,7 +760,7 @@ export const Result = {
},
fromJSON(object: any): Result {
const message = Object.create(baseResult) as Result;
const message = { ...baseResult } as Result;
message.events = [];
if (object.data !== undefined && object.data !== null) {
message.data = bytesFromBase64(object.data);
@ -740,6 +778,19 @@ export const Result = {
return message;
},
toJSON(message: Result): unknown {
const obj: any = {};
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
message.log !== undefined && (obj.log = message.log);
if (message.events) {
obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined));
} else {
obj.events = [];
}
return obj;
},
fromPartial(object: DeepPartial<Result>): Result {
const message = { ...baseResult } as Result;
message.events = [];
@ -760,19 +811,6 @@ export const Result = {
}
return message;
},
toJSON(message: Result): unknown {
const obj: any = {};
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
message.log !== undefined && (obj.log = message.log);
if (message.events) {
obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined));
} else {
obj.events = [];
}
return obj;
},
};
const baseSimulationResponse: object = {};
@ -791,7 +829,7 @@ export const SimulationResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): SimulationResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSimulationResponse) as SimulationResponse;
const message = { ...baseSimulationResponse } as SimulationResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -810,7 +848,7 @@ export const SimulationResponse = {
},
fromJSON(object: any): SimulationResponse {
const message = Object.create(baseSimulationResponse) as SimulationResponse;
const message = { ...baseSimulationResponse } as SimulationResponse;
if (object.gasInfo !== undefined && object.gasInfo !== null) {
message.gasInfo = GasInfo.fromJSON(object.gasInfo);
} else {
@ -824,6 +862,14 @@ export const SimulationResponse = {
return message;
},
toJSON(message: SimulationResponse): unknown {
const obj: any = {};
message.gasInfo !== undefined &&
(obj.gasInfo = message.gasInfo ? GasInfo.toJSON(message.gasInfo) : undefined);
message.result !== undefined && (obj.result = message.result ? Result.toJSON(message.result) : undefined);
return obj;
},
fromPartial(object: DeepPartial<SimulationResponse>): SimulationResponse {
const message = { ...baseSimulationResponse } as SimulationResponse;
if (object.gasInfo !== undefined && object.gasInfo !== null) {
@ -838,29 +884,25 @@ export const SimulationResponse = {
}
return message;
},
toJSON(message: SimulationResponse): unknown {
const obj: any = {};
message.gasInfo !== undefined &&
(obj.gasInfo = message.gasInfo ? GasInfo.toJSON(message.gasInfo) : undefined);
message.result !== undefined && (obj.result = message.result ? Result.toJSON(message.result) : undefined);
return obj;
},
};
const baseMsgData: object = { msgType: "" };
export const MsgData = {
encode(message: MsgData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.msgType);
writer.uint32(18).bytes(message.data);
if (message.msgType !== "") {
writer.uint32(10).string(message.msgType);
}
if (message.data.length !== 0) {
writer.uint32(18).bytes(message.data);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgData {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgData) as MsgData;
const message = { ...baseMsgData } as MsgData;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -879,7 +921,7 @@ export const MsgData = {
},
fromJSON(object: any): MsgData {
const message = Object.create(baseMsgData) as MsgData;
const message = { ...baseMsgData } as MsgData;
if (object.msgType !== undefined && object.msgType !== null) {
message.msgType = String(object.msgType);
} else {
@ -891,6 +933,14 @@ export const MsgData = {
return message;
},
toJSON(message: MsgData): unknown {
const obj: any = {};
message.msgType !== undefined && (obj.msgType = message.msgType);
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<MsgData>): MsgData {
const message = { ...baseMsgData } as MsgData;
if (object.msgType !== undefined && object.msgType !== null) {
@ -905,14 +955,6 @@ export const MsgData = {
}
return message;
},
toJSON(message: MsgData): unknown {
const obj: any = {};
message.msgType !== undefined && (obj.msgType = message.msgType);
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
return obj;
},
};
const baseTxMsgData: object = {};
@ -928,7 +970,7 @@ export const TxMsgData = {
decode(input: _m0.Reader | Uint8Array, length?: number): TxMsgData {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseTxMsgData) as TxMsgData;
const message = { ...baseTxMsgData } as TxMsgData;
message.data = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -945,22 +987,11 @@ export const TxMsgData = {
},
fromJSON(object: any): TxMsgData {
const message = Object.create(baseTxMsgData) as TxMsgData;
message.data = [];
if (object.data !== undefined && object.data !== null) {
for (const e of object.data) {
message.data.push(MsgData.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<TxMsgData>): TxMsgData {
const message = { ...baseTxMsgData } as TxMsgData;
message.data = [];
if (object.data !== undefined && object.data !== null) {
for (const e of object.data) {
message.data.push(MsgData.fromPartial(e));
message.data.push(MsgData.fromJSON(e));
}
}
return message;
@ -975,6 +1006,17 @@ export const TxMsgData = {
}
return obj;
},
fromPartial(object: DeepPartial<TxMsgData>): TxMsgData {
const message = { ...baseTxMsgData } as TxMsgData;
message.data = [];
if (object.data !== undefined && object.data !== null) {
for (const e of object.data) {
message.data.push(MsgData.fromPartial(e));
}
}
return message;
},
};
const baseSearchTxsResult: object = {
@ -987,11 +1029,21 @@ const baseSearchTxsResult: object = {
export const SearchTxsResult = {
encode(message: SearchTxsResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint64(message.totalCount);
writer.uint32(16).uint64(message.count);
writer.uint32(24).uint64(message.pageNumber);
writer.uint32(32).uint64(message.pageTotal);
writer.uint32(40).uint64(message.limit);
if (!message.totalCount.isZero()) {
writer.uint32(8).uint64(message.totalCount);
}
if (!message.count.isZero()) {
writer.uint32(16).uint64(message.count);
}
if (!message.pageNumber.isZero()) {
writer.uint32(24).uint64(message.pageNumber);
}
if (!message.pageTotal.isZero()) {
writer.uint32(32).uint64(message.pageTotal);
}
if (!message.limit.isZero()) {
writer.uint32(40).uint64(message.limit);
}
for (const v of message.txs) {
TxResponse.encode(v!, writer.uint32(50).fork()).ldelim();
}
@ -1001,7 +1053,7 @@ export const SearchTxsResult = {
decode(input: _m0.Reader | Uint8Array, length?: number): SearchTxsResult {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSearchTxsResult) as SearchTxsResult;
const message = { ...baseSearchTxsResult } as SearchTxsResult;
message.txs = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -1033,7 +1085,7 @@ export const SearchTxsResult = {
},
fromJSON(object: any): SearchTxsResult {
const message = Object.create(baseSearchTxsResult) as SearchTxsResult;
const message = { ...baseSearchTxsResult } as SearchTxsResult;
message.txs = [];
if (object.totalCount !== undefined && object.totalCount !== null) {
message.totalCount = Long.fromString(object.totalCount);
@ -1068,6 +1120,21 @@ export const SearchTxsResult = {
return message;
},
toJSON(message: SearchTxsResult): unknown {
const obj: any = {};
message.totalCount !== undefined && (obj.totalCount = (message.totalCount || Long.UZERO).toString());
message.count !== undefined && (obj.count = (message.count || Long.UZERO).toString());
message.pageNumber !== undefined && (obj.pageNumber = (message.pageNumber || Long.UZERO).toString());
message.pageTotal !== undefined && (obj.pageTotal = (message.pageTotal || Long.UZERO).toString());
message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString());
if (message.txs) {
obj.txs = message.txs.map((e) => (e ? TxResponse.toJSON(e) : undefined));
} else {
obj.txs = [];
}
return obj;
},
fromPartial(object: DeepPartial<SearchTxsResult>): SearchTxsResult {
const message = { ...baseSearchTxsResult } as SearchTxsResult;
message.txs = [];
@ -1103,21 +1170,6 @@ export const SearchTxsResult = {
}
return message;
},
toJSON(message: SearchTxsResult): unknown {
const obj: any = {};
message.totalCount !== undefined && (obj.totalCount = (message.totalCount || Long.UZERO).toString());
message.count !== undefined && (obj.count = (message.count || Long.UZERO).toString());
message.pageNumber !== undefined && (obj.pageNumber = (message.pageNumber || Long.UZERO).toString());
message.pageTotal !== undefined && (obj.pageTotal = (message.pageTotal || Long.UZERO).toString());
message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString());
if (message.txs) {
obj.txs = message.txs.map((e) => (e ? TxResponse.toJSON(e) : undefined));
} else {
obj.txs = [];
}
return obj;
},
};
declare var self: any | undefined;
@ -1127,7 +1179,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -66,17 +66,25 @@ const basePageRequest: object = { offset: Long.UZERO, limit: Long.UZERO, countTo
export const PageRequest = {
encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.key);
writer.uint32(16).uint64(message.offset);
writer.uint32(24).uint64(message.limit);
writer.uint32(32).bool(message.countTotal);
if (message.key.length !== 0) {
writer.uint32(10).bytes(message.key);
}
if (!message.offset.isZero()) {
writer.uint32(16).uint64(message.offset);
}
if (!message.limit.isZero()) {
writer.uint32(24).uint64(message.limit);
}
if (message.countTotal === true) {
writer.uint32(32).bool(message.countTotal);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): PageRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(basePageRequest) as PageRequest;
const message = { ...basePageRequest } as PageRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -101,7 +109,7 @@ export const PageRequest = {
},
fromJSON(object: any): PageRequest {
const message = Object.create(basePageRequest) as PageRequest;
const message = { ...basePageRequest } as PageRequest;
if (object.key !== undefined && object.key !== null) {
message.key = bytesFromBase64(object.key);
}
@ -123,6 +131,16 @@ export const PageRequest = {
return message;
},
toJSON(message: PageRequest): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.offset !== undefined && (obj.offset = (message.offset || Long.UZERO).toString());
message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString());
message.countTotal !== undefined && (obj.countTotal = message.countTotal);
return obj;
},
fromPartial(object: DeepPartial<PageRequest>): PageRequest {
const message = { ...basePageRequest } as PageRequest;
if (object.key !== undefined && object.key !== null) {
@ -147,31 +165,25 @@ export const PageRequest = {
}
return message;
},
toJSON(message: PageRequest): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.offset !== undefined && (obj.offset = (message.offset || Long.UZERO).toString());
message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString());
message.countTotal !== undefined && (obj.countTotal = message.countTotal);
return obj;
},
};
const basePageResponse: object = { total: Long.UZERO };
export const PageResponse = {
encode(message: PageResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.nextKey);
writer.uint32(16).uint64(message.total);
if (message.nextKey.length !== 0) {
writer.uint32(10).bytes(message.nextKey);
}
if (!message.total.isZero()) {
writer.uint32(16).uint64(message.total);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): PageResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(basePageResponse) as PageResponse;
const message = { ...basePageResponse } as PageResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -190,7 +202,7 @@ export const PageResponse = {
},
fromJSON(object: any): PageResponse {
const message = Object.create(basePageResponse) as PageResponse;
const message = { ...basePageResponse } as PageResponse;
if (object.nextKey !== undefined && object.nextKey !== null) {
message.nextKey = bytesFromBase64(object.nextKey);
}
@ -202,6 +214,14 @@ export const PageResponse = {
return message;
},
toJSON(message: PageResponse): unknown {
const obj: any = {};
message.nextKey !== undefined &&
(obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array()));
message.total !== undefined && (obj.total = (message.total || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<PageResponse>): PageResponse {
const message = { ...basePageResponse } as PageResponse;
if (object.nextKey !== undefined && object.nextKey !== null) {
@ -216,14 +236,6 @@ export const PageResponse = {
}
return message;
},
toJSON(message: PageResponse): unknown {
const obj: any = {};
message.nextKey !== undefined &&
(obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array()));
message.total !== undefined && (obj.total = (message.total || Long.UZERO).toString());
return obj;
},
};
declare var self: any | undefined;
@ -233,7 +245,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -40,15 +40,19 @@ const baseCoin: object = { denom: "", amount: "" };
export const Coin = {
encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.denom);
writer.uint32(18).string(message.amount);
if (message.denom !== "") {
writer.uint32(10).string(message.denom);
}
if (message.amount !== "") {
writer.uint32(18).string(message.amount);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Coin {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCoin) as Coin;
const message = { ...baseCoin } as Coin;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -67,7 +71,7 @@ export const Coin = {
},
fromJSON(object: any): Coin {
const message = Object.create(baseCoin) as Coin;
const message = { ...baseCoin } as Coin;
if (object.denom !== undefined && object.denom !== null) {
message.denom = String(object.denom);
} else {
@ -81,6 +85,13 @@ export const Coin = {
return message;
},
toJSON(message: Coin): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.amount !== undefined && (obj.amount = message.amount);
return obj;
},
fromPartial(object: DeepPartial<Coin>): Coin {
const message = { ...baseCoin } as Coin;
if (object.denom !== undefined && object.denom !== null) {
@ -95,28 +106,25 @@ export const Coin = {
}
return message;
},
toJSON(message: Coin): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.amount !== undefined && (obj.amount = message.amount);
return obj;
},
};
const baseDecCoin: object = { denom: "", amount: "" };
export const DecCoin = {
encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.denom);
writer.uint32(18).string(message.amount);
if (message.denom !== "") {
writer.uint32(10).string(message.denom);
}
if (message.amount !== "") {
writer.uint32(18).string(message.amount);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): DecCoin {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseDecCoin) as DecCoin;
const message = { ...baseDecCoin } as DecCoin;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -135,7 +143,7 @@ export const DecCoin = {
},
fromJSON(object: any): DecCoin {
const message = Object.create(baseDecCoin) as DecCoin;
const message = { ...baseDecCoin } as DecCoin;
if (object.denom !== undefined && object.denom !== null) {
message.denom = String(object.denom);
} else {
@ -149,6 +157,13 @@ export const DecCoin = {
return message;
},
toJSON(message: DecCoin): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.amount !== undefined && (obj.amount = message.amount);
return obj;
},
fromPartial(object: DeepPartial<DecCoin>): DecCoin {
const message = { ...baseDecCoin } as DecCoin;
if (object.denom !== undefined && object.denom !== null) {
@ -163,27 +178,22 @@ export const DecCoin = {
}
return message;
},
toJSON(message: DecCoin): unknown {
const obj: any = {};
message.denom !== undefined && (obj.denom = message.denom);
message.amount !== undefined && (obj.amount = message.amount);
return obj;
},
};
const baseIntProto: object = { int: "" };
export const IntProto = {
encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.int);
if (message.int !== "") {
writer.uint32(10).string(message.int);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): IntProto {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseIntProto) as IntProto;
const message = { ...baseIntProto } as IntProto;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -199,19 +209,9 @@ export const IntProto = {
},
fromJSON(object: any): IntProto {
const message = Object.create(baseIntProto) as IntProto;
if (object.int !== undefined && object.int !== null) {
message.int = String(object.int);
} else {
message.int = "";
}
return message;
},
fromPartial(object: DeepPartial<IntProto>): IntProto {
const message = { ...baseIntProto } as IntProto;
if (object.int !== undefined && object.int !== null) {
message.int = object.int;
message.int = String(object.int);
} else {
message.int = "";
}
@ -223,20 +223,32 @@ export const IntProto = {
message.int !== undefined && (obj.int = message.int);
return obj;
},
fromPartial(object: DeepPartial<IntProto>): IntProto {
const message = { ...baseIntProto } as IntProto;
if (object.int !== undefined && object.int !== null) {
message.int = object.int;
} else {
message.int = "";
}
return message;
},
};
const baseDecProto: object = { dec: "" };
export const DecProto = {
encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.dec);
if (message.dec !== "") {
writer.uint32(10).string(message.dec);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): DecProto {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseDecProto) as DecProto;
const message = { ...baseDecProto } as DecProto;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -252,19 +264,9 @@ export const DecProto = {
},
fromJSON(object: any): DecProto {
const message = Object.create(baseDecProto) as DecProto;
if (object.dec !== undefined && object.dec !== null) {
message.dec = String(object.dec);
} else {
message.dec = "";
}
return message;
},
fromPartial(object: DeepPartial<DecProto>): DecProto {
const message = { ...baseDecProto } as DecProto;
if (object.dec !== undefined && object.dec !== null) {
message.dec = object.dec;
message.dec = String(object.dec);
} else {
message.dec = "";
}
@ -276,6 +278,16 @@ export const DecProto = {
message.dec !== undefined && (obj.dec = message.dec);
return obj;
},
fromPartial(object: DeepPartial<DecProto>): DecProto {
const message = { ...baseDecProto } as DecProto;
if (object.dec !== undefined && object.dec !== null) {
message.dec = object.dec;
} else {
message.dec = "";
}
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;

View File

@ -37,7 +37,7 @@ export const MultiSignature = {
decode(input: _m0.Reader | Uint8Array, length?: number): MultiSignature {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMultiSignature) as MultiSignature;
const message = { ...baseMultiSignature } as MultiSignature;
message.signatures = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -54,22 +54,11 @@ export const MultiSignature = {
},
fromJSON(object: any): MultiSignature {
const message = Object.create(baseMultiSignature) as MultiSignature;
message.signatures = [];
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(bytesFromBase64(e));
}
}
return message;
},
fromPartial(object: DeepPartial<MultiSignature>): MultiSignature {
const message = { ...baseMultiSignature } as MultiSignature;
message.signatures = [];
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(e);
message.signatures.push(bytesFromBase64(e));
}
}
return message;
@ -84,21 +73,36 @@ export const MultiSignature = {
}
return obj;
},
fromPartial(object: DeepPartial<MultiSignature>): MultiSignature {
const message = { ...baseMultiSignature } as MultiSignature;
message.signatures = [];
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(e);
}
}
return message;
},
};
const baseCompactBitArray: object = { extraBitsStored: 0 };
export const CompactBitArray = {
encode(message: CompactBitArray, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint32(message.extraBitsStored);
writer.uint32(18).bytes(message.elems);
if (message.extraBitsStored !== 0) {
writer.uint32(8).uint32(message.extraBitsStored);
}
if (message.elems.length !== 0) {
writer.uint32(18).bytes(message.elems);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): CompactBitArray {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCompactBitArray) as CompactBitArray;
const message = { ...baseCompactBitArray } as CompactBitArray;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -117,7 +121,7 @@ export const CompactBitArray = {
},
fromJSON(object: any): CompactBitArray {
const message = Object.create(baseCompactBitArray) as CompactBitArray;
const message = { ...baseCompactBitArray } as CompactBitArray;
if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) {
message.extraBitsStored = Number(object.extraBitsStored);
} else {
@ -129,6 +133,14 @@ export const CompactBitArray = {
return message;
},
toJSON(message: CompactBitArray): unknown {
const obj: any = {};
message.extraBitsStored !== undefined && (obj.extraBitsStored = message.extraBitsStored);
message.elems !== undefined &&
(obj.elems = base64FromBytes(message.elems !== undefined ? message.elems : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<CompactBitArray>): CompactBitArray {
const message = { ...baseCompactBitArray } as CompactBitArray;
if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) {
@ -143,14 +155,6 @@ export const CompactBitArray = {
}
return message;
},
toJSON(message: CompactBitArray): unknown {
const obj: any = {};
message.extraBitsStored !== undefined && (obj.extraBitsStored = message.extraBitsStored);
message.elems !== undefined &&
(obj.elems = base64FromBytes(message.elems !== undefined ? message.elems : new Uint8Array()));
return obj;
},
};
declare var self: any | undefined;
@ -160,7 +164,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -24,14 +24,16 @@ const basePubKey: object = {};
export const PubKey = {
encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.key);
if (message.key.length !== 0) {
writer.uint32(10).bytes(message.key);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): PubKey {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(basePubKey) as PubKey;
const message = { ...basePubKey } as PubKey;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -47,13 +49,20 @@ export const PubKey = {
},
fromJSON(object: any): PubKey {
const message = Object.create(basePubKey) as PubKey;
const message = { ...basePubKey } as PubKey;
if (object.key !== undefined && object.key !== null) {
message.key = bytesFromBase64(object.key);
}
return message;
},
toJSON(message: PubKey): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<PubKey>): PubKey {
const message = { ...basePubKey } as PubKey;
if (object.key !== undefined && object.key !== null) {
@ -63,27 +72,22 @@ export const PubKey = {
}
return message;
},
toJSON(message: PubKey): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
return obj;
},
};
const basePrivKey: object = {};
export const PrivKey = {
encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.key);
if (message.key.length !== 0) {
writer.uint32(10).bytes(message.key);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(basePrivKey) as PrivKey;
const message = { ...basePrivKey } as PrivKey;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -99,13 +103,20 @@ export const PrivKey = {
},
fromJSON(object: any): PrivKey {
const message = Object.create(basePrivKey) as PrivKey;
const message = { ...basePrivKey } as PrivKey;
if (object.key !== undefined && object.key !== null) {
message.key = bytesFromBase64(object.key);
}
return message;
},
toJSON(message: PrivKey): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<PrivKey>): PrivKey {
const message = { ...basePrivKey } as PrivKey;
if (object.key !== undefined && object.key !== null) {
@ -115,13 +126,6 @@ export const PrivKey = {
}
return message;
},
toJSON(message: PrivKey): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
return obj;
},
};
declare var self: any | undefined;
@ -131,7 +135,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -135,17 +135,25 @@ const baseParams: object = {
export const Params = {
encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.communityTax);
writer.uint32(18).string(message.baseProposerReward);
writer.uint32(26).string(message.bonusProposerReward);
writer.uint32(32).bool(message.withdrawAddrEnabled);
if (message.communityTax !== "") {
writer.uint32(10).string(message.communityTax);
}
if (message.baseProposerReward !== "") {
writer.uint32(18).string(message.baseProposerReward);
}
if (message.bonusProposerReward !== "") {
writer.uint32(26).string(message.bonusProposerReward);
}
if (message.withdrawAddrEnabled === true) {
writer.uint32(32).bool(message.withdrawAddrEnabled);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Params {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseParams) as Params;
const message = { ...baseParams } as Params;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -170,7 +178,7 @@ export const Params = {
},
fromJSON(object: any): Params {
const message = Object.create(baseParams) as Params;
const message = { ...baseParams } as Params;
if (object.communityTax !== undefined && object.communityTax !== null) {
message.communityTax = String(object.communityTax);
} else {
@ -194,6 +202,15 @@ export const Params = {
return message;
},
toJSON(message: Params): unknown {
const obj: any = {};
message.communityTax !== undefined && (obj.communityTax = message.communityTax);
message.baseProposerReward !== undefined && (obj.baseProposerReward = message.baseProposerReward);
message.bonusProposerReward !== undefined && (obj.bonusProposerReward = message.bonusProposerReward);
message.withdrawAddrEnabled !== undefined && (obj.withdrawAddrEnabled = message.withdrawAddrEnabled);
return obj;
},
fromPartial(object: DeepPartial<Params>): Params {
const message = { ...baseParams } as Params;
if (object.communityTax !== undefined && object.communityTax !== null) {
@ -218,15 +235,6 @@ export const Params = {
}
return message;
},
toJSON(message: Params): unknown {
const obj: any = {};
message.communityTax !== undefined && (obj.communityTax = message.communityTax);
message.baseProposerReward !== undefined && (obj.baseProposerReward = message.baseProposerReward);
message.bonusProposerReward !== undefined && (obj.bonusProposerReward = message.bonusProposerReward);
message.withdrawAddrEnabled !== undefined && (obj.withdrawAddrEnabled = message.withdrawAddrEnabled);
return obj;
},
};
const baseValidatorHistoricalRewards: object = { referenceCount: 0 };
@ -236,14 +244,16 @@ export const ValidatorHistoricalRewards = {
for (const v of message.cumulativeRewardRatio) {
DecCoin.encode(v!, writer.uint32(10).fork()).ldelim();
}
writer.uint32(16).uint32(message.referenceCount);
if (message.referenceCount !== 0) {
writer.uint32(16).uint32(message.referenceCount);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorHistoricalRewards {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseValidatorHistoricalRewards) as ValidatorHistoricalRewards;
const message = { ...baseValidatorHistoricalRewards } as ValidatorHistoricalRewards;
message.cumulativeRewardRatio = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -263,7 +273,7 @@ export const ValidatorHistoricalRewards = {
},
fromJSON(object: any): ValidatorHistoricalRewards {
const message = Object.create(baseValidatorHistoricalRewards) as ValidatorHistoricalRewards;
const message = { ...baseValidatorHistoricalRewards } as ValidatorHistoricalRewards;
message.cumulativeRewardRatio = [];
if (object.cumulativeRewardRatio !== undefined && object.cumulativeRewardRatio !== null) {
for (const e of object.cumulativeRewardRatio) {
@ -278,22 +288,6 @@ export const ValidatorHistoricalRewards = {
return message;
},
fromPartial(object: DeepPartial<ValidatorHistoricalRewards>): ValidatorHistoricalRewards {
const message = { ...baseValidatorHistoricalRewards } as ValidatorHistoricalRewards;
message.cumulativeRewardRatio = [];
if (object.cumulativeRewardRatio !== undefined && object.cumulativeRewardRatio !== null) {
for (const e of object.cumulativeRewardRatio) {
message.cumulativeRewardRatio.push(DecCoin.fromPartial(e));
}
}
if (object.referenceCount !== undefined && object.referenceCount !== null) {
message.referenceCount = object.referenceCount;
} else {
message.referenceCount = 0;
}
return message;
},
toJSON(message: ValidatorHistoricalRewards): unknown {
const obj: any = {};
if (message.cumulativeRewardRatio) {
@ -306,6 +300,22 @@ export const ValidatorHistoricalRewards = {
message.referenceCount !== undefined && (obj.referenceCount = message.referenceCount);
return obj;
},
fromPartial(object: DeepPartial<ValidatorHistoricalRewards>): ValidatorHistoricalRewards {
const message = { ...baseValidatorHistoricalRewards } as ValidatorHistoricalRewards;
message.cumulativeRewardRatio = [];
if (object.cumulativeRewardRatio !== undefined && object.cumulativeRewardRatio !== null) {
for (const e of object.cumulativeRewardRatio) {
message.cumulativeRewardRatio.push(DecCoin.fromPartial(e));
}
}
if (object.referenceCount !== undefined && object.referenceCount !== null) {
message.referenceCount = object.referenceCount;
} else {
message.referenceCount = 0;
}
return message;
},
};
const baseValidatorCurrentRewards: object = { period: Long.UZERO };
@ -315,14 +325,16 @@ export const ValidatorCurrentRewards = {
for (const v of message.rewards) {
DecCoin.encode(v!, writer.uint32(10).fork()).ldelim();
}
writer.uint32(16).uint64(message.period);
if (!message.period.isZero()) {
writer.uint32(16).uint64(message.period);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorCurrentRewards {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseValidatorCurrentRewards) as ValidatorCurrentRewards;
const message = { ...baseValidatorCurrentRewards } as ValidatorCurrentRewards;
message.rewards = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -342,7 +354,7 @@ export const ValidatorCurrentRewards = {
},
fromJSON(object: any): ValidatorCurrentRewards {
const message = Object.create(baseValidatorCurrentRewards) as ValidatorCurrentRewards;
const message = { ...baseValidatorCurrentRewards } as ValidatorCurrentRewards;
message.rewards = [];
if (object.rewards !== undefined && object.rewards !== null) {
for (const e of object.rewards) {
@ -357,6 +369,17 @@ export const ValidatorCurrentRewards = {
return message;
},
toJSON(message: ValidatorCurrentRewards): unknown {
const obj: any = {};
if (message.rewards) {
obj.rewards = message.rewards.map((e) => (e ? DecCoin.toJSON(e) : undefined));
} else {
obj.rewards = [];
}
message.period !== undefined && (obj.period = (message.period || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<ValidatorCurrentRewards>): ValidatorCurrentRewards {
const message = { ...baseValidatorCurrentRewards } as ValidatorCurrentRewards;
message.rewards = [];
@ -372,17 +395,6 @@ export const ValidatorCurrentRewards = {
}
return message;
},
toJSON(message: ValidatorCurrentRewards): unknown {
const obj: any = {};
if (message.rewards) {
obj.rewards = message.rewards.map((e) => (e ? DecCoin.toJSON(e) : undefined));
} else {
obj.rewards = [];
}
message.period !== undefined && (obj.period = (message.period || Long.UZERO).toString());
return obj;
},
};
const baseValidatorAccumulatedCommission: object = {};
@ -398,7 +410,7 @@ export const ValidatorAccumulatedCommission = {
decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorAccumulatedCommission {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseValidatorAccumulatedCommission) as ValidatorAccumulatedCommission;
const message = { ...baseValidatorAccumulatedCommission } as ValidatorAccumulatedCommission;
message.commission = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -415,22 +427,11 @@ export const ValidatorAccumulatedCommission = {
},
fromJSON(object: any): ValidatorAccumulatedCommission {
const message = Object.create(baseValidatorAccumulatedCommission) as ValidatorAccumulatedCommission;
message.commission = [];
if (object.commission !== undefined && object.commission !== null) {
for (const e of object.commission) {
message.commission.push(DecCoin.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<ValidatorAccumulatedCommission>): ValidatorAccumulatedCommission {
const message = { ...baseValidatorAccumulatedCommission } as ValidatorAccumulatedCommission;
message.commission = [];
if (object.commission !== undefined && object.commission !== null) {
for (const e of object.commission) {
message.commission.push(DecCoin.fromPartial(e));
message.commission.push(DecCoin.fromJSON(e));
}
}
return message;
@ -445,6 +446,17 @@ export const ValidatorAccumulatedCommission = {
}
return obj;
},
fromPartial(object: DeepPartial<ValidatorAccumulatedCommission>): ValidatorAccumulatedCommission {
const message = { ...baseValidatorAccumulatedCommission } as ValidatorAccumulatedCommission;
message.commission = [];
if (object.commission !== undefined && object.commission !== null) {
for (const e of object.commission) {
message.commission.push(DecCoin.fromPartial(e));
}
}
return message;
},
};
const baseValidatorOutstandingRewards: object = {};
@ -460,7 +472,7 @@ export const ValidatorOutstandingRewards = {
decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorOutstandingRewards {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseValidatorOutstandingRewards) as ValidatorOutstandingRewards;
const message = { ...baseValidatorOutstandingRewards } as ValidatorOutstandingRewards;
message.rewards = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -477,22 +489,11 @@ export const ValidatorOutstandingRewards = {
},
fromJSON(object: any): ValidatorOutstandingRewards {
const message = Object.create(baseValidatorOutstandingRewards) as ValidatorOutstandingRewards;
message.rewards = [];
if (object.rewards !== undefined && object.rewards !== null) {
for (const e of object.rewards) {
message.rewards.push(DecCoin.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<ValidatorOutstandingRewards>): ValidatorOutstandingRewards {
const message = { ...baseValidatorOutstandingRewards } as ValidatorOutstandingRewards;
message.rewards = [];
if (object.rewards !== undefined && object.rewards !== null) {
for (const e of object.rewards) {
message.rewards.push(DecCoin.fromPartial(e));
message.rewards.push(DecCoin.fromJSON(e));
}
}
return message;
@ -507,21 +508,36 @@ export const ValidatorOutstandingRewards = {
}
return obj;
},
fromPartial(object: DeepPartial<ValidatorOutstandingRewards>): ValidatorOutstandingRewards {
const message = { ...baseValidatorOutstandingRewards } as ValidatorOutstandingRewards;
message.rewards = [];
if (object.rewards !== undefined && object.rewards !== null) {
for (const e of object.rewards) {
message.rewards.push(DecCoin.fromPartial(e));
}
}
return message;
},
};
const baseValidatorSlashEvent: object = { validatorPeriod: Long.UZERO, fraction: "" };
export const ValidatorSlashEvent = {
encode(message: ValidatorSlashEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint64(message.validatorPeriod);
writer.uint32(18).string(message.fraction);
if (!message.validatorPeriod.isZero()) {
writer.uint32(8).uint64(message.validatorPeriod);
}
if (message.fraction !== "") {
writer.uint32(18).string(message.fraction);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEvent {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseValidatorSlashEvent) as ValidatorSlashEvent;
const message = { ...baseValidatorSlashEvent } as ValidatorSlashEvent;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -540,7 +556,7 @@ export const ValidatorSlashEvent = {
},
fromJSON(object: any): ValidatorSlashEvent {
const message = Object.create(baseValidatorSlashEvent) as ValidatorSlashEvent;
const message = { ...baseValidatorSlashEvent } as ValidatorSlashEvent;
if (object.validatorPeriod !== undefined && object.validatorPeriod !== null) {
message.validatorPeriod = Long.fromString(object.validatorPeriod);
} else {
@ -554,6 +570,14 @@ export const ValidatorSlashEvent = {
return message;
},
toJSON(message: ValidatorSlashEvent): unknown {
const obj: any = {};
message.validatorPeriod !== undefined &&
(obj.validatorPeriod = (message.validatorPeriod || Long.UZERO).toString());
message.fraction !== undefined && (obj.fraction = message.fraction);
return obj;
},
fromPartial(object: DeepPartial<ValidatorSlashEvent>): ValidatorSlashEvent {
const message = { ...baseValidatorSlashEvent } as ValidatorSlashEvent;
if (object.validatorPeriod !== undefined && object.validatorPeriod !== null) {
@ -568,14 +592,6 @@ export const ValidatorSlashEvent = {
}
return message;
},
toJSON(message: ValidatorSlashEvent): unknown {
const obj: any = {};
message.validatorPeriod !== undefined &&
(obj.validatorPeriod = (message.validatorPeriod || Long.UZERO).toString());
message.fraction !== undefined && (obj.fraction = message.fraction);
return obj;
},
};
const baseValidatorSlashEvents: object = {};
@ -591,7 +607,7 @@ export const ValidatorSlashEvents = {
decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEvents {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseValidatorSlashEvents) as ValidatorSlashEvents;
const message = { ...baseValidatorSlashEvents } as ValidatorSlashEvents;
message.validatorSlashEvents = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -608,22 +624,11 @@ export const ValidatorSlashEvents = {
},
fromJSON(object: any): ValidatorSlashEvents {
const message = Object.create(baseValidatorSlashEvents) as ValidatorSlashEvents;
message.validatorSlashEvents = [];
if (object.validatorSlashEvents !== undefined && object.validatorSlashEvents !== null) {
for (const e of object.validatorSlashEvents) {
message.validatorSlashEvents.push(ValidatorSlashEvent.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<ValidatorSlashEvents>): ValidatorSlashEvents {
const message = { ...baseValidatorSlashEvents } as ValidatorSlashEvents;
message.validatorSlashEvents = [];
if (object.validatorSlashEvents !== undefined && object.validatorSlashEvents !== null) {
for (const e of object.validatorSlashEvents) {
message.validatorSlashEvents.push(ValidatorSlashEvent.fromPartial(e));
message.validatorSlashEvents.push(ValidatorSlashEvent.fromJSON(e));
}
}
return message;
@ -640,6 +645,17 @@ export const ValidatorSlashEvents = {
}
return obj;
},
fromPartial(object: DeepPartial<ValidatorSlashEvents>): ValidatorSlashEvents {
const message = { ...baseValidatorSlashEvents } as ValidatorSlashEvents;
message.validatorSlashEvents = [];
if (object.validatorSlashEvents !== undefined && object.validatorSlashEvents !== null) {
for (const e of object.validatorSlashEvents) {
message.validatorSlashEvents.push(ValidatorSlashEvent.fromPartial(e));
}
}
return message;
},
};
const baseFeePool: object = {};
@ -655,7 +671,7 @@ export const FeePool = {
decode(input: _m0.Reader | Uint8Array, length?: number): FeePool {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseFeePool) as FeePool;
const message = { ...baseFeePool } as FeePool;
message.communityPool = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -672,22 +688,11 @@ export const FeePool = {
},
fromJSON(object: any): FeePool {
const message = Object.create(baseFeePool) as FeePool;
message.communityPool = [];
if (object.communityPool !== undefined && object.communityPool !== null) {
for (const e of object.communityPool) {
message.communityPool.push(DecCoin.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<FeePool>): FeePool {
const message = { ...baseFeePool } as FeePool;
message.communityPool = [];
if (object.communityPool !== undefined && object.communityPool !== null) {
for (const e of object.communityPool) {
message.communityPool.push(DecCoin.fromPartial(e));
message.communityPool.push(DecCoin.fromJSON(e));
}
}
return message;
@ -702,15 +707,32 @@ export const FeePool = {
}
return obj;
},
fromPartial(object: DeepPartial<FeePool>): FeePool {
const message = { ...baseFeePool } as FeePool;
message.communityPool = [];
if (object.communityPool !== undefined && object.communityPool !== null) {
for (const e of object.communityPool) {
message.communityPool.push(DecCoin.fromPartial(e));
}
}
return message;
},
};
const baseCommunityPoolSpendProposal: object = { title: "", description: "", recipient: "" };
export const CommunityPoolSpendProposal = {
encode(message: CommunityPoolSpendProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.title);
writer.uint32(18).string(message.description);
writer.uint32(26).string(message.recipient);
if (message.title !== "") {
writer.uint32(10).string(message.title);
}
if (message.description !== "") {
writer.uint32(18).string(message.description);
}
if (message.recipient !== "") {
writer.uint32(26).string(message.recipient);
}
for (const v of message.amount) {
Coin.encode(v!, writer.uint32(34).fork()).ldelim();
}
@ -720,7 +742,7 @@ export const CommunityPoolSpendProposal = {
decode(input: _m0.Reader | Uint8Array, length?: number): CommunityPoolSpendProposal {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCommunityPoolSpendProposal) as CommunityPoolSpendProposal;
const message = { ...baseCommunityPoolSpendProposal } as CommunityPoolSpendProposal;
message.amount = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -746,7 +768,7 @@ export const CommunityPoolSpendProposal = {
},
fromJSON(object: any): CommunityPoolSpendProposal {
const message = Object.create(baseCommunityPoolSpendProposal) as CommunityPoolSpendProposal;
const message = { ...baseCommunityPoolSpendProposal } as CommunityPoolSpendProposal;
message.amount = [];
if (object.title !== undefined && object.title !== null) {
message.title = String(object.title);
@ -771,6 +793,19 @@ export const CommunityPoolSpendProposal = {
return message;
},
toJSON(message: CommunityPoolSpendProposal): unknown {
const obj: any = {};
message.title !== undefined && (obj.title = message.title);
message.description !== undefined && (obj.description = message.description);
message.recipient !== undefined && (obj.recipient = message.recipient);
if (message.amount) {
obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.amount = [];
}
return obj;
},
fromPartial(object: DeepPartial<CommunityPoolSpendProposal>): CommunityPoolSpendProposal {
const message = { ...baseCommunityPoolSpendProposal } as CommunityPoolSpendProposal;
message.amount = [];
@ -796,35 +831,28 @@ export const CommunityPoolSpendProposal = {
}
return message;
},
toJSON(message: CommunityPoolSpendProposal): unknown {
const obj: any = {};
message.title !== undefined && (obj.title = message.title);
message.description !== undefined && (obj.description = message.description);
message.recipient !== undefined && (obj.recipient = message.recipient);
if (message.amount) {
obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.amount = [];
}
return obj;
},
};
const baseDelegatorStartingInfo: object = { previousPeriod: Long.UZERO, stake: "", height: Long.UZERO };
export const DelegatorStartingInfo = {
encode(message: DelegatorStartingInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint64(message.previousPeriod);
writer.uint32(18).string(message.stake);
writer.uint32(24).uint64(message.height);
if (!message.previousPeriod.isZero()) {
writer.uint32(8).uint64(message.previousPeriod);
}
if (message.stake !== "") {
writer.uint32(18).string(message.stake);
}
if (!message.height.isZero()) {
writer.uint32(24).uint64(message.height);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorStartingInfo {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseDelegatorStartingInfo) as DelegatorStartingInfo;
const message = { ...baseDelegatorStartingInfo } as DelegatorStartingInfo;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -846,7 +874,7 @@ export const DelegatorStartingInfo = {
},
fromJSON(object: any): DelegatorStartingInfo {
const message = Object.create(baseDelegatorStartingInfo) as DelegatorStartingInfo;
const message = { ...baseDelegatorStartingInfo } as DelegatorStartingInfo;
if (object.previousPeriod !== undefined && object.previousPeriod !== null) {
message.previousPeriod = Long.fromString(object.previousPeriod);
} else {
@ -865,6 +893,15 @@ export const DelegatorStartingInfo = {
return message;
},
toJSON(message: DelegatorStartingInfo): unknown {
const obj: any = {};
message.previousPeriod !== undefined &&
(obj.previousPeriod = (message.previousPeriod || Long.UZERO).toString());
message.stake !== undefined && (obj.stake = message.stake);
message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<DelegatorStartingInfo>): DelegatorStartingInfo {
const message = { ...baseDelegatorStartingInfo } as DelegatorStartingInfo;
if (object.previousPeriod !== undefined && object.previousPeriod !== null) {
@ -884,22 +921,15 @@ export const DelegatorStartingInfo = {
}
return message;
},
toJSON(message: DelegatorStartingInfo): unknown {
const obj: any = {};
message.previousPeriod !== undefined &&
(obj.previousPeriod = (message.previousPeriod || Long.UZERO).toString());
message.stake !== undefined && (obj.stake = message.stake);
message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString());
return obj;
},
};
const baseDelegationDelegatorReward: object = { validatorAddress: "" };
export const DelegationDelegatorReward = {
encode(message: DelegationDelegatorReward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.validatorAddress);
if (message.validatorAddress !== "") {
writer.uint32(10).string(message.validatorAddress);
}
for (const v of message.reward) {
DecCoin.encode(v!, writer.uint32(18).fork()).ldelim();
}
@ -909,7 +939,7 @@ export const DelegationDelegatorReward = {
decode(input: _m0.Reader | Uint8Array, length?: number): DelegationDelegatorReward {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseDelegationDelegatorReward) as DelegationDelegatorReward;
const message = { ...baseDelegationDelegatorReward } as DelegationDelegatorReward;
message.reward = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -929,7 +959,7 @@ export const DelegationDelegatorReward = {
},
fromJSON(object: any): DelegationDelegatorReward {
const message = Object.create(baseDelegationDelegatorReward) as DelegationDelegatorReward;
const message = { ...baseDelegationDelegatorReward } as DelegationDelegatorReward;
message.reward = [];
if (object.validatorAddress !== undefined && object.validatorAddress !== null) {
message.validatorAddress = String(object.validatorAddress);
@ -944,6 +974,17 @@ export const DelegationDelegatorReward = {
return message;
},
toJSON(message: DelegationDelegatorReward): unknown {
const obj: any = {};
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
if (message.reward) {
obj.reward = message.reward.map((e) => (e ? DecCoin.toJSON(e) : undefined));
} else {
obj.reward = [];
}
return obj;
},
fromPartial(object: DeepPartial<DelegationDelegatorReward>): DelegationDelegatorReward {
const message = { ...baseDelegationDelegatorReward } as DelegationDelegatorReward;
message.reward = [];
@ -959,17 +1000,6 @@ export const DelegationDelegatorReward = {
}
return message;
},
toJSON(message: DelegationDelegatorReward): unknown {
const obj: any = {};
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
if (message.reward) {
obj.reward = message.reward.map((e) => (e ? DecCoin.toJSON(e) : undefined));
} else {
obj.reward = [];
}
return obj;
},
};
const baseCommunityPoolSpendProposalWithDeposit: object = {
@ -985,20 +1015,28 @@ export const CommunityPoolSpendProposalWithDeposit = {
message: CommunityPoolSpendProposalWithDeposit,
writer: _m0.Writer = _m0.Writer.create(),
): _m0.Writer {
writer.uint32(10).string(message.title);
writer.uint32(18).string(message.description);
writer.uint32(26).string(message.recipient);
writer.uint32(34).string(message.amount);
writer.uint32(42).string(message.deposit);
if (message.title !== "") {
writer.uint32(10).string(message.title);
}
if (message.description !== "") {
writer.uint32(18).string(message.description);
}
if (message.recipient !== "") {
writer.uint32(26).string(message.recipient);
}
if (message.amount !== "") {
writer.uint32(34).string(message.amount);
}
if (message.deposit !== "") {
writer.uint32(42).string(message.deposit);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): CommunityPoolSpendProposalWithDeposit {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(
baseCommunityPoolSpendProposalWithDeposit,
) as CommunityPoolSpendProposalWithDeposit;
const message = { ...baseCommunityPoolSpendProposalWithDeposit } as CommunityPoolSpendProposalWithDeposit;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -1026,9 +1064,7 @@ export const CommunityPoolSpendProposalWithDeposit = {
},
fromJSON(object: any): CommunityPoolSpendProposalWithDeposit {
const message = Object.create(
baseCommunityPoolSpendProposalWithDeposit,
) as CommunityPoolSpendProposalWithDeposit;
const message = { ...baseCommunityPoolSpendProposalWithDeposit } as CommunityPoolSpendProposalWithDeposit;
if (object.title !== undefined && object.title !== null) {
message.title = String(object.title);
} else {
@ -1057,6 +1093,16 @@ export const CommunityPoolSpendProposalWithDeposit = {
return message;
},
toJSON(message: CommunityPoolSpendProposalWithDeposit): unknown {
const obj: any = {};
message.title !== undefined && (obj.title = message.title);
message.description !== undefined && (obj.description = message.description);
message.recipient !== undefined && (obj.recipient = message.recipient);
message.amount !== undefined && (obj.amount = message.amount);
message.deposit !== undefined && (obj.deposit = message.deposit);
return obj;
},
fromPartial(
object: DeepPartial<CommunityPoolSpendProposalWithDeposit>,
): CommunityPoolSpendProposalWithDeposit {
@ -1088,16 +1134,6 @@ export const CommunityPoolSpendProposalWithDeposit = {
}
return message;
},
toJSON(message: CommunityPoolSpendProposalWithDeposit): unknown {
const obj: any = {};
message.title !== undefined && (obj.title = message.title);
message.description !== undefined && (obj.description = message.description);
message.recipient !== undefined && (obj.recipient = message.recipient);
message.amount !== undefined && (obj.amount = message.amount);
message.deposit !== undefined && (obj.deposit = message.deposit);
return obj;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;

View File

@ -184,7 +184,7 @@ export const QueryParamsRequest = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryParamsRequest) as QueryParamsRequest;
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -197,11 +197,6 @@ export const QueryParamsRequest = {
},
fromJSON(_: any): QueryParamsRequest {
const message = Object.create(baseQueryParamsRequest) as QueryParamsRequest;
return message;
},
fromPartial(_: DeepPartial<QueryParamsRequest>): QueryParamsRequest {
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
return message;
},
@ -210,6 +205,11 @@ export const QueryParamsRequest = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<QueryParamsRequest>): QueryParamsRequest {
const message = { ...baseQueryParamsRequest } as QueryParamsRequest;
return message;
},
};
const baseQueryParamsResponse: object = {};
@ -225,7 +225,7 @@ export const QueryParamsResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryParamsResponse) as QueryParamsResponse;
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -241,19 +241,9 @@ export const QueryParamsResponse = {
},
fromJSON(object: any): QueryParamsResponse {
const message = Object.create(baseQueryParamsResponse) as QueryParamsResponse;
if (object.params !== undefined && object.params !== null) {
message.params = Params.fromJSON(object.params);
} else {
message.params = undefined;
}
return message;
},
fromPartial(object: DeepPartial<QueryParamsResponse>): QueryParamsResponse {
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
if (object.params !== undefined && object.params !== null) {
message.params = Params.fromPartial(object.params);
message.params = Params.fromJSON(object.params);
} else {
message.params = undefined;
}
@ -265,6 +255,16 @@ export const QueryParamsResponse = {
message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryParamsResponse>): QueryParamsResponse {
const message = { ...baseQueryParamsResponse } as QueryParamsResponse;
if (object.params !== undefined && object.params !== null) {
message.params = Params.fromPartial(object.params);
} else {
message.params = undefined;
}
return message;
},
};
const baseQueryValidatorOutstandingRewardsRequest: object = { validatorAddress: "" };
@ -274,16 +274,18 @@ export const QueryValidatorOutstandingRewardsRequest = {
message: QueryValidatorOutstandingRewardsRequest,
writer: _m0.Writer = _m0.Writer.create(),
): _m0.Writer {
writer.uint32(10).string(message.validatorAddress);
if (message.validatorAddress !== "") {
writer.uint32(10).string(message.validatorAddress);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(
baseQueryValidatorOutstandingRewardsRequest,
) as QueryValidatorOutstandingRewardsRequest;
const message = {
...baseQueryValidatorOutstandingRewardsRequest,
} as QueryValidatorOutstandingRewardsRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -299,9 +301,9 @@ export const QueryValidatorOutstandingRewardsRequest = {
},
fromJSON(object: any): QueryValidatorOutstandingRewardsRequest {
const message = Object.create(
baseQueryValidatorOutstandingRewardsRequest,
) as QueryValidatorOutstandingRewardsRequest;
const message = {
...baseQueryValidatorOutstandingRewardsRequest,
} as QueryValidatorOutstandingRewardsRequest;
if (object.validatorAddress !== undefined && object.validatorAddress !== null) {
message.validatorAddress = String(object.validatorAddress);
} else {
@ -310,6 +312,12 @@ export const QueryValidatorOutstandingRewardsRequest = {
return message;
},
toJSON(message: QueryValidatorOutstandingRewardsRequest): unknown {
const obj: any = {};
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
return obj;
},
fromPartial(
object: DeepPartial<QueryValidatorOutstandingRewardsRequest>,
): QueryValidatorOutstandingRewardsRequest {
@ -323,12 +331,6 @@ export const QueryValidatorOutstandingRewardsRequest = {
}
return message;
},
toJSON(message: QueryValidatorOutstandingRewardsRequest): unknown {
const obj: any = {};
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
return obj;
},
};
const baseQueryValidatorOutstandingRewardsResponse: object = {};
@ -347,9 +349,9 @@ export const QueryValidatorOutstandingRewardsResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(
baseQueryValidatorOutstandingRewardsResponse,
) as QueryValidatorOutstandingRewardsResponse;
const message = {
...baseQueryValidatorOutstandingRewardsResponse,
} as QueryValidatorOutstandingRewardsResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -365,9 +367,9 @@ export const QueryValidatorOutstandingRewardsResponse = {
},
fromJSON(object: any): QueryValidatorOutstandingRewardsResponse {
const message = Object.create(
baseQueryValidatorOutstandingRewardsResponse,
) as QueryValidatorOutstandingRewardsResponse;
const message = {
...baseQueryValidatorOutstandingRewardsResponse,
} as QueryValidatorOutstandingRewardsResponse;
if (object.rewards !== undefined && object.rewards !== null) {
message.rewards = ValidatorOutstandingRewards.fromJSON(object.rewards);
} else {
@ -376,6 +378,13 @@ export const QueryValidatorOutstandingRewardsResponse = {
return message;
},
toJSON(message: QueryValidatorOutstandingRewardsResponse): unknown {
const obj: any = {};
message.rewards !== undefined &&
(obj.rewards = message.rewards ? ValidatorOutstandingRewards.toJSON(message.rewards) : undefined);
return obj;
},
fromPartial(
object: DeepPartial<QueryValidatorOutstandingRewardsResponse>,
): QueryValidatorOutstandingRewardsResponse {
@ -389,27 +398,22 @@ export const QueryValidatorOutstandingRewardsResponse = {
}
return message;
},
toJSON(message: QueryValidatorOutstandingRewardsResponse): unknown {
const obj: any = {};
message.rewards !== undefined &&
(obj.rewards = message.rewards ? ValidatorOutstandingRewards.toJSON(message.rewards) : undefined);
return obj;
},
};
const baseQueryValidatorCommissionRequest: object = { validatorAddress: "" };
export const QueryValidatorCommissionRequest = {
encode(message: QueryValidatorCommissionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.validatorAddress);
if (message.validatorAddress !== "") {
writer.uint32(10).string(message.validatorAddress);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorCommissionRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryValidatorCommissionRequest) as QueryValidatorCommissionRequest;
const message = { ...baseQueryValidatorCommissionRequest } as QueryValidatorCommissionRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -425,19 +429,9 @@ export const QueryValidatorCommissionRequest = {
},
fromJSON(object: any): QueryValidatorCommissionRequest {
const message = Object.create(baseQueryValidatorCommissionRequest) as QueryValidatorCommissionRequest;
if (object.validatorAddress !== undefined && object.validatorAddress !== null) {
message.validatorAddress = String(object.validatorAddress);
} else {
message.validatorAddress = "";
}
return message;
},
fromPartial(object: DeepPartial<QueryValidatorCommissionRequest>): QueryValidatorCommissionRequest {
const message = { ...baseQueryValidatorCommissionRequest } as QueryValidatorCommissionRequest;
if (object.validatorAddress !== undefined && object.validatorAddress !== null) {
message.validatorAddress = object.validatorAddress;
message.validatorAddress = String(object.validatorAddress);
} else {
message.validatorAddress = "";
}
@ -449,6 +443,16 @@ export const QueryValidatorCommissionRequest = {
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
return obj;
},
fromPartial(object: DeepPartial<QueryValidatorCommissionRequest>): QueryValidatorCommissionRequest {
const message = { ...baseQueryValidatorCommissionRequest } as QueryValidatorCommissionRequest;
if (object.validatorAddress !== undefined && object.validatorAddress !== null) {
message.validatorAddress = object.validatorAddress;
} else {
message.validatorAddress = "";
}
return message;
},
};
const baseQueryValidatorCommissionResponse: object = {};
@ -464,7 +468,7 @@ export const QueryValidatorCommissionResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorCommissionResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryValidatorCommissionResponse) as QueryValidatorCommissionResponse;
const message = { ...baseQueryValidatorCommissionResponse } as QueryValidatorCommissionResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -480,19 +484,9 @@ export const QueryValidatorCommissionResponse = {
},
fromJSON(object: any): QueryValidatorCommissionResponse {
const message = Object.create(baseQueryValidatorCommissionResponse) as QueryValidatorCommissionResponse;
if (object.commission !== undefined && object.commission !== null) {
message.commission = ValidatorAccumulatedCommission.fromJSON(object.commission);
} else {
message.commission = undefined;
}
return message;
},
fromPartial(object: DeepPartial<QueryValidatorCommissionResponse>): QueryValidatorCommissionResponse {
const message = { ...baseQueryValidatorCommissionResponse } as QueryValidatorCommissionResponse;
if (object.commission !== undefined && object.commission !== null) {
message.commission = ValidatorAccumulatedCommission.fromPartial(object.commission);
message.commission = ValidatorAccumulatedCommission.fromJSON(object.commission);
} else {
message.commission = undefined;
}
@ -507,6 +501,16 @@ export const QueryValidatorCommissionResponse = {
: undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryValidatorCommissionResponse>): QueryValidatorCommissionResponse {
const message = { ...baseQueryValidatorCommissionResponse } as QueryValidatorCommissionResponse;
if (object.commission !== undefined && object.commission !== null) {
message.commission = ValidatorAccumulatedCommission.fromPartial(object.commission);
} else {
message.commission = undefined;
}
return message;
},
};
const baseQueryValidatorSlashesRequest: object = {
@ -517,9 +521,15 @@ const baseQueryValidatorSlashesRequest: object = {
export const QueryValidatorSlashesRequest = {
encode(message: QueryValidatorSlashesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.validatorAddress);
writer.uint32(16).uint64(message.startingHeight);
writer.uint32(24).uint64(message.endingHeight);
if (message.validatorAddress !== "") {
writer.uint32(10).string(message.validatorAddress);
}
if (!message.startingHeight.isZero()) {
writer.uint32(16).uint64(message.startingHeight);
}
if (!message.endingHeight.isZero()) {
writer.uint32(24).uint64(message.endingHeight);
}
if (message.pagination !== undefined) {
PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim();
}
@ -529,7 +539,7 @@ export const QueryValidatorSlashesRequest = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorSlashesRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryValidatorSlashesRequest) as QueryValidatorSlashesRequest;
const message = { ...baseQueryValidatorSlashesRequest } as QueryValidatorSlashesRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -554,7 +564,7 @@ export const QueryValidatorSlashesRequest = {
},
fromJSON(object: any): QueryValidatorSlashesRequest {
const message = Object.create(baseQueryValidatorSlashesRequest) as QueryValidatorSlashesRequest;
const message = { ...baseQueryValidatorSlashesRequest } as QueryValidatorSlashesRequest;
if (object.validatorAddress !== undefined && object.validatorAddress !== null) {
message.validatorAddress = String(object.validatorAddress);
} else {
@ -578,6 +588,18 @@ export const QueryValidatorSlashesRequest = {
return message;
},
toJSON(message: QueryValidatorSlashesRequest): unknown {
const obj: any = {};
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
message.startingHeight !== undefined &&
(obj.startingHeight = (message.startingHeight || Long.UZERO).toString());
message.endingHeight !== undefined &&
(obj.endingHeight = (message.endingHeight || Long.UZERO).toString());
message.pagination !== undefined &&
(obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryValidatorSlashesRequest>): QueryValidatorSlashesRequest {
const message = { ...baseQueryValidatorSlashesRequest } as QueryValidatorSlashesRequest;
if (object.validatorAddress !== undefined && object.validatorAddress !== null) {
@ -602,18 +624,6 @@ export const QueryValidatorSlashesRequest = {
}
return message;
},
toJSON(message: QueryValidatorSlashesRequest): unknown {
const obj: any = {};
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
message.startingHeight !== undefined &&
(obj.startingHeight = (message.startingHeight || Long.UZERO).toString());
message.endingHeight !== undefined &&
(obj.endingHeight = (message.endingHeight || Long.UZERO).toString());
message.pagination !== undefined &&
(obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined);
return obj;
},
};
const baseQueryValidatorSlashesResponse: object = {};
@ -632,7 +642,7 @@ export const QueryValidatorSlashesResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorSlashesResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryValidatorSlashesResponse) as QueryValidatorSlashesResponse;
const message = { ...baseQueryValidatorSlashesResponse } as QueryValidatorSlashesResponse;
message.slashes = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -652,7 +662,7 @@ export const QueryValidatorSlashesResponse = {
},
fromJSON(object: any): QueryValidatorSlashesResponse {
const message = Object.create(baseQueryValidatorSlashesResponse) as QueryValidatorSlashesResponse;
const message = { ...baseQueryValidatorSlashesResponse } as QueryValidatorSlashesResponse;
message.slashes = [];
if (object.slashes !== undefined && object.slashes !== null) {
for (const e of object.slashes) {
@ -667,22 +677,6 @@ export const QueryValidatorSlashesResponse = {
return message;
},
fromPartial(object: DeepPartial<QueryValidatorSlashesResponse>): QueryValidatorSlashesResponse {
const message = { ...baseQueryValidatorSlashesResponse } as QueryValidatorSlashesResponse;
message.slashes = [];
if (object.slashes !== undefined && object.slashes !== null) {
for (const e of object.slashes) {
message.slashes.push(ValidatorSlashEvent.fromPartial(e));
}
}
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageResponse.fromPartial(object.pagination);
} else {
message.pagination = undefined;
}
return message;
},
toJSON(message: QueryValidatorSlashesResponse): unknown {
const obj: any = {};
if (message.slashes) {
@ -694,21 +688,41 @@ export const QueryValidatorSlashesResponse = {
(obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryValidatorSlashesResponse>): QueryValidatorSlashesResponse {
const message = { ...baseQueryValidatorSlashesResponse } as QueryValidatorSlashesResponse;
message.slashes = [];
if (object.slashes !== undefined && object.slashes !== null) {
for (const e of object.slashes) {
message.slashes.push(ValidatorSlashEvent.fromPartial(e));
}
}
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageResponse.fromPartial(object.pagination);
} else {
message.pagination = undefined;
}
return message;
},
};
const baseQueryDelegationRewardsRequest: object = { delegatorAddress: "", validatorAddress: "" };
export const QueryDelegationRewardsRequest = {
encode(message: QueryDelegationRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.delegatorAddress);
writer.uint32(18).string(message.validatorAddress);
if (message.delegatorAddress !== "") {
writer.uint32(10).string(message.delegatorAddress);
}
if (message.validatorAddress !== "") {
writer.uint32(18).string(message.validatorAddress);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRewardsRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryDelegationRewardsRequest) as QueryDelegationRewardsRequest;
const message = { ...baseQueryDelegationRewardsRequest } as QueryDelegationRewardsRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -727,7 +741,7 @@ export const QueryDelegationRewardsRequest = {
},
fromJSON(object: any): QueryDelegationRewardsRequest {
const message = Object.create(baseQueryDelegationRewardsRequest) as QueryDelegationRewardsRequest;
const message = { ...baseQueryDelegationRewardsRequest } as QueryDelegationRewardsRequest;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
message.delegatorAddress = String(object.delegatorAddress);
} else {
@ -741,6 +755,13 @@ export const QueryDelegationRewardsRequest = {
return message;
},
toJSON(message: QueryDelegationRewardsRequest): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
return obj;
},
fromPartial(object: DeepPartial<QueryDelegationRewardsRequest>): QueryDelegationRewardsRequest {
const message = { ...baseQueryDelegationRewardsRequest } as QueryDelegationRewardsRequest;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
@ -755,13 +776,6 @@ export const QueryDelegationRewardsRequest = {
}
return message;
},
toJSON(message: QueryDelegationRewardsRequest): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
return obj;
},
};
const baseQueryDelegationRewardsResponse: object = {};
@ -777,7 +791,7 @@ export const QueryDelegationRewardsResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRewardsResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryDelegationRewardsResponse) as QueryDelegationRewardsResponse;
const message = { ...baseQueryDelegationRewardsResponse } as QueryDelegationRewardsResponse;
message.rewards = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -794,22 +808,11 @@ export const QueryDelegationRewardsResponse = {
},
fromJSON(object: any): QueryDelegationRewardsResponse {
const message = Object.create(baseQueryDelegationRewardsResponse) as QueryDelegationRewardsResponse;
message.rewards = [];
if (object.rewards !== undefined && object.rewards !== null) {
for (const e of object.rewards) {
message.rewards.push(DecCoin.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<QueryDelegationRewardsResponse>): QueryDelegationRewardsResponse {
const message = { ...baseQueryDelegationRewardsResponse } as QueryDelegationRewardsResponse;
message.rewards = [];
if (object.rewards !== undefined && object.rewards !== null) {
for (const e of object.rewards) {
message.rewards.push(DecCoin.fromPartial(e));
message.rewards.push(DecCoin.fromJSON(e));
}
}
return message;
@ -824,22 +827,33 @@ export const QueryDelegationRewardsResponse = {
}
return obj;
},
fromPartial(object: DeepPartial<QueryDelegationRewardsResponse>): QueryDelegationRewardsResponse {
const message = { ...baseQueryDelegationRewardsResponse } as QueryDelegationRewardsResponse;
message.rewards = [];
if (object.rewards !== undefined && object.rewards !== null) {
for (const e of object.rewards) {
message.rewards.push(DecCoin.fromPartial(e));
}
}
return message;
},
};
const baseQueryDelegationTotalRewardsRequest: object = { delegatorAddress: "" };
export const QueryDelegationTotalRewardsRequest = {
encode(message: QueryDelegationTotalRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.delegatorAddress);
if (message.delegatorAddress !== "") {
writer.uint32(10).string(message.delegatorAddress);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationTotalRewardsRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(
baseQueryDelegationTotalRewardsRequest,
) as QueryDelegationTotalRewardsRequest;
const message = { ...baseQueryDelegationTotalRewardsRequest } as QueryDelegationTotalRewardsRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -855,21 +869,9 @@ export const QueryDelegationTotalRewardsRequest = {
},
fromJSON(object: any): QueryDelegationTotalRewardsRequest {
const message = Object.create(
baseQueryDelegationTotalRewardsRequest,
) as QueryDelegationTotalRewardsRequest;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
message.delegatorAddress = String(object.delegatorAddress);
} else {
message.delegatorAddress = "";
}
return message;
},
fromPartial(object: DeepPartial<QueryDelegationTotalRewardsRequest>): QueryDelegationTotalRewardsRequest {
const message = { ...baseQueryDelegationTotalRewardsRequest } as QueryDelegationTotalRewardsRequest;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
message.delegatorAddress = object.delegatorAddress;
message.delegatorAddress = String(object.delegatorAddress);
} else {
message.delegatorAddress = "";
}
@ -881,6 +883,16 @@ export const QueryDelegationTotalRewardsRequest = {
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
return obj;
},
fromPartial(object: DeepPartial<QueryDelegationTotalRewardsRequest>): QueryDelegationTotalRewardsRequest {
const message = { ...baseQueryDelegationTotalRewardsRequest } as QueryDelegationTotalRewardsRequest;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
message.delegatorAddress = object.delegatorAddress;
} else {
message.delegatorAddress = "";
}
return message;
},
};
const baseQueryDelegationTotalRewardsResponse: object = {};
@ -899,9 +911,7 @@ export const QueryDelegationTotalRewardsResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationTotalRewardsResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(
baseQueryDelegationTotalRewardsResponse,
) as QueryDelegationTotalRewardsResponse;
const message = { ...baseQueryDelegationTotalRewardsResponse } as QueryDelegationTotalRewardsResponse;
message.rewards = [];
message.total = [];
while (reader.pos < end) {
@ -922,9 +932,7 @@ export const QueryDelegationTotalRewardsResponse = {
},
fromJSON(object: any): QueryDelegationTotalRewardsResponse {
const message = Object.create(
baseQueryDelegationTotalRewardsResponse,
) as QueryDelegationTotalRewardsResponse;
const message = { ...baseQueryDelegationTotalRewardsResponse } as QueryDelegationTotalRewardsResponse;
message.rewards = [];
message.total = [];
if (object.rewards !== undefined && object.rewards !== null) {
@ -940,23 +948,6 @@ export const QueryDelegationTotalRewardsResponse = {
return message;
},
fromPartial(object: DeepPartial<QueryDelegationTotalRewardsResponse>): QueryDelegationTotalRewardsResponse {
const message = { ...baseQueryDelegationTotalRewardsResponse } as QueryDelegationTotalRewardsResponse;
message.rewards = [];
message.total = [];
if (object.rewards !== undefined && object.rewards !== null) {
for (const e of object.rewards) {
message.rewards.push(DelegationDelegatorReward.fromPartial(e));
}
}
if (object.total !== undefined && object.total !== null) {
for (const e of object.total) {
message.total.push(DecCoin.fromPartial(e));
}
}
return message;
},
toJSON(message: QueryDelegationTotalRewardsResponse): unknown {
const obj: any = {};
if (message.rewards) {
@ -971,20 +962,39 @@ export const QueryDelegationTotalRewardsResponse = {
}
return obj;
},
fromPartial(object: DeepPartial<QueryDelegationTotalRewardsResponse>): QueryDelegationTotalRewardsResponse {
const message = { ...baseQueryDelegationTotalRewardsResponse } as QueryDelegationTotalRewardsResponse;
message.rewards = [];
message.total = [];
if (object.rewards !== undefined && object.rewards !== null) {
for (const e of object.rewards) {
message.rewards.push(DelegationDelegatorReward.fromPartial(e));
}
}
if (object.total !== undefined && object.total !== null) {
for (const e of object.total) {
message.total.push(DecCoin.fromPartial(e));
}
}
return message;
},
};
const baseQueryDelegatorValidatorsRequest: object = { delegatorAddress: "" };
export const QueryDelegatorValidatorsRequest = {
encode(message: QueryDelegatorValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.delegatorAddress);
if (message.delegatorAddress !== "") {
writer.uint32(10).string(message.delegatorAddress);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryDelegatorValidatorsRequest) as QueryDelegatorValidatorsRequest;
const message = { ...baseQueryDelegatorValidatorsRequest } as QueryDelegatorValidatorsRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -1000,19 +1010,9 @@ export const QueryDelegatorValidatorsRequest = {
},
fromJSON(object: any): QueryDelegatorValidatorsRequest {
const message = Object.create(baseQueryDelegatorValidatorsRequest) as QueryDelegatorValidatorsRequest;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
message.delegatorAddress = String(object.delegatorAddress);
} else {
message.delegatorAddress = "";
}
return message;
},
fromPartial(object: DeepPartial<QueryDelegatorValidatorsRequest>): QueryDelegatorValidatorsRequest {
const message = { ...baseQueryDelegatorValidatorsRequest } as QueryDelegatorValidatorsRequest;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
message.delegatorAddress = object.delegatorAddress;
message.delegatorAddress = String(object.delegatorAddress);
} else {
message.delegatorAddress = "";
}
@ -1024,6 +1024,16 @@ export const QueryDelegatorValidatorsRequest = {
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
return obj;
},
fromPartial(object: DeepPartial<QueryDelegatorValidatorsRequest>): QueryDelegatorValidatorsRequest {
const message = { ...baseQueryDelegatorValidatorsRequest } as QueryDelegatorValidatorsRequest;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
message.delegatorAddress = object.delegatorAddress;
} else {
message.delegatorAddress = "";
}
return message;
},
};
const baseQueryDelegatorValidatorsResponse: object = { validators: "" };
@ -1039,7 +1049,7 @@ export const QueryDelegatorValidatorsResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryDelegatorValidatorsResponse) as QueryDelegatorValidatorsResponse;
const message = { ...baseQueryDelegatorValidatorsResponse } as QueryDelegatorValidatorsResponse;
message.validators = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -1056,22 +1066,11 @@ export const QueryDelegatorValidatorsResponse = {
},
fromJSON(object: any): QueryDelegatorValidatorsResponse {
const message = Object.create(baseQueryDelegatorValidatorsResponse) as QueryDelegatorValidatorsResponse;
message.validators = [];
if (object.validators !== undefined && object.validators !== null) {
for (const e of object.validators) {
message.validators.push(String(e));
}
}
return message;
},
fromPartial(object: DeepPartial<QueryDelegatorValidatorsResponse>): QueryDelegatorValidatorsResponse {
const message = { ...baseQueryDelegatorValidatorsResponse } as QueryDelegatorValidatorsResponse;
message.validators = [];
if (object.validators !== undefined && object.validators !== null) {
for (const e of object.validators) {
message.validators.push(e);
message.validators.push(String(e));
}
}
return message;
@ -1086,6 +1085,17 @@ export const QueryDelegatorValidatorsResponse = {
}
return obj;
},
fromPartial(object: DeepPartial<QueryDelegatorValidatorsResponse>): QueryDelegatorValidatorsResponse {
const message = { ...baseQueryDelegatorValidatorsResponse } as QueryDelegatorValidatorsResponse;
message.validators = [];
if (object.validators !== undefined && object.validators !== null) {
for (const e of object.validators) {
message.validators.push(e);
}
}
return message;
},
};
const baseQueryDelegatorWithdrawAddressRequest: object = { delegatorAddress: "" };
@ -1095,16 +1105,16 @@ export const QueryDelegatorWithdrawAddressRequest = {
message: QueryDelegatorWithdrawAddressRequest,
writer: _m0.Writer = _m0.Writer.create(),
): _m0.Writer {
writer.uint32(10).string(message.delegatorAddress);
if (message.delegatorAddress !== "") {
writer.uint32(10).string(message.delegatorAddress);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(
baseQueryDelegatorWithdrawAddressRequest,
) as QueryDelegatorWithdrawAddressRequest;
const message = { ...baseQueryDelegatorWithdrawAddressRequest } as QueryDelegatorWithdrawAddressRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -1120,9 +1130,7 @@ export const QueryDelegatorWithdrawAddressRequest = {
},
fromJSON(object: any): QueryDelegatorWithdrawAddressRequest {
const message = Object.create(
baseQueryDelegatorWithdrawAddressRequest,
) as QueryDelegatorWithdrawAddressRequest;
const message = { ...baseQueryDelegatorWithdrawAddressRequest } as QueryDelegatorWithdrawAddressRequest;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
message.delegatorAddress = String(object.delegatorAddress);
} else {
@ -1131,6 +1139,12 @@ export const QueryDelegatorWithdrawAddressRequest = {
return message;
},
toJSON(message: QueryDelegatorWithdrawAddressRequest): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
return obj;
},
fromPartial(
object: DeepPartial<QueryDelegatorWithdrawAddressRequest>,
): QueryDelegatorWithdrawAddressRequest {
@ -1142,12 +1156,6 @@ export const QueryDelegatorWithdrawAddressRequest = {
}
return message;
},
toJSON(message: QueryDelegatorWithdrawAddressRequest): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
return obj;
},
};
const baseQueryDelegatorWithdrawAddressResponse: object = { withdrawAddress: "" };
@ -1157,16 +1165,16 @@ export const QueryDelegatorWithdrawAddressResponse = {
message: QueryDelegatorWithdrawAddressResponse,
writer: _m0.Writer = _m0.Writer.create(),
): _m0.Writer {
writer.uint32(10).string(message.withdrawAddress);
if (message.withdrawAddress !== "") {
writer.uint32(10).string(message.withdrawAddress);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(
baseQueryDelegatorWithdrawAddressResponse,
) as QueryDelegatorWithdrawAddressResponse;
const message = { ...baseQueryDelegatorWithdrawAddressResponse } as QueryDelegatorWithdrawAddressResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -1182,9 +1190,7 @@ export const QueryDelegatorWithdrawAddressResponse = {
},
fromJSON(object: any): QueryDelegatorWithdrawAddressResponse {
const message = Object.create(
baseQueryDelegatorWithdrawAddressResponse,
) as QueryDelegatorWithdrawAddressResponse;
const message = { ...baseQueryDelegatorWithdrawAddressResponse } as QueryDelegatorWithdrawAddressResponse;
if (object.withdrawAddress !== undefined && object.withdrawAddress !== null) {
message.withdrawAddress = String(object.withdrawAddress);
} else {
@ -1193,6 +1199,12 @@ export const QueryDelegatorWithdrawAddressResponse = {
return message;
},
toJSON(message: QueryDelegatorWithdrawAddressResponse): unknown {
const obj: any = {};
message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress);
return obj;
},
fromPartial(
object: DeepPartial<QueryDelegatorWithdrawAddressResponse>,
): QueryDelegatorWithdrawAddressResponse {
@ -1204,12 +1216,6 @@ export const QueryDelegatorWithdrawAddressResponse = {
}
return message;
},
toJSON(message: QueryDelegatorWithdrawAddressResponse): unknown {
const obj: any = {};
message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress);
return obj;
},
};
const baseQueryCommunityPoolRequest: object = {};
@ -1222,7 +1228,7 @@ export const QueryCommunityPoolRequest = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryCommunityPoolRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryCommunityPoolRequest) as QueryCommunityPoolRequest;
const message = { ...baseQueryCommunityPoolRequest } as QueryCommunityPoolRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -1235,11 +1241,6 @@ export const QueryCommunityPoolRequest = {
},
fromJSON(_: any): QueryCommunityPoolRequest {
const message = Object.create(baseQueryCommunityPoolRequest) as QueryCommunityPoolRequest;
return message;
},
fromPartial(_: DeepPartial<QueryCommunityPoolRequest>): QueryCommunityPoolRequest {
const message = { ...baseQueryCommunityPoolRequest } as QueryCommunityPoolRequest;
return message;
},
@ -1248,6 +1249,11 @@ export const QueryCommunityPoolRequest = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<QueryCommunityPoolRequest>): QueryCommunityPoolRequest {
const message = { ...baseQueryCommunityPoolRequest } as QueryCommunityPoolRequest;
return message;
},
};
const baseQueryCommunityPoolResponse: object = {};
@ -1263,7 +1269,7 @@ export const QueryCommunityPoolResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryCommunityPoolResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryCommunityPoolResponse) as QueryCommunityPoolResponse;
const message = { ...baseQueryCommunityPoolResponse } as QueryCommunityPoolResponse;
message.pool = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -1280,22 +1286,11 @@ export const QueryCommunityPoolResponse = {
},
fromJSON(object: any): QueryCommunityPoolResponse {
const message = Object.create(baseQueryCommunityPoolResponse) as QueryCommunityPoolResponse;
message.pool = [];
if (object.pool !== undefined && object.pool !== null) {
for (const e of object.pool) {
message.pool.push(DecCoin.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<QueryCommunityPoolResponse>): QueryCommunityPoolResponse {
const message = { ...baseQueryCommunityPoolResponse } as QueryCommunityPoolResponse;
message.pool = [];
if (object.pool !== undefined && object.pool !== null) {
for (const e of object.pool) {
message.pool.push(DecCoin.fromPartial(e));
message.pool.push(DecCoin.fromJSON(e));
}
}
return message;
@ -1310,6 +1305,17 @@ export const QueryCommunityPoolResponse = {
}
return obj;
},
fromPartial(object: DeepPartial<QueryCommunityPoolResponse>): QueryCommunityPoolResponse {
const message = { ...baseQueryCommunityPoolResponse } as QueryCommunityPoolResponse;
message.pool = [];
if (object.pool !== undefined && object.pool !== null) {
for (const e of object.pool) {
message.pool.push(DecCoin.fromPartial(e));
}
}
return message;
},
};
/** Query defines the gRPC querier service for distribution module. */

View File

@ -56,15 +56,19 @@ const baseMsgSetWithdrawAddress: object = { delegatorAddress: "", withdrawAddres
export const MsgSetWithdrawAddress = {
encode(message: MsgSetWithdrawAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.delegatorAddress);
writer.uint32(18).string(message.withdrawAddress);
if (message.delegatorAddress !== "") {
writer.uint32(10).string(message.delegatorAddress);
}
if (message.withdrawAddress !== "") {
writer.uint32(18).string(message.withdrawAddress);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetWithdrawAddress {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgSetWithdrawAddress) as MsgSetWithdrawAddress;
const message = { ...baseMsgSetWithdrawAddress } as MsgSetWithdrawAddress;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -83,7 +87,7 @@ export const MsgSetWithdrawAddress = {
},
fromJSON(object: any): MsgSetWithdrawAddress {
const message = Object.create(baseMsgSetWithdrawAddress) as MsgSetWithdrawAddress;
const message = { ...baseMsgSetWithdrawAddress } as MsgSetWithdrawAddress;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
message.delegatorAddress = String(object.delegatorAddress);
} else {
@ -97,6 +101,13 @@ export const MsgSetWithdrawAddress = {
return message;
},
toJSON(message: MsgSetWithdrawAddress): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress);
return obj;
},
fromPartial(object: DeepPartial<MsgSetWithdrawAddress>): MsgSetWithdrawAddress {
const message = { ...baseMsgSetWithdrawAddress } as MsgSetWithdrawAddress;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
@ -111,13 +122,6 @@ export const MsgSetWithdrawAddress = {
}
return message;
},
toJSON(message: MsgSetWithdrawAddress): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress);
return obj;
},
};
const baseMsgSetWithdrawAddressResponse: object = {};
@ -130,7 +134,7 @@ export const MsgSetWithdrawAddressResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetWithdrawAddressResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgSetWithdrawAddressResponse) as MsgSetWithdrawAddressResponse;
const message = { ...baseMsgSetWithdrawAddressResponse } as MsgSetWithdrawAddressResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -143,11 +147,6 @@ export const MsgSetWithdrawAddressResponse = {
},
fromJSON(_: any): MsgSetWithdrawAddressResponse {
const message = Object.create(baseMsgSetWithdrawAddressResponse) as MsgSetWithdrawAddressResponse;
return message;
},
fromPartial(_: DeepPartial<MsgSetWithdrawAddressResponse>): MsgSetWithdrawAddressResponse {
const message = { ...baseMsgSetWithdrawAddressResponse } as MsgSetWithdrawAddressResponse;
return message;
},
@ -156,21 +155,30 @@ export const MsgSetWithdrawAddressResponse = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<MsgSetWithdrawAddressResponse>): MsgSetWithdrawAddressResponse {
const message = { ...baseMsgSetWithdrawAddressResponse } as MsgSetWithdrawAddressResponse;
return message;
},
};
const baseMsgWithdrawDelegatorReward: object = { delegatorAddress: "", validatorAddress: "" };
export const MsgWithdrawDelegatorReward = {
encode(message: MsgWithdrawDelegatorReward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.delegatorAddress);
writer.uint32(18).string(message.validatorAddress);
if (message.delegatorAddress !== "") {
writer.uint32(10).string(message.delegatorAddress);
}
if (message.validatorAddress !== "") {
writer.uint32(18).string(message.validatorAddress);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawDelegatorReward {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgWithdrawDelegatorReward) as MsgWithdrawDelegatorReward;
const message = { ...baseMsgWithdrawDelegatorReward } as MsgWithdrawDelegatorReward;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -189,7 +197,7 @@ export const MsgWithdrawDelegatorReward = {
},
fromJSON(object: any): MsgWithdrawDelegatorReward {
const message = Object.create(baseMsgWithdrawDelegatorReward) as MsgWithdrawDelegatorReward;
const message = { ...baseMsgWithdrawDelegatorReward } as MsgWithdrawDelegatorReward;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
message.delegatorAddress = String(object.delegatorAddress);
} else {
@ -203,6 +211,13 @@ export const MsgWithdrawDelegatorReward = {
return message;
},
toJSON(message: MsgWithdrawDelegatorReward): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
return obj;
},
fromPartial(object: DeepPartial<MsgWithdrawDelegatorReward>): MsgWithdrawDelegatorReward {
const message = { ...baseMsgWithdrawDelegatorReward } as MsgWithdrawDelegatorReward;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
@ -217,13 +232,6 @@ export const MsgWithdrawDelegatorReward = {
}
return message;
},
toJSON(message: MsgWithdrawDelegatorReward): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
return obj;
},
};
const baseMsgWithdrawDelegatorRewardResponse: object = {};
@ -236,9 +244,7 @@ export const MsgWithdrawDelegatorRewardResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawDelegatorRewardResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(
baseMsgWithdrawDelegatorRewardResponse,
) as MsgWithdrawDelegatorRewardResponse;
const message = { ...baseMsgWithdrawDelegatorRewardResponse } as MsgWithdrawDelegatorRewardResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -251,13 +257,6 @@ export const MsgWithdrawDelegatorRewardResponse = {
},
fromJSON(_: any): MsgWithdrawDelegatorRewardResponse {
const message = Object.create(
baseMsgWithdrawDelegatorRewardResponse,
) as MsgWithdrawDelegatorRewardResponse;
return message;
},
fromPartial(_: DeepPartial<MsgWithdrawDelegatorRewardResponse>): MsgWithdrawDelegatorRewardResponse {
const message = { ...baseMsgWithdrawDelegatorRewardResponse } as MsgWithdrawDelegatorRewardResponse;
return message;
},
@ -266,20 +265,27 @@ export const MsgWithdrawDelegatorRewardResponse = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<MsgWithdrawDelegatorRewardResponse>): MsgWithdrawDelegatorRewardResponse {
const message = { ...baseMsgWithdrawDelegatorRewardResponse } as MsgWithdrawDelegatorRewardResponse;
return message;
},
};
const baseMsgWithdrawValidatorCommission: object = { validatorAddress: "" };
export const MsgWithdrawValidatorCommission = {
encode(message: MsgWithdrawValidatorCommission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.validatorAddress);
if (message.validatorAddress !== "") {
writer.uint32(10).string(message.validatorAddress);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawValidatorCommission {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgWithdrawValidatorCommission) as MsgWithdrawValidatorCommission;
const message = { ...baseMsgWithdrawValidatorCommission } as MsgWithdrawValidatorCommission;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -295,19 +301,9 @@ export const MsgWithdrawValidatorCommission = {
},
fromJSON(object: any): MsgWithdrawValidatorCommission {
const message = Object.create(baseMsgWithdrawValidatorCommission) as MsgWithdrawValidatorCommission;
if (object.validatorAddress !== undefined && object.validatorAddress !== null) {
message.validatorAddress = String(object.validatorAddress);
} else {
message.validatorAddress = "";
}
return message;
},
fromPartial(object: DeepPartial<MsgWithdrawValidatorCommission>): MsgWithdrawValidatorCommission {
const message = { ...baseMsgWithdrawValidatorCommission } as MsgWithdrawValidatorCommission;
if (object.validatorAddress !== undefined && object.validatorAddress !== null) {
message.validatorAddress = object.validatorAddress;
message.validatorAddress = String(object.validatorAddress);
} else {
message.validatorAddress = "";
}
@ -319,6 +315,16 @@ export const MsgWithdrawValidatorCommission = {
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
return obj;
},
fromPartial(object: DeepPartial<MsgWithdrawValidatorCommission>): MsgWithdrawValidatorCommission {
const message = { ...baseMsgWithdrawValidatorCommission } as MsgWithdrawValidatorCommission;
if (object.validatorAddress !== undefined && object.validatorAddress !== null) {
message.validatorAddress = object.validatorAddress;
} else {
message.validatorAddress = "";
}
return message;
},
};
const baseMsgWithdrawValidatorCommissionResponse: object = {};
@ -331,9 +337,9 @@ export const MsgWithdrawValidatorCommissionResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawValidatorCommissionResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(
baseMsgWithdrawValidatorCommissionResponse,
) as MsgWithdrawValidatorCommissionResponse;
const message = {
...baseMsgWithdrawValidatorCommissionResponse,
} as MsgWithdrawValidatorCommissionResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -346,15 +352,6 @@ export const MsgWithdrawValidatorCommissionResponse = {
},
fromJSON(_: any): MsgWithdrawValidatorCommissionResponse {
const message = Object.create(
baseMsgWithdrawValidatorCommissionResponse,
) as MsgWithdrawValidatorCommissionResponse;
return message;
},
fromPartial(
_: DeepPartial<MsgWithdrawValidatorCommissionResponse>,
): MsgWithdrawValidatorCommissionResponse {
const message = {
...baseMsgWithdrawValidatorCommissionResponse,
} as MsgWithdrawValidatorCommissionResponse;
@ -365,6 +362,15 @@ export const MsgWithdrawValidatorCommissionResponse = {
const obj: any = {};
return obj;
},
fromPartial(
_: DeepPartial<MsgWithdrawValidatorCommissionResponse>,
): MsgWithdrawValidatorCommissionResponse {
const message = {
...baseMsgWithdrawValidatorCommissionResponse,
} as MsgWithdrawValidatorCommissionResponse;
return message;
},
};
const baseMsgFundCommunityPool: object = { depositor: "" };
@ -374,14 +380,16 @@ export const MsgFundCommunityPool = {
for (const v of message.amount) {
Coin.encode(v!, writer.uint32(10).fork()).ldelim();
}
writer.uint32(18).string(message.depositor);
if (message.depositor !== "") {
writer.uint32(18).string(message.depositor);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgFundCommunityPool {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgFundCommunityPool) as MsgFundCommunityPool;
const message = { ...baseMsgFundCommunityPool } as MsgFundCommunityPool;
message.amount = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -401,7 +409,7 @@ export const MsgFundCommunityPool = {
},
fromJSON(object: any): MsgFundCommunityPool {
const message = Object.create(baseMsgFundCommunityPool) as MsgFundCommunityPool;
const message = { ...baseMsgFundCommunityPool } as MsgFundCommunityPool;
message.amount = [];
if (object.amount !== undefined && object.amount !== null) {
for (const e of object.amount) {
@ -416,6 +424,17 @@ export const MsgFundCommunityPool = {
return message;
},
toJSON(message: MsgFundCommunityPool): unknown {
const obj: any = {};
if (message.amount) {
obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.amount = [];
}
message.depositor !== undefined && (obj.depositor = message.depositor);
return obj;
},
fromPartial(object: DeepPartial<MsgFundCommunityPool>): MsgFundCommunityPool {
const message = { ...baseMsgFundCommunityPool } as MsgFundCommunityPool;
message.amount = [];
@ -431,17 +450,6 @@ export const MsgFundCommunityPool = {
}
return message;
},
toJSON(message: MsgFundCommunityPool): unknown {
const obj: any = {};
if (message.amount) {
obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.amount = [];
}
message.depositor !== undefined && (obj.depositor = message.depositor);
return obj;
},
};
const baseMsgFundCommunityPoolResponse: object = {};
@ -454,7 +462,7 @@ export const MsgFundCommunityPoolResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgFundCommunityPoolResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgFundCommunityPoolResponse) as MsgFundCommunityPoolResponse;
const message = { ...baseMsgFundCommunityPoolResponse } as MsgFundCommunityPoolResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -467,11 +475,6 @@ export const MsgFundCommunityPoolResponse = {
},
fromJSON(_: any): MsgFundCommunityPoolResponse {
const message = Object.create(baseMsgFundCommunityPoolResponse) as MsgFundCommunityPoolResponse;
return message;
},
fromPartial(_: DeepPartial<MsgFundCommunityPoolResponse>): MsgFundCommunityPoolResponse {
const message = { ...baseMsgFundCommunityPoolResponse } as MsgFundCommunityPoolResponse;
return message;
},
@ -480,6 +483,11 @@ export const MsgFundCommunityPoolResponse = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<MsgFundCommunityPoolResponse>): MsgFundCommunityPoolResponse {
const message = { ...baseMsgFundCommunityPoolResponse } as MsgFundCommunityPoolResponse;
return message;
},
};
/** Msg defines the distribution Msg service. */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -93,9 +93,15 @@ export const MsgCreateValidator = {
if (message.commission !== undefined) {
CommissionRates.encode(message.commission, writer.uint32(18).fork()).ldelim();
}
writer.uint32(26).string(message.minSelfDelegation);
writer.uint32(34).string(message.delegatorAddress);
writer.uint32(42).string(message.validatorAddress);
if (message.minSelfDelegation !== "") {
writer.uint32(26).string(message.minSelfDelegation);
}
if (message.delegatorAddress !== "") {
writer.uint32(34).string(message.delegatorAddress);
}
if (message.validatorAddress !== "") {
writer.uint32(42).string(message.validatorAddress);
}
if (message.pubkey !== undefined) {
Any.encode(message.pubkey, writer.uint32(50).fork()).ldelim();
}
@ -108,7 +114,7 @@ export const MsgCreateValidator = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateValidator {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgCreateValidator) as MsgCreateValidator;
const message = { ...baseMsgCreateValidator } as MsgCreateValidator;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -142,7 +148,7 @@ export const MsgCreateValidator = {
},
fromJSON(object: any): MsgCreateValidator {
const message = Object.create(baseMsgCreateValidator) as MsgCreateValidator;
const message = { ...baseMsgCreateValidator } as MsgCreateValidator;
if (object.description !== undefined && object.description !== null) {
message.description = Description.fromJSON(object.description);
} else {
@ -181,6 +187,20 @@ export const MsgCreateValidator = {
return message;
},
toJSON(message: MsgCreateValidator): unknown {
const obj: any = {};
message.description !== undefined &&
(obj.description = message.description ? Description.toJSON(message.description) : undefined);
message.commission !== undefined &&
(obj.commission = message.commission ? CommissionRates.toJSON(message.commission) : undefined);
message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation);
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
message.pubkey !== undefined && (obj.pubkey = message.pubkey ? Any.toJSON(message.pubkey) : undefined);
message.value !== undefined && (obj.value = message.value ? Coin.toJSON(message.value) : undefined);
return obj;
},
fromPartial(object: DeepPartial<MsgCreateValidator>): MsgCreateValidator {
const message = { ...baseMsgCreateValidator } as MsgCreateValidator;
if (object.description !== undefined && object.description !== null) {
@ -220,20 +240,6 @@ export const MsgCreateValidator = {
}
return message;
},
toJSON(message: MsgCreateValidator): unknown {
const obj: any = {};
message.description !== undefined &&
(obj.description = message.description ? Description.toJSON(message.description) : undefined);
message.commission !== undefined &&
(obj.commission = message.commission ? CommissionRates.toJSON(message.commission) : undefined);
message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation);
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
message.pubkey !== undefined && (obj.pubkey = message.pubkey ? Any.toJSON(message.pubkey) : undefined);
message.value !== undefined && (obj.value = message.value ? Coin.toJSON(message.value) : undefined);
return obj;
},
};
const baseMsgCreateValidatorResponse: object = {};
@ -246,7 +252,7 @@ export const MsgCreateValidatorResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateValidatorResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgCreateValidatorResponse) as MsgCreateValidatorResponse;
const message = { ...baseMsgCreateValidatorResponse } as MsgCreateValidatorResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -259,11 +265,6 @@ export const MsgCreateValidatorResponse = {
},
fromJSON(_: any): MsgCreateValidatorResponse {
const message = Object.create(baseMsgCreateValidatorResponse) as MsgCreateValidatorResponse;
return message;
},
fromPartial(_: DeepPartial<MsgCreateValidatorResponse>): MsgCreateValidatorResponse {
const message = { ...baseMsgCreateValidatorResponse } as MsgCreateValidatorResponse;
return message;
},
@ -272,6 +273,11 @@ export const MsgCreateValidatorResponse = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<MsgCreateValidatorResponse>): MsgCreateValidatorResponse {
const message = { ...baseMsgCreateValidatorResponse } as MsgCreateValidatorResponse;
return message;
},
};
const baseMsgEditValidator: object = { validatorAddress: "", commissionRate: "", minSelfDelegation: "" };
@ -281,16 +287,22 @@ export const MsgEditValidator = {
if (message.description !== undefined) {
Description.encode(message.description, writer.uint32(10).fork()).ldelim();
}
writer.uint32(18).string(message.validatorAddress);
writer.uint32(26).string(message.commissionRate);
writer.uint32(34).string(message.minSelfDelegation);
if (message.validatorAddress !== "") {
writer.uint32(18).string(message.validatorAddress);
}
if (message.commissionRate !== "") {
writer.uint32(26).string(message.commissionRate);
}
if (message.minSelfDelegation !== "") {
writer.uint32(34).string(message.minSelfDelegation);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MsgEditValidator {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgEditValidator) as MsgEditValidator;
const message = { ...baseMsgEditValidator } as MsgEditValidator;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -315,7 +327,7 @@ export const MsgEditValidator = {
},
fromJSON(object: any): MsgEditValidator {
const message = Object.create(baseMsgEditValidator) as MsgEditValidator;
const message = { ...baseMsgEditValidator } as MsgEditValidator;
if (object.description !== undefined && object.description !== null) {
message.description = Description.fromJSON(object.description);
} else {
@ -339,6 +351,16 @@ export const MsgEditValidator = {
return message;
},
toJSON(message: MsgEditValidator): unknown {
const obj: any = {};
message.description !== undefined &&
(obj.description = message.description ? Description.toJSON(message.description) : undefined);
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
message.commissionRate !== undefined && (obj.commissionRate = message.commissionRate);
message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation);
return obj;
},
fromPartial(object: DeepPartial<MsgEditValidator>): MsgEditValidator {
const message = { ...baseMsgEditValidator } as MsgEditValidator;
if (object.description !== undefined && object.description !== null) {
@ -363,16 +385,6 @@ export const MsgEditValidator = {
}
return message;
},
toJSON(message: MsgEditValidator): unknown {
const obj: any = {};
message.description !== undefined &&
(obj.description = message.description ? Description.toJSON(message.description) : undefined);
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
message.commissionRate !== undefined && (obj.commissionRate = message.commissionRate);
message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation);
return obj;
},
};
const baseMsgEditValidatorResponse: object = {};
@ -385,7 +397,7 @@ export const MsgEditValidatorResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgEditValidatorResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgEditValidatorResponse) as MsgEditValidatorResponse;
const message = { ...baseMsgEditValidatorResponse } as MsgEditValidatorResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -398,11 +410,6 @@ export const MsgEditValidatorResponse = {
},
fromJSON(_: any): MsgEditValidatorResponse {
const message = Object.create(baseMsgEditValidatorResponse) as MsgEditValidatorResponse;
return message;
},
fromPartial(_: DeepPartial<MsgEditValidatorResponse>): MsgEditValidatorResponse {
const message = { ...baseMsgEditValidatorResponse } as MsgEditValidatorResponse;
return message;
},
@ -411,14 +418,23 @@ export const MsgEditValidatorResponse = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<MsgEditValidatorResponse>): MsgEditValidatorResponse {
const message = { ...baseMsgEditValidatorResponse } as MsgEditValidatorResponse;
return message;
},
};
const baseMsgDelegate: object = { delegatorAddress: "", validatorAddress: "" };
export const MsgDelegate = {
encode(message: MsgDelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.delegatorAddress);
writer.uint32(18).string(message.validatorAddress);
if (message.delegatorAddress !== "") {
writer.uint32(10).string(message.delegatorAddress);
}
if (message.validatorAddress !== "") {
writer.uint32(18).string(message.validatorAddress);
}
if (message.amount !== undefined) {
Coin.encode(message.amount, writer.uint32(26).fork()).ldelim();
}
@ -428,7 +444,7 @@ export const MsgDelegate = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgDelegate {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgDelegate) as MsgDelegate;
const message = { ...baseMsgDelegate } as MsgDelegate;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -450,7 +466,7 @@ export const MsgDelegate = {
},
fromJSON(object: any): MsgDelegate {
const message = Object.create(baseMsgDelegate) as MsgDelegate;
const message = { ...baseMsgDelegate } as MsgDelegate;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
message.delegatorAddress = String(object.delegatorAddress);
} else {
@ -469,6 +485,14 @@ export const MsgDelegate = {
return message;
},
toJSON(message: MsgDelegate): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined);
return obj;
},
fromPartial(object: DeepPartial<MsgDelegate>): MsgDelegate {
const message = { ...baseMsgDelegate } as MsgDelegate;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
@ -488,14 +512,6 @@ export const MsgDelegate = {
}
return message;
},
toJSON(message: MsgDelegate): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined);
return obj;
},
};
const baseMsgDelegateResponse: object = {};
@ -508,7 +524,7 @@ export const MsgDelegateResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgDelegateResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgDelegateResponse) as MsgDelegateResponse;
const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -521,11 +537,6 @@ export const MsgDelegateResponse = {
},
fromJSON(_: any): MsgDelegateResponse {
const message = Object.create(baseMsgDelegateResponse) as MsgDelegateResponse;
return message;
},
fromPartial(_: DeepPartial<MsgDelegateResponse>): MsgDelegateResponse {
const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse;
return message;
},
@ -534,6 +545,11 @@ export const MsgDelegateResponse = {
const obj: any = {};
return obj;
},
fromPartial(_: DeepPartial<MsgDelegateResponse>): MsgDelegateResponse {
const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse;
return message;
},
};
const baseMsgBeginRedelegate: object = {
@ -544,9 +560,15 @@ const baseMsgBeginRedelegate: object = {
export const MsgBeginRedelegate = {
encode(message: MsgBeginRedelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.delegatorAddress);
writer.uint32(18).string(message.validatorSrcAddress);
writer.uint32(26).string(message.validatorDstAddress);
if (message.delegatorAddress !== "") {
writer.uint32(10).string(message.delegatorAddress);
}
if (message.validatorSrcAddress !== "") {
writer.uint32(18).string(message.validatorSrcAddress);
}
if (message.validatorDstAddress !== "") {
writer.uint32(26).string(message.validatorDstAddress);
}
if (message.amount !== undefined) {
Coin.encode(message.amount, writer.uint32(34).fork()).ldelim();
}
@ -556,7 +578,7 @@ export const MsgBeginRedelegate = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgBeginRedelegate {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgBeginRedelegate) as MsgBeginRedelegate;
const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -581,7 +603,7 @@ export const MsgBeginRedelegate = {
},
fromJSON(object: any): MsgBeginRedelegate {
const message = Object.create(baseMsgBeginRedelegate) as MsgBeginRedelegate;
const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
message.delegatorAddress = String(object.delegatorAddress);
} else {
@ -605,6 +627,15 @@ export const MsgBeginRedelegate = {
return message;
},
toJSON(message: MsgBeginRedelegate): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress);
message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress);
message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined);
return obj;
},
fromPartial(object: DeepPartial<MsgBeginRedelegate>): MsgBeginRedelegate {
const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
@ -629,15 +660,6 @@ export const MsgBeginRedelegate = {
}
return message;
},
toJSON(message: MsgBeginRedelegate): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress);
message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress);
message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined);
return obj;
},
};
const baseMsgBeginRedelegateResponse: object = {};
@ -653,7 +675,7 @@ export const MsgBeginRedelegateResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgBeginRedelegateResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgBeginRedelegateResponse) as MsgBeginRedelegateResponse;
const message = { ...baseMsgBeginRedelegateResponse } as MsgBeginRedelegateResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -669,19 +691,9 @@ export const MsgBeginRedelegateResponse = {
},
fromJSON(object: any): MsgBeginRedelegateResponse {
const message = Object.create(baseMsgBeginRedelegateResponse) as MsgBeginRedelegateResponse;
if (object.completionTime !== undefined && object.completionTime !== null) {
message.completionTime = fromJsonTimestamp(object.completionTime);
} else {
message.completionTime = undefined;
}
return message;
},
fromPartial(object: DeepPartial<MsgBeginRedelegateResponse>): MsgBeginRedelegateResponse {
const message = { ...baseMsgBeginRedelegateResponse } as MsgBeginRedelegateResponse;
if (object.completionTime !== undefined && object.completionTime !== null) {
message.completionTime = object.completionTime;
message.completionTime = fromJsonTimestamp(object.completionTime);
} else {
message.completionTime = undefined;
}
@ -695,14 +707,28 @@ export const MsgBeginRedelegateResponse = {
message.completionTime !== undefined ? message.completionTime.toISOString() : null);
return obj;
},
fromPartial(object: DeepPartial<MsgBeginRedelegateResponse>): MsgBeginRedelegateResponse {
const message = { ...baseMsgBeginRedelegateResponse } as MsgBeginRedelegateResponse;
if (object.completionTime !== undefined && object.completionTime !== null) {
message.completionTime = object.completionTime;
} else {
message.completionTime = undefined;
}
return message;
},
};
const baseMsgUndelegate: object = { delegatorAddress: "", validatorAddress: "" };
export const MsgUndelegate = {
encode(message: MsgUndelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.delegatorAddress);
writer.uint32(18).string(message.validatorAddress);
if (message.delegatorAddress !== "") {
writer.uint32(10).string(message.delegatorAddress);
}
if (message.validatorAddress !== "") {
writer.uint32(18).string(message.validatorAddress);
}
if (message.amount !== undefined) {
Coin.encode(message.amount, writer.uint32(26).fork()).ldelim();
}
@ -712,7 +738,7 @@ export const MsgUndelegate = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgUndelegate {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgUndelegate) as MsgUndelegate;
const message = { ...baseMsgUndelegate } as MsgUndelegate;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -734,7 +760,7 @@ export const MsgUndelegate = {
},
fromJSON(object: any): MsgUndelegate {
const message = Object.create(baseMsgUndelegate) as MsgUndelegate;
const message = { ...baseMsgUndelegate } as MsgUndelegate;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
message.delegatorAddress = String(object.delegatorAddress);
} else {
@ -753,6 +779,14 @@ export const MsgUndelegate = {
return message;
},
toJSON(message: MsgUndelegate): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined);
return obj;
},
fromPartial(object: DeepPartial<MsgUndelegate>): MsgUndelegate {
const message = { ...baseMsgUndelegate } as MsgUndelegate;
if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) {
@ -772,14 +806,6 @@ export const MsgUndelegate = {
}
return message;
},
toJSON(message: MsgUndelegate): unknown {
const obj: any = {};
message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress);
message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress);
message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined);
return obj;
},
};
const baseMsgUndelegateResponse: object = {};
@ -795,7 +821,7 @@ export const MsgUndelegateResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): MsgUndelegateResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMsgUndelegateResponse) as MsgUndelegateResponse;
const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -811,19 +837,9 @@ export const MsgUndelegateResponse = {
},
fromJSON(object: any): MsgUndelegateResponse {
const message = Object.create(baseMsgUndelegateResponse) as MsgUndelegateResponse;
if (object.completionTime !== undefined && object.completionTime !== null) {
message.completionTime = fromJsonTimestamp(object.completionTime);
} else {
message.completionTime = undefined;
}
return message;
},
fromPartial(object: DeepPartial<MsgUndelegateResponse>): MsgUndelegateResponse {
const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse;
if (object.completionTime !== undefined && object.completionTime !== null) {
message.completionTime = object.completionTime;
message.completionTime = fromJsonTimestamp(object.completionTime);
} else {
message.completionTime = undefined;
}
@ -837,6 +853,16 @@ export const MsgUndelegateResponse = {
message.completionTime !== undefined ? message.completionTime.toISOString() : null);
return obj;
},
fromPartial(object: DeepPartial<MsgUndelegateResponse>): MsgUndelegateResponse {
const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse;
if (object.completionTime !== undefined && object.completionTime !== null) {
message.completionTime = object.completionTime;
} else {
message.completionTime = undefined;
}
return message;
},
};
/** Msg defines the staking Msg service. */

View File

@ -129,7 +129,7 @@ export const SignatureDescriptors = {
decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptors {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignatureDescriptors) as SignatureDescriptors;
const message = { ...baseSignatureDescriptors } as SignatureDescriptors;
message.signatures = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -146,22 +146,11 @@ export const SignatureDescriptors = {
},
fromJSON(object: any): SignatureDescriptors {
const message = Object.create(baseSignatureDescriptors) as SignatureDescriptors;
message.signatures = [];
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(SignatureDescriptor.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<SignatureDescriptors>): SignatureDescriptors {
const message = { ...baseSignatureDescriptors } as SignatureDescriptors;
message.signatures = [];
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(SignatureDescriptor.fromPartial(e));
message.signatures.push(SignatureDescriptor.fromJSON(e));
}
}
return message;
@ -176,6 +165,17 @@ export const SignatureDescriptors = {
}
return obj;
},
fromPartial(object: DeepPartial<SignatureDescriptors>): SignatureDescriptors {
const message = { ...baseSignatureDescriptors } as SignatureDescriptors;
message.signatures = [];
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(SignatureDescriptor.fromPartial(e));
}
}
return message;
},
};
const baseSignatureDescriptor: object = { sequence: Long.UZERO };
@ -188,14 +188,16 @@ export const SignatureDescriptor = {
if (message.data !== undefined) {
SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim();
}
writer.uint32(24).uint64(message.sequence);
if (!message.sequence.isZero()) {
writer.uint32(24).uint64(message.sequence);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignatureDescriptor) as SignatureDescriptor;
const message = { ...baseSignatureDescriptor } as SignatureDescriptor;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -217,7 +219,7 @@ export const SignatureDescriptor = {
},
fromJSON(object: any): SignatureDescriptor {
const message = Object.create(baseSignatureDescriptor) as SignatureDescriptor;
const message = { ...baseSignatureDescriptor } as SignatureDescriptor;
if (object.publicKey !== undefined && object.publicKey !== null) {
message.publicKey = Any.fromJSON(object.publicKey);
} else {
@ -236,6 +238,16 @@ export const SignatureDescriptor = {
return message;
},
toJSON(message: SignatureDescriptor): unknown {
const obj: any = {};
message.publicKey !== undefined &&
(obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined);
message.data !== undefined &&
(obj.data = message.data ? SignatureDescriptor_Data.toJSON(message.data) : undefined);
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<SignatureDescriptor>): SignatureDescriptor {
const message = { ...baseSignatureDescriptor } as SignatureDescriptor;
if (object.publicKey !== undefined && object.publicKey !== null) {
@ -255,16 +267,6 @@ export const SignatureDescriptor = {
}
return message;
},
toJSON(message: SignatureDescriptor): unknown {
const obj: any = {};
message.publicKey !== undefined &&
(obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined);
message.data !== undefined &&
(obj.data = message.data ? SignatureDescriptor_Data.toJSON(message.data) : undefined);
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
return obj;
},
};
const baseSignatureDescriptor_Data: object = {};
@ -283,7 +285,7 @@ export const SignatureDescriptor_Data = {
decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignatureDescriptor_Data) as SignatureDescriptor_Data;
const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -302,7 +304,7 @@ export const SignatureDescriptor_Data = {
},
fromJSON(object: any): SignatureDescriptor_Data {
const message = Object.create(baseSignatureDescriptor_Data) as SignatureDescriptor_Data;
const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data;
if (object.single !== undefined && object.single !== null) {
message.single = SignatureDescriptor_Data_Single.fromJSON(object.single);
} else {
@ -316,6 +318,15 @@ export const SignatureDescriptor_Data = {
return message;
},
toJSON(message: SignatureDescriptor_Data): unknown {
const obj: any = {};
message.single !== undefined &&
(obj.single = message.single ? SignatureDescriptor_Data_Single.toJSON(message.single) : undefined);
message.multi !== undefined &&
(obj.multi = message.multi ? SignatureDescriptor_Data_Multi.toJSON(message.multi) : undefined);
return obj;
},
fromPartial(object: DeepPartial<SignatureDescriptor_Data>): SignatureDescriptor_Data {
const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data;
if (object.single !== undefined && object.single !== null) {
@ -330,30 +341,25 @@ export const SignatureDescriptor_Data = {
}
return message;
},
toJSON(message: SignatureDescriptor_Data): unknown {
const obj: any = {};
message.single !== undefined &&
(obj.single = message.single ? SignatureDescriptor_Data_Single.toJSON(message.single) : undefined);
message.multi !== undefined &&
(obj.multi = message.multi ? SignatureDescriptor_Data_Multi.toJSON(message.multi) : undefined);
return obj;
},
};
const baseSignatureDescriptor_Data_Single: object = { mode: 0 };
export const SignatureDescriptor_Data_Single = {
encode(message: SignatureDescriptor_Data_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int32(message.mode);
writer.uint32(18).bytes(message.signature);
if (message.mode !== 0) {
writer.uint32(8).int32(message.mode);
}
if (message.signature.length !== 0) {
writer.uint32(18).bytes(message.signature);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Single {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignatureDescriptor_Data_Single) as SignatureDescriptor_Data_Single;
const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -372,7 +378,7 @@ export const SignatureDescriptor_Data_Single = {
},
fromJSON(object: any): SignatureDescriptor_Data_Single {
const message = Object.create(baseSignatureDescriptor_Data_Single) as SignatureDescriptor_Data_Single;
const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single;
if (object.mode !== undefined && object.mode !== null) {
message.mode = signModeFromJSON(object.mode);
} else {
@ -384,6 +390,16 @@ export const SignatureDescriptor_Data_Single = {
return message;
},
toJSON(message: SignatureDescriptor_Data_Single): unknown {
const obj: any = {};
message.mode !== undefined && (obj.mode = signModeToJSON(message.mode));
message.signature !== undefined &&
(obj.signature = base64FromBytes(
message.signature !== undefined ? message.signature : new Uint8Array(),
));
return obj;
},
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) {
@ -398,16 +414,6 @@ export const SignatureDescriptor_Data_Single = {
}
return message;
},
toJSON(message: SignatureDescriptor_Data_Single): unknown {
const obj: any = {};
message.mode !== undefined && (obj.mode = signModeToJSON(message.mode));
message.signature !== undefined &&
(obj.signature = base64FromBytes(
message.signature !== undefined ? message.signature : new Uint8Array(),
));
return obj;
},
};
const baseSignatureDescriptor_Data_Multi: object = {};
@ -426,7 +432,7 @@ export const SignatureDescriptor_Data_Multi = {
decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignatureDescriptor_Data_Multi) as SignatureDescriptor_Data_Multi;
const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi;
message.signatures = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -446,7 +452,7 @@ export const SignatureDescriptor_Data_Multi = {
},
fromJSON(object: any): SignatureDescriptor_Data_Multi {
const message = Object.create(baseSignatureDescriptor_Data_Multi) as SignatureDescriptor_Data_Multi;
const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi;
message.signatures = [];
if (object.bitarray !== undefined && object.bitarray !== null) {
message.bitarray = CompactBitArray.fromJSON(object.bitarray);
@ -461,6 +467,18 @@ export const SignatureDescriptor_Data_Multi = {
return message;
},
toJSON(message: SignatureDescriptor_Data_Multi): unknown {
const obj: any = {};
message.bitarray !== undefined &&
(obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined);
if (message.signatures) {
obj.signatures = message.signatures.map((e) => (e ? SignatureDescriptor_Data.toJSON(e) : undefined));
} else {
obj.signatures = [];
}
return obj;
},
fromPartial(object: DeepPartial<SignatureDescriptor_Data_Multi>): SignatureDescriptor_Data_Multi {
const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi;
message.signatures = [];
@ -476,18 +494,6 @@ export const SignatureDescriptor_Data_Multi = {
}
return message;
},
toJSON(message: SignatureDescriptor_Data_Multi): unknown {
const obj: any = {};
message.bitarray !== undefined &&
(obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined);
if (message.signatures) {
obj.signatures = message.signatures.map((e) => (e ? SignatureDescriptor_Data.toJSON(e) : undefined));
} else {
obj.signatures = [];
}
return obj;
},
};
declare var self: any | undefined;
@ -497,7 +503,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -226,7 +226,7 @@ export const Tx = {
decode(input: _m0.Reader | Uint8Array, length?: number): Tx {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseTx) as Tx;
const message = { ...baseTx } as Tx;
message.signatures = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -249,7 +249,7 @@ export const Tx = {
},
fromJSON(object: any): Tx {
const message = Object.create(baseTx) as Tx;
const message = { ...baseTx } as Tx;
message.signatures = [];
if (object.body !== undefined && object.body !== null) {
message.body = TxBody.fromJSON(object.body);
@ -269,6 +269,19 @@ export const Tx = {
return message;
},
toJSON(message: Tx): unknown {
const obj: any = {};
message.body !== undefined && (obj.body = message.body ? TxBody.toJSON(message.body) : undefined);
message.authInfo !== undefined &&
(obj.authInfo = message.authInfo ? AuthInfo.toJSON(message.authInfo) : undefined);
if (message.signatures) {
obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));
} else {
obj.signatures = [];
}
return obj;
},
fromPartial(object: DeepPartial<Tx>): Tx {
const message = { ...baseTx } as Tx;
message.signatures = [];
@ -289,27 +302,18 @@ export const Tx = {
}
return message;
},
toJSON(message: Tx): unknown {
const obj: any = {};
message.body !== undefined && (obj.body = message.body ? TxBody.toJSON(message.body) : undefined);
message.authInfo !== undefined &&
(obj.authInfo = message.authInfo ? AuthInfo.toJSON(message.authInfo) : undefined);
if (message.signatures) {
obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));
} else {
obj.signatures = [];
}
return obj;
},
};
const baseTxRaw: object = {};
export const TxRaw = {
encode(message: TxRaw, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.bodyBytes);
writer.uint32(18).bytes(message.authInfoBytes);
if (message.bodyBytes.length !== 0) {
writer.uint32(10).bytes(message.bodyBytes);
}
if (message.authInfoBytes.length !== 0) {
writer.uint32(18).bytes(message.authInfoBytes);
}
for (const v of message.signatures) {
writer.uint32(26).bytes(v!);
}
@ -319,7 +323,7 @@ export const TxRaw = {
decode(input: _m0.Reader | Uint8Array, length?: number): TxRaw {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseTxRaw) as TxRaw;
const message = { ...baseTxRaw } as TxRaw;
message.signatures = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -342,7 +346,7 @@ export const TxRaw = {
},
fromJSON(object: any): TxRaw {
const message = Object.create(baseTxRaw) as TxRaw;
const message = { ...baseTxRaw } as TxRaw;
message.signatures = [];
if (object.bodyBytes !== undefined && object.bodyBytes !== null) {
message.bodyBytes = bytesFromBase64(object.bodyBytes);
@ -358,27 +362,6 @@ export const TxRaw = {
return message;
},
fromPartial(object: DeepPartial<TxRaw>): TxRaw {
const message = { ...baseTxRaw } as TxRaw;
message.signatures = [];
if (object.bodyBytes !== undefined && object.bodyBytes !== null) {
message.bodyBytes = object.bodyBytes;
} else {
message.bodyBytes = new Uint8Array();
}
if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) {
message.authInfoBytes = object.authInfoBytes;
} else {
message.authInfoBytes = new Uint8Array();
}
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(e);
}
}
return message;
},
toJSON(message: TxRaw): unknown {
const obj: any = {};
message.bodyBytes !== undefined &&
@ -396,23 +379,52 @@ export const TxRaw = {
}
return obj;
},
fromPartial(object: DeepPartial<TxRaw>): TxRaw {
const message = { ...baseTxRaw } as TxRaw;
message.signatures = [];
if (object.bodyBytes !== undefined && object.bodyBytes !== null) {
message.bodyBytes = object.bodyBytes;
} else {
message.bodyBytes = new Uint8Array();
}
if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) {
message.authInfoBytes = object.authInfoBytes;
} else {
message.authInfoBytes = new Uint8Array();
}
if (object.signatures !== undefined && object.signatures !== null) {
for (const e of object.signatures) {
message.signatures.push(e);
}
}
return message;
},
};
const baseSignDoc: object = { chainId: "", accountNumber: Long.UZERO };
export const SignDoc = {
encode(message: SignDoc, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.bodyBytes);
writer.uint32(18).bytes(message.authInfoBytes);
writer.uint32(26).string(message.chainId);
writer.uint32(32).uint64(message.accountNumber);
if (message.bodyBytes.length !== 0) {
writer.uint32(10).bytes(message.bodyBytes);
}
if (message.authInfoBytes.length !== 0) {
writer.uint32(18).bytes(message.authInfoBytes);
}
if (message.chainId !== "") {
writer.uint32(26).string(message.chainId);
}
if (!message.accountNumber.isZero()) {
writer.uint32(32).uint64(message.accountNumber);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): SignDoc {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignDoc) as SignDoc;
const message = { ...baseSignDoc } as SignDoc;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -437,7 +449,7 @@ export const SignDoc = {
},
fromJSON(object: any): SignDoc {
const message = Object.create(baseSignDoc) as SignDoc;
const message = { ...baseSignDoc } as SignDoc;
if (object.bodyBytes !== undefined && object.bodyBytes !== null) {
message.bodyBytes = bytesFromBase64(object.bodyBytes);
}
@ -457,6 +469,22 @@ export const SignDoc = {
return message;
},
toJSON(message: SignDoc): unknown {
const obj: any = {};
message.bodyBytes !== undefined &&
(obj.bodyBytes = base64FromBytes(
message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array(),
));
message.authInfoBytes !== undefined &&
(obj.authInfoBytes = base64FromBytes(
message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array(),
));
message.chainId !== undefined && (obj.chainId = message.chainId);
message.accountNumber !== undefined &&
(obj.accountNumber = (message.accountNumber || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<SignDoc>): SignDoc {
const message = { ...baseSignDoc } as SignDoc;
if (object.bodyBytes !== undefined && object.bodyBytes !== null) {
@ -481,22 +509,6 @@ export const SignDoc = {
}
return message;
},
toJSON(message: SignDoc): unknown {
const obj: any = {};
message.bodyBytes !== undefined &&
(obj.bodyBytes = base64FromBytes(
message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array(),
));
message.authInfoBytes !== undefined &&
(obj.authInfoBytes = base64FromBytes(
message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array(),
));
message.chainId !== undefined && (obj.chainId = message.chainId);
message.accountNumber !== undefined &&
(obj.accountNumber = (message.accountNumber || Long.UZERO).toString());
return obj;
},
};
const baseTxBody: object = { memo: "", timeoutHeight: Long.UZERO };
@ -506,8 +518,12 @@ export const TxBody = {
for (const v of message.messages) {
Any.encode(v!, writer.uint32(10).fork()).ldelim();
}
writer.uint32(18).string(message.memo);
writer.uint32(24).uint64(message.timeoutHeight);
if (message.memo !== "") {
writer.uint32(18).string(message.memo);
}
if (!message.timeoutHeight.isZero()) {
writer.uint32(24).uint64(message.timeoutHeight);
}
for (const v of message.extensionOptions) {
Any.encode(v!, writer.uint32(8186).fork()).ldelim();
}
@ -520,7 +536,7 @@ export const TxBody = {
decode(input: _m0.Reader | Uint8Array, length?: number): TxBody {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseTxBody) as TxBody;
const message = { ...baseTxBody } as TxBody;
message.messages = [];
message.extensionOptions = [];
message.nonCriticalExtensionOptions = [];
@ -551,7 +567,7 @@ export const TxBody = {
},
fromJSON(object: any): TxBody {
const message = Object.create(baseTxBody) as TxBody;
const message = { ...baseTxBody } as TxBody;
message.messages = [];
message.extensionOptions = [];
message.nonCriticalExtensionOptions = [];
@ -583,6 +599,31 @@ export const TxBody = {
return message;
},
toJSON(message: TxBody): unknown {
const obj: any = {};
if (message.messages) {
obj.messages = message.messages.map((e) => (e ? Any.toJSON(e) : undefined));
} else {
obj.messages = [];
}
message.memo !== undefined && (obj.memo = message.memo);
message.timeoutHeight !== undefined &&
(obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString());
if (message.extensionOptions) {
obj.extensionOptions = message.extensionOptions.map((e) => (e ? Any.toJSON(e) : undefined));
} else {
obj.extensionOptions = [];
}
if (message.nonCriticalExtensionOptions) {
obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map((e) =>
e ? Any.toJSON(e) : undefined,
);
} else {
obj.nonCriticalExtensionOptions = [];
}
return obj;
},
fromPartial(object: DeepPartial<TxBody>): TxBody {
const message = { ...baseTxBody } as TxBody;
message.messages = [];
@ -615,31 +656,6 @@ export const TxBody = {
}
return message;
},
toJSON(message: TxBody): unknown {
const obj: any = {};
if (message.messages) {
obj.messages = message.messages.map((e) => (e ? Any.toJSON(e) : undefined));
} else {
obj.messages = [];
}
message.memo !== undefined && (obj.memo = message.memo);
message.timeoutHeight !== undefined &&
(obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString());
if (message.extensionOptions) {
obj.extensionOptions = message.extensionOptions.map((e) => (e ? Any.toJSON(e) : undefined));
} else {
obj.extensionOptions = [];
}
if (message.nonCriticalExtensionOptions) {
obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map((e) =>
e ? Any.toJSON(e) : undefined,
);
} else {
obj.nonCriticalExtensionOptions = [];
}
return obj;
},
};
const baseAuthInfo: object = {};
@ -658,7 +674,7 @@ export const AuthInfo = {
decode(input: _m0.Reader | Uint8Array, length?: number): AuthInfo {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseAuthInfo) as AuthInfo;
const message = { ...baseAuthInfo } as AuthInfo;
message.signerInfos = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -678,7 +694,7 @@ export const AuthInfo = {
},
fromJSON(object: any): AuthInfo {
const message = Object.create(baseAuthInfo) as AuthInfo;
const message = { ...baseAuthInfo } as AuthInfo;
message.signerInfos = [];
if (object.signerInfos !== undefined && object.signerInfos !== null) {
for (const e of object.signerInfos) {
@ -693,6 +709,17 @@ export const AuthInfo = {
return message;
},
toJSON(message: AuthInfo): unknown {
const obj: any = {};
if (message.signerInfos) {
obj.signerInfos = message.signerInfos.map((e) => (e ? SignerInfo.toJSON(e) : undefined));
} else {
obj.signerInfos = [];
}
message.fee !== undefined && (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined);
return obj;
},
fromPartial(object: DeepPartial<AuthInfo>): AuthInfo {
const message = { ...baseAuthInfo } as AuthInfo;
message.signerInfos = [];
@ -708,17 +735,6 @@ export const AuthInfo = {
}
return message;
},
toJSON(message: AuthInfo): unknown {
const obj: any = {};
if (message.signerInfos) {
obj.signerInfos = message.signerInfos.map((e) => (e ? SignerInfo.toJSON(e) : undefined));
} else {
obj.signerInfos = [];
}
message.fee !== undefined && (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined);
return obj;
},
};
const baseSignerInfo: object = { sequence: Long.UZERO };
@ -731,14 +747,16 @@ export const SignerInfo = {
if (message.modeInfo !== undefined) {
ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim();
}
writer.uint32(24).uint64(message.sequence);
if (!message.sequence.isZero()) {
writer.uint32(24).uint64(message.sequence);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): SignerInfo {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignerInfo) as SignerInfo;
const message = { ...baseSignerInfo } as SignerInfo;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -760,7 +778,7 @@ export const SignerInfo = {
},
fromJSON(object: any): SignerInfo {
const message = Object.create(baseSignerInfo) as SignerInfo;
const message = { ...baseSignerInfo } as SignerInfo;
if (object.publicKey !== undefined && object.publicKey !== null) {
message.publicKey = Any.fromJSON(object.publicKey);
} else {
@ -779,6 +797,16 @@ export const SignerInfo = {
return message;
},
toJSON(message: SignerInfo): unknown {
const obj: any = {};
message.publicKey !== undefined &&
(obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined);
message.modeInfo !== undefined &&
(obj.modeInfo = message.modeInfo ? ModeInfo.toJSON(message.modeInfo) : undefined);
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<SignerInfo>): SignerInfo {
const message = { ...baseSignerInfo } as SignerInfo;
if (object.publicKey !== undefined && object.publicKey !== null) {
@ -798,16 +826,6 @@ export const SignerInfo = {
}
return message;
},
toJSON(message: SignerInfo): unknown {
const obj: any = {};
message.publicKey !== undefined &&
(obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined);
message.modeInfo !== undefined &&
(obj.modeInfo = message.modeInfo ? ModeInfo.toJSON(message.modeInfo) : undefined);
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
return obj;
},
};
const baseModeInfo: object = {};
@ -826,7 +844,7 @@ export const ModeInfo = {
decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseModeInfo) as ModeInfo;
const message = { ...baseModeInfo } as ModeInfo;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -845,7 +863,7 @@ export const ModeInfo = {
},
fromJSON(object: any): ModeInfo {
const message = Object.create(baseModeInfo) as ModeInfo;
const message = { ...baseModeInfo } as ModeInfo;
if (object.single !== undefined && object.single !== null) {
message.single = ModeInfo_Single.fromJSON(object.single);
} else {
@ -859,6 +877,15 @@ export const ModeInfo = {
return message;
},
toJSON(message: ModeInfo): unknown {
const obj: any = {};
message.single !== undefined &&
(obj.single = message.single ? ModeInfo_Single.toJSON(message.single) : undefined);
message.multi !== undefined &&
(obj.multi = message.multi ? ModeInfo_Multi.toJSON(message.multi) : undefined);
return obj;
},
fromPartial(object: DeepPartial<ModeInfo>): ModeInfo {
const message = { ...baseModeInfo } as ModeInfo;
if (object.single !== undefined && object.single !== null) {
@ -873,29 +900,22 @@ export const ModeInfo = {
}
return message;
},
toJSON(message: ModeInfo): unknown {
const obj: any = {};
message.single !== undefined &&
(obj.single = message.single ? ModeInfo_Single.toJSON(message.single) : undefined);
message.multi !== undefined &&
(obj.multi = message.multi ? ModeInfo_Multi.toJSON(message.multi) : undefined);
return obj;
},
};
const baseModeInfo_Single: object = { mode: 0 };
export const ModeInfo_Single = {
encode(message: ModeInfo_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int32(message.mode);
if (message.mode !== 0) {
writer.uint32(8).int32(message.mode);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Single {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseModeInfo_Single) as ModeInfo_Single;
const message = { ...baseModeInfo_Single } as ModeInfo_Single;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -911,19 +931,9 @@ export const ModeInfo_Single = {
},
fromJSON(object: any): ModeInfo_Single {
const message = Object.create(baseModeInfo_Single) as ModeInfo_Single;
if (object.mode !== undefined && object.mode !== null) {
message.mode = signModeFromJSON(object.mode);
} else {
message.mode = 0;
}
return message;
},
fromPartial(object: DeepPartial<ModeInfo_Single>): ModeInfo_Single {
const message = { ...baseModeInfo_Single } as ModeInfo_Single;
if (object.mode !== undefined && object.mode !== null) {
message.mode = object.mode;
message.mode = signModeFromJSON(object.mode);
} else {
message.mode = 0;
}
@ -935,6 +945,16 @@ export const ModeInfo_Single = {
message.mode !== undefined && (obj.mode = signModeToJSON(message.mode));
return obj;
},
fromPartial(object: DeepPartial<ModeInfo_Single>): ModeInfo_Single {
const message = { ...baseModeInfo_Single } as ModeInfo_Single;
if (object.mode !== undefined && object.mode !== null) {
message.mode = object.mode;
} else {
message.mode = 0;
}
return message;
},
};
const baseModeInfo_Multi: object = {};
@ -953,7 +973,7 @@ export const ModeInfo_Multi = {
decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Multi {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseModeInfo_Multi) as ModeInfo_Multi;
const message = { ...baseModeInfo_Multi } as ModeInfo_Multi;
message.modeInfos = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -973,7 +993,7 @@ export const ModeInfo_Multi = {
},
fromJSON(object: any): ModeInfo_Multi {
const message = Object.create(baseModeInfo_Multi) as ModeInfo_Multi;
const message = { ...baseModeInfo_Multi } as ModeInfo_Multi;
message.modeInfos = [];
if (object.bitarray !== undefined && object.bitarray !== null) {
message.bitarray = CompactBitArray.fromJSON(object.bitarray);
@ -988,6 +1008,18 @@ export const ModeInfo_Multi = {
return message;
},
toJSON(message: ModeInfo_Multi): unknown {
const obj: any = {};
message.bitarray !== undefined &&
(obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined);
if (message.modeInfos) {
obj.modeInfos = message.modeInfos.map((e) => (e ? ModeInfo.toJSON(e) : undefined));
} else {
obj.modeInfos = [];
}
return obj;
},
fromPartial(object: DeepPartial<ModeInfo_Multi>): ModeInfo_Multi {
const message = { ...baseModeInfo_Multi } as ModeInfo_Multi;
message.modeInfos = [];
@ -1003,18 +1035,6 @@ export const ModeInfo_Multi = {
}
return message;
},
toJSON(message: ModeInfo_Multi): unknown {
const obj: any = {};
message.bitarray !== undefined &&
(obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined);
if (message.modeInfos) {
obj.modeInfos = message.modeInfos.map((e) => (e ? ModeInfo.toJSON(e) : undefined));
} else {
obj.modeInfos = [];
}
return obj;
},
};
const baseFee: object = { gasLimit: Long.UZERO, payer: "", granter: "" };
@ -1024,16 +1044,22 @@ export const Fee = {
for (const v of message.amount) {
Coin.encode(v!, writer.uint32(10).fork()).ldelim();
}
writer.uint32(16).uint64(message.gasLimit);
writer.uint32(26).string(message.payer);
writer.uint32(34).string(message.granter);
if (!message.gasLimit.isZero()) {
writer.uint32(16).uint64(message.gasLimit);
}
if (message.payer !== "") {
writer.uint32(26).string(message.payer);
}
if (message.granter !== "") {
writer.uint32(34).string(message.granter);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Fee {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseFee) as Fee;
const message = { ...baseFee } as Fee;
message.amount = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -1059,7 +1085,7 @@ export const Fee = {
},
fromJSON(object: any): Fee {
const message = Object.create(baseFee) as Fee;
const message = { ...baseFee } as Fee;
message.amount = [];
if (object.amount !== undefined && object.amount !== null) {
for (const e of object.amount) {
@ -1084,6 +1110,19 @@ export const Fee = {
return message;
},
toJSON(message: Fee): unknown {
const obj: any = {};
if (message.amount) {
obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.amount = [];
}
message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || Long.UZERO).toString());
message.payer !== undefined && (obj.payer = message.payer);
message.granter !== undefined && (obj.granter = message.granter);
return obj;
},
fromPartial(object: DeepPartial<Fee>): Fee {
const message = { ...baseFee } as Fee;
message.amount = [];
@ -1109,19 +1148,6 @@ export const Fee = {
}
return message;
},
toJSON(message: Fee): unknown {
const obj: any = {};
if (message.amount) {
obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined));
} else {
obj.amount = [];
}
message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || Long.UZERO).toString());
message.payer !== undefined && (obj.payer = message.payer);
message.granter !== undefined && (obj.granter = message.granter);
return obj;
},
};
declare var self: any | undefined;
@ -1131,7 +1157,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -124,15 +124,19 @@ const baseAny: object = { typeUrl: "" };
export const Any = {
encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.typeUrl);
writer.uint32(18).bytes(message.value);
if (message.typeUrl !== "") {
writer.uint32(10).string(message.typeUrl);
}
if (message.value.length !== 0) {
writer.uint32(18).bytes(message.value);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Any {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseAny) as Any;
const message = { ...baseAny } as Any;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -151,7 +155,7 @@ export const Any = {
},
fromJSON(object: any): Any {
const message = Object.create(baseAny) as Any;
const message = { ...baseAny } as Any;
if (object.typeUrl !== undefined && object.typeUrl !== null) {
message.typeUrl = String(object.typeUrl);
} else {
@ -163,6 +167,14 @@ export const Any = {
return message;
},
toJSON(message: Any): unknown {
const obj: any = {};
message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl);
message.value !== undefined &&
(obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<Any>): Any {
const message = { ...baseAny } as Any;
if (object.typeUrl !== undefined && object.typeUrl !== null) {
@ -177,14 +189,6 @@ export const Any = {
}
return message;
},
toJSON(message: Any): unknown {
const obj: any = {};
message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl);
message.value !== undefined &&
(obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
return obj;
},
};
declare var self: any | undefined;
@ -194,7 +198,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -86,15 +86,19 @@ const baseDuration: object = { seconds: Long.ZERO, nanos: 0 };
export const Duration = {
encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int64(message.seconds);
writer.uint32(16).int32(message.nanos);
if (!message.seconds.isZero()) {
writer.uint32(8).int64(message.seconds);
}
if (message.nanos !== 0) {
writer.uint32(16).int32(message.nanos);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Duration {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseDuration) as Duration;
const message = { ...baseDuration } as Duration;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -113,7 +117,7 @@ export const Duration = {
},
fromJSON(object: any): Duration {
const message = Object.create(baseDuration) as Duration;
const message = { ...baseDuration } as Duration;
if (object.seconds !== undefined && object.seconds !== null) {
message.seconds = Long.fromString(object.seconds);
} else {
@ -127,6 +131,13 @@ export const Duration = {
return message;
},
toJSON(message: Duration): unknown {
const obj: any = {};
message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString());
message.nanos !== undefined && (obj.nanos = message.nanos);
return obj;
},
fromPartial(object: DeepPartial<Duration>): Duration {
const message = { ...baseDuration } as Duration;
if (object.seconds !== undefined && object.seconds !== null) {
@ -141,13 +152,6 @@ export const Duration = {
}
return message;
},
toJSON(message: Duration): unknown {
const obj: any = {};
message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString());
message.nanos !== undefined && (obj.nanos = message.nanos);
return obj;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;

View File

@ -117,15 +117,19 @@ const baseTimestamp: object = { seconds: Long.ZERO, nanos: 0 };
export const Timestamp = {
encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int64(message.seconds);
writer.uint32(16).int32(message.nanos);
if (!message.seconds.isZero()) {
writer.uint32(8).int64(message.seconds);
}
if (message.nanos !== 0) {
writer.uint32(16).int32(message.nanos);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseTimestamp) as Timestamp;
const message = { ...baseTimestamp } as Timestamp;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -144,7 +148,7 @@ export const Timestamp = {
},
fromJSON(object: any): Timestamp {
const message = Object.create(baseTimestamp) as Timestamp;
const message = { ...baseTimestamp } as Timestamp;
if (object.seconds !== undefined && object.seconds !== null) {
message.seconds = Long.fromString(object.seconds);
} else {
@ -158,6 +162,13 @@ export const Timestamp = {
return message;
},
toJSON(message: Timestamp): unknown {
const obj: any = {};
message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString());
message.nanos !== undefined && (obj.nanos = message.nanos);
return obj;
},
fromPartial(object: DeepPartial<Timestamp>): Timestamp {
const message = { ...baseTimestamp } as Timestamp;
if (object.seconds !== undefined && object.seconds !== null) {
@ -172,13 +183,6 @@ export const Timestamp = {
}
return message;
},
toJSON(message: Timestamp): unknown {
const obj: any = {};
message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString());
message.nanos !== undefined && (obj.nanos = message.nanos);
return obj;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;

View File

@ -227,22 +227,28 @@ const baseChannel: object = { state: 0, ordering: 0, connectionHops: "", version
export const Channel = {
encode(message: Channel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int32(message.state);
writer.uint32(16).int32(message.ordering);
if (message.state !== 0) {
writer.uint32(8).int32(message.state);
}
if (message.ordering !== 0) {
writer.uint32(16).int32(message.ordering);
}
if (message.counterparty !== undefined) {
Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim();
}
for (const v of message.connectionHops) {
writer.uint32(34).string(v!);
}
writer.uint32(42).string(message.version);
if (message.version !== "") {
writer.uint32(42).string(message.version);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Channel {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseChannel) as Channel;
const message = { ...baseChannel } as Channel;
message.connectionHops = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -271,7 +277,7 @@ export const Channel = {
},
fromJSON(object: any): Channel {
const message = Object.create(baseChannel) as Channel;
const message = { ...baseChannel } as Channel;
message.connectionHops = [];
if (object.state !== undefined && object.state !== null) {
message.state = stateFromJSON(object.state);
@ -301,6 +307,21 @@ export const Channel = {
return message;
},
toJSON(message: Channel): unknown {
const obj: any = {};
message.state !== undefined && (obj.state = stateToJSON(message.state));
message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering));
message.counterparty !== undefined &&
(obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined);
if (message.connectionHops) {
obj.connectionHops = message.connectionHops.map((e) => e);
} else {
obj.connectionHops = [];
}
message.version !== undefined && (obj.version = message.version);
return obj;
},
fromPartial(object: DeepPartial<Channel>): Channel {
const message = { ...baseChannel } as Channel;
message.connectionHops = [];
@ -331,21 +352,6 @@ export const Channel = {
}
return message;
},
toJSON(message: Channel): unknown {
const obj: any = {};
message.state !== undefined && (obj.state = stateToJSON(message.state));
message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering));
message.counterparty !== undefined &&
(obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined);
if (message.connectionHops) {
obj.connectionHops = message.connectionHops.map((e) => e);
} else {
obj.connectionHops = [];
}
message.version !== undefined && (obj.version = message.version);
return obj;
},
};
const baseIdentifiedChannel: object = {
@ -359,24 +365,34 @@ const baseIdentifiedChannel: object = {
export const IdentifiedChannel = {
encode(message: IdentifiedChannel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int32(message.state);
writer.uint32(16).int32(message.ordering);
if (message.state !== 0) {
writer.uint32(8).int32(message.state);
}
if (message.ordering !== 0) {
writer.uint32(16).int32(message.ordering);
}
if (message.counterparty !== undefined) {
Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim();
}
for (const v of message.connectionHops) {
writer.uint32(34).string(v!);
}
writer.uint32(42).string(message.version);
writer.uint32(50).string(message.portId);
writer.uint32(58).string(message.channelId);
if (message.version !== "") {
writer.uint32(42).string(message.version);
}
if (message.portId !== "") {
writer.uint32(50).string(message.portId);
}
if (message.channelId !== "") {
writer.uint32(58).string(message.channelId);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedChannel {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseIdentifiedChannel) as IdentifiedChannel;
const message = { ...baseIdentifiedChannel } as IdentifiedChannel;
message.connectionHops = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -411,7 +427,7 @@ export const IdentifiedChannel = {
},
fromJSON(object: any): IdentifiedChannel {
const message = Object.create(baseIdentifiedChannel) as IdentifiedChannel;
const message = { ...baseIdentifiedChannel } as IdentifiedChannel;
message.connectionHops = [];
if (object.state !== undefined && object.state !== null) {
message.state = stateFromJSON(object.state);
@ -451,6 +467,23 @@ export const IdentifiedChannel = {
return message;
},
toJSON(message: IdentifiedChannel): unknown {
const obj: any = {};
message.state !== undefined && (obj.state = stateToJSON(message.state));
message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering));
message.counterparty !== undefined &&
(obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined);
if (message.connectionHops) {
obj.connectionHops = message.connectionHops.map((e) => e);
} else {
obj.connectionHops = [];
}
message.version !== undefined && (obj.version = message.version);
message.portId !== undefined && (obj.portId = message.portId);
message.channelId !== undefined && (obj.channelId = message.channelId);
return obj;
},
fromPartial(object: DeepPartial<IdentifiedChannel>): IdentifiedChannel {
const message = { ...baseIdentifiedChannel } as IdentifiedChannel;
message.connectionHops = [];
@ -491,38 +524,25 @@ export const IdentifiedChannel = {
}
return message;
},
toJSON(message: IdentifiedChannel): unknown {
const obj: any = {};
message.state !== undefined && (obj.state = stateToJSON(message.state));
message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering));
message.counterparty !== undefined &&
(obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined);
if (message.connectionHops) {
obj.connectionHops = message.connectionHops.map((e) => e);
} else {
obj.connectionHops = [];
}
message.version !== undefined && (obj.version = message.version);
message.portId !== undefined && (obj.portId = message.portId);
message.channelId !== undefined && (obj.channelId = message.channelId);
return obj;
},
};
const baseCounterparty: object = { portId: "", channelId: "" };
export const Counterparty = {
encode(message: Counterparty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.portId);
writer.uint32(18).string(message.channelId);
if (message.portId !== "") {
writer.uint32(10).string(message.portId);
}
if (message.channelId !== "") {
writer.uint32(18).string(message.channelId);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Counterparty {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCounterparty) as Counterparty;
const message = { ...baseCounterparty } as Counterparty;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -541,7 +561,7 @@ export const Counterparty = {
},
fromJSON(object: any): Counterparty {
const message = Object.create(baseCounterparty) as Counterparty;
const message = { ...baseCounterparty } as Counterparty;
if (object.portId !== undefined && object.portId !== null) {
message.portId = String(object.portId);
} else {
@ -555,6 +575,13 @@ export const Counterparty = {
return message;
},
toJSON(message: Counterparty): unknown {
const obj: any = {};
message.portId !== undefined && (obj.portId = message.portId);
message.channelId !== undefined && (obj.channelId = message.channelId);
return obj;
},
fromPartial(object: DeepPartial<Counterparty>): Counterparty {
const message = { ...baseCounterparty } as Counterparty;
if (object.portId !== undefined && object.portId !== null) {
@ -569,13 +596,6 @@ export const Counterparty = {
}
return message;
},
toJSON(message: Counterparty): unknown {
const obj: any = {};
message.portId !== undefined && (obj.portId = message.portId);
message.channelId !== undefined && (obj.channelId = message.channelId);
return obj;
},
};
const basePacket: object = {
@ -589,23 +609,37 @@ const basePacket: object = {
export const Packet = {
encode(message: Packet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint64(message.sequence);
writer.uint32(18).string(message.sourcePort);
writer.uint32(26).string(message.sourceChannel);
writer.uint32(34).string(message.destinationPort);
writer.uint32(42).string(message.destinationChannel);
writer.uint32(50).bytes(message.data);
if (!message.sequence.isZero()) {
writer.uint32(8).uint64(message.sequence);
}
if (message.sourcePort !== "") {
writer.uint32(18).string(message.sourcePort);
}
if (message.sourceChannel !== "") {
writer.uint32(26).string(message.sourceChannel);
}
if (message.destinationPort !== "") {
writer.uint32(34).string(message.destinationPort);
}
if (message.destinationChannel !== "") {
writer.uint32(42).string(message.destinationChannel);
}
if (message.data.length !== 0) {
writer.uint32(50).bytes(message.data);
}
if (message.timeoutHeight !== undefined) {
Height.encode(message.timeoutHeight, writer.uint32(58).fork()).ldelim();
}
writer.uint32(64).uint64(message.timeoutTimestamp);
if (!message.timeoutTimestamp.isZero()) {
writer.uint32(64).uint64(message.timeoutTimestamp);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Packet {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(basePacket) as Packet;
const message = { ...basePacket } as Packet;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -642,7 +676,7 @@ export const Packet = {
},
fromJSON(object: any): Packet {
const message = Object.create(basePacket) as Packet;
const message = { ...basePacket } as Packet;
if (object.sequence !== undefined && object.sequence !== null) {
message.sequence = Long.fromString(object.sequence);
} else {
@ -684,6 +718,22 @@ export const Packet = {
return message;
},
toJSON(message: Packet): unknown {
const obj: any = {};
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
message.sourcePort !== undefined && (obj.sourcePort = message.sourcePort);
message.sourceChannel !== undefined && (obj.sourceChannel = message.sourceChannel);
message.destinationPort !== undefined && (obj.destinationPort = message.destinationPort);
message.destinationChannel !== undefined && (obj.destinationChannel = message.destinationChannel);
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
message.timeoutHeight !== undefined &&
(obj.timeoutHeight = message.timeoutHeight ? Height.toJSON(message.timeoutHeight) : undefined);
message.timeoutTimestamp !== undefined &&
(obj.timeoutTimestamp = (message.timeoutTimestamp || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<Packet>): Packet {
const message = { ...basePacket } as Packet;
if (object.sequence !== undefined && object.sequence !== null) {
@ -728,39 +778,31 @@ export const Packet = {
}
return message;
},
toJSON(message: Packet): unknown {
const obj: any = {};
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
message.sourcePort !== undefined && (obj.sourcePort = message.sourcePort);
message.sourceChannel !== undefined && (obj.sourceChannel = message.sourceChannel);
message.destinationPort !== undefined && (obj.destinationPort = message.destinationPort);
message.destinationChannel !== undefined && (obj.destinationChannel = message.destinationChannel);
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
message.timeoutHeight !== undefined &&
(obj.timeoutHeight = message.timeoutHeight ? Height.toJSON(message.timeoutHeight) : undefined);
message.timeoutTimestamp !== undefined &&
(obj.timeoutTimestamp = (message.timeoutTimestamp || Long.UZERO).toString());
return obj;
},
};
const basePacketState: object = { portId: "", channelId: "", sequence: Long.UZERO };
export const PacketState = {
encode(message: PacketState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.portId);
writer.uint32(18).string(message.channelId);
writer.uint32(24).uint64(message.sequence);
writer.uint32(34).bytes(message.data);
if (message.portId !== "") {
writer.uint32(10).string(message.portId);
}
if (message.channelId !== "") {
writer.uint32(18).string(message.channelId);
}
if (!message.sequence.isZero()) {
writer.uint32(24).uint64(message.sequence);
}
if (message.data.length !== 0) {
writer.uint32(34).bytes(message.data);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): PacketState {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(basePacketState) as PacketState;
const message = { ...basePacketState } as PacketState;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -785,7 +827,7 @@ export const PacketState = {
},
fromJSON(object: any): PacketState {
const message = Object.create(basePacketState) as PacketState;
const message = { ...basePacketState } as PacketState;
if (object.portId !== undefined && object.portId !== null) {
message.portId = String(object.portId);
} else {
@ -807,6 +849,16 @@ export const PacketState = {
return message;
},
toJSON(message: PacketState): unknown {
const obj: any = {};
message.portId !== undefined && (obj.portId = message.portId);
message.channelId !== undefined && (obj.channelId = message.channelId);
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<PacketState>): PacketState {
const message = { ...basePacketState } as PacketState;
if (object.portId !== undefined && object.portId !== null) {
@ -831,16 +883,6 @@ export const PacketState = {
}
return message;
},
toJSON(message: PacketState): unknown {
const obj: any = {};
message.portId !== undefined && (obj.portId = message.portId);
message.channelId !== undefined && (obj.channelId = message.channelId);
message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString());
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
return obj;
},
};
const baseAcknowledgement: object = {};
@ -859,7 +901,7 @@ export const Acknowledgement = {
decode(input: _m0.Reader | Uint8Array, length?: number): Acknowledgement {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseAcknowledgement) as Acknowledgement;
const message = { ...baseAcknowledgement } as Acknowledgement;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -878,7 +920,7 @@ export const Acknowledgement = {
},
fromJSON(object: any): Acknowledgement {
const message = Object.create(baseAcknowledgement) as Acknowledgement;
const message = { ...baseAcknowledgement } as Acknowledgement;
if (object.result !== undefined && object.result !== null) {
message.result = bytesFromBase64(object.result);
}
@ -890,6 +932,14 @@ export const Acknowledgement = {
return message;
},
toJSON(message: Acknowledgement): unknown {
const obj: any = {};
message.result !== undefined &&
(obj.result = message.result !== undefined ? base64FromBytes(message.result) : undefined);
message.error !== undefined && (obj.error = message.error);
return obj;
},
fromPartial(object: DeepPartial<Acknowledgement>): Acknowledgement {
const message = { ...baseAcknowledgement } as Acknowledgement;
if (object.result !== undefined && object.result !== null) {
@ -904,14 +954,6 @@ export const Acknowledgement = {
}
return message;
},
toJSON(message: Acknowledgement): unknown {
const obj: any = {};
message.result !== undefined &&
(obj.result = message.result !== undefined ? base64FromBytes(message.result) : undefined);
message.error !== undefined && (obj.error = message.error);
return obj;
},
};
declare var self: any | undefined;
@ -921,7 +963,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

File diff suppressed because it is too large Load Diff

View File

@ -79,7 +79,9 @@ const baseIdentifiedClientState: object = { clientId: "" };
export const IdentifiedClientState = {
encode(message: IdentifiedClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.clientId);
if (message.clientId !== "") {
writer.uint32(10).string(message.clientId);
}
if (message.clientState !== undefined) {
Any.encode(message.clientState, writer.uint32(18).fork()).ldelim();
}
@ -89,7 +91,7 @@ export const IdentifiedClientState = {
decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedClientState {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseIdentifiedClientState) as IdentifiedClientState;
const message = { ...baseIdentifiedClientState } as IdentifiedClientState;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -108,7 +110,7 @@ export const IdentifiedClientState = {
},
fromJSON(object: any): IdentifiedClientState {
const message = Object.create(baseIdentifiedClientState) as IdentifiedClientState;
const message = { ...baseIdentifiedClientState } as IdentifiedClientState;
if (object.clientId !== undefined && object.clientId !== null) {
message.clientId = String(object.clientId);
} else {
@ -122,6 +124,14 @@ export const IdentifiedClientState = {
return message;
},
toJSON(message: IdentifiedClientState): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
message.clientState !== undefined &&
(obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined);
return obj;
},
fromPartial(object: DeepPartial<IdentifiedClientState>): IdentifiedClientState {
const message = { ...baseIdentifiedClientState } as IdentifiedClientState;
if (object.clientId !== undefined && object.clientId !== null) {
@ -136,14 +146,6 @@ export const IdentifiedClientState = {
}
return message;
},
toJSON(message: IdentifiedClientState): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
message.clientState !== undefined &&
(obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined);
return obj;
},
};
const baseConsensusStateWithHeight: object = {};
@ -162,7 +164,7 @@ export const ConsensusStateWithHeight = {
decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusStateWithHeight {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseConsensusStateWithHeight) as ConsensusStateWithHeight;
const message = { ...baseConsensusStateWithHeight } as ConsensusStateWithHeight;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -181,7 +183,7 @@ export const ConsensusStateWithHeight = {
},
fromJSON(object: any): ConsensusStateWithHeight {
const message = Object.create(baseConsensusStateWithHeight) as ConsensusStateWithHeight;
const message = { ...baseConsensusStateWithHeight } as ConsensusStateWithHeight;
if (object.height !== undefined && object.height !== null) {
message.height = Height.fromJSON(object.height);
} else {
@ -195,6 +197,14 @@ export const ConsensusStateWithHeight = {
return message;
},
toJSON(message: ConsensusStateWithHeight): unknown {
const obj: any = {};
message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined);
message.consensusState !== undefined &&
(obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined);
return obj;
},
fromPartial(object: DeepPartial<ConsensusStateWithHeight>): ConsensusStateWithHeight {
const message = { ...baseConsensusStateWithHeight } as ConsensusStateWithHeight;
if (object.height !== undefined && object.height !== null) {
@ -209,21 +219,15 @@ export const ConsensusStateWithHeight = {
}
return message;
},
toJSON(message: ConsensusStateWithHeight): unknown {
const obj: any = {};
message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined);
message.consensusState !== undefined &&
(obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined);
return obj;
},
};
const baseClientConsensusStates: object = { clientId: "" };
export const ClientConsensusStates = {
encode(message: ClientConsensusStates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.clientId);
if (message.clientId !== "") {
writer.uint32(10).string(message.clientId);
}
for (const v of message.consensusStates) {
ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim();
}
@ -233,7 +237,7 @@ export const ClientConsensusStates = {
decode(input: _m0.Reader | Uint8Array, length?: number): ClientConsensusStates {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseClientConsensusStates) as ClientConsensusStates;
const message = { ...baseClientConsensusStates } as ClientConsensusStates;
message.consensusStates = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -253,7 +257,7 @@ export const ClientConsensusStates = {
},
fromJSON(object: any): ClientConsensusStates {
const message = Object.create(baseClientConsensusStates) as ClientConsensusStates;
const message = { ...baseClientConsensusStates } as ClientConsensusStates;
message.consensusStates = [];
if (object.clientId !== undefined && object.clientId !== null) {
message.clientId = String(object.clientId);
@ -268,22 +272,6 @@ export const ClientConsensusStates = {
return message;
},
fromPartial(object: DeepPartial<ClientConsensusStates>): ClientConsensusStates {
const message = { ...baseClientConsensusStates } as ClientConsensusStates;
message.consensusStates = [];
if (object.clientId !== undefined && object.clientId !== null) {
message.clientId = object.clientId;
} else {
message.clientId = "";
}
if (object.consensusStates !== undefined && object.consensusStates !== null) {
for (const e of object.consensusStates) {
message.consensusStates.push(ConsensusStateWithHeight.fromPartial(e));
}
}
return message;
},
toJSON(message: ClientConsensusStates): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
@ -296,15 +284,37 @@ export const ClientConsensusStates = {
}
return obj;
},
fromPartial(object: DeepPartial<ClientConsensusStates>): ClientConsensusStates {
const message = { ...baseClientConsensusStates } as ClientConsensusStates;
message.consensusStates = [];
if (object.clientId !== undefined && object.clientId !== null) {
message.clientId = object.clientId;
} else {
message.clientId = "";
}
if (object.consensusStates !== undefined && object.consensusStates !== null) {
for (const e of object.consensusStates) {
message.consensusStates.push(ConsensusStateWithHeight.fromPartial(e));
}
}
return message;
},
};
const baseClientUpdateProposal: object = { title: "", description: "", clientId: "" };
export const ClientUpdateProposal = {
encode(message: ClientUpdateProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.title);
writer.uint32(18).string(message.description);
writer.uint32(26).string(message.clientId);
if (message.title !== "") {
writer.uint32(10).string(message.title);
}
if (message.description !== "") {
writer.uint32(18).string(message.description);
}
if (message.clientId !== "") {
writer.uint32(26).string(message.clientId);
}
if (message.header !== undefined) {
Any.encode(message.header, writer.uint32(34).fork()).ldelim();
}
@ -314,7 +324,7 @@ export const ClientUpdateProposal = {
decode(input: _m0.Reader | Uint8Array, length?: number): ClientUpdateProposal {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseClientUpdateProposal) as ClientUpdateProposal;
const message = { ...baseClientUpdateProposal } as ClientUpdateProposal;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -339,7 +349,7 @@ export const ClientUpdateProposal = {
},
fromJSON(object: any): ClientUpdateProposal {
const message = Object.create(baseClientUpdateProposal) as ClientUpdateProposal;
const message = { ...baseClientUpdateProposal } as ClientUpdateProposal;
if (object.title !== undefined && object.title !== null) {
message.title = String(object.title);
} else {
@ -363,6 +373,15 @@ export const ClientUpdateProposal = {
return message;
},
toJSON(message: ClientUpdateProposal): unknown {
const obj: any = {};
message.title !== undefined && (obj.title = message.title);
message.description !== undefined && (obj.description = message.description);
message.clientId !== undefined && (obj.clientId = message.clientId);
message.header !== undefined && (obj.header = message.header ? Any.toJSON(message.header) : undefined);
return obj;
},
fromPartial(object: DeepPartial<ClientUpdateProposal>): ClientUpdateProposal {
const message = { ...baseClientUpdateProposal } as ClientUpdateProposal;
if (object.title !== undefined && object.title !== null) {
@ -387,30 +406,25 @@ export const ClientUpdateProposal = {
}
return message;
},
toJSON(message: ClientUpdateProposal): unknown {
const obj: any = {};
message.title !== undefined && (obj.title = message.title);
message.description !== undefined && (obj.description = message.description);
message.clientId !== undefined && (obj.clientId = message.clientId);
message.header !== undefined && (obj.header = message.header ? Any.toJSON(message.header) : undefined);
return obj;
},
};
const baseHeight: object = { revisionNumber: Long.UZERO, revisionHeight: Long.UZERO };
export const Height = {
encode(message: Height, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint64(message.revisionNumber);
writer.uint32(16).uint64(message.revisionHeight);
if (!message.revisionNumber.isZero()) {
writer.uint32(8).uint64(message.revisionNumber);
}
if (!message.revisionHeight.isZero()) {
writer.uint32(16).uint64(message.revisionHeight);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Height {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseHeight) as Height;
const message = { ...baseHeight } as Height;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -429,7 +443,7 @@ export const Height = {
},
fromJSON(object: any): Height {
const message = Object.create(baseHeight) as Height;
const message = { ...baseHeight } as Height;
if (object.revisionNumber !== undefined && object.revisionNumber !== null) {
message.revisionNumber = Long.fromString(object.revisionNumber);
} else {
@ -443,6 +457,15 @@ export const Height = {
return message;
},
toJSON(message: Height): unknown {
const obj: any = {};
message.revisionNumber !== undefined &&
(obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString());
message.revisionHeight !== undefined &&
(obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<Height>): Height {
const message = { ...baseHeight } as Height;
if (object.revisionNumber !== undefined && object.revisionNumber !== null) {
@ -457,15 +480,6 @@ export const Height = {
}
return message;
},
toJSON(message: Height): unknown {
const obj: any = {};
message.revisionNumber !== undefined &&
(obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString());
message.revisionHeight !== undefined &&
(obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString());
return obj;
},
};
const baseParams: object = { allowedClients: "" };
@ -481,7 +495,7 @@ export const Params = {
decode(input: _m0.Reader | Uint8Array, length?: number): Params {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseParams) as Params;
const message = { ...baseParams } as Params;
message.allowedClients = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -498,22 +512,11 @@ export const Params = {
},
fromJSON(object: any): Params {
const message = Object.create(baseParams) as Params;
message.allowedClients = [];
if (object.allowedClients !== undefined && object.allowedClients !== null) {
for (const e of object.allowedClients) {
message.allowedClients.push(String(e));
}
}
return message;
},
fromPartial(object: DeepPartial<Params>): Params {
const message = { ...baseParams } as Params;
message.allowedClients = [];
if (object.allowedClients !== undefined && object.allowedClients !== null) {
for (const e of object.allowedClients) {
message.allowedClients.push(e);
message.allowedClients.push(String(e));
}
}
return message;
@ -528,6 +531,17 @@ export const Params = {
}
return obj;
},
fromPartial(object: DeepPartial<Params>): Params {
const message = { ...baseParams } as Params;
message.allowedClients = [];
if (object.allowedClients !== undefined && object.allowedClients !== null) {
for (const e of object.allowedClients) {
message.allowedClients.push(e);
}
}
return message;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;

View File

@ -46,14 +46,16 @@ const baseMerkleRoot: object = {};
export const MerkleRoot = {
encode(message: MerkleRoot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.hash);
if (message.hash.length !== 0) {
writer.uint32(10).bytes(message.hash);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MerkleRoot {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMerkleRoot) as MerkleRoot;
const message = { ...baseMerkleRoot } as MerkleRoot;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -69,13 +71,20 @@ export const MerkleRoot = {
},
fromJSON(object: any): MerkleRoot {
const message = Object.create(baseMerkleRoot) as MerkleRoot;
const message = { ...baseMerkleRoot } as MerkleRoot;
if (object.hash !== undefined && object.hash !== null) {
message.hash = bytesFromBase64(object.hash);
}
return message;
},
toJSON(message: MerkleRoot): unknown {
const obj: any = {};
message.hash !== undefined &&
(obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<MerkleRoot>): MerkleRoot {
const message = { ...baseMerkleRoot } as MerkleRoot;
if (object.hash !== undefined && object.hash !== null) {
@ -85,27 +94,22 @@ export const MerkleRoot = {
}
return message;
},
toJSON(message: MerkleRoot): unknown {
const obj: any = {};
message.hash !== undefined &&
(obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));
return obj;
},
};
const baseMerklePrefix: object = {};
export const MerklePrefix = {
encode(message: MerklePrefix, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.keyPrefix);
if (message.keyPrefix.length !== 0) {
writer.uint32(10).bytes(message.keyPrefix);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MerklePrefix {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMerklePrefix) as MerklePrefix;
const message = { ...baseMerklePrefix } as MerklePrefix;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -121,19 +125,9 @@ export const MerklePrefix = {
},
fromJSON(object: any): MerklePrefix {
const message = Object.create(baseMerklePrefix) as MerklePrefix;
if (object.keyPrefix !== undefined && object.keyPrefix !== null) {
message.keyPrefix = bytesFromBase64(object.keyPrefix);
}
return message;
},
fromPartial(object: DeepPartial<MerklePrefix>): MerklePrefix {
const message = { ...baseMerklePrefix } as MerklePrefix;
if (object.keyPrefix !== undefined && object.keyPrefix !== null) {
message.keyPrefix = object.keyPrefix;
} else {
message.keyPrefix = new Uint8Array();
message.keyPrefix = bytesFromBase64(object.keyPrefix);
}
return message;
},
@ -146,6 +140,16 @@ export const MerklePrefix = {
));
return obj;
},
fromPartial(object: DeepPartial<MerklePrefix>): MerklePrefix {
const message = { ...baseMerklePrefix } as MerklePrefix;
if (object.keyPrefix !== undefined && object.keyPrefix !== null) {
message.keyPrefix = object.keyPrefix;
} else {
message.keyPrefix = new Uint8Array();
}
return message;
},
};
const baseMerklePath: object = { keyPath: "" };
@ -161,7 +165,7 @@ export const MerklePath = {
decode(input: _m0.Reader | Uint8Array, length?: number): MerklePath {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMerklePath) as MerklePath;
const message = { ...baseMerklePath } as MerklePath;
message.keyPath = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -178,22 +182,11 @@ export const MerklePath = {
},
fromJSON(object: any): MerklePath {
const message = Object.create(baseMerklePath) as MerklePath;
message.keyPath = [];
if (object.keyPath !== undefined && object.keyPath !== null) {
for (const e of object.keyPath) {
message.keyPath.push(String(e));
}
}
return message;
},
fromPartial(object: DeepPartial<MerklePath>): MerklePath {
const message = { ...baseMerklePath } as MerklePath;
message.keyPath = [];
if (object.keyPath !== undefined && object.keyPath !== null) {
for (const e of object.keyPath) {
message.keyPath.push(e);
message.keyPath.push(String(e));
}
}
return message;
@ -208,6 +201,17 @@ export const MerklePath = {
}
return obj;
},
fromPartial(object: DeepPartial<MerklePath>): MerklePath {
const message = { ...baseMerklePath } as MerklePath;
message.keyPath = [];
if (object.keyPath !== undefined && object.keyPath !== null) {
for (const e of object.keyPath) {
message.keyPath.push(e);
}
}
return message;
},
};
const baseMerkleProof: object = {};
@ -223,7 +227,7 @@ export const MerkleProof = {
decode(input: _m0.Reader | Uint8Array, length?: number): MerkleProof {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseMerkleProof) as MerkleProof;
const message = { ...baseMerkleProof } as MerkleProof;
message.proofs = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -240,22 +244,11 @@ export const MerkleProof = {
},
fromJSON(object: any): MerkleProof {
const message = Object.create(baseMerkleProof) as MerkleProof;
message.proofs = [];
if (object.proofs !== undefined && object.proofs !== null) {
for (const e of object.proofs) {
message.proofs.push(CommitmentProof.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<MerkleProof>): MerkleProof {
const message = { ...baseMerkleProof } as MerkleProof;
message.proofs = [];
if (object.proofs !== undefined && object.proofs !== null) {
for (const e of object.proofs) {
message.proofs.push(CommitmentProof.fromPartial(e));
message.proofs.push(CommitmentProof.fromJSON(e));
}
}
return message;
@ -270,6 +263,17 @@ export const MerkleProof = {
}
return obj;
},
fromPartial(object: DeepPartial<MerkleProof>): MerkleProof {
const message = { ...baseMerkleProof } as MerkleProof;
message.proofs = [];
if (object.proofs !== undefined && object.proofs !== null) {
for (const e of object.proofs) {
message.proofs.push(CommitmentProof.fromPartial(e));
}
}
return message;
},
};
declare var self: any | undefined;
@ -279,7 +283,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -152,22 +152,28 @@ const baseConnectionEnd: object = { clientId: "", state: 0, delayPeriod: Long.UZ
export const ConnectionEnd = {
encode(message: ConnectionEnd, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.clientId);
if (message.clientId !== "") {
writer.uint32(10).string(message.clientId);
}
for (const v of message.versions) {
Version.encode(v!, writer.uint32(18).fork()).ldelim();
}
writer.uint32(24).int32(message.state);
if (message.state !== 0) {
writer.uint32(24).int32(message.state);
}
if (message.counterparty !== undefined) {
Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim();
}
writer.uint32(40).uint64(message.delayPeriod);
if (!message.delayPeriod.isZero()) {
writer.uint32(40).uint64(message.delayPeriod);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): ConnectionEnd {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseConnectionEnd) as ConnectionEnd;
const message = { ...baseConnectionEnd } as ConnectionEnd;
message.versions = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -196,7 +202,7 @@ export const ConnectionEnd = {
},
fromJSON(object: any): ConnectionEnd {
const message = Object.create(baseConnectionEnd) as ConnectionEnd;
const message = { ...baseConnectionEnd } as ConnectionEnd;
message.versions = [];
if (object.clientId !== undefined && object.clientId !== null) {
message.clientId = String(object.clientId);
@ -226,6 +232,21 @@ export const ConnectionEnd = {
return message;
},
toJSON(message: ConnectionEnd): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
if (message.versions) {
obj.versions = message.versions.map((e) => (e ? Version.toJSON(e) : undefined));
} else {
obj.versions = [];
}
message.state !== undefined && (obj.state = stateToJSON(message.state));
message.counterparty !== undefined &&
(obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined);
message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<ConnectionEnd>): ConnectionEnd {
const message = { ...baseConnectionEnd } as ConnectionEnd;
message.versions = [];
@ -256,44 +277,37 @@ export const ConnectionEnd = {
}
return message;
},
toJSON(message: ConnectionEnd): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
if (message.versions) {
obj.versions = message.versions.map((e) => (e ? Version.toJSON(e) : undefined));
} else {
obj.versions = [];
}
message.state !== undefined && (obj.state = stateToJSON(message.state));
message.counterparty !== undefined &&
(obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined);
message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || Long.UZERO).toString());
return obj;
},
};
const baseIdentifiedConnection: object = { id: "", clientId: "", state: 0, delayPeriod: Long.UZERO };
export const IdentifiedConnection = {
encode(message: IdentifiedConnection, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.id);
writer.uint32(18).string(message.clientId);
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
if (message.clientId !== "") {
writer.uint32(18).string(message.clientId);
}
for (const v of message.versions) {
Version.encode(v!, writer.uint32(26).fork()).ldelim();
}
writer.uint32(32).int32(message.state);
if (message.state !== 0) {
writer.uint32(32).int32(message.state);
}
if (message.counterparty !== undefined) {
Counterparty.encode(message.counterparty, writer.uint32(42).fork()).ldelim();
}
writer.uint32(48).uint64(message.delayPeriod);
if (!message.delayPeriod.isZero()) {
writer.uint32(48).uint64(message.delayPeriod);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedConnection {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseIdentifiedConnection) as IdentifiedConnection;
const message = { ...baseIdentifiedConnection } as IdentifiedConnection;
message.versions = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -325,7 +339,7 @@ export const IdentifiedConnection = {
},
fromJSON(object: any): IdentifiedConnection {
const message = Object.create(baseIdentifiedConnection) as IdentifiedConnection;
const message = { ...baseIdentifiedConnection } as IdentifiedConnection;
message.versions = [];
if (object.id !== undefined && object.id !== null) {
message.id = String(object.id);
@ -360,6 +374,22 @@ export const IdentifiedConnection = {
return message;
},
toJSON(message: IdentifiedConnection): unknown {
const obj: any = {};
message.id !== undefined && (obj.id = message.id);
message.clientId !== undefined && (obj.clientId = message.clientId);
if (message.versions) {
obj.versions = message.versions.map((e) => (e ? Version.toJSON(e) : undefined));
} else {
obj.versions = [];
}
message.state !== undefined && (obj.state = stateToJSON(message.state));
message.counterparty !== undefined &&
(obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined);
message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<IdentifiedConnection>): IdentifiedConnection {
const message = { ...baseIdentifiedConnection } as IdentifiedConnection;
message.versions = [];
@ -395,30 +425,18 @@ export const IdentifiedConnection = {
}
return message;
},
toJSON(message: IdentifiedConnection): unknown {
const obj: any = {};
message.id !== undefined && (obj.id = message.id);
message.clientId !== undefined && (obj.clientId = message.clientId);
if (message.versions) {
obj.versions = message.versions.map((e) => (e ? Version.toJSON(e) : undefined));
} else {
obj.versions = [];
}
message.state !== undefined && (obj.state = stateToJSON(message.state));
message.counterparty !== undefined &&
(obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined);
message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || Long.UZERO).toString());
return obj;
},
};
const baseCounterparty: object = { clientId: "", connectionId: "" };
export const Counterparty = {
encode(message: Counterparty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.clientId);
writer.uint32(18).string(message.connectionId);
if (message.clientId !== "") {
writer.uint32(10).string(message.clientId);
}
if (message.connectionId !== "") {
writer.uint32(18).string(message.connectionId);
}
if (message.prefix !== undefined) {
MerklePrefix.encode(message.prefix, writer.uint32(26).fork()).ldelim();
}
@ -428,7 +446,7 @@ export const Counterparty = {
decode(input: _m0.Reader | Uint8Array, length?: number): Counterparty {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCounterparty) as Counterparty;
const message = { ...baseCounterparty } as Counterparty;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -450,7 +468,7 @@ export const Counterparty = {
},
fromJSON(object: any): Counterparty {
const message = Object.create(baseCounterparty) as Counterparty;
const message = { ...baseCounterparty } as Counterparty;
if (object.clientId !== undefined && object.clientId !== null) {
message.clientId = String(object.clientId);
} else {
@ -469,6 +487,15 @@ export const Counterparty = {
return message;
},
toJSON(message: Counterparty): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
message.connectionId !== undefined && (obj.connectionId = message.connectionId);
message.prefix !== undefined &&
(obj.prefix = message.prefix ? MerklePrefix.toJSON(message.prefix) : undefined);
return obj;
},
fromPartial(object: DeepPartial<Counterparty>): Counterparty {
const message = { ...baseCounterparty } as Counterparty;
if (object.clientId !== undefined && object.clientId !== null) {
@ -488,15 +515,6 @@ export const Counterparty = {
}
return message;
},
toJSON(message: Counterparty): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
message.connectionId !== undefined && (obj.connectionId = message.connectionId);
message.prefix !== undefined &&
(obj.prefix = message.prefix ? MerklePrefix.toJSON(message.prefix) : undefined);
return obj;
},
};
const baseClientPaths: object = { paths: "" };
@ -512,7 +530,7 @@ export const ClientPaths = {
decode(input: _m0.Reader | Uint8Array, length?: number): ClientPaths {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseClientPaths) as ClientPaths;
const message = { ...baseClientPaths } as ClientPaths;
message.paths = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -529,22 +547,11 @@ export const ClientPaths = {
},
fromJSON(object: any): ClientPaths {
const message = Object.create(baseClientPaths) as ClientPaths;
message.paths = [];
if (object.paths !== undefined && object.paths !== null) {
for (const e of object.paths) {
message.paths.push(String(e));
}
}
return message;
},
fromPartial(object: DeepPartial<ClientPaths>): ClientPaths {
const message = { ...baseClientPaths } as ClientPaths;
message.paths = [];
if (object.paths !== undefined && object.paths !== null) {
for (const e of object.paths) {
message.paths.push(e);
message.paths.push(String(e));
}
}
return message;
@ -559,13 +566,26 @@ export const ClientPaths = {
}
return obj;
},
fromPartial(object: DeepPartial<ClientPaths>): ClientPaths {
const message = { ...baseClientPaths } as ClientPaths;
message.paths = [];
if (object.paths !== undefined && object.paths !== null) {
for (const e of object.paths) {
message.paths.push(e);
}
}
return message;
},
};
const baseConnectionPaths: object = { clientId: "", paths: "" };
export const ConnectionPaths = {
encode(message: ConnectionPaths, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.clientId);
if (message.clientId !== "") {
writer.uint32(10).string(message.clientId);
}
for (const v of message.paths) {
writer.uint32(18).string(v!);
}
@ -575,7 +595,7 @@ export const ConnectionPaths = {
decode(input: _m0.Reader | Uint8Array, length?: number): ConnectionPaths {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseConnectionPaths) as ConnectionPaths;
const message = { ...baseConnectionPaths } as ConnectionPaths;
message.paths = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -595,7 +615,7 @@ export const ConnectionPaths = {
},
fromJSON(object: any): ConnectionPaths {
const message = Object.create(baseConnectionPaths) as ConnectionPaths;
const message = { ...baseConnectionPaths } as ConnectionPaths;
message.paths = [];
if (object.clientId !== undefined && object.clientId !== null) {
message.clientId = String(object.clientId);
@ -610,6 +630,17 @@ export const ConnectionPaths = {
return message;
},
toJSON(message: ConnectionPaths): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
if (message.paths) {
obj.paths = message.paths.map((e) => e);
} else {
obj.paths = [];
}
return obj;
},
fromPartial(object: DeepPartial<ConnectionPaths>): ConnectionPaths {
const message = { ...baseConnectionPaths } as ConnectionPaths;
message.paths = [];
@ -625,24 +656,15 @@ export const ConnectionPaths = {
}
return message;
},
toJSON(message: ConnectionPaths): unknown {
const obj: any = {};
message.clientId !== undefined && (obj.clientId = message.clientId);
if (message.paths) {
obj.paths = message.paths.map((e) => e);
} else {
obj.paths = [];
}
return obj;
},
};
const baseVersion: object = { identifier: "", features: "" };
export const Version = {
encode(message: Version, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.identifier);
if (message.identifier !== "") {
writer.uint32(10).string(message.identifier);
}
for (const v of message.features) {
writer.uint32(18).string(v!);
}
@ -652,7 +674,7 @@ export const Version = {
decode(input: _m0.Reader | Uint8Array, length?: number): Version {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseVersion) as Version;
const message = { ...baseVersion } as Version;
message.features = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -672,7 +694,7 @@ export const Version = {
},
fromJSON(object: any): Version {
const message = Object.create(baseVersion) as Version;
const message = { ...baseVersion } as Version;
message.features = [];
if (object.identifier !== undefined && object.identifier !== null) {
message.identifier = String(object.identifier);
@ -687,6 +709,17 @@ export const Version = {
return message;
},
toJSON(message: Version): unknown {
const obj: any = {};
message.identifier !== undefined && (obj.identifier = message.identifier);
if (message.features) {
obj.features = message.features.map((e) => e);
} else {
obj.features = [];
}
return obj;
},
fromPartial(object: DeepPartial<Version>): Version {
const message = { ...baseVersion } as Version;
message.features = [];
@ -702,17 +735,6 @@ export const Version = {
}
return message;
},
toJSON(message: Version): unknown {
const obj: any = {};
message.identifier !== undefined && (obj.identifier = message.identifier);
if (message.features) {
obj.features = message.features.map((e) => e);
} else {
obj.features = [];
}
return obj;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;

View File

@ -126,14 +126,16 @@ const baseQueryConnectionRequest: object = { connectionId: "" };
export const QueryConnectionRequest = {
encode(message: QueryConnectionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.connectionId);
if (message.connectionId !== "") {
writer.uint32(10).string(message.connectionId);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryConnectionRequest) as QueryConnectionRequest;
const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -149,19 +151,9 @@ export const QueryConnectionRequest = {
},
fromJSON(object: any): QueryConnectionRequest {
const message = Object.create(baseQueryConnectionRequest) as QueryConnectionRequest;
if (object.connectionId !== undefined && object.connectionId !== null) {
message.connectionId = String(object.connectionId);
} else {
message.connectionId = "";
}
return message;
},
fromPartial(object: DeepPartial<QueryConnectionRequest>): QueryConnectionRequest {
const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest;
if (object.connectionId !== undefined && object.connectionId !== null) {
message.connectionId = object.connectionId;
message.connectionId = String(object.connectionId);
} else {
message.connectionId = "";
}
@ -173,6 +165,16 @@ export const QueryConnectionRequest = {
message.connectionId !== undefined && (obj.connectionId = message.connectionId);
return obj;
},
fromPartial(object: DeepPartial<QueryConnectionRequest>): QueryConnectionRequest {
const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest;
if (object.connectionId !== undefined && object.connectionId !== null) {
message.connectionId = object.connectionId;
} else {
message.connectionId = "";
}
return message;
},
};
const baseQueryConnectionResponse: object = {};
@ -182,7 +184,9 @@ export const QueryConnectionResponse = {
if (message.connection !== undefined) {
ConnectionEnd.encode(message.connection, writer.uint32(10).fork()).ldelim();
}
writer.uint32(18).bytes(message.proof);
if (message.proof.length !== 0) {
writer.uint32(18).bytes(message.proof);
}
if (message.proofHeight !== undefined) {
Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim();
}
@ -192,7 +196,7 @@ export const QueryConnectionResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryConnectionResponse) as QueryConnectionResponse;
const message = { ...baseQueryConnectionResponse } as QueryConnectionResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -214,7 +218,7 @@ export const QueryConnectionResponse = {
},
fromJSON(object: any): QueryConnectionResponse {
const message = Object.create(baseQueryConnectionResponse) as QueryConnectionResponse;
const message = { ...baseQueryConnectionResponse } as QueryConnectionResponse;
if (object.connection !== undefined && object.connection !== null) {
message.connection = ConnectionEnd.fromJSON(object.connection);
} else {
@ -231,6 +235,17 @@ export const QueryConnectionResponse = {
return message;
},
toJSON(message: QueryConnectionResponse): unknown {
const obj: any = {};
message.connection !== undefined &&
(obj.connection = message.connection ? ConnectionEnd.toJSON(message.connection) : undefined);
message.proof !== undefined &&
(obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
message.proofHeight !== undefined &&
(obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryConnectionResponse>): QueryConnectionResponse {
const message = { ...baseQueryConnectionResponse } as QueryConnectionResponse;
if (object.connection !== undefined && object.connection !== null) {
@ -250,17 +265,6 @@ export const QueryConnectionResponse = {
}
return message;
},
toJSON(message: QueryConnectionResponse): unknown {
const obj: any = {};
message.connection !== undefined &&
(obj.connection = message.connection ? ConnectionEnd.toJSON(message.connection) : undefined);
message.proof !== undefined &&
(obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
message.proofHeight !== undefined &&
(obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined);
return obj;
},
};
const baseQueryConnectionsRequest: object = {};
@ -276,7 +280,7 @@ export const QueryConnectionsRequest = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionsRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryConnectionsRequest) as QueryConnectionsRequest;
const message = { ...baseQueryConnectionsRequest } as QueryConnectionsRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -292,19 +296,9 @@ export const QueryConnectionsRequest = {
},
fromJSON(object: any): QueryConnectionsRequest {
const message = Object.create(baseQueryConnectionsRequest) as QueryConnectionsRequest;
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageRequest.fromJSON(object.pagination);
} else {
message.pagination = undefined;
}
return message;
},
fromPartial(object: DeepPartial<QueryConnectionsRequest>): QueryConnectionsRequest {
const message = { ...baseQueryConnectionsRequest } as QueryConnectionsRequest;
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageRequest.fromPartial(object.pagination);
message.pagination = PageRequest.fromJSON(object.pagination);
} else {
message.pagination = undefined;
}
@ -317,6 +311,16 @@ export const QueryConnectionsRequest = {
(obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryConnectionsRequest>): QueryConnectionsRequest {
const message = { ...baseQueryConnectionsRequest } as QueryConnectionsRequest;
if (object.pagination !== undefined && object.pagination !== null) {
message.pagination = PageRequest.fromPartial(object.pagination);
} else {
message.pagination = undefined;
}
return message;
},
};
const baseQueryConnectionsResponse: object = {};
@ -338,7 +342,7 @@ export const QueryConnectionsResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionsResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryConnectionsResponse) as QueryConnectionsResponse;
const message = { ...baseQueryConnectionsResponse } as QueryConnectionsResponse;
message.connections = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -361,7 +365,7 @@ export const QueryConnectionsResponse = {
},
fromJSON(object: any): QueryConnectionsResponse {
const message = Object.create(baseQueryConnectionsResponse) as QueryConnectionsResponse;
const message = { ...baseQueryConnectionsResponse } as QueryConnectionsResponse;
message.connections = [];
if (object.connections !== undefined && object.connections !== null) {
for (const e of object.connections) {
@ -381,6 +385,19 @@ export const QueryConnectionsResponse = {
return message;
},
toJSON(message: QueryConnectionsResponse): unknown {
const obj: any = {};
if (message.connections) {
obj.connections = message.connections.map((e) => (e ? IdentifiedConnection.toJSON(e) : undefined));
} else {
obj.connections = [];
}
message.pagination !== undefined &&
(obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined);
message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryConnectionsResponse>): QueryConnectionsResponse {
const message = { ...baseQueryConnectionsResponse } as QueryConnectionsResponse;
message.connections = [];
@ -401,33 +418,22 @@ export const QueryConnectionsResponse = {
}
return message;
},
toJSON(message: QueryConnectionsResponse): unknown {
const obj: any = {};
if (message.connections) {
obj.connections = message.connections.map((e) => (e ? IdentifiedConnection.toJSON(e) : undefined));
} else {
obj.connections = [];
}
message.pagination !== undefined &&
(obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined);
message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined);
return obj;
},
};
const baseQueryClientConnectionsRequest: object = { clientId: "" };
export const QueryClientConnectionsRequest = {
encode(message: QueryClientConnectionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.clientId);
if (message.clientId !== "") {
writer.uint32(10).string(message.clientId);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientConnectionsRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryClientConnectionsRequest) as QueryClientConnectionsRequest;
const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -443,19 +449,9 @@ export const QueryClientConnectionsRequest = {
},
fromJSON(object: any): QueryClientConnectionsRequest {
const message = Object.create(baseQueryClientConnectionsRequest) as QueryClientConnectionsRequest;
if (object.clientId !== undefined && object.clientId !== null) {
message.clientId = String(object.clientId);
} else {
message.clientId = "";
}
return message;
},
fromPartial(object: DeepPartial<QueryClientConnectionsRequest>): QueryClientConnectionsRequest {
const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest;
if (object.clientId !== undefined && object.clientId !== null) {
message.clientId = object.clientId;
message.clientId = String(object.clientId);
} else {
message.clientId = "";
}
@ -467,6 +463,16 @@ export const QueryClientConnectionsRequest = {
message.clientId !== undefined && (obj.clientId = message.clientId);
return obj;
},
fromPartial(object: DeepPartial<QueryClientConnectionsRequest>): QueryClientConnectionsRequest {
const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest;
if (object.clientId !== undefined && object.clientId !== null) {
message.clientId = object.clientId;
} else {
message.clientId = "";
}
return message;
},
};
const baseQueryClientConnectionsResponse: object = { connectionPaths: "" };
@ -476,7 +482,9 @@ export const QueryClientConnectionsResponse = {
for (const v of message.connectionPaths) {
writer.uint32(10).string(v!);
}
writer.uint32(18).bytes(message.proof);
if (message.proof.length !== 0) {
writer.uint32(18).bytes(message.proof);
}
if (message.proofHeight !== undefined) {
Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim();
}
@ -486,7 +494,7 @@ export const QueryClientConnectionsResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientConnectionsResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryClientConnectionsResponse) as QueryClientConnectionsResponse;
const message = { ...baseQueryClientConnectionsResponse } as QueryClientConnectionsResponse;
message.connectionPaths = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -509,7 +517,7 @@ export const QueryClientConnectionsResponse = {
},
fromJSON(object: any): QueryClientConnectionsResponse {
const message = Object.create(baseQueryClientConnectionsResponse) as QueryClientConnectionsResponse;
const message = { ...baseQueryClientConnectionsResponse } as QueryClientConnectionsResponse;
message.connectionPaths = [];
if (object.connectionPaths !== undefined && object.connectionPaths !== null) {
for (const e of object.connectionPaths) {
@ -527,6 +535,20 @@ export const QueryClientConnectionsResponse = {
return message;
},
toJSON(message: QueryClientConnectionsResponse): unknown {
const obj: any = {};
if (message.connectionPaths) {
obj.connectionPaths = message.connectionPaths.map((e) => e);
} else {
obj.connectionPaths = [];
}
message.proof !== undefined &&
(obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
message.proofHeight !== undefined &&
(obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryClientConnectionsResponse>): QueryClientConnectionsResponse {
const message = { ...baseQueryClientConnectionsResponse } as QueryClientConnectionsResponse;
message.connectionPaths = [];
@ -547,34 +569,22 @@ export const QueryClientConnectionsResponse = {
}
return message;
},
toJSON(message: QueryClientConnectionsResponse): unknown {
const obj: any = {};
if (message.connectionPaths) {
obj.connectionPaths = message.connectionPaths.map((e) => e);
} else {
obj.connectionPaths = [];
}
message.proof !== undefined &&
(obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
message.proofHeight !== undefined &&
(obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined);
return obj;
},
};
const baseQueryConnectionClientStateRequest: object = { connectionId: "" };
export const QueryConnectionClientStateRequest = {
encode(message: QueryConnectionClientStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.connectionId);
if (message.connectionId !== "") {
writer.uint32(10).string(message.connectionId);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionClientStateRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseQueryConnectionClientStateRequest) as QueryConnectionClientStateRequest;
const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -590,19 +600,9 @@ export const QueryConnectionClientStateRequest = {
},
fromJSON(object: any): QueryConnectionClientStateRequest {
const message = Object.create(baseQueryConnectionClientStateRequest) as QueryConnectionClientStateRequest;
if (object.connectionId !== undefined && object.connectionId !== null) {
message.connectionId = String(object.connectionId);
} else {
message.connectionId = "";
}
return message;
},
fromPartial(object: DeepPartial<QueryConnectionClientStateRequest>): QueryConnectionClientStateRequest {
const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest;
if (object.connectionId !== undefined && object.connectionId !== null) {
message.connectionId = object.connectionId;
message.connectionId = String(object.connectionId);
} else {
message.connectionId = "";
}
@ -614,6 +614,16 @@ export const QueryConnectionClientStateRequest = {
message.connectionId !== undefined && (obj.connectionId = message.connectionId);
return obj;
},
fromPartial(object: DeepPartial<QueryConnectionClientStateRequest>): QueryConnectionClientStateRequest {
const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest;
if (object.connectionId !== undefined && object.connectionId !== null) {
message.connectionId = object.connectionId;
} else {
message.connectionId = "";
}
return message;
},
};
const baseQueryConnectionClientStateResponse: object = {};
@ -623,7 +633,9 @@ export const QueryConnectionClientStateResponse = {
if (message.identifiedClientState !== undefined) {
IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim();
}
writer.uint32(18).bytes(message.proof);
if (message.proof.length !== 0) {
writer.uint32(18).bytes(message.proof);
}
if (message.proofHeight !== undefined) {
Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim();
}
@ -633,9 +645,7 @@ export const QueryConnectionClientStateResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionClientStateResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(
baseQueryConnectionClientStateResponse,
) as QueryConnectionClientStateResponse;
const message = { ...baseQueryConnectionClientStateResponse } as QueryConnectionClientStateResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -657,9 +667,7 @@ export const QueryConnectionClientStateResponse = {
},
fromJSON(object: any): QueryConnectionClientStateResponse {
const message = Object.create(
baseQueryConnectionClientStateResponse,
) as QueryConnectionClientStateResponse;
const message = { ...baseQueryConnectionClientStateResponse } as QueryConnectionClientStateResponse;
if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) {
message.identifiedClientState = IdentifiedClientState.fromJSON(object.identifiedClientState);
} else {
@ -676,6 +684,19 @@ export const QueryConnectionClientStateResponse = {
return message;
},
toJSON(message: QueryConnectionClientStateResponse): unknown {
const obj: any = {};
message.identifiedClientState !== undefined &&
(obj.identifiedClientState = message.identifiedClientState
? IdentifiedClientState.toJSON(message.identifiedClientState)
: undefined);
message.proof !== undefined &&
(obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
message.proofHeight !== undefined &&
(obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined);
return obj;
},
fromPartial(object: DeepPartial<QueryConnectionClientStateResponse>): QueryConnectionClientStateResponse {
const message = { ...baseQueryConnectionClientStateResponse } as QueryConnectionClientStateResponse;
if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) {
@ -695,19 +716,6 @@ export const QueryConnectionClientStateResponse = {
}
return message;
},
toJSON(message: QueryConnectionClientStateResponse): unknown {
const obj: any = {};
message.identifiedClientState !== undefined &&
(obj.identifiedClientState = message.identifiedClientState
? IdentifiedClientState.toJSON(message.identifiedClientState)
: undefined);
message.proof !== undefined &&
(obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
message.proofHeight !== undefined &&
(obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined);
return obj;
},
};
const baseQueryConnectionConsensusStateRequest: object = {
@ -721,18 +729,22 @@ export const QueryConnectionConsensusStateRequest = {
message: QueryConnectionConsensusStateRequest,
writer: _m0.Writer = _m0.Writer.create(),
): _m0.Writer {
writer.uint32(10).string(message.connectionId);
writer.uint32(16).uint64(message.revisionNumber);
writer.uint32(24).uint64(message.revisionHeight);
if (message.connectionId !== "") {
writer.uint32(10).string(message.connectionId);
}
if (!message.revisionNumber.isZero()) {
writer.uint32(16).uint64(message.revisionNumber);
}
if (!message.revisionHeight.isZero()) {
writer.uint32(24).uint64(message.revisionHeight);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionConsensusStateRequest {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(
baseQueryConnectionConsensusStateRequest,
) as QueryConnectionConsensusStateRequest;
const message = { ...baseQueryConnectionConsensusStateRequest } as QueryConnectionConsensusStateRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -754,9 +766,7 @@ export const QueryConnectionConsensusStateRequest = {
},
fromJSON(object: any): QueryConnectionConsensusStateRequest {
const message = Object.create(
baseQueryConnectionConsensusStateRequest,
) as QueryConnectionConsensusStateRequest;
const message = { ...baseQueryConnectionConsensusStateRequest } as QueryConnectionConsensusStateRequest;
if (object.connectionId !== undefined && object.connectionId !== null) {
message.connectionId = String(object.connectionId);
} else {
@ -775,6 +785,16 @@ export const QueryConnectionConsensusStateRequest = {
return message;
},
toJSON(message: QueryConnectionConsensusStateRequest): unknown {
const obj: any = {};
message.connectionId !== undefined && (obj.connectionId = message.connectionId);
message.revisionNumber !== undefined &&
(obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString());
message.revisionHeight !== undefined &&
(obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString());
return obj;
},
fromPartial(
object: DeepPartial<QueryConnectionConsensusStateRequest>,
): QueryConnectionConsensusStateRequest {
@ -796,16 +816,6 @@ export const QueryConnectionConsensusStateRequest = {
}
return message;
},
toJSON(message: QueryConnectionConsensusStateRequest): unknown {
const obj: any = {};
message.connectionId !== undefined && (obj.connectionId = message.connectionId);
message.revisionNumber !== undefined &&
(obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString());
message.revisionHeight !== undefined &&
(obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString());
return obj;
},
};
const baseQueryConnectionConsensusStateResponse: object = { clientId: "" };
@ -818,8 +828,12 @@ export const QueryConnectionConsensusStateResponse = {
if (message.consensusState !== undefined) {
Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim();
}
writer.uint32(18).string(message.clientId);
writer.uint32(26).bytes(message.proof);
if (message.clientId !== "") {
writer.uint32(18).string(message.clientId);
}
if (message.proof.length !== 0) {
writer.uint32(26).bytes(message.proof);
}
if (message.proofHeight !== undefined) {
Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim();
}
@ -829,9 +843,7 @@ export const QueryConnectionConsensusStateResponse = {
decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionConsensusStateResponse {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(
baseQueryConnectionConsensusStateResponse,
) as QueryConnectionConsensusStateResponse;
const message = { ...baseQueryConnectionConsensusStateResponse } as QueryConnectionConsensusStateResponse;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -856,9 +868,7 @@ export const QueryConnectionConsensusStateResponse = {
},
fromJSON(object: any): QueryConnectionConsensusStateResponse {
const message = Object.create(
baseQueryConnectionConsensusStateResponse,
) as QueryConnectionConsensusStateResponse;
const message = { ...baseQueryConnectionConsensusStateResponse } as QueryConnectionConsensusStateResponse;
if (object.consensusState !== undefined && object.consensusState !== null) {
message.consensusState = Any.fromJSON(object.consensusState);
} else {
@ -880,6 +890,18 @@ export const QueryConnectionConsensusStateResponse = {
return message;
},
toJSON(message: QueryConnectionConsensusStateResponse): unknown {
const obj: any = {};
message.consensusState !== undefined &&
(obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined);
message.clientId !== undefined && (obj.clientId = message.clientId);
message.proof !== undefined &&
(obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
message.proofHeight !== undefined &&
(obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined);
return obj;
},
fromPartial(
object: DeepPartial<QueryConnectionConsensusStateResponse>,
): QueryConnectionConsensusStateResponse {
@ -906,18 +928,6 @@ export const QueryConnectionConsensusStateResponse = {
}
return message;
},
toJSON(message: QueryConnectionConsensusStateResponse): unknown {
const obj: any = {};
message.consensusState !== undefined &&
(obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined);
message.clientId !== undefined && (obj.clientId = message.clientId);
message.proof !== undefined &&
(obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array()));
message.proofHeight !== undefined &&
(obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined);
return obj;
},
};
/** Query provides defines the gRPC querier service */
@ -998,7 +1008,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,7 @@ export const PublicKey = {
decode(input: _m0.Reader | Uint8Array, length?: number): PublicKey {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(basePublicKey) as PublicKey;
const message = { ...basePublicKey } as PublicKey;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -45,7 +45,7 @@ export const PublicKey = {
},
fromJSON(object: any): PublicKey {
const message = Object.create(basePublicKey) as PublicKey;
const message = { ...basePublicKey } as PublicKey;
if (object.ed25519 !== undefined && object.ed25519 !== null) {
message.ed25519 = bytesFromBase64(object.ed25519);
}
@ -55,6 +55,15 @@ export const PublicKey = {
return message;
},
toJSON(message: PublicKey): unknown {
const obj: any = {};
message.ed25519 !== undefined &&
(obj.ed25519 = message.ed25519 !== undefined ? base64FromBytes(message.ed25519) : undefined);
message.secp256k1 !== undefined &&
(obj.secp256k1 = message.secp256k1 !== undefined ? base64FromBytes(message.secp256k1) : undefined);
return obj;
},
fromPartial(object: DeepPartial<PublicKey>): PublicKey {
const message = { ...basePublicKey } as PublicKey;
if (object.ed25519 !== undefined && object.ed25519 !== null) {
@ -69,15 +78,6 @@ export const PublicKey = {
}
return message;
},
toJSON(message: PublicKey): unknown {
const obj: any = {};
message.ed25519 !== undefined &&
(obj.ed25519 = message.ed25519 !== undefined ? base64FromBytes(message.ed25519) : undefined);
message.secp256k1 !== undefined &&
(obj.secp256k1 = message.secp256k1 !== undefined ? base64FromBytes(message.secp256k1) : undefined);
return obj;
},
};
declare var self: any | undefined;
@ -87,7 +87,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -44,9 +44,15 @@ const baseProof: object = { total: Long.ZERO, index: Long.ZERO };
export const Proof = {
encode(message: Proof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int64(message.total);
writer.uint32(16).int64(message.index);
writer.uint32(26).bytes(message.leafHash);
if (!message.total.isZero()) {
writer.uint32(8).int64(message.total);
}
if (!message.index.isZero()) {
writer.uint32(16).int64(message.index);
}
if (message.leafHash.length !== 0) {
writer.uint32(26).bytes(message.leafHash);
}
for (const v of message.aunts) {
writer.uint32(34).bytes(v!);
}
@ -56,7 +62,7 @@ export const Proof = {
decode(input: _m0.Reader | Uint8Array, length?: number): Proof {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseProof) as Proof;
const message = { ...baseProof } as Proof;
message.aunts = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -82,7 +88,7 @@ export const Proof = {
},
fromJSON(object: any): Proof {
const message = Object.create(baseProof) as Proof;
const message = { ...baseProof } as Proof;
message.aunts = [];
if (object.total !== undefined && object.total !== null) {
message.total = Long.fromString(object.total);
@ -105,6 +111,20 @@ export const Proof = {
return message;
},
toJSON(message: Proof): unknown {
const obj: any = {};
message.total !== undefined && (obj.total = (message.total || Long.ZERO).toString());
message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString());
message.leafHash !== undefined &&
(obj.leafHash = base64FromBytes(message.leafHash !== undefined ? message.leafHash : new Uint8Array()));
if (message.aunts) {
obj.aunts = message.aunts.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));
} else {
obj.aunts = [];
}
return obj;
},
fromPartial(object: DeepPartial<Proof>): Proof {
const message = { ...baseProof } as Proof;
message.aunts = [];
@ -130,27 +150,15 @@ export const Proof = {
}
return message;
},
toJSON(message: Proof): unknown {
const obj: any = {};
message.total !== undefined && (obj.total = (message.total || Long.ZERO).toString());
message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString());
message.leafHash !== undefined &&
(obj.leafHash = base64FromBytes(message.leafHash !== undefined ? message.leafHash : new Uint8Array()));
if (message.aunts) {
obj.aunts = message.aunts.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));
} else {
obj.aunts = [];
}
return obj;
},
};
const baseValueOp: object = {};
export const ValueOp = {
encode(message: ValueOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.key);
if (message.key.length !== 0) {
writer.uint32(10).bytes(message.key);
}
if (message.proof !== undefined) {
Proof.encode(message.proof, writer.uint32(18).fork()).ldelim();
}
@ -160,7 +168,7 @@ export const ValueOp = {
decode(input: _m0.Reader | Uint8Array, length?: number): ValueOp {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseValueOp) as ValueOp;
const message = { ...baseValueOp } as ValueOp;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -179,7 +187,7 @@ export const ValueOp = {
},
fromJSON(object: any): ValueOp {
const message = Object.create(baseValueOp) as ValueOp;
const message = { ...baseValueOp } as ValueOp;
if (object.key !== undefined && object.key !== null) {
message.key = bytesFromBase64(object.key);
}
@ -191,6 +199,14 @@ export const ValueOp = {
return message;
},
toJSON(message: ValueOp): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined);
return obj;
},
fromPartial(object: DeepPartial<ValueOp>): ValueOp {
const message = { ...baseValueOp } as ValueOp;
if (object.key !== undefined && object.key !== null) {
@ -205,30 +221,28 @@ export const ValueOp = {
}
return message;
},
toJSON(message: ValueOp): unknown {
const obj: any = {};
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined);
return obj;
},
};
const baseDominoOp: object = { key: "", input: "", output: "" };
export const DominoOp = {
encode(message: DominoOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.key);
writer.uint32(18).string(message.input);
writer.uint32(26).string(message.output);
if (message.key !== "") {
writer.uint32(10).string(message.key);
}
if (message.input !== "") {
writer.uint32(18).string(message.input);
}
if (message.output !== "") {
writer.uint32(26).string(message.output);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): DominoOp {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseDominoOp) as DominoOp;
const message = { ...baseDominoOp } as DominoOp;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -250,7 +264,7 @@ export const DominoOp = {
},
fromJSON(object: any): DominoOp {
const message = Object.create(baseDominoOp) as DominoOp;
const message = { ...baseDominoOp } as DominoOp;
if (object.key !== undefined && object.key !== null) {
message.key = String(object.key);
} else {
@ -269,6 +283,14 @@ export const DominoOp = {
return message;
},
toJSON(message: DominoOp): unknown {
const obj: any = {};
message.key !== undefined && (obj.key = message.key);
message.input !== undefined && (obj.input = message.input);
message.output !== undefined && (obj.output = message.output);
return obj;
},
fromPartial(object: DeepPartial<DominoOp>): DominoOp {
const message = { ...baseDominoOp } as DominoOp;
if (object.key !== undefined && object.key !== null) {
@ -288,30 +310,28 @@ export const DominoOp = {
}
return message;
},
toJSON(message: DominoOp): unknown {
const obj: any = {};
message.key !== undefined && (obj.key = message.key);
message.input !== undefined && (obj.input = message.input);
message.output !== undefined && (obj.output = message.output);
return obj;
},
};
const baseProofOp: object = { type: "" };
export const ProofOp = {
encode(message: ProofOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).string(message.type);
writer.uint32(18).bytes(message.key);
writer.uint32(26).bytes(message.data);
if (message.type !== "") {
writer.uint32(10).string(message.type);
}
if (message.key.length !== 0) {
writer.uint32(18).bytes(message.key);
}
if (message.data.length !== 0) {
writer.uint32(26).bytes(message.data);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): ProofOp {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseProofOp) as ProofOp;
const message = { ...baseProofOp } as ProofOp;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -333,7 +353,7 @@ export const ProofOp = {
},
fromJSON(object: any): ProofOp {
const message = Object.create(baseProofOp) as ProofOp;
const message = { ...baseProofOp } as ProofOp;
if (object.type !== undefined && object.type !== null) {
message.type = String(object.type);
} else {
@ -348,6 +368,16 @@ export const ProofOp = {
return message;
},
toJSON(message: ProofOp): unknown {
const obj: any = {};
message.type !== undefined && (obj.type = message.type);
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<ProofOp>): ProofOp {
const message = { ...baseProofOp } as ProofOp;
if (object.type !== undefined && object.type !== null) {
@ -367,16 +397,6 @@ export const ProofOp = {
}
return message;
},
toJSON(message: ProofOp): unknown {
const obj: any = {};
message.type !== undefined && (obj.type = message.type);
message.key !== undefined &&
(obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
return obj;
},
};
const baseProofOps: object = {};
@ -392,7 +412,7 @@ export const ProofOps = {
decode(input: _m0.Reader | Uint8Array, length?: number): ProofOps {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseProofOps) as ProofOps;
const message = { ...baseProofOps } as ProofOps;
message.ops = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -409,22 +429,11 @@ export const ProofOps = {
},
fromJSON(object: any): ProofOps {
const message = Object.create(baseProofOps) as ProofOps;
message.ops = [];
if (object.ops !== undefined && object.ops !== null) {
for (const e of object.ops) {
message.ops.push(ProofOp.fromJSON(e));
}
}
return message;
},
fromPartial(object: DeepPartial<ProofOps>): ProofOps {
const message = { ...baseProofOps } as ProofOps;
message.ops = [];
if (object.ops !== undefined && object.ops !== null) {
for (const e of object.ops) {
message.ops.push(ProofOp.fromPartial(e));
message.ops.push(ProofOp.fromJSON(e));
}
}
return message;
@ -439,6 +448,17 @@ export const ProofOps = {
}
return obj;
},
fromPartial(object: DeepPartial<ProofOps>): ProofOps {
const message = { ...baseProofOps } as ProofOps;
message.ops = [];
if (object.ops !== undefined && object.ops !== null) {
for (const e of object.ops) {
message.ops.push(ProofOp.fromPartial(e));
}
}
return message;
},
};
declare var self: any | undefined;
@ -448,7 +468,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -13,7 +13,9 @@ const baseBitArray: object = { bits: Long.ZERO, elems: Long.UZERO };
export const BitArray = {
encode(message: BitArray, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int64(message.bits);
if (!message.bits.isZero()) {
writer.uint32(8).int64(message.bits);
}
writer.uint32(18).fork();
for (const v of message.elems) {
writer.uint64(v);
@ -25,7 +27,7 @@ export const BitArray = {
decode(input: _m0.Reader | Uint8Array, length?: number): BitArray {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseBitArray) as BitArray;
const message = { ...baseBitArray } as BitArray;
message.elems = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -52,7 +54,7 @@ export const BitArray = {
},
fromJSON(object: any): BitArray {
const message = Object.create(baseBitArray) as BitArray;
const message = { ...baseBitArray } as BitArray;
message.elems = [];
if (object.bits !== undefined && object.bits !== null) {
message.bits = Long.fromString(object.bits);
@ -67,6 +69,17 @@ export const BitArray = {
return message;
},
toJSON(message: BitArray): unknown {
const obj: any = {};
message.bits !== undefined && (obj.bits = (message.bits || Long.ZERO).toString());
if (message.elems) {
obj.elems = message.elems.map((e) => (e || Long.UZERO).toString());
} else {
obj.elems = [];
}
return obj;
},
fromPartial(object: DeepPartial<BitArray>): BitArray {
const message = { ...baseBitArray } as BitArray;
message.elems = [];
@ -82,17 +95,6 @@ export const BitArray = {
}
return message;
},
toJSON(message: BitArray): unknown {
const obj: any = {};
message.bits !== undefined && (obj.bits = (message.bits || Long.ZERO).toString());
if (message.elems) {
obj.elems = message.elems.map((e) => (e || Long.UZERO).toString());
} else {
obj.elems = [];
}
return obj;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;

View File

@ -107,7 +107,7 @@ export const ConsensusParams = {
decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusParams {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseConsensusParams) as ConsensusParams;
const message = { ...baseConsensusParams } as ConsensusParams;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -132,7 +132,7 @@ export const ConsensusParams = {
},
fromJSON(object: any): ConsensusParams {
const message = Object.create(baseConsensusParams) as ConsensusParams;
const message = { ...baseConsensusParams } as ConsensusParams;
if (object.block !== undefined && object.block !== null) {
message.block = BlockParams.fromJSON(object.block);
} else {
@ -156,6 +156,19 @@ export const ConsensusParams = {
return message;
},
toJSON(message: ConsensusParams): unknown {
const obj: any = {};
message.block !== undefined &&
(obj.block = message.block ? BlockParams.toJSON(message.block) : undefined);
message.evidence !== undefined &&
(obj.evidence = message.evidence ? EvidenceParams.toJSON(message.evidence) : undefined);
message.validator !== undefined &&
(obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined);
message.version !== undefined &&
(obj.version = message.version ? VersionParams.toJSON(message.version) : undefined);
return obj;
},
fromPartial(object: DeepPartial<ConsensusParams>): ConsensusParams {
const message = { ...baseConsensusParams } as ConsensusParams;
if (object.block !== undefined && object.block !== null) {
@ -180,35 +193,28 @@ export const ConsensusParams = {
}
return message;
},
toJSON(message: ConsensusParams): unknown {
const obj: any = {};
message.block !== undefined &&
(obj.block = message.block ? BlockParams.toJSON(message.block) : undefined);
message.evidence !== undefined &&
(obj.evidence = message.evidence ? EvidenceParams.toJSON(message.evidence) : undefined);
message.validator !== undefined &&
(obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined);
message.version !== undefined &&
(obj.version = message.version ? VersionParams.toJSON(message.version) : undefined);
return obj;
},
};
const baseBlockParams: object = { maxBytes: Long.ZERO, maxGas: Long.ZERO, timeIotaMs: Long.ZERO };
export const BlockParams = {
encode(message: BlockParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int64(message.maxBytes);
writer.uint32(16).int64(message.maxGas);
writer.uint32(24).int64(message.timeIotaMs);
if (!message.maxBytes.isZero()) {
writer.uint32(8).int64(message.maxBytes);
}
if (!message.maxGas.isZero()) {
writer.uint32(16).int64(message.maxGas);
}
if (!message.timeIotaMs.isZero()) {
writer.uint32(24).int64(message.timeIotaMs);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): BlockParams {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseBlockParams) as BlockParams;
const message = { ...baseBlockParams } as BlockParams;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -230,7 +236,7 @@ export const BlockParams = {
},
fromJSON(object: any): BlockParams {
const message = Object.create(baseBlockParams) as BlockParams;
const message = { ...baseBlockParams } as BlockParams;
if (object.maxBytes !== undefined && object.maxBytes !== null) {
message.maxBytes = Long.fromString(object.maxBytes);
} else {
@ -249,6 +255,14 @@ export const BlockParams = {
return message;
},
toJSON(message: BlockParams): unknown {
const obj: any = {};
message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString());
message.maxGas !== undefined && (obj.maxGas = (message.maxGas || Long.ZERO).toString());
message.timeIotaMs !== undefined && (obj.timeIotaMs = (message.timeIotaMs || Long.ZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<BlockParams>): BlockParams {
const message = { ...baseBlockParams } as BlockParams;
if (object.maxBytes !== undefined && object.maxBytes !== null) {
@ -268,32 +282,28 @@ export const BlockParams = {
}
return message;
},
toJSON(message: BlockParams): unknown {
const obj: any = {};
message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString());
message.maxGas !== undefined && (obj.maxGas = (message.maxGas || Long.ZERO).toString());
message.timeIotaMs !== undefined && (obj.timeIotaMs = (message.timeIotaMs || Long.ZERO).toString());
return obj;
},
};
const baseEvidenceParams: object = { maxAgeNumBlocks: Long.ZERO, maxBytes: Long.ZERO };
export const EvidenceParams = {
encode(message: EvidenceParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int64(message.maxAgeNumBlocks);
if (!message.maxAgeNumBlocks.isZero()) {
writer.uint32(8).int64(message.maxAgeNumBlocks);
}
if (message.maxAgeDuration !== undefined) {
Duration.encode(message.maxAgeDuration, writer.uint32(18).fork()).ldelim();
}
writer.uint32(24).int64(message.maxBytes);
if (!message.maxBytes.isZero()) {
writer.uint32(24).int64(message.maxBytes);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): EvidenceParams {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseEvidenceParams) as EvidenceParams;
const message = { ...baseEvidenceParams } as EvidenceParams;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -315,7 +325,7 @@ export const EvidenceParams = {
},
fromJSON(object: any): EvidenceParams {
const message = Object.create(baseEvidenceParams) as EvidenceParams;
const message = { ...baseEvidenceParams } as EvidenceParams;
if (object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null) {
message.maxAgeNumBlocks = Long.fromString(object.maxAgeNumBlocks);
} else {
@ -334,6 +344,16 @@ export const EvidenceParams = {
return message;
},
toJSON(message: EvidenceParams): unknown {
const obj: any = {};
message.maxAgeNumBlocks !== undefined &&
(obj.maxAgeNumBlocks = (message.maxAgeNumBlocks || Long.ZERO).toString());
message.maxAgeDuration !== undefined &&
(obj.maxAgeDuration = message.maxAgeDuration ? Duration.toJSON(message.maxAgeDuration) : undefined);
message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<EvidenceParams>): EvidenceParams {
const message = { ...baseEvidenceParams } as EvidenceParams;
if (object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null) {
@ -353,16 +373,6 @@ export const EvidenceParams = {
}
return message;
},
toJSON(message: EvidenceParams): unknown {
const obj: any = {};
message.maxAgeNumBlocks !== undefined &&
(obj.maxAgeNumBlocks = (message.maxAgeNumBlocks || Long.ZERO).toString());
message.maxAgeDuration !== undefined &&
(obj.maxAgeDuration = message.maxAgeDuration ? Duration.toJSON(message.maxAgeDuration) : undefined);
message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString());
return obj;
},
};
const baseValidatorParams: object = { pubKeyTypes: "" };
@ -378,7 +388,7 @@ export const ValidatorParams = {
decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorParams {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseValidatorParams) as ValidatorParams;
const message = { ...baseValidatorParams } as ValidatorParams;
message.pubKeyTypes = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -395,22 +405,11 @@ export const ValidatorParams = {
},
fromJSON(object: any): ValidatorParams {
const message = Object.create(baseValidatorParams) as ValidatorParams;
message.pubKeyTypes = [];
if (object.pubKeyTypes !== undefined && object.pubKeyTypes !== null) {
for (const e of object.pubKeyTypes) {
message.pubKeyTypes.push(String(e));
}
}
return message;
},
fromPartial(object: DeepPartial<ValidatorParams>): ValidatorParams {
const message = { ...baseValidatorParams } as ValidatorParams;
message.pubKeyTypes = [];
if (object.pubKeyTypes !== undefined && object.pubKeyTypes !== null) {
for (const e of object.pubKeyTypes) {
message.pubKeyTypes.push(e);
message.pubKeyTypes.push(String(e));
}
}
return message;
@ -425,20 +424,33 @@ export const ValidatorParams = {
}
return obj;
},
fromPartial(object: DeepPartial<ValidatorParams>): ValidatorParams {
const message = { ...baseValidatorParams } as ValidatorParams;
message.pubKeyTypes = [];
if (object.pubKeyTypes !== undefined && object.pubKeyTypes !== null) {
for (const e of object.pubKeyTypes) {
message.pubKeyTypes.push(e);
}
}
return message;
},
};
const baseVersionParams: object = { appVersion: Long.UZERO };
export const VersionParams = {
encode(message: VersionParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint64(message.appVersion);
if (!message.appVersion.isZero()) {
writer.uint32(8).uint64(message.appVersion);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): VersionParams {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseVersionParams) as VersionParams;
const message = { ...baseVersionParams } as VersionParams;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -454,19 +466,9 @@ export const VersionParams = {
},
fromJSON(object: any): VersionParams {
const message = Object.create(baseVersionParams) as VersionParams;
if (object.appVersion !== undefined && object.appVersion !== null) {
message.appVersion = Long.fromString(object.appVersion);
} else {
message.appVersion = Long.UZERO;
}
return message;
},
fromPartial(object: DeepPartial<VersionParams>): VersionParams {
const message = { ...baseVersionParams } as VersionParams;
if (object.appVersion !== undefined && object.appVersion !== null) {
message.appVersion = object.appVersion as Long;
message.appVersion = Long.fromString(object.appVersion);
} else {
message.appVersion = Long.UZERO;
}
@ -478,21 +480,35 @@ export const VersionParams = {
message.appVersion !== undefined && (obj.appVersion = (message.appVersion || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<VersionParams>): VersionParams {
const message = { ...baseVersionParams } as VersionParams;
if (object.appVersion !== undefined && object.appVersion !== null) {
message.appVersion = object.appVersion as Long;
} else {
message.appVersion = Long.UZERO;
}
return message;
},
};
const baseHashedParams: object = { blockMaxBytes: Long.ZERO, blockMaxGas: Long.ZERO };
export const HashedParams = {
encode(message: HashedParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int64(message.blockMaxBytes);
writer.uint32(16).int64(message.blockMaxGas);
if (!message.blockMaxBytes.isZero()) {
writer.uint32(8).int64(message.blockMaxBytes);
}
if (!message.blockMaxGas.isZero()) {
writer.uint32(16).int64(message.blockMaxGas);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): HashedParams {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseHashedParams) as HashedParams;
const message = { ...baseHashedParams } as HashedParams;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -511,7 +527,7 @@ export const HashedParams = {
},
fromJSON(object: any): HashedParams {
const message = Object.create(baseHashedParams) as HashedParams;
const message = { ...baseHashedParams } as HashedParams;
if (object.blockMaxBytes !== undefined && object.blockMaxBytes !== null) {
message.blockMaxBytes = Long.fromString(object.blockMaxBytes);
} else {
@ -525,6 +541,14 @@ export const HashedParams = {
return message;
},
toJSON(message: HashedParams): unknown {
const obj: any = {};
message.blockMaxBytes !== undefined &&
(obj.blockMaxBytes = (message.blockMaxBytes || Long.ZERO).toString());
message.blockMaxGas !== undefined && (obj.blockMaxGas = (message.blockMaxGas || Long.ZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<HashedParams>): HashedParams {
const message = { ...baseHashedParams } as HashedParams;
if (object.blockMaxBytes !== undefined && object.blockMaxBytes !== null) {
@ -539,14 +563,6 @@ export const HashedParams = {
}
return message;
},
toJSON(message: HashedParams): unknown {
const obj: any = {};
message.blockMaxBytes !== undefined &&
(obj.blockMaxBytes = (message.blockMaxBytes || Long.ZERO).toString());
message.blockMaxGas !== undefined && (obj.blockMaxGas = (message.blockMaxGas || Long.ZERO).toString());
return obj;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;

View File

@ -227,15 +227,19 @@ const basePartSetHeader: object = { total: 0 };
export const PartSetHeader = {
encode(message: PartSetHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint32(message.total);
writer.uint32(18).bytes(message.hash);
if (message.total !== 0) {
writer.uint32(8).uint32(message.total);
}
if (message.hash.length !== 0) {
writer.uint32(18).bytes(message.hash);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): PartSetHeader {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(basePartSetHeader) as PartSetHeader;
const message = { ...basePartSetHeader } as PartSetHeader;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -254,7 +258,7 @@ export const PartSetHeader = {
},
fromJSON(object: any): PartSetHeader {
const message = Object.create(basePartSetHeader) as PartSetHeader;
const message = { ...basePartSetHeader } as PartSetHeader;
if (object.total !== undefined && object.total !== null) {
message.total = Number(object.total);
} else {
@ -266,6 +270,14 @@ export const PartSetHeader = {
return message;
},
toJSON(message: PartSetHeader): unknown {
const obj: any = {};
message.total !== undefined && (obj.total = message.total);
message.hash !== undefined &&
(obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));
return obj;
},
fromPartial(object: DeepPartial<PartSetHeader>): PartSetHeader {
const message = { ...basePartSetHeader } as PartSetHeader;
if (object.total !== undefined && object.total !== null) {
@ -280,22 +292,18 @@ export const PartSetHeader = {
}
return message;
},
toJSON(message: PartSetHeader): unknown {
const obj: any = {};
message.total !== undefined && (obj.total = message.total);
message.hash !== undefined &&
(obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));
return obj;
},
};
const basePart: object = { index: 0 };
export const Part = {
encode(message: Part, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint32(message.index);
writer.uint32(18).bytes(message.bytes);
if (message.index !== 0) {
writer.uint32(8).uint32(message.index);
}
if (message.bytes.length !== 0) {
writer.uint32(18).bytes(message.bytes);
}
if (message.proof !== undefined) {
Proof.encode(message.proof, writer.uint32(26).fork()).ldelim();
}
@ -305,7 +313,7 @@ export const Part = {
decode(input: _m0.Reader | Uint8Array, length?: number): Part {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(basePart) as Part;
const message = { ...basePart } as Part;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -327,7 +335,7 @@ export const Part = {
},
fromJSON(object: any): Part {
const message = Object.create(basePart) as Part;
const message = { ...basePart } as Part;
if (object.index !== undefined && object.index !== null) {
message.index = Number(object.index);
} else {
@ -344,6 +352,15 @@ export const Part = {
return message;
},
toJSON(message: Part): unknown {
const obj: any = {};
message.index !== undefined && (obj.index = message.index);
message.bytes !== undefined &&
(obj.bytes = base64FromBytes(message.bytes !== undefined ? message.bytes : new Uint8Array()));
message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined);
return obj;
},
fromPartial(object: DeepPartial<Part>): Part {
const message = { ...basePart } as Part;
if (object.index !== undefined && object.index !== null) {
@ -363,22 +380,15 @@ export const Part = {
}
return message;
},
toJSON(message: Part): unknown {
const obj: any = {};
message.index !== undefined && (obj.index = message.index);
message.bytes !== undefined &&
(obj.bytes = base64FromBytes(message.bytes !== undefined ? message.bytes : new Uint8Array()));
message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined);
return obj;
},
};
const baseBlockID: object = {};
export const BlockID = {
encode(message: BlockID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.hash);
if (message.hash.length !== 0) {
writer.uint32(10).bytes(message.hash);
}
if (message.partSetHeader !== undefined) {
PartSetHeader.encode(message.partSetHeader, writer.uint32(18).fork()).ldelim();
}
@ -388,7 +398,7 @@ export const BlockID = {
decode(input: _m0.Reader | Uint8Array, length?: number): BlockID {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseBlockID) as BlockID;
const message = { ...baseBlockID } as BlockID;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -407,7 +417,7 @@ export const BlockID = {
},
fromJSON(object: any): BlockID {
const message = Object.create(baseBlockID) as BlockID;
const message = { ...baseBlockID } as BlockID;
if (object.hash !== undefined && object.hash !== null) {
message.hash = bytesFromBase64(object.hash);
}
@ -419,6 +429,15 @@ export const BlockID = {
return message;
},
toJSON(message: BlockID): unknown {
const obj: any = {};
message.hash !== undefined &&
(obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));
message.partSetHeader !== undefined &&
(obj.partSetHeader = message.partSetHeader ? PartSetHeader.toJSON(message.partSetHeader) : undefined);
return obj;
},
fromPartial(object: DeepPartial<BlockID>): BlockID {
const message = { ...baseBlockID } as BlockID;
if (object.hash !== undefined && object.hash !== null) {
@ -433,15 +452,6 @@ export const BlockID = {
}
return message;
},
toJSON(message: BlockID): unknown {
const obj: any = {};
message.hash !== undefined &&
(obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));
message.partSetHeader !== undefined &&
(obj.partSetHeader = message.partSetHeader ? PartSetHeader.toJSON(message.partSetHeader) : undefined);
return obj;
},
};
const baseHeader: object = { chainId: "", height: Long.ZERO };
@ -451,30 +461,52 @@ export const Header = {
if (message.version !== undefined) {
Consensus.encode(message.version, writer.uint32(10).fork()).ldelim();
}
writer.uint32(18).string(message.chainId);
writer.uint32(24).int64(message.height);
if (message.chainId !== "") {
writer.uint32(18).string(message.chainId);
}
if (!message.height.isZero()) {
writer.uint32(24).int64(message.height);
}
if (message.time !== undefined) {
Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim();
}
if (message.lastBlockId !== undefined) {
BlockID.encode(message.lastBlockId, writer.uint32(42).fork()).ldelim();
}
writer.uint32(50).bytes(message.lastCommitHash);
writer.uint32(58).bytes(message.dataHash);
writer.uint32(66).bytes(message.validatorsHash);
writer.uint32(74).bytes(message.nextValidatorsHash);
writer.uint32(82).bytes(message.consensusHash);
writer.uint32(90).bytes(message.appHash);
writer.uint32(98).bytes(message.lastResultsHash);
writer.uint32(106).bytes(message.evidenceHash);
writer.uint32(114).bytes(message.proposerAddress);
if (message.lastCommitHash.length !== 0) {
writer.uint32(50).bytes(message.lastCommitHash);
}
if (message.dataHash.length !== 0) {
writer.uint32(58).bytes(message.dataHash);
}
if (message.validatorsHash.length !== 0) {
writer.uint32(66).bytes(message.validatorsHash);
}
if (message.nextValidatorsHash.length !== 0) {
writer.uint32(74).bytes(message.nextValidatorsHash);
}
if (message.consensusHash.length !== 0) {
writer.uint32(82).bytes(message.consensusHash);
}
if (message.appHash.length !== 0) {
writer.uint32(90).bytes(message.appHash);
}
if (message.lastResultsHash.length !== 0) {
writer.uint32(98).bytes(message.lastResultsHash);
}
if (message.evidenceHash.length !== 0) {
writer.uint32(106).bytes(message.evidenceHash);
}
if (message.proposerAddress.length !== 0) {
writer.uint32(114).bytes(message.proposerAddress);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Header {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseHeader) as Header;
const message = { ...baseHeader } as Header;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -529,7 +561,7 @@ export const Header = {
},
fromJSON(object: any): Header {
const message = Object.create(baseHeader) as Header;
const message = { ...baseHeader } as Header;
if (object.version !== undefined && object.version !== null) {
message.version = Consensus.fromJSON(object.version);
} else {
@ -585,6 +617,50 @@ export const Header = {
return message;
},
toJSON(message: Header): unknown {
const obj: any = {};
message.version !== undefined &&
(obj.version = message.version ? Consensus.toJSON(message.version) : undefined);
message.chainId !== undefined && (obj.chainId = message.chainId);
message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString());
message.time !== undefined && (obj.time = message.time !== undefined ? message.time.toISOString() : null);
message.lastBlockId !== undefined &&
(obj.lastBlockId = message.lastBlockId ? BlockID.toJSON(message.lastBlockId) : undefined);
message.lastCommitHash !== undefined &&
(obj.lastCommitHash = base64FromBytes(
message.lastCommitHash !== undefined ? message.lastCommitHash : new Uint8Array(),
));
message.dataHash !== undefined &&
(obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array()));
message.validatorsHash !== undefined &&
(obj.validatorsHash = base64FromBytes(
message.validatorsHash !== undefined ? message.validatorsHash : new Uint8Array(),
));
message.nextValidatorsHash !== undefined &&
(obj.nextValidatorsHash = base64FromBytes(
message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(),
));
message.consensusHash !== undefined &&
(obj.consensusHash = base64FromBytes(
message.consensusHash !== undefined ? message.consensusHash : new Uint8Array(),
));
message.appHash !== undefined &&
(obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array()));
message.lastResultsHash !== undefined &&
(obj.lastResultsHash = base64FromBytes(
message.lastResultsHash !== undefined ? message.lastResultsHash : new Uint8Array(),
));
message.evidenceHash !== undefined &&
(obj.evidenceHash = base64FromBytes(
message.evidenceHash !== undefined ? message.evidenceHash : new Uint8Array(),
));
message.proposerAddress !== undefined &&
(obj.proposerAddress = base64FromBytes(
message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array(),
));
return obj;
},
fromPartial(object: DeepPartial<Header>): Header {
const message = { ...baseHeader } as Header;
if (object.version !== undefined && object.version !== null) {
@ -659,50 +735,6 @@ export const Header = {
}
return message;
},
toJSON(message: Header): unknown {
const obj: any = {};
message.version !== undefined &&
(obj.version = message.version ? Consensus.toJSON(message.version) : undefined);
message.chainId !== undefined && (obj.chainId = message.chainId);
message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString());
message.time !== undefined && (obj.time = message.time !== undefined ? message.time.toISOString() : null);
message.lastBlockId !== undefined &&
(obj.lastBlockId = message.lastBlockId ? BlockID.toJSON(message.lastBlockId) : undefined);
message.lastCommitHash !== undefined &&
(obj.lastCommitHash = base64FromBytes(
message.lastCommitHash !== undefined ? message.lastCommitHash : new Uint8Array(),
));
message.dataHash !== undefined &&
(obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array()));
message.validatorsHash !== undefined &&
(obj.validatorsHash = base64FromBytes(
message.validatorsHash !== undefined ? message.validatorsHash : new Uint8Array(),
));
message.nextValidatorsHash !== undefined &&
(obj.nextValidatorsHash = base64FromBytes(
message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(),
));
message.consensusHash !== undefined &&
(obj.consensusHash = base64FromBytes(
message.consensusHash !== undefined ? message.consensusHash : new Uint8Array(),
));
message.appHash !== undefined &&
(obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array()));
message.lastResultsHash !== undefined &&
(obj.lastResultsHash = base64FromBytes(
message.lastResultsHash !== undefined ? message.lastResultsHash : new Uint8Array(),
));
message.evidenceHash !== undefined &&
(obj.evidenceHash = base64FromBytes(
message.evidenceHash !== undefined ? message.evidenceHash : new Uint8Array(),
));
message.proposerAddress !== undefined &&
(obj.proposerAddress = base64FromBytes(
message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array(),
));
return obj;
},
};
const baseData: object = {};
@ -718,7 +750,7 @@ export const Data = {
decode(input: _m0.Reader | Uint8Array, length?: number): Data {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseData) as Data;
const message = { ...baseData } as Data;
message.txs = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -735,22 +767,11 @@ export const Data = {
},
fromJSON(object: any): Data {
const message = Object.create(baseData) as Data;
message.txs = [];
if (object.txs !== undefined && object.txs !== null) {
for (const e of object.txs) {
message.txs.push(bytesFromBase64(e));
}
}
return message;
},
fromPartial(object: DeepPartial<Data>): Data {
const message = { ...baseData } as Data;
message.txs = [];
if (object.txs !== undefined && object.txs !== null) {
for (const e of object.txs) {
message.txs.push(e);
message.txs.push(bytesFromBase64(e));
}
}
return message;
@ -765,31 +786,54 @@ export const Data = {
}
return obj;
},
fromPartial(object: DeepPartial<Data>): Data {
const message = { ...baseData } as Data;
message.txs = [];
if (object.txs !== undefined && object.txs !== null) {
for (const e of object.txs) {
message.txs.push(e);
}
}
return message;
},
};
const baseVote: object = { type: 0, height: Long.ZERO, round: 0, validatorIndex: 0 };
export const Vote = {
encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int32(message.type);
writer.uint32(16).int64(message.height);
writer.uint32(24).int32(message.round);
if (message.type !== 0) {
writer.uint32(8).int32(message.type);
}
if (!message.height.isZero()) {
writer.uint32(16).int64(message.height);
}
if (message.round !== 0) {
writer.uint32(24).int32(message.round);
}
if (message.blockId !== undefined) {
BlockID.encode(message.blockId, writer.uint32(34).fork()).ldelim();
}
if (message.timestamp !== undefined) {
Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim();
}
writer.uint32(50).bytes(message.validatorAddress);
writer.uint32(56).int32(message.validatorIndex);
writer.uint32(66).bytes(message.signature);
if (message.validatorAddress.length !== 0) {
writer.uint32(50).bytes(message.validatorAddress);
}
if (message.validatorIndex !== 0) {
writer.uint32(56).int32(message.validatorIndex);
}
if (message.signature.length !== 0) {
writer.uint32(66).bytes(message.signature);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Vote {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseVote) as Vote;
const message = { ...baseVote } as Vote;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -826,7 +870,7 @@ export const Vote = {
},
fromJSON(object: any): Vote {
const message = Object.create(baseVote) as Vote;
const message = { ...baseVote } as Vote;
if (object.type !== undefined && object.type !== null) {
message.type = signedMsgTypeFromJSON(object.type);
} else {
@ -866,6 +910,27 @@ export const Vote = {
return message;
},
toJSON(message: Vote): unknown {
const obj: any = {};
message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type));
message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString());
message.round !== undefined && (obj.round = message.round);
message.blockId !== undefined &&
(obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined);
message.timestamp !== undefined &&
(obj.timestamp = message.timestamp !== undefined ? message.timestamp.toISOString() : null);
message.validatorAddress !== undefined &&
(obj.validatorAddress = base64FromBytes(
message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(),
));
message.validatorIndex !== undefined && (obj.validatorIndex = message.validatorIndex);
message.signature !== undefined &&
(obj.signature = base64FromBytes(
message.signature !== undefined ? message.signature : new Uint8Array(),
));
return obj;
},
fromPartial(object: DeepPartial<Vote>): Vote {
const message = { ...baseVote } as Vote;
if (object.type !== undefined && object.type !== null) {
@ -910,35 +975,18 @@ export const Vote = {
}
return message;
},
toJSON(message: Vote): unknown {
const obj: any = {};
message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type));
message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString());
message.round !== undefined && (obj.round = message.round);
message.blockId !== undefined &&
(obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined);
message.timestamp !== undefined &&
(obj.timestamp = message.timestamp !== undefined ? message.timestamp.toISOString() : null);
message.validatorAddress !== undefined &&
(obj.validatorAddress = base64FromBytes(
message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(),
));
message.validatorIndex !== undefined && (obj.validatorIndex = message.validatorIndex);
message.signature !== undefined &&
(obj.signature = base64FromBytes(
message.signature !== undefined ? message.signature : new Uint8Array(),
));
return obj;
},
};
const baseCommit: object = { height: Long.ZERO, round: 0 };
export const Commit = {
encode(message: Commit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int64(message.height);
writer.uint32(16).int32(message.round);
if (!message.height.isZero()) {
writer.uint32(8).int64(message.height);
}
if (message.round !== 0) {
writer.uint32(16).int32(message.round);
}
if (message.blockId !== undefined) {
BlockID.encode(message.blockId, writer.uint32(26).fork()).ldelim();
}
@ -951,7 +999,7 @@ export const Commit = {
decode(input: _m0.Reader | Uint8Array, length?: number): Commit {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCommit) as Commit;
const message = { ...baseCommit } as Commit;
message.signatures = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -977,7 +1025,7 @@ export const Commit = {
},
fromJSON(object: any): Commit {
const message = Object.create(baseCommit) as Commit;
const message = { ...baseCommit } as Commit;
message.signatures = [];
if (object.height !== undefined && object.height !== null) {
message.height = Long.fromString(object.height);
@ -1002,6 +1050,20 @@ export const Commit = {
return message;
},
toJSON(message: Commit): unknown {
const obj: any = {};
message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString());
message.round !== undefined && (obj.round = message.round);
message.blockId !== undefined &&
(obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined);
if (message.signatures) {
obj.signatures = message.signatures.map((e) => (e ? CommitSig.toJSON(e) : undefined));
} else {
obj.signatures = [];
}
return obj;
},
fromPartial(object: DeepPartial<Commit>): Commit {
const message = { ...baseCommit } as Commit;
message.signatures = [];
@ -1027,39 +1089,31 @@ export const Commit = {
}
return message;
},
toJSON(message: Commit): unknown {
const obj: any = {};
message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString());
message.round !== undefined && (obj.round = message.round);
message.blockId !== undefined &&
(obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined);
if (message.signatures) {
obj.signatures = message.signatures.map((e) => (e ? CommitSig.toJSON(e) : undefined));
} else {
obj.signatures = [];
}
return obj;
},
};
const baseCommitSig: object = { blockIdFlag: 0 };
export const CommitSig = {
encode(message: CommitSig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int32(message.blockIdFlag);
writer.uint32(18).bytes(message.validatorAddress);
if (message.blockIdFlag !== 0) {
writer.uint32(8).int32(message.blockIdFlag);
}
if (message.validatorAddress.length !== 0) {
writer.uint32(18).bytes(message.validatorAddress);
}
if (message.timestamp !== undefined) {
Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(26).fork()).ldelim();
}
writer.uint32(34).bytes(message.signature);
if (message.signature.length !== 0) {
writer.uint32(34).bytes(message.signature);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): CommitSig {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseCommitSig) as CommitSig;
const message = { ...baseCommitSig } as CommitSig;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -1084,7 +1138,7 @@ export const CommitSig = {
},
fromJSON(object: any): CommitSig {
const message = Object.create(baseCommitSig) as CommitSig;
const message = { ...baseCommitSig } as CommitSig;
if (object.blockIdFlag !== undefined && object.blockIdFlag !== null) {
message.blockIdFlag = blockIDFlagFromJSON(object.blockIdFlag);
} else {
@ -1104,6 +1158,22 @@ export const CommitSig = {
return message;
},
toJSON(message: CommitSig): unknown {
const obj: any = {};
message.blockIdFlag !== undefined && (obj.blockIdFlag = blockIDFlagToJSON(message.blockIdFlag));
message.validatorAddress !== undefined &&
(obj.validatorAddress = base64FromBytes(
message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(),
));
message.timestamp !== undefined &&
(obj.timestamp = message.timestamp !== undefined ? message.timestamp.toISOString() : null);
message.signature !== undefined &&
(obj.signature = base64FromBytes(
message.signature !== undefined ? message.signature : new Uint8Array(),
));
return obj;
},
fromPartial(object: DeepPartial<CommitSig>): CommitSig {
const message = { ...baseCommitSig } as CommitSig;
if (object.blockIdFlag !== undefined && object.blockIdFlag !== null) {
@ -1128,46 +1198,40 @@ export const CommitSig = {
}
return message;
},
toJSON(message: CommitSig): unknown {
const obj: any = {};
message.blockIdFlag !== undefined && (obj.blockIdFlag = blockIDFlagToJSON(message.blockIdFlag));
message.validatorAddress !== undefined &&
(obj.validatorAddress = base64FromBytes(
message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(),
));
message.timestamp !== undefined &&
(obj.timestamp = message.timestamp !== undefined ? message.timestamp.toISOString() : null);
message.signature !== undefined &&
(obj.signature = base64FromBytes(
message.signature !== undefined ? message.signature : new Uint8Array(),
));
return obj;
},
};
const baseProposal: object = { type: 0, height: Long.ZERO, round: 0, polRound: 0 };
export const Proposal = {
encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).int32(message.type);
writer.uint32(16).int64(message.height);
writer.uint32(24).int32(message.round);
writer.uint32(32).int32(message.polRound);
if (message.type !== 0) {
writer.uint32(8).int32(message.type);
}
if (!message.height.isZero()) {
writer.uint32(16).int64(message.height);
}
if (message.round !== 0) {
writer.uint32(24).int32(message.round);
}
if (message.polRound !== 0) {
writer.uint32(32).int32(message.polRound);
}
if (message.blockId !== undefined) {
BlockID.encode(message.blockId, writer.uint32(42).fork()).ldelim();
}
if (message.timestamp !== undefined) {
Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(50).fork()).ldelim();
}
writer.uint32(58).bytes(message.signature);
if (message.signature.length !== 0) {
writer.uint32(58).bytes(message.signature);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Proposal {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseProposal) as Proposal;
const message = { ...baseProposal } as Proposal;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -1201,7 +1265,7 @@ export const Proposal = {
},
fromJSON(object: any): Proposal {
const message = Object.create(baseProposal) as Proposal;
const message = { ...baseProposal } as Proposal;
if (object.type !== undefined && object.type !== null) {
message.type = signedMsgTypeFromJSON(object.type);
} else {
@ -1238,6 +1302,23 @@ export const Proposal = {
return message;
},
toJSON(message: Proposal): unknown {
const obj: any = {};
message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type));
message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString());
message.round !== undefined && (obj.round = message.round);
message.polRound !== undefined && (obj.polRound = message.polRound);
message.blockId !== undefined &&
(obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined);
message.timestamp !== undefined &&
(obj.timestamp = message.timestamp !== undefined ? message.timestamp.toISOString() : null);
message.signature !== undefined &&
(obj.signature = base64FromBytes(
message.signature !== undefined ? message.signature : new Uint8Array(),
));
return obj;
},
fromPartial(object: DeepPartial<Proposal>): Proposal {
const message = { ...baseProposal } as Proposal;
if (object.type !== undefined && object.type !== null) {
@ -1277,23 +1358,6 @@ export const Proposal = {
}
return message;
},
toJSON(message: Proposal): unknown {
const obj: any = {};
message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type));
message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString());
message.round !== undefined && (obj.round = message.round);
message.polRound !== undefined && (obj.polRound = message.polRound);
message.blockId !== undefined &&
(obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined);
message.timestamp !== undefined &&
(obj.timestamp = message.timestamp !== undefined ? message.timestamp.toISOString() : null);
message.signature !== undefined &&
(obj.signature = base64FromBytes(
message.signature !== undefined ? message.signature : new Uint8Array(),
));
return obj;
},
};
const baseSignedHeader: object = {};
@ -1312,7 +1376,7 @@ export const SignedHeader = {
decode(input: _m0.Reader | Uint8Array, length?: number): SignedHeader {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSignedHeader) as SignedHeader;
const message = { ...baseSignedHeader } as SignedHeader;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -1331,7 +1395,7 @@ export const SignedHeader = {
},
fromJSON(object: any): SignedHeader {
const message = Object.create(baseSignedHeader) as SignedHeader;
const message = { ...baseSignedHeader } as SignedHeader;
if (object.header !== undefined && object.header !== null) {
message.header = Header.fromJSON(object.header);
} else {
@ -1345,6 +1409,13 @@ export const SignedHeader = {
return message;
},
toJSON(message: SignedHeader): unknown {
const obj: any = {};
message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined);
message.commit !== undefined && (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined);
return obj;
},
fromPartial(object: DeepPartial<SignedHeader>): SignedHeader {
const message = { ...baseSignedHeader } as SignedHeader;
if (object.header !== undefined && object.header !== null) {
@ -1359,13 +1430,6 @@ export const SignedHeader = {
}
return message;
},
toJSON(message: SignedHeader): unknown {
const obj: any = {};
message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined);
message.commit !== undefined && (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined);
return obj;
},
};
const baseLightBlock: object = {};
@ -1384,7 +1448,7 @@ export const LightBlock = {
decode(input: _m0.Reader | Uint8Array, length?: number): LightBlock {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseLightBlock) as LightBlock;
const message = { ...baseLightBlock } as LightBlock;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -1403,7 +1467,7 @@ export const LightBlock = {
},
fromJSON(object: any): LightBlock {
const message = Object.create(baseLightBlock) as LightBlock;
const message = { ...baseLightBlock } as LightBlock;
if (object.signedHeader !== undefined && object.signedHeader !== null) {
message.signedHeader = SignedHeader.fromJSON(object.signedHeader);
} else {
@ -1417,6 +1481,15 @@ export const LightBlock = {
return message;
},
toJSON(message: LightBlock): unknown {
const obj: any = {};
message.signedHeader !== undefined &&
(obj.signedHeader = message.signedHeader ? SignedHeader.toJSON(message.signedHeader) : undefined);
message.validatorSet !== undefined &&
(obj.validatorSet = message.validatorSet ? ValidatorSet.toJSON(message.validatorSet) : undefined);
return obj;
},
fromPartial(object: DeepPartial<LightBlock>): LightBlock {
const message = { ...baseLightBlock } as LightBlock;
if (object.signedHeader !== undefined && object.signedHeader !== null) {
@ -1431,15 +1504,6 @@ export const LightBlock = {
}
return message;
},
toJSON(message: LightBlock): unknown {
const obj: any = {};
message.signedHeader !== undefined &&
(obj.signedHeader = message.signedHeader ? SignedHeader.toJSON(message.signedHeader) : undefined);
message.validatorSet !== undefined &&
(obj.validatorSet = message.validatorSet ? ValidatorSet.toJSON(message.validatorSet) : undefined);
return obj;
},
};
const baseBlockMeta: object = { blockSize: Long.ZERO, numTxs: Long.ZERO };
@ -1449,18 +1513,22 @@ export const BlockMeta = {
if (message.blockId !== undefined) {
BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim();
}
writer.uint32(16).int64(message.blockSize);
if (!message.blockSize.isZero()) {
writer.uint32(16).int64(message.blockSize);
}
if (message.header !== undefined) {
Header.encode(message.header, writer.uint32(26).fork()).ldelim();
}
writer.uint32(32).int64(message.numTxs);
if (!message.numTxs.isZero()) {
writer.uint32(32).int64(message.numTxs);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): BlockMeta {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseBlockMeta) as BlockMeta;
const message = { ...baseBlockMeta } as BlockMeta;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -1485,7 +1553,7 @@ export const BlockMeta = {
},
fromJSON(object: any): BlockMeta {
const message = Object.create(baseBlockMeta) as BlockMeta;
const message = { ...baseBlockMeta } as BlockMeta;
if (object.blockId !== undefined && object.blockId !== null) {
message.blockId = BlockID.fromJSON(object.blockId);
} else {
@ -1509,6 +1577,16 @@ export const BlockMeta = {
return message;
},
toJSON(message: BlockMeta): unknown {
const obj: any = {};
message.blockId !== undefined &&
(obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined);
message.blockSize !== undefined && (obj.blockSize = (message.blockSize || Long.ZERO).toString());
message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined);
message.numTxs !== undefined && (obj.numTxs = (message.numTxs || Long.ZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<BlockMeta>): BlockMeta {
const message = { ...baseBlockMeta } as BlockMeta;
if (object.blockId !== undefined && object.blockId !== null) {
@ -1533,24 +1611,18 @@ export const BlockMeta = {
}
return message;
},
toJSON(message: BlockMeta): unknown {
const obj: any = {};
message.blockId !== undefined &&
(obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined);
message.blockSize !== undefined && (obj.blockSize = (message.blockSize || Long.ZERO).toString());
message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined);
message.numTxs !== undefined && (obj.numTxs = (message.numTxs || Long.ZERO).toString());
return obj;
},
};
const baseTxProof: object = {};
export const TxProof = {
encode(message: TxProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.rootHash);
writer.uint32(18).bytes(message.data);
if (message.rootHash.length !== 0) {
writer.uint32(10).bytes(message.rootHash);
}
if (message.data.length !== 0) {
writer.uint32(18).bytes(message.data);
}
if (message.proof !== undefined) {
Proof.encode(message.proof, writer.uint32(26).fork()).ldelim();
}
@ -1560,7 +1632,7 @@ export const TxProof = {
decode(input: _m0.Reader | Uint8Array, length?: number): TxProof {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseTxProof) as TxProof;
const message = { ...baseTxProof } as TxProof;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -1582,7 +1654,7 @@ export const TxProof = {
},
fromJSON(object: any): TxProof {
const message = Object.create(baseTxProof) as TxProof;
const message = { ...baseTxProof } as TxProof;
if (object.rootHash !== undefined && object.rootHash !== null) {
message.rootHash = bytesFromBase64(object.rootHash);
}
@ -1597,6 +1669,16 @@ export const TxProof = {
return message;
},
toJSON(message: TxProof): unknown {
const obj: any = {};
message.rootHash !== undefined &&
(obj.rootHash = base64FromBytes(message.rootHash !== undefined ? message.rootHash : new Uint8Array()));
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined);
return obj;
},
fromPartial(object: DeepPartial<TxProof>): TxProof {
const message = { ...baseTxProof } as TxProof;
if (object.rootHash !== undefined && object.rootHash !== null) {
@ -1616,16 +1698,6 @@ export const TxProof = {
}
return message;
},
toJSON(message: TxProof): unknown {
const obj: any = {};
message.rootHash !== undefined &&
(obj.rootHash = base64FromBytes(message.rootHash !== undefined ? message.rootHash : new Uint8Array()));
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined);
return obj;
},
};
declare var self: any | undefined;
@ -1635,7 +1707,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -33,14 +33,16 @@ export const ValidatorSet = {
if (message.proposer !== undefined) {
Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim();
}
writer.uint32(24).int64(message.totalVotingPower);
if (!message.totalVotingPower.isZero()) {
writer.uint32(24).int64(message.totalVotingPower);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSet {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseValidatorSet) as ValidatorSet;
const message = { ...baseValidatorSet } as ValidatorSet;
message.validators = [];
while (reader.pos < end) {
const tag = reader.uint32();
@ -63,7 +65,7 @@ export const ValidatorSet = {
},
fromJSON(object: any): ValidatorSet {
const message = Object.create(baseValidatorSet) as ValidatorSet;
const message = { ...baseValidatorSet } as ValidatorSet;
message.validators = [];
if (object.validators !== undefined && object.validators !== null) {
for (const e of object.validators) {
@ -83,6 +85,20 @@ export const ValidatorSet = {
return message;
},
toJSON(message: ValidatorSet): unknown {
const obj: any = {};
if (message.validators) {
obj.validators = message.validators.map((e) => (e ? Validator.toJSON(e) : undefined));
} else {
obj.validators = [];
}
message.proposer !== undefined &&
(obj.proposer = message.proposer ? Validator.toJSON(message.proposer) : undefined);
message.totalVotingPower !== undefined &&
(obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<ValidatorSet>): ValidatorSet {
const message = { ...baseValidatorSet } as ValidatorSet;
message.validators = [];
@ -103,39 +119,31 @@ export const ValidatorSet = {
}
return message;
},
toJSON(message: ValidatorSet): unknown {
const obj: any = {};
if (message.validators) {
obj.validators = message.validators.map((e) => (e ? Validator.toJSON(e) : undefined));
} else {
obj.validators = [];
}
message.proposer !== undefined &&
(obj.proposer = message.proposer ? Validator.toJSON(message.proposer) : undefined);
message.totalVotingPower !== undefined &&
(obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString());
return obj;
},
};
const baseValidator: object = { votingPower: Long.ZERO, proposerPriority: Long.ZERO };
export const Validator = {
encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).bytes(message.address);
if (message.address.length !== 0) {
writer.uint32(10).bytes(message.address);
}
if (message.pubKey !== undefined) {
PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim();
}
writer.uint32(24).int64(message.votingPower);
writer.uint32(32).int64(message.proposerPriority);
if (!message.votingPower.isZero()) {
writer.uint32(24).int64(message.votingPower);
}
if (!message.proposerPriority.isZero()) {
writer.uint32(32).int64(message.proposerPriority);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Validator {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseValidator) as Validator;
const message = { ...baseValidator } as Validator;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -160,7 +168,7 @@ export const Validator = {
},
fromJSON(object: any): Validator {
const message = Object.create(baseValidator) as Validator;
const message = { ...baseValidator } as Validator;
if (object.address !== undefined && object.address !== null) {
message.address = bytesFromBase64(object.address);
}
@ -182,6 +190,18 @@ export const Validator = {
return message;
},
toJSON(message: Validator): unknown {
const obj: any = {};
message.address !== undefined &&
(obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array()));
message.pubKey !== undefined &&
(obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined);
message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString());
message.proposerPriority !== undefined &&
(obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<Validator>): Validator {
const message = { ...baseValidator } as Validator;
if (object.address !== undefined && object.address !== null) {
@ -206,18 +226,6 @@ export const Validator = {
}
return message;
},
toJSON(message: Validator): unknown {
const obj: any = {};
message.address !== undefined &&
(obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array()));
message.pubKey !== undefined &&
(obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined);
message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString());
message.proposerPriority !== undefined &&
(obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString());
return obj;
},
};
const baseSimpleValidator: object = { votingPower: Long.ZERO };
@ -227,14 +235,16 @@ export const SimpleValidator = {
if (message.pubKey !== undefined) {
PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim();
}
writer.uint32(16).int64(message.votingPower);
if (!message.votingPower.isZero()) {
writer.uint32(16).int64(message.votingPower);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): SimpleValidator {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseSimpleValidator) as SimpleValidator;
const message = { ...baseSimpleValidator } as SimpleValidator;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -253,7 +263,7 @@ export const SimpleValidator = {
},
fromJSON(object: any): SimpleValidator {
const message = Object.create(baseSimpleValidator) as SimpleValidator;
const message = { ...baseSimpleValidator } as SimpleValidator;
if (object.pubKey !== undefined && object.pubKey !== null) {
message.pubKey = PublicKey.fromJSON(object.pubKey);
} else {
@ -267,6 +277,14 @@ export const SimpleValidator = {
return message;
},
toJSON(message: SimpleValidator): unknown {
const obj: any = {};
message.pubKey !== undefined &&
(obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined);
message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<SimpleValidator>): SimpleValidator {
const message = { ...baseSimpleValidator } as SimpleValidator;
if (object.pubKey !== undefined && object.pubKey !== null) {
@ -281,14 +299,6 @@ export const SimpleValidator = {
}
return message;
},
toJSON(message: SimpleValidator): unknown {
const obj: any = {};
message.pubKey !== undefined &&
(obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined);
message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString());
return obj;
},
};
declare var self: any | undefined;
@ -298,7 +308,7 @@ var globalThis: any = (() => {
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");
throw "Unable to locate global object";
})();
const atob: (b64: string) => string =

View File

@ -28,15 +28,19 @@ const baseApp: object = { protocol: Long.UZERO, software: "" };
export const App = {
encode(message: App, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint64(message.protocol);
writer.uint32(18).string(message.software);
if (!message.protocol.isZero()) {
writer.uint32(8).uint64(message.protocol);
}
if (message.software !== "") {
writer.uint32(18).string(message.software);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): App {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseApp) as App;
const message = { ...baseApp } as App;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -55,7 +59,7 @@ export const App = {
},
fromJSON(object: any): App {
const message = Object.create(baseApp) as App;
const message = { ...baseApp } as App;
if (object.protocol !== undefined && object.protocol !== null) {
message.protocol = Long.fromString(object.protocol);
} else {
@ -69,6 +73,13 @@ export const App = {
return message;
},
toJSON(message: App): unknown {
const obj: any = {};
message.protocol !== undefined && (obj.protocol = (message.protocol || Long.UZERO).toString());
message.software !== undefined && (obj.software = message.software);
return obj;
},
fromPartial(object: DeepPartial<App>): App {
const message = { ...baseApp } as App;
if (object.protocol !== undefined && object.protocol !== null) {
@ -83,28 +94,25 @@ export const App = {
}
return message;
},
toJSON(message: App): unknown {
const obj: any = {};
message.protocol !== undefined && (obj.protocol = (message.protocol || Long.UZERO).toString());
message.software !== undefined && (obj.software = message.software);
return obj;
},
};
const baseConsensus: object = { block: Long.UZERO, app: Long.UZERO };
export const Consensus = {
encode(message: Consensus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(8).uint64(message.block);
writer.uint32(16).uint64(message.app);
if (!message.block.isZero()) {
writer.uint32(8).uint64(message.block);
}
if (!message.app.isZero()) {
writer.uint32(16).uint64(message.app);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Consensus {
const reader = input instanceof Uint8Array ? new _m0.Reader(input) : input;
let end = length === undefined ? reader.len : reader.pos + length;
const message = Object.create(baseConsensus) as Consensus;
const message = { ...baseConsensus } as Consensus;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@ -123,7 +131,7 @@ export const Consensus = {
},
fromJSON(object: any): Consensus {
const message = Object.create(baseConsensus) as Consensus;
const message = { ...baseConsensus } as Consensus;
if (object.block !== undefined && object.block !== null) {
message.block = Long.fromString(object.block);
} else {
@ -137,6 +145,13 @@ export const Consensus = {
return message;
},
toJSON(message: Consensus): unknown {
const obj: any = {};
message.block !== undefined && (obj.block = (message.block || Long.UZERO).toString());
message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString());
return obj;
},
fromPartial(object: DeepPartial<Consensus>): Consensus {
const message = { ...baseConsensus } as Consensus;
if (object.block !== undefined && object.block !== null) {
@ -151,13 +166,6 @@ export const Consensus = {
}
return message;
},
toJSON(message: Consensus): unknown {
const obj: any = {};
message.block !== undefined && (obj.block = (message.block || Long.UZERO).toString());
message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString());
return obj;
},
};
type Builtin = Date | Function | Uint8Array | string | number | undefined | Long;

View File

@ -8654,16 +8654,24 @@ ts-poet@^4.5.0:
lodash "^4.17.15"
prettier "^2.0.2"
ts-proto@=1.61.0:
version "1.61.0"
resolved "https://registry.yarnpkg.com/ts-proto/-/ts-proto-1.61.0.tgz#0ae36097f52b0be2dae3481e34b2436ab7e44564"
integrity sha512-F7FnsOPn22ij6fI3E+1lnOVEhYyILpYk1DLpqEEHVOF77ctA5Jz11G9DtwxWTqzlQ0mAvCEWkAhwdCNa0p7CBQ==
ts-proto-descriptors@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/ts-proto-descriptors/-/ts-proto-descriptors-1.2.0.tgz#47fdef5dc640d2c87fbe0c010678f009e79f63bc"
integrity sha512-0t2WITzCiQ/3H6zPuFrFFOj2jhH6xZNu7agS7aKecKrz7tjRMW9VrmlBlJXslTTC3K7/4phV4qlsP5fOfLxuDg==
dependencies:
protobufjs "^6.8.8"
ts-proto@^1.67.0:
version "1.67.0"
resolved "https://registry.yarnpkg.com/ts-proto/-/ts-proto-1.67.0.tgz#27c45852e5640daa260750a91341026e49dfce40"
integrity sha512-+a7zleIP3EuZucu8B/HgSqzZarYHSeZ9z2KYK0/P9K8meSuLKBFB5yipYU0VK78FxAdX+u//ZTGvwe2Pzq1XfA==
dependencies:
"@types/object-hash" "^1.3.0"
dataloader "^1.4.0"
object-hash "^1.3.1"
protobufjs "^6.8.8"
ts-poet "^4.5.0"
ts-proto-descriptors "^1.2.0"
tsconfig-paths@^3.9.0:
version "3.9.0"