From 43593c15b26588ded36e790167af458d44957f5a Mon Sep 17 00:00:00 2001 From: 0xmuralik Date: Mon, 19 Dec 2022 11:25:28 +0530 Subject: [PATCH 1/7] attributes to any --- .../nameservice/v1beta1/attributes.proto | 31 + .../nameservice/v1beta1/nameservice.proto | 5 +- src/index.ts | 2 +- .../cosmos/base/query/v1beta1/pagination.ts | 40 +- src/proto/cosmos/base/v1beta1/coin.ts | 46 +- src/proto/gogoproto/gogo.ts | 2 +- src/proto/google/api/annotations.ts | 2 +- src/proto/google/api/http.ts | 97 +- src/proto/google/protobuf/any.ts | 101 ++ src/proto/google/protobuf/descriptor.ts | 1058 +++++++++++------ src/proto/google/protobuf/duration.ts | 15 +- src/proto/google/protobuf/timestamp.ts | 15 +- .../vulcanize/auction/v1beta1/genesis.ts | 14 +- src/proto/vulcanize/auction/v1beta1/query.ts | 150 ++- src/proto/vulcanize/auction/v1beta1/tx.ts | 100 +- src/proto/vulcanize/auction/v1beta1/types.ts | 146 ++- src/proto/vulcanize/bond/v1beta1/bond.ts | 27 +- src/proto/vulcanize/bond/v1beta1/genesis.ts | 14 +- src/proto/vulcanize/bond/v1beta1/query.ts | 96 +- src/proto/vulcanize/bond/v1beta1/tx.ts | 80 +- .../nameservice/v1beta1/attributes.ts | 491 ++++++++ .../vulcanize/nameservice/v1beta1/genesis.ts | 18 +- .../nameservice/v1beta1/nameservice.ts | 262 ++-- .../vulcanize/nameservice/v1beta1/query.ts | 304 +++-- src/proto/vulcanize/nameservice/v1beta1/tx.ts | 223 ++-- src/testing/data/watcher.yml | 11 +- src/types.ts | 14 +- 27 files changed, 2355 insertions(+), 1009 deletions(-) create mode 100644 proto/vulcanize/nameservice/v1beta1/attributes.proto create mode 100644 src/proto/google/protobuf/any.ts create mode 100644 src/proto/vulcanize/nameservice/v1beta1/attributes.ts diff --git a/proto/vulcanize/nameservice/v1beta1/attributes.proto b/proto/vulcanize/nameservice/v1beta1/attributes.proto new file mode 100644 index 0000000..0173d81 --- /dev/null +++ b/proto/vulcanize/nameservice/v1beta1/attributes.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package vulcanize.nameservice.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cerc-io/laconicd/x/nameservice/types"; + +message ServiceProviderRegistration { + string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""]; + string laconic_id = 2 [(gogoproto.moretags) = "json:\"laconicId\" yaml:\"laconicId\""]; + X500 x500 = 3 [(gogoproto.moretags) = "json:\"x500\" yaml:\"x500\""]; + string type = 4 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""]; +} + +message X500 { + string common_name = 1 [(gogoproto.moretags) = "json:\"commonName\" yaml:\"commonName\""]; + string organization_unit = 2 [(gogoproto.moretags) = "json:\"organizationUnit\" yaml:\"organizationUnit\""]; + string organization_name = 3 [(gogoproto.moretags) = "json:\"organizationName\" yaml:\"organizationName\""]; + string locality_name = 4 [(gogoproto.moretags) = "json:\"localityName\" yaml:\"localityName\""]; + string state_name = 5 [(gogoproto.moretags) = "json:\"stateName\" yaml:\"stateName\""]; + string country = 6 [(gogoproto.moretags) = "json:\"country\" yaml:\"country\""]; +} + +message WebsiteRegistrationRecord { + string url = 1 [(gogoproto.moretags) = "json:\"url\" yaml:\"url\""]; + string repo_registration_record_cid = 2 + [(gogoproto.moretags) = "json:\"repoRegistrationRecordCID\" yaml:\"repoRegistrationRecordCID\""]; + string build_artifact_cid = 3 [(gogoproto.moretags) = "json:\"buildArtifactCID\" yaml:\"buildArtifactCID\""]; + string tls_cert_cid = 4 [(gogoproto.moretags) = "json:\"TLSCertCID\" yaml:\"TLSCertCID\""]; + string type = 5 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""]; +} \ No newline at end of file diff --git a/proto/vulcanize/nameservice/v1beta1/nameservice.proto b/proto/vulcanize/nameservice/v1beta1/nameservice.proto index 860dd91..ea0351d 100644 --- a/proto/vulcanize/nameservice/v1beta1/nameservice.proto +++ b/proto/vulcanize/nameservice/v1beta1/nameservice.proto @@ -3,8 +3,9 @@ package vulcanize.nameservice.v1beta1; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; -import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; option go_package = "github.com/tharsis/ethermint/x/nameservice/types"; @@ -78,7 +79,7 @@ message Record { repeated string owners = 6 [ (gogoproto.moretags) = "json:\"owners\" yaml:\"owners\"" ]; - string attributes = 7 [ + google.protobuf.Any attributes = 7 [ (gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\"" ]; repeated string names = 8 [ diff --git a/src/index.ts b/src/index.ts index c83797d..0c4f83b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,7 +53,7 @@ import { MessageMsgRevealBid } from './messages/auction'; -export const DEFAULT_CHAIN_ID = 'laconic_9000-1'; +export const DEFAULT_CHAIN_ID = 'ethermint_9000-1'; const DEFAULT_WRITE_ERROR = 'Unable to write to laconicd.'; diff --git a/src/proto/cosmos/base/query/v1beta1/pagination.ts b/src/proto/cosmos/base/query/v1beta1/pagination.ts index 83e69d8..e596bd5 100644 --- a/src/proto/cosmos/base/query/v1beta1/pagination.ts +++ b/src/proto/cosmos/base/query/v1beta1/pagination.ts @@ -2,12 +2,13 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: cosmos/base/query/v1beta1/pagination.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as pb_1 from "google-protobuf"; export namespace cosmos.base.query.v1beta1 { export class PageRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { key?: Uint8Array; offset?: number; @@ -16,7 +17,7 @@ export namespace cosmos.base.query.v1beta1 { reverse?: boolean; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("key" in data && data.key != undefined) { this.key = data.key; @@ -36,31 +37,31 @@ export namespace cosmos.base.query.v1beta1 { } } get key() { - return pb_1.Message.getField(this, 1) as Uint8Array; + return pb_1.Message.getFieldWithDefault(this, 1, new Uint8Array()) as Uint8Array; } set key(value: Uint8Array) { pb_1.Message.setField(this, 1, value); } get offset() { - return pb_1.Message.getField(this, 2) as number; + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; } set offset(value: number) { pb_1.Message.setField(this, 2, value); } get limit() { - return pb_1.Message.getField(this, 3) as number; + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; } set limit(value: number) { pb_1.Message.setField(this, 3, value); } get count_total() { - return pb_1.Message.getField(this, 4) as boolean; + return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean; } set count_total(value: boolean) { pb_1.Message.setField(this, 4, value); } get reverse() { - return pb_1.Message.getField(this, 5) as boolean; + return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean; } set reverse(value: boolean) { pb_1.Message.setField(this, 5, value); @@ -71,7 +72,7 @@ export namespace cosmos.base.query.v1beta1 { limit?: number; count_total?: boolean; reverse?: boolean; - }) { + }): PageRequest { const message = new PageRequest({}); if (data.key != null) { message.key = data.key; @@ -119,15 +120,15 @@ export namespace cosmos.base.query.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.key !== undefined) + if (this.key.length) writer.writeBytes(1, this.key); - if (this.offset !== undefined) + if (this.offset != 0) writer.writeUint64(2, this.offset); - if (this.limit !== undefined) + if (this.limit != 0) writer.writeUint64(3, this.limit); - if (this.count_total !== undefined) + if (this.count_total != false) writer.writeBool(4, this.count_total); - if (this.reverse !== undefined) + if (this.reverse != false) writer.writeBool(5, this.reverse); if (!w) return writer.getResultBuffer(); @@ -166,12 +167,13 @@ export namespace cosmos.base.query.v1beta1 { } } export class PageResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { next_key?: Uint8Array; total?: number; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("next_key" in data && data.next_key != undefined) { this.next_key = data.next_key; @@ -182,13 +184,13 @@ export namespace cosmos.base.query.v1beta1 { } } get next_key() { - return pb_1.Message.getField(this, 1) as Uint8Array; + return pb_1.Message.getFieldWithDefault(this, 1, new Uint8Array()) as Uint8Array; } set next_key(value: Uint8Array) { pb_1.Message.setField(this, 1, value); } get total() { - return pb_1.Message.getField(this, 2) as number; + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; } set total(value: number) { pb_1.Message.setField(this, 2, value); @@ -196,7 +198,7 @@ export namespace cosmos.base.query.v1beta1 { static fromObject(data: { next_key?: Uint8Array; total?: number; - }) { + }): PageResponse { const message = new PageResponse({}); if (data.next_key != null) { message.next_key = data.next_key; @@ -223,9 +225,9 @@ export namespace cosmos.base.query.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.next_key !== undefined) + if (this.next_key.length) writer.writeBytes(1, this.next_key); - if (this.total !== undefined) + if (this.total != 0) writer.writeUint64(2, this.total); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/cosmos/base/v1beta1/coin.ts b/src/proto/cosmos/base/v1beta1/coin.ts index 4807b01..2aa2169 100644 --- a/src/proto/cosmos/base/v1beta1/coin.ts +++ b/src/proto/cosmos/base/v1beta1/coin.ts @@ -2,19 +2,20 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: cosmos/base/v1beta1/coin.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../gogoproto/gogo"; import * as pb_1 from "google-protobuf"; export namespace cosmos.base.v1beta1 { export class Coin extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { denom?: string; amount?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("denom" in data && data.denom != undefined) { this.denom = data.denom; @@ -25,13 +26,13 @@ export namespace cosmos.base.v1beta1 { } } get denom() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set denom(value: string) { pb_1.Message.setField(this, 1, value); } get amount() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set amount(value: string) { pb_1.Message.setField(this, 2, value); @@ -39,7 +40,7 @@ export namespace cosmos.base.v1beta1 { static fromObject(data: { denom?: string; amount?: string; - }) { + }): Coin { const message = new Coin({}); if (data.denom != null) { message.denom = data.denom; @@ -66,9 +67,9 @@ export namespace cosmos.base.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.denom === "string" && this.denom.length) + if (this.denom.length) writer.writeString(1, this.denom); - if (typeof this.amount === "string" && this.amount.length) + if (this.amount.length) writer.writeString(2, this.amount); if (!w) return writer.getResultBuffer(); @@ -98,12 +99,13 @@ export namespace cosmos.base.v1beta1 { } } export class DecCoin extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { denom?: string; amount?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("denom" in data && data.denom != undefined) { this.denom = data.denom; @@ -114,13 +116,13 @@ export namespace cosmos.base.v1beta1 { } } get denom() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set denom(value: string) { pb_1.Message.setField(this, 1, value); } get amount() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set amount(value: string) { pb_1.Message.setField(this, 2, value); @@ -128,7 +130,7 @@ export namespace cosmos.base.v1beta1 { static fromObject(data: { denom?: string; amount?: string; - }) { + }): DecCoin { const message = new DecCoin({}); if (data.denom != null) { message.denom = data.denom; @@ -155,9 +157,9 @@ export namespace cosmos.base.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.denom === "string" && this.denom.length) + if (this.denom.length) writer.writeString(1, this.denom); - if (typeof this.amount === "string" && this.amount.length) + if (this.amount.length) writer.writeString(2, this.amount); if (!w) return writer.getResultBuffer(); @@ -187,11 +189,12 @@ export namespace cosmos.base.v1beta1 { } } export class IntProto extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { int?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("int" in data && data.int != undefined) { this.int = data.int; @@ -199,14 +202,14 @@ export namespace cosmos.base.v1beta1 { } } get int() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set int(value: string) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { int?: string; - }) { + }): IntProto { const message = new IntProto({}); if (data.int != null) { message.int = data.int; @@ -226,7 +229,7 @@ export namespace cosmos.base.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.int === "string" && this.int.length) + if (this.int.length) writer.writeString(1, this.int); if (!w) return writer.getResultBuffer(); @@ -253,11 +256,12 @@ export namespace cosmos.base.v1beta1 { } } export class DecProto extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { dec?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("dec" in data && data.dec != undefined) { this.dec = data.dec; @@ -265,14 +269,14 @@ export namespace cosmos.base.v1beta1 { } } get dec() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set dec(value: string) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { dec?: string; - }) { + }): DecProto { const message = new DecProto({}); if (data.dec != null) { message.dec = data.dec; @@ -292,7 +296,7 @@ export namespace cosmos.base.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.dec === "string" && this.dec.length) + if (this.dec.length) writer.writeString(1, this.dec); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/gogoproto/gogo.ts b/src/proto/gogoproto/gogo.ts index 9ca76e1..862d824 100644 --- a/src/proto/gogoproto/gogo.ts +++ b/src/proto/gogoproto/gogo.ts @@ -2,7 +2,7 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: gogoproto/gogo.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../google/protobuf/descriptor"; diff --git a/src/proto/google/api/annotations.ts b/src/proto/google/api/annotations.ts index 8c702e6..43c5989 100644 --- a/src/proto/google/api/annotations.ts +++ b/src/proto/google/api/annotations.ts @@ -2,7 +2,7 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: google/api/annotations.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./http"; diff --git a/src/proto/google/api/http.ts b/src/proto/google/api/http.ts index 5566d36..6280850 100644 --- a/src/proto/google/api/http.ts +++ b/src/proto/google/api/http.ts @@ -2,18 +2,19 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: google/api/http.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as pb_1 from "google-protobuf"; export namespace google.api { export class Http extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { rules?: HttpRule[]; fully_decode_reserved_expansion?: boolean; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("rules" in data && data.rules != undefined) { this.rules = data.rules; @@ -30,7 +31,7 @@ export namespace google.api { pb_1.Message.setRepeatedWrapperField(this, 1, value); } get fully_decode_reserved_expansion() { - return pb_1.Message.getField(this, 2) as boolean; + return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean; } set fully_decode_reserved_expansion(value: boolean) { pb_1.Message.setField(this, 2, value); @@ -38,7 +39,7 @@ export namespace google.api { static fromObject(data: { rules?: ReturnType[]; fully_decode_reserved_expansion?: boolean; - }) { + }): Http { const message = new Http({}); if (data.rules != null) { message.rules = data.rules.map(item => HttpRule.fromObject(item)); @@ -65,9 +66,9 @@ export namespace google.api { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.rules !== undefined) + if (this.rules.length) writer.writeRepeatedMessage(1, this.rules, (item: HttpRule) => item.serialize(writer)); - if (this.fully_decode_reserved_expansion !== undefined) + if (this.fully_decode_reserved_expansion != false) writer.writeBool(2, this.fully_decode_reserved_expansion); if (!w) return writer.getResultBuffer(); @@ -97,6 +98,7 @@ export namespace google.api { } } export class HttpRule extends pb_1.Message { + #one_of_decls: number[][] = [[2, 3, 4, 5, 6, 8]]; constructor(data?: any[] | ({ selector?: string; body?: string; @@ -146,7 +148,7 @@ export namespace google.api { custom?: CustomHttpPattern; })))) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [11], [[2, 3, 4, 5, 6, 8]]); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [11], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("selector" in data && data.selector != undefined) { this.selector = data.selector; @@ -181,55 +183,73 @@ export namespace google.api { } } get selector() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set selector(value: string) { pb_1.Message.setField(this, 1, value); } get get() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set get(value: string) { - pb_1.Message.setOneofField(this, 2, [2, 3, 4, 5, 6, 8], value); + pb_1.Message.setOneofField(this, 2, this.#one_of_decls[0], value); + } + get has_get() { + return pb_1.Message.getField(this, 2) != null; } get put() { - return pb_1.Message.getField(this, 3) as string; + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set put(value: string) { - pb_1.Message.setOneofField(this, 3, [2, 3, 4, 5, 6, 8], value); + pb_1.Message.setOneofField(this, 3, this.#one_of_decls[0], value); + } + get has_put() { + return pb_1.Message.getField(this, 3) != null; } get post() { - return pb_1.Message.getField(this, 4) as string; + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; } set post(value: string) { - pb_1.Message.setOneofField(this, 4, [2, 3, 4, 5, 6, 8], value); + pb_1.Message.setOneofField(this, 4, this.#one_of_decls[0], value); + } + get has_post() { + return pb_1.Message.getField(this, 4) != null; } get delete() { - return pb_1.Message.getField(this, 5) as string; + return pb_1.Message.getFieldWithDefault(this, 5, "") as string; } set delete(value: string) { - pb_1.Message.setOneofField(this, 5, [2, 3, 4, 5, 6, 8], value); + pb_1.Message.setOneofField(this, 5, this.#one_of_decls[0], value); + } + get has_delete() { + return pb_1.Message.getField(this, 5) != null; } get patch() { - return pb_1.Message.getField(this, 6) as string; + return pb_1.Message.getFieldWithDefault(this, 6, "") as string; } set patch(value: string) { - pb_1.Message.setOneofField(this, 6, [2, 3, 4, 5, 6, 8], value); + pb_1.Message.setOneofField(this, 6, this.#one_of_decls[0], value); + } + get has_patch() { + return pb_1.Message.getField(this, 6) != null; } get custom() { return pb_1.Message.getWrapperField(this, CustomHttpPattern, 8) as CustomHttpPattern; } set custom(value: CustomHttpPattern) { - pb_1.Message.setOneofWrapperField(this, 8, [2, 3, 4, 5, 6, 8], value); + pb_1.Message.setOneofWrapperField(this, 8, this.#one_of_decls[0], value); + } + get has_custom() { + return pb_1.Message.getField(this, 8) != null; } get body() { - return pb_1.Message.getField(this, 7) as string; + return pb_1.Message.getFieldWithDefault(this, 7, "") as string; } set body(value: string) { pb_1.Message.setField(this, 7, value); } get response_body() { - return pb_1.Message.getField(this, 12) as string; + return pb_1.Message.getFieldWithDefault(this, 12, "") as string; } set response_body(value: string) { pb_1.Message.setField(this, 12, value); @@ -265,7 +285,7 @@ export namespace google.api { body?: string; response_body?: string; additional_bindings?: ReturnType[]; - }) { + }): HttpRule { const message = new HttpRule({}); if (data.selector != null) { message.selector = data.selector; @@ -348,25 +368,25 @@ export namespace google.api { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.selector === "string" && this.selector.length) + if (this.selector.length) writer.writeString(1, this.selector); - if (typeof this.get === "string" && this.get.length) + if (this.has_get) writer.writeString(2, this.get); - if (typeof this.put === "string" && this.put.length) + if (this.has_put) writer.writeString(3, this.put); - if (typeof this.post === "string" && this.post.length) + if (this.has_post) writer.writeString(4, this.post); - if (typeof this.delete === "string" && this.delete.length) + if (this.has_delete) writer.writeString(5, this.delete); - if (typeof this.patch === "string" && this.patch.length) + if (this.has_patch) writer.writeString(6, this.patch); - if (this.custom !== undefined) + if (this.has_custom) writer.writeMessage(8, this.custom, () => this.custom.serialize(writer)); - if (typeof this.body === "string" && this.body.length) + if (this.body.length) writer.writeString(7, this.body); - if (typeof this.response_body === "string" && this.response_body.length) + if (this.response_body.length) writer.writeString(12, this.response_body); - if (this.additional_bindings !== undefined) + if (this.additional_bindings.length) writer.writeRepeatedMessage(11, this.additional_bindings, (item: HttpRule) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -420,12 +440,13 @@ export namespace google.api { } } export class CustomHttpPattern extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { kind?: string; path?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("kind" in data && data.kind != undefined) { this.kind = data.kind; @@ -436,13 +457,13 @@ export namespace google.api { } } get kind() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set kind(value: string) { pb_1.Message.setField(this, 1, value); } get path() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set path(value: string) { pb_1.Message.setField(this, 2, value); @@ -450,7 +471,7 @@ export namespace google.api { static fromObject(data: { kind?: string; path?: string; - }) { + }): CustomHttpPattern { const message = new CustomHttpPattern({}); if (data.kind != null) { message.kind = data.kind; @@ -477,9 +498,9 @@ export namespace google.api { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.kind === "string" && this.kind.length) + if (this.kind.length) writer.writeString(1, this.kind); - if (typeof this.path === "string" && this.path.length) + if (this.path.length) writer.writeString(2, this.path); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/google/protobuf/any.ts b/src/proto/google/protobuf/any.ts new file mode 100644 index 0000000..16c08b5 --- /dev/null +++ b/src/proto/google/protobuf/any.ts @@ -0,0 +1,101 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.12.4 + * source: google/protobuf/any.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../gogoproto/gogo"; +import * as pb_1 from "google-protobuf"; +export namespace google.protobuf { + export class Any extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + type_url?: string; + value?: Uint8Array; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("type_url" in data && data.type_url != undefined) { + this.type_url = data.type_url; + } + if ("value" in data && data.value != undefined) { + this.value = data.value; + } + } + } + get type_url() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set type_url(value: string) { + pb_1.Message.setField(this, 1, value); + } + get value() { + return pb_1.Message.getFieldWithDefault(this, 2, new Uint8Array()) as Uint8Array; + } + set value(value: Uint8Array) { + pb_1.Message.setField(this, 2, value); + } + static fromObject(data: { + type_url?: string; + value?: Uint8Array; + }): Any { + const message = new Any({}); + if (data.type_url != null) { + message.type_url = data.type_url; + } + if (data.value != null) { + message.value = data.value; + } + return message; + } + toObject() { + const data: { + type_url?: string; + value?: Uint8Array; + } = {}; + if (this.type_url != null) { + data.type_url = this.type_url; + } + if (this.value != null) { + data.value = this.value; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.type_url.length) + writer.writeString(1, this.type_url); + if (this.value.length) + writer.writeBytes(2, this.value); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Any { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Any(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.type_url = reader.readString(); + break; + case 2: + message.value = reader.readBytes(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): Any { + return Any.deserialize(bytes); + } + } +} diff --git a/src/proto/google/protobuf/descriptor.ts b/src/proto/google/protobuf/descriptor.ts index e2bd862..b58970e 100644 --- a/src/proto/google/protobuf/descriptor.ts +++ b/src/proto/google/protobuf/descriptor.ts @@ -2,17 +2,18 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: google/protobuf/descriptor.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as pb_1 from "google-protobuf"; export namespace google.protobuf { export class FileDescriptorSet extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { file: FileDescriptorProto[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { this.file = data.file; } @@ -24,8 +25,8 @@ export namespace google.protobuf { pb_1.Message.setRepeatedWrapperField(this, 1, value); } static fromObject(data: { - file: ReturnType[]; - }) { + file?: ReturnType[]; + }): FileDescriptorSet { const message = new FileDescriptorSet({ file: data.file.map(item => FileDescriptorProto.fromObject(item)) }); @@ -33,17 +34,18 @@ export namespace google.protobuf { } toObject() { const data: { - file: ReturnType[]; - } = { - file: this.file.map((item: FileDescriptorProto) => item.toObject()) - }; + file?: ReturnType[]; + } = {}; + if (this.file != null) { + data.file = this.file.map((item: FileDescriptorProto) => item.toObject()); + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.file !== undefined) + if (this.file.length) writer.writeRepeatedMessage(1, this.file, (item: FileDescriptorProto) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -70,6 +72,7 @@ export namespace google.protobuf { } } export class FileDescriptorProto extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name?: string; package?: string; @@ -85,7 +88,7 @@ export namespace google.protobuf { syntax?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 10, 11, 4, 5, 6, 7], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 10, 11, 4, 5, 6, 7], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; @@ -112,31 +115,37 @@ export namespace google.protobuf { } } get name() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set name(value: string) { pb_1.Message.setField(this, 1, value); } + get has_name() { + return pb_1.Message.getField(this, 1) != null; + } get package() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set package(value: string) { pb_1.Message.setField(this, 2, value); } + get has_package() { + return pb_1.Message.getField(this, 2) != null; + } get dependency() { - return pb_1.Message.getField(this, 3) as string[]; + return pb_1.Message.getFieldWithDefault(this, 3, []) as string[]; } set dependency(value: string[]) { pb_1.Message.setField(this, 3, value); } get public_dependency() { - return pb_1.Message.getField(this, 10) as number[]; + return pb_1.Message.getFieldWithDefault(this, 10, []) as number[]; } set public_dependency(value: number[]) { pb_1.Message.setField(this, 10, value); } get weak_dependency() { - return pb_1.Message.getField(this, 11) as number[]; + return pb_1.Message.getFieldWithDefault(this, 11, []) as number[]; } set weak_dependency(value: number[]) { pb_1.Message.setField(this, 11, value); @@ -171,32 +180,41 @@ export namespace google.protobuf { set options(value: FileOptions) { pb_1.Message.setWrapperField(this, 8, value); } + get has_options() { + return pb_1.Message.getField(this, 8) != null; + } get source_code_info() { return pb_1.Message.getWrapperField(this, SourceCodeInfo, 9) as SourceCodeInfo; } set source_code_info(value: SourceCodeInfo) { pb_1.Message.setWrapperField(this, 9, value); } + get has_source_code_info() { + return pb_1.Message.getField(this, 9) != null; + } get syntax() { - return pb_1.Message.getField(this, 12) as string; + return pb_1.Message.getFieldWithDefault(this, 12, "") as string; } set syntax(value: string) { pb_1.Message.setField(this, 12, value); } + get has_syntax() { + return pb_1.Message.getField(this, 12) != null; + } static fromObject(data: { name?: string; package?: string; dependency: string[]; public_dependency: number[]; weak_dependency: number[]; - message_type: ReturnType[]; - enum_type: ReturnType[]; - service: ReturnType[]; - extension: ReturnType[]; + message_type?: ReturnType[]; + enum_type?: ReturnType[]; + service?: ReturnType[]; + extension?: ReturnType[]; options?: ReturnType; source_code_info?: ReturnType; syntax?: string; - }) { + }): FileDescriptorProto { const message = new FileDescriptorProto({ dependency: data.dependency, public_dependency: data.public_dependency, @@ -230,21 +248,17 @@ export namespace google.protobuf { dependency: string[]; public_dependency: number[]; weak_dependency: number[]; - message_type: ReturnType[]; - enum_type: ReturnType[]; - service: ReturnType[]; - extension: ReturnType[]; + message_type?: ReturnType[]; + enum_type?: ReturnType[]; + service?: ReturnType[]; + extension?: ReturnType[]; options?: ReturnType; source_code_info?: ReturnType; syntax?: string; } = { dependency: this.dependency, public_dependency: this.public_dependency, - weak_dependency: this.weak_dependency, - message_type: this.message_type.map((item: DescriptorProto) => item.toObject()), - enum_type: this.enum_type.map((item: EnumDescriptorProto) => item.toObject()), - service: this.service.map((item: ServiceDescriptorProto) => item.toObject()), - extension: this.extension.map((item: FieldDescriptorProto) => item.toObject()) + weak_dependency: this.weak_dependency }; if (this.name != null) { data.name = this.name; @@ -252,6 +266,18 @@ export namespace google.protobuf { if (this.package != null) { data.package = this.package; } + if (this.message_type != null) { + data.message_type = this.message_type.map((item: DescriptorProto) => item.toObject()); + } + if (this.enum_type != null) { + data.enum_type = this.enum_type.map((item: EnumDescriptorProto) => item.toObject()); + } + if (this.service != null) { + data.service = this.service.map((item: ServiceDescriptorProto) => item.toObject()); + } + if (this.extension != null) { + data.extension = this.extension.map((item: FieldDescriptorProto) => item.toObject()); + } if (this.options != null) { data.options = this.options.toObject(); } @@ -267,29 +293,29 @@ export namespace google.protobuf { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.name === "string" && this.name.length) + if (this.has_name && this.name.length) writer.writeString(1, this.name); - if (typeof this.package === "string" && this.package.length) + if (this.has_package && this.package.length) writer.writeString(2, this.package); - if (this.dependency !== undefined) + if (this.dependency.length) writer.writeRepeatedString(3, this.dependency); - if (this.public_dependency !== undefined) + if (this.public_dependency.length) writer.writeRepeatedInt32(10, this.public_dependency); - if (this.weak_dependency !== undefined) + if (this.weak_dependency.length) writer.writeRepeatedInt32(11, this.weak_dependency); - if (this.message_type !== undefined) + if (this.message_type.length) writer.writeRepeatedMessage(4, this.message_type, (item: DescriptorProto) => item.serialize(writer)); - if (this.enum_type !== undefined) + if (this.enum_type.length) writer.writeRepeatedMessage(5, this.enum_type, (item: EnumDescriptorProto) => item.serialize(writer)); - if (this.service !== undefined) + if (this.service.length) writer.writeRepeatedMessage(6, this.service, (item: ServiceDescriptorProto) => item.serialize(writer)); - if (this.extension !== undefined) + if (this.extension.length) writer.writeRepeatedMessage(7, this.extension, (item: FieldDescriptorProto) => item.serialize(writer)); - if (this.options !== undefined) + if (this.has_options) writer.writeMessage(8, this.options, () => this.options.serialize(writer)); - if (this.source_code_info !== undefined) + if (this.has_source_code_info) writer.writeMessage(9, this.source_code_info, () => this.source_code_info.serialize(writer)); - if (typeof this.syntax === "string" && this.syntax.length) + if (this.has_syntax && this.syntax.length) writer.writeString(12, this.syntax); if (!w) return writer.getResultBuffer(); @@ -349,6 +375,7 @@ export namespace google.protobuf { } } export class DescriptorProto extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name?: string; field: FieldDescriptorProto[]; @@ -362,7 +389,7 @@ export namespace google.protobuf { reserved_name: string[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 6, 3, 4, 5, 8, 9, 10], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 6, 3, 4, 5, 8, 9, 10], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; @@ -381,11 +408,14 @@ export namespace google.protobuf { } } get name() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set name(value: string) { pb_1.Message.setField(this, 1, value); } + get has_name() { + return pb_1.Message.getField(this, 1) != null; + } get field() { return pb_1.Message.getRepeatedWrapperField(this, FieldDescriptorProto, 2) as FieldDescriptorProto[]; } @@ -428,6 +458,9 @@ export namespace google.protobuf { set options(value: MessageOptions) { pb_1.Message.setWrapperField(this, 7, value); } + get has_options() { + return pb_1.Message.getField(this, 7) != null; + } get reserved_range() { return pb_1.Message.getRepeatedWrapperField(this, DescriptorProto.ReservedRange, 9) as DescriptorProto.ReservedRange[]; } @@ -435,23 +468,23 @@ export namespace google.protobuf { pb_1.Message.setRepeatedWrapperField(this, 9, value); } get reserved_name() { - return pb_1.Message.getField(this, 10) as string[]; + return pb_1.Message.getFieldWithDefault(this, 10, []) as string[]; } set reserved_name(value: string[]) { pb_1.Message.setField(this, 10, value); } static fromObject(data: { name?: string; - field: ReturnType[]; - extension: ReturnType[]; - nested_type: ReturnType[]; - enum_type: ReturnType[]; - extension_range: ReturnType[]; - oneof_decl: ReturnType[]; + field?: ReturnType[]; + extension?: ReturnType[]; + nested_type?: ReturnType[]; + enum_type?: ReturnType[]; + extension_range?: ReturnType[]; + oneof_decl?: ReturnType[]; options?: ReturnType; - reserved_range: ReturnType[]; + reserved_range?: ReturnType[]; reserved_name: string[]; - }) { + }): DescriptorProto { const message = new DescriptorProto({ field: data.field.map(item => FieldDescriptorProto.fromObject(item)), extension: data.extension.map(item => FieldDescriptorProto.fromObject(item)), @@ -473,56 +506,70 @@ export namespace google.protobuf { toObject() { const data: { name?: string; - field: ReturnType[]; - extension: ReturnType[]; - nested_type: ReturnType[]; - enum_type: ReturnType[]; - extension_range: ReturnType[]; - oneof_decl: ReturnType[]; + field?: ReturnType[]; + extension?: ReturnType[]; + nested_type?: ReturnType[]; + enum_type?: ReturnType[]; + extension_range?: ReturnType[]; + oneof_decl?: ReturnType[]; options?: ReturnType; - reserved_range: ReturnType[]; + reserved_range?: ReturnType[]; reserved_name: string[]; } = { - field: this.field.map((item: FieldDescriptorProto) => item.toObject()), - extension: this.extension.map((item: FieldDescriptorProto) => item.toObject()), - nested_type: this.nested_type.map((item: DescriptorProto) => item.toObject()), - enum_type: this.enum_type.map((item: EnumDescriptorProto) => item.toObject()), - extension_range: this.extension_range.map((item: DescriptorProto.ExtensionRange) => item.toObject()), - oneof_decl: this.oneof_decl.map((item: OneofDescriptorProto) => item.toObject()), - reserved_range: this.reserved_range.map((item: DescriptorProto.ReservedRange) => item.toObject()), reserved_name: this.reserved_name }; if (this.name != null) { data.name = this.name; } + if (this.field != null) { + data.field = this.field.map((item: FieldDescriptorProto) => item.toObject()); + } + if (this.extension != null) { + data.extension = this.extension.map((item: FieldDescriptorProto) => item.toObject()); + } + if (this.nested_type != null) { + data.nested_type = this.nested_type.map((item: DescriptorProto) => item.toObject()); + } + if (this.enum_type != null) { + data.enum_type = this.enum_type.map((item: EnumDescriptorProto) => item.toObject()); + } + if (this.extension_range != null) { + data.extension_range = this.extension_range.map((item: DescriptorProto.ExtensionRange) => item.toObject()); + } + if (this.oneof_decl != null) { + data.oneof_decl = this.oneof_decl.map((item: OneofDescriptorProto) => item.toObject()); + } if (this.options != null) { data.options = this.options.toObject(); } + if (this.reserved_range != null) { + data.reserved_range = this.reserved_range.map((item: DescriptorProto.ReservedRange) => item.toObject()); + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.name === "string" && this.name.length) + if (this.has_name && this.name.length) writer.writeString(1, this.name); - if (this.field !== undefined) + if (this.field.length) writer.writeRepeatedMessage(2, this.field, (item: FieldDescriptorProto) => item.serialize(writer)); - if (this.extension !== undefined) + if (this.extension.length) writer.writeRepeatedMessage(6, this.extension, (item: FieldDescriptorProto) => item.serialize(writer)); - if (this.nested_type !== undefined) + if (this.nested_type.length) writer.writeRepeatedMessage(3, this.nested_type, (item: DescriptorProto) => item.serialize(writer)); - if (this.enum_type !== undefined) + if (this.enum_type.length) writer.writeRepeatedMessage(4, this.enum_type, (item: EnumDescriptorProto) => item.serialize(writer)); - if (this.extension_range !== undefined) + if (this.extension_range.length) writer.writeRepeatedMessage(5, this.extension_range, (item: DescriptorProto.ExtensionRange) => item.serialize(writer)); - if (this.oneof_decl !== undefined) + if (this.oneof_decl.length) writer.writeRepeatedMessage(8, this.oneof_decl, (item: OneofDescriptorProto) => item.serialize(writer)); - if (this.options !== undefined) + if (this.has_options) writer.writeMessage(7, this.options, () => this.options.serialize(writer)); - if (this.reserved_range !== undefined) + if (this.reserved_range.length) writer.writeRepeatedMessage(9, this.reserved_range, (item: DescriptorProto.ReservedRange) => item.serialize(writer)); - if (this.reserved_name !== undefined) + if (this.reserved_name.length) writer.writeRepeatedString(10, this.reserved_name); if (!w) return writer.getResultBuffer(); @@ -577,13 +624,14 @@ export namespace google.protobuf { } export namespace DescriptorProto { export class ExtensionRange extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { start?: number; end?: number; options?: ExtensionRangeOptions; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("start" in data && data.start != undefined) { this.start = data.start; @@ -597,28 +645,37 @@ export namespace google.protobuf { } } get start() { - return pb_1.Message.getField(this, 1) as number; + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; } set start(value: number) { pb_1.Message.setField(this, 1, value); } + get has_start() { + return pb_1.Message.getField(this, 1) != null; + } get end() { - return pb_1.Message.getField(this, 2) as number; + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; } set end(value: number) { pb_1.Message.setField(this, 2, value); } + get has_end() { + return pb_1.Message.getField(this, 2) != null; + } get options() { return pb_1.Message.getWrapperField(this, ExtensionRangeOptions, 3) as ExtensionRangeOptions; } set options(value: ExtensionRangeOptions) { pb_1.Message.setWrapperField(this, 3, value); } + get has_options() { + return pb_1.Message.getField(this, 3) != null; + } static fromObject(data: { start?: number; end?: number; options?: ReturnType; - }) { + }): ExtensionRange { const message = new ExtensionRange({}); if (data.start != null) { message.start = data.start; @@ -652,11 +709,11 @@ export namespace google.protobuf { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.start !== undefined) + if (this.has_start) writer.writeInt32(1, this.start); - if (this.end !== undefined) + if (this.has_end) writer.writeInt32(2, this.end); - if (this.options !== undefined) + if (this.has_options) writer.writeMessage(3, this.options, () => this.options.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -689,12 +746,13 @@ export namespace google.protobuf { } } export class ReservedRange extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { start?: number; end?: number; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("start" in data && data.start != undefined) { this.start = data.start; @@ -705,21 +763,27 @@ export namespace google.protobuf { } } get start() { - return pb_1.Message.getField(this, 1) as number; + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; } set start(value: number) { pb_1.Message.setField(this, 1, value); } + get has_start() { + return pb_1.Message.getField(this, 1) != null; + } get end() { - return pb_1.Message.getField(this, 2) as number; + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; } set end(value: number) { pb_1.Message.setField(this, 2, value); } + get has_end() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { start?: number; end?: number; - }) { + }): ReservedRange { const message = new ReservedRange({}); if (data.start != null) { message.start = data.start; @@ -746,9 +810,9 @@ export namespace google.protobuf { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.start !== undefined) + if (this.has_start) writer.writeInt32(1, this.start); - if (this.end !== undefined) + if (this.has_end) writer.writeInt32(2, this.end); if (!w) return writer.getResultBuffer(); @@ -779,11 +843,12 @@ export namespace google.protobuf { } } export class ExtensionRangeOptions extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { uninterpreted_option: UninterpretedOption[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { this.uninterpreted_option = data.uninterpreted_option; } @@ -795,8 +860,8 @@ export namespace google.protobuf { pb_1.Message.setRepeatedWrapperField(this, 999, value); } static fromObject(data: { - uninterpreted_option: ReturnType[]; - }) { + uninterpreted_option?: ReturnType[]; + }): ExtensionRangeOptions { const message = new ExtensionRangeOptions({ uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) }); @@ -804,17 +869,18 @@ export namespace google.protobuf { } toObject() { const data: { - uninterpreted_option: ReturnType[]; - } = { - uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) - }; + uninterpreted_option?: ReturnType[]; + } = {}; + if (this.uninterpreted_option != null) { + data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()); + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.uninterpreted_option !== undefined) + if (this.uninterpreted_option.length) writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -841,6 +907,7 @@ export namespace google.protobuf { } } export class FieldDescriptorProto extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name?: string; number?: number; @@ -855,7 +922,7 @@ export namespace google.protobuf { proto3_optional?: boolean; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; @@ -893,71 +960,104 @@ export namespace google.protobuf { } } get name() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set name(value: string) { pb_1.Message.setField(this, 1, value); } + get has_name() { + return pb_1.Message.getField(this, 1) != null; + } get number() { - return pb_1.Message.getField(this, 3) as number; + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; } set number(value: number) { pb_1.Message.setField(this, 3, value); } + get has_number() { + return pb_1.Message.getField(this, 3) != null; + } get label() { - return pb_1.Message.getField(this, 4) as FieldDescriptorProto.Label; + return pb_1.Message.getFieldWithDefault(this, 4, FieldDescriptorProto.Label.LABEL_OPTIONAL) as FieldDescriptorProto.Label; } set label(value: FieldDescriptorProto.Label) { pb_1.Message.setField(this, 4, value); } + get has_label() { + return pb_1.Message.getField(this, 4) != null; + } get type() { - return pb_1.Message.getField(this, 5) as FieldDescriptorProto.Type; + return pb_1.Message.getFieldWithDefault(this, 5, FieldDescriptorProto.Type.TYPE_DOUBLE) as FieldDescriptorProto.Type; } set type(value: FieldDescriptorProto.Type) { pb_1.Message.setField(this, 5, value); } + get has_type() { + return pb_1.Message.getField(this, 5) != null; + } get type_name() { - return pb_1.Message.getField(this, 6) as string; + return pb_1.Message.getFieldWithDefault(this, 6, "") as string; } set type_name(value: string) { pb_1.Message.setField(this, 6, value); } + get has_type_name() { + return pb_1.Message.getField(this, 6) != null; + } get extendee() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set extendee(value: string) { pb_1.Message.setField(this, 2, value); } + get has_extendee() { + return pb_1.Message.getField(this, 2) != null; + } get default_value() { - return pb_1.Message.getField(this, 7) as string; + return pb_1.Message.getFieldWithDefault(this, 7, "") as string; } set default_value(value: string) { pb_1.Message.setField(this, 7, value); } + get has_default_value() { + return pb_1.Message.getField(this, 7) != null; + } get oneof_index() { - return pb_1.Message.getField(this, 9) as number; + return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; } set oneof_index(value: number) { pb_1.Message.setField(this, 9, value); } + get has_oneof_index() { + return pb_1.Message.getField(this, 9) != null; + } get json_name() { - return pb_1.Message.getField(this, 10) as string; + return pb_1.Message.getFieldWithDefault(this, 10, "") as string; } set json_name(value: string) { pb_1.Message.setField(this, 10, value); } + get has_json_name() { + return pb_1.Message.getField(this, 10) != null; + } get options() { return pb_1.Message.getWrapperField(this, FieldOptions, 8) as FieldOptions; } set options(value: FieldOptions) { pb_1.Message.setWrapperField(this, 8, value); } + get has_options() { + return pb_1.Message.getField(this, 8) != null; + } get proto3_optional() { - return pb_1.Message.getField(this, 17) as boolean; + return pb_1.Message.getFieldWithDefault(this, 17, false) as boolean; } set proto3_optional(value: boolean) { pb_1.Message.setField(this, 17, value); } + get has_proto3_optional() { + return pb_1.Message.getField(this, 17) != null; + } static fromObject(data: { name?: string; number?: number; @@ -970,7 +1070,7 @@ export namespace google.protobuf { json_name?: string; options?: ReturnType; proto3_optional?: boolean; - }) { + }): FieldDescriptorProto { const message = new FieldDescriptorProto({}); if (data.name != null) { message.name = data.name; @@ -1060,27 +1160,27 @@ export namespace google.protobuf { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.name === "string" && this.name.length) + if (this.has_name && this.name.length) writer.writeString(1, this.name); - if (this.number !== undefined) + if (this.has_number) writer.writeInt32(3, this.number); - if (this.label !== undefined) + if (this.has_label) writer.writeEnum(4, this.label); - if (this.type !== undefined) + if (this.has_type) writer.writeEnum(5, this.type); - if (typeof this.type_name === "string" && this.type_name.length) + if (this.has_type_name && this.type_name.length) writer.writeString(6, this.type_name); - if (typeof this.extendee === "string" && this.extendee.length) + if (this.has_extendee && this.extendee.length) writer.writeString(2, this.extendee); - if (typeof this.default_value === "string" && this.default_value.length) + if (this.has_default_value && this.default_value.length) writer.writeString(7, this.default_value); - if (this.oneof_index !== undefined) + if (this.has_oneof_index) writer.writeInt32(9, this.oneof_index); - if (typeof this.json_name === "string" && this.json_name.length) + if (this.has_json_name && this.json_name.length) writer.writeString(10, this.json_name); - if (this.options !== undefined) + if (this.has_options) writer.writeMessage(8, this.options, () => this.options.serialize(writer)); - if (this.proto3_optional !== undefined) + if (this.has_proto3_optional) writer.writeBool(17, this.proto3_optional); if (!w) return writer.getResultBuffer(); @@ -1164,12 +1264,13 @@ export namespace google.protobuf { } } export class OneofDescriptorProto extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name?: string; options?: OneofOptions; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; @@ -1180,21 +1281,27 @@ export namespace google.protobuf { } } get name() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set name(value: string) { pb_1.Message.setField(this, 1, value); } + get has_name() { + return pb_1.Message.getField(this, 1) != null; + } get options() { return pb_1.Message.getWrapperField(this, OneofOptions, 2) as OneofOptions; } set options(value: OneofOptions) { pb_1.Message.setWrapperField(this, 2, value); } + get has_options() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { name?: string; options?: ReturnType; - }) { + }): OneofDescriptorProto { const message = new OneofDescriptorProto({}); if (data.name != null) { message.name = data.name; @@ -1221,9 +1328,9 @@ export namespace google.protobuf { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.name === "string" && this.name.length) + if (this.has_name && this.name.length) writer.writeString(1, this.name); - if (this.options !== undefined) + if (this.has_options) writer.writeMessage(2, this.options, () => this.options.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -1253,6 +1360,7 @@ export namespace google.protobuf { } } export class EnumDescriptorProto extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name?: string; value: EnumValueDescriptorProto[]; @@ -1261,7 +1369,7 @@ export namespace google.protobuf { reserved_name: string[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 4, 5], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 4, 5], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; @@ -1275,11 +1383,14 @@ export namespace google.protobuf { } } get name() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set name(value: string) { pb_1.Message.setField(this, 1, value); } + get has_name() { + return pb_1.Message.getField(this, 1) != null; + } get value() { return pb_1.Message.getRepeatedWrapperField(this, EnumValueDescriptorProto, 2) as EnumValueDescriptorProto[]; } @@ -1292,6 +1403,9 @@ export namespace google.protobuf { set options(value: EnumOptions) { pb_1.Message.setWrapperField(this, 3, value); } + get has_options() { + return pb_1.Message.getField(this, 3) != null; + } get reserved_range() { return pb_1.Message.getRepeatedWrapperField(this, EnumDescriptorProto.EnumReservedRange, 4) as EnumDescriptorProto.EnumReservedRange[]; } @@ -1299,18 +1413,18 @@ export namespace google.protobuf { pb_1.Message.setRepeatedWrapperField(this, 4, value); } get reserved_name() { - return pb_1.Message.getField(this, 5) as string[]; + return pb_1.Message.getFieldWithDefault(this, 5, []) as string[]; } set reserved_name(value: string[]) { pb_1.Message.setField(this, 5, value); } static fromObject(data: { name?: string; - value: ReturnType[]; + value?: ReturnType[]; options?: ReturnType; - reserved_range: ReturnType[]; + reserved_range?: ReturnType[]; reserved_name: string[]; - }) { + }): EnumDescriptorProto { const message = new EnumDescriptorProto({ value: data.value.map(item => EnumValueDescriptorProto.fromObject(item)), reserved_range: data.reserved_range.map(item => EnumDescriptorProto.EnumReservedRange.fromObject(item)), @@ -1327,36 +1441,40 @@ export namespace google.protobuf { toObject() { const data: { name?: string; - value: ReturnType[]; + value?: ReturnType[]; options?: ReturnType; - reserved_range: ReturnType[]; + reserved_range?: ReturnType[]; reserved_name: string[]; } = { - value: this.value.map((item: EnumValueDescriptorProto) => item.toObject()), - reserved_range: this.reserved_range.map((item: EnumDescriptorProto.EnumReservedRange) => item.toObject()), reserved_name: this.reserved_name }; if (this.name != null) { data.name = this.name; } + if (this.value != null) { + data.value = this.value.map((item: EnumValueDescriptorProto) => item.toObject()); + } if (this.options != null) { data.options = this.options.toObject(); } + if (this.reserved_range != null) { + data.reserved_range = this.reserved_range.map((item: EnumDescriptorProto.EnumReservedRange) => item.toObject()); + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.name === "string" && this.name.length) + if (this.has_name && this.name.length) writer.writeString(1, this.name); - if (this.value !== undefined) + if (this.value.length) writer.writeRepeatedMessage(2, this.value, (item: EnumValueDescriptorProto) => item.serialize(writer)); - if (this.options !== undefined) + if (this.has_options) writer.writeMessage(3, this.options, () => this.options.serialize(writer)); - if (this.reserved_range !== undefined) + if (this.reserved_range.length) writer.writeRepeatedMessage(4, this.reserved_range, (item: EnumDescriptorProto.EnumReservedRange) => item.serialize(writer)); - if (this.reserved_name !== undefined) + if (this.reserved_name.length) writer.writeRepeatedString(5, this.reserved_name); if (!w) return writer.getResultBuffer(); @@ -1396,12 +1514,13 @@ export namespace google.protobuf { } export namespace EnumDescriptorProto { export class EnumReservedRange extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { start?: number; end?: number; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("start" in data && data.start != undefined) { this.start = data.start; @@ -1412,21 +1531,27 @@ export namespace google.protobuf { } } get start() { - return pb_1.Message.getField(this, 1) as number; + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; } set start(value: number) { pb_1.Message.setField(this, 1, value); } + get has_start() { + return pb_1.Message.getField(this, 1) != null; + } get end() { - return pb_1.Message.getField(this, 2) as number; + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; } set end(value: number) { pb_1.Message.setField(this, 2, value); } + get has_end() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { start?: number; end?: number; - }) { + }): EnumReservedRange { const message = new EnumReservedRange({}); if (data.start != null) { message.start = data.start; @@ -1453,9 +1578,9 @@ export namespace google.protobuf { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.start !== undefined) + if (this.has_start) writer.writeInt32(1, this.start); - if (this.end !== undefined) + if (this.has_end) writer.writeInt32(2, this.end); if (!w) return writer.getResultBuffer(); @@ -1486,13 +1611,14 @@ export namespace google.protobuf { } } export class EnumValueDescriptorProto extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name?: string; number?: number; options?: EnumValueOptions; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; @@ -1506,28 +1632,37 @@ export namespace google.protobuf { } } get name() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set name(value: string) { pb_1.Message.setField(this, 1, value); } + get has_name() { + return pb_1.Message.getField(this, 1) != null; + } get number() { - return pb_1.Message.getField(this, 2) as number; + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; } set number(value: number) { pb_1.Message.setField(this, 2, value); } + get has_number() { + return pb_1.Message.getField(this, 2) != null; + } get options() { return pb_1.Message.getWrapperField(this, EnumValueOptions, 3) as EnumValueOptions; } set options(value: EnumValueOptions) { pb_1.Message.setWrapperField(this, 3, value); } + get has_options() { + return pb_1.Message.getField(this, 3) != null; + } static fromObject(data: { name?: string; number?: number; options?: ReturnType; - }) { + }): EnumValueDescriptorProto { const message = new EnumValueDescriptorProto({}); if (data.name != null) { message.name = data.name; @@ -1561,11 +1696,11 @@ export namespace google.protobuf { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.name === "string" && this.name.length) + if (this.has_name && this.name.length) writer.writeString(1, this.name); - if (this.number !== undefined) + if (this.has_number) writer.writeInt32(2, this.number); - if (this.options !== undefined) + if (this.has_options) writer.writeMessage(3, this.options, () => this.options.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -1598,13 +1733,14 @@ export namespace google.protobuf { } } export class ServiceDescriptorProto extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name?: string; method: MethodDescriptorProto[]; options?: ServiceOptions; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; @@ -1616,11 +1752,14 @@ export namespace google.protobuf { } } get name() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set name(value: string) { pb_1.Message.setField(this, 1, value); } + get has_name() { + return pb_1.Message.getField(this, 1) != null; + } get method() { return pb_1.Message.getRepeatedWrapperField(this, MethodDescriptorProto, 2) as MethodDescriptorProto[]; } @@ -1633,11 +1772,14 @@ export namespace google.protobuf { set options(value: ServiceOptions) { pb_1.Message.setWrapperField(this, 3, value); } + get has_options() { + return pb_1.Message.getField(this, 3) != null; + } static fromObject(data: { name?: string; - method: ReturnType[]; + method?: ReturnType[]; options?: ReturnType; - }) { + }): ServiceDescriptorProto { const message = new ServiceDescriptorProto({ method: data.method.map(item => MethodDescriptorProto.fromObject(item)) }); @@ -1652,14 +1794,15 @@ export namespace google.protobuf { toObject() { const data: { name?: string; - method: ReturnType[]; + method?: ReturnType[]; options?: ReturnType; - } = { - method: this.method.map((item: MethodDescriptorProto) => item.toObject()) - }; + } = {}; if (this.name != null) { data.name = this.name; } + if (this.method != null) { + data.method = this.method.map((item: MethodDescriptorProto) => item.toObject()); + } if (this.options != null) { data.options = this.options.toObject(); } @@ -1669,11 +1812,11 @@ export namespace google.protobuf { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.name === "string" && this.name.length) + if (this.has_name && this.name.length) writer.writeString(1, this.name); - if (this.method !== undefined) + if (this.method.length) writer.writeRepeatedMessage(2, this.method, (item: MethodDescriptorProto) => item.serialize(writer)); - if (this.options !== undefined) + if (this.has_options) writer.writeMessage(3, this.options, () => this.options.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -1706,6 +1849,7 @@ export namespace google.protobuf { } } export class MethodDescriptorProto extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name?: string; input_type?: string; @@ -1715,7 +1859,7 @@ export namespace google.protobuf { server_streaming?: boolean; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; @@ -1738,41 +1882,59 @@ export namespace google.protobuf { } } get name() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set name(value: string) { pb_1.Message.setField(this, 1, value); } + get has_name() { + return pb_1.Message.getField(this, 1) != null; + } get input_type() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set input_type(value: string) { pb_1.Message.setField(this, 2, value); } + get has_input_type() { + return pb_1.Message.getField(this, 2) != null; + } get output_type() { - return pb_1.Message.getField(this, 3) as string; + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set output_type(value: string) { pb_1.Message.setField(this, 3, value); } + get has_output_type() { + return pb_1.Message.getField(this, 3) != null; + } get options() { return pb_1.Message.getWrapperField(this, MethodOptions, 4) as MethodOptions; } set options(value: MethodOptions) { pb_1.Message.setWrapperField(this, 4, value); } + get has_options() { + return pb_1.Message.getField(this, 4) != null; + } get client_streaming() { return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean; } set client_streaming(value: boolean) { pb_1.Message.setField(this, 5, value); } + get has_client_streaming() { + return pb_1.Message.getField(this, 5) != null; + } get server_streaming() { return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean; } set server_streaming(value: boolean) { pb_1.Message.setField(this, 6, value); } + get has_server_streaming() { + return pb_1.Message.getField(this, 6) != null; + } static fromObject(data: { name?: string; input_type?: string; @@ -1780,7 +1942,7 @@ export namespace google.protobuf { options?: ReturnType; client_streaming?: boolean; server_streaming?: boolean; - }) { + }): MethodDescriptorProto { const message = new MethodDescriptorProto({}); if (data.name != null) { message.name = data.name; @@ -1835,17 +1997,17 @@ export namespace google.protobuf { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.name === "string" && this.name.length) + if (this.has_name && this.name.length) writer.writeString(1, this.name); - if (typeof this.input_type === "string" && this.input_type.length) + if (this.has_input_type && this.input_type.length) writer.writeString(2, this.input_type); - if (typeof this.output_type === "string" && this.output_type.length) + if (this.has_output_type && this.output_type.length) writer.writeString(3, this.output_type); - if (this.options !== undefined) + if (this.has_options) writer.writeMessage(4, this.options, () => this.options.serialize(writer)); - if (this.client_streaming !== undefined) + if (this.has_client_streaming) writer.writeBool(5, this.client_streaming); - if (this.server_streaming !== undefined) + if (this.has_server_streaming) writer.writeBool(6, this.server_streaming); if (!w) return writer.getResultBuffer(); @@ -1887,6 +2049,7 @@ export namespace google.protobuf { } } export class FileOptions extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { java_package?: string; java_outer_classname?: string; @@ -1912,7 +2075,7 @@ export namespace google.protobuf { uninterpreted_option: UninterpretedOption[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("java_package" in data && data.java_package != undefined) { this.java_package = data.java_package; @@ -1978,127 +2141,188 @@ export namespace google.protobuf { } } get java_package() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set java_package(value: string) { pb_1.Message.setField(this, 1, value); } + get has_java_package() { + return pb_1.Message.getField(this, 1) != null; + } get java_outer_classname() { - return pb_1.Message.getField(this, 8) as string; + return pb_1.Message.getFieldWithDefault(this, 8, "") as string; } set java_outer_classname(value: string) { pb_1.Message.setField(this, 8, value); } + get has_java_outer_classname() { + return pb_1.Message.getField(this, 8) != null; + } get java_multiple_files() { return pb_1.Message.getFieldWithDefault(this, 10, false) as boolean; } set java_multiple_files(value: boolean) { pb_1.Message.setField(this, 10, value); } + get has_java_multiple_files() { + return pb_1.Message.getField(this, 10) != null; + } /** @deprecated*/ get java_generate_equals_and_hash() { - return pb_1.Message.getField(this, 20) as boolean; + return pb_1.Message.getFieldWithDefault(this, 20, false) as boolean; } /** @deprecated*/ set java_generate_equals_and_hash(value: boolean) { pb_1.Message.setField(this, 20, value); } + /** @deprecated*/ + get has_java_generate_equals_and_hash() { + return pb_1.Message.getField(this, 20) != null; + } get java_string_check_utf8() { return pb_1.Message.getFieldWithDefault(this, 27, false) as boolean; } set java_string_check_utf8(value: boolean) { pb_1.Message.setField(this, 27, value); } + get has_java_string_check_utf8() { + return pb_1.Message.getField(this, 27) != null; + } get optimize_for() { return pb_1.Message.getFieldWithDefault(this, 9, FileOptions.OptimizeMode.SPEED) as FileOptions.OptimizeMode; } set optimize_for(value: FileOptions.OptimizeMode) { pb_1.Message.setField(this, 9, value); } + get has_optimize_for() { + return pb_1.Message.getField(this, 9) != null; + } get go_package() { - return pb_1.Message.getField(this, 11) as string; + return pb_1.Message.getFieldWithDefault(this, 11, "") as string; } set go_package(value: string) { pb_1.Message.setField(this, 11, value); } + get has_go_package() { + return pb_1.Message.getField(this, 11) != null; + } get cc_generic_services() { return pb_1.Message.getFieldWithDefault(this, 16, false) as boolean; } set cc_generic_services(value: boolean) { pb_1.Message.setField(this, 16, value); } + get has_cc_generic_services() { + return pb_1.Message.getField(this, 16) != null; + } get java_generic_services() { return pb_1.Message.getFieldWithDefault(this, 17, false) as boolean; } set java_generic_services(value: boolean) { pb_1.Message.setField(this, 17, value); } + get has_java_generic_services() { + return pb_1.Message.getField(this, 17) != null; + } get py_generic_services() { return pb_1.Message.getFieldWithDefault(this, 18, false) as boolean; } set py_generic_services(value: boolean) { pb_1.Message.setField(this, 18, value); } + get has_py_generic_services() { + return pb_1.Message.getField(this, 18) != null; + } get php_generic_services() { return pb_1.Message.getFieldWithDefault(this, 42, false) as boolean; } set php_generic_services(value: boolean) { pb_1.Message.setField(this, 42, value); } + get has_php_generic_services() { + return pb_1.Message.getField(this, 42) != null; + } get deprecated() { return pb_1.Message.getFieldWithDefault(this, 23, false) as boolean; } set deprecated(value: boolean) { pb_1.Message.setField(this, 23, value); } + get has_deprecated() { + return pb_1.Message.getField(this, 23) != null; + } get cc_enable_arenas() { return pb_1.Message.getFieldWithDefault(this, 31, true) as boolean; } set cc_enable_arenas(value: boolean) { pb_1.Message.setField(this, 31, value); } + get has_cc_enable_arenas() { + return pb_1.Message.getField(this, 31) != null; + } get objc_class_prefix() { - return pb_1.Message.getField(this, 36) as string; + return pb_1.Message.getFieldWithDefault(this, 36, "") as string; } set objc_class_prefix(value: string) { pb_1.Message.setField(this, 36, value); } + get has_objc_class_prefix() { + return pb_1.Message.getField(this, 36) != null; + } get csharp_namespace() { - return pb_1.Message.getField(this, 37) as string; + return pb_1.Message.getFieldWithDefault(this, 37, "") as string; } set csharp_namespace(value: string) { pb_1.Message.setField(this, 37, value); } + get has_csharp_namespace() { + return pb_1.Message.getField(this, 37) != null; + } get swift_prefix() { - return pb_1.Message.getField(this, 39) as string; + return pb_1.Message.getFieldWithDefault(this, 39, "") as string; } set swift_prefix(value: string) { pb_1.Message.setField(this, 39, value); } + get has_swift_prefix() { + return pb_1.Message.getField(this, 39) != null; + } get php_class_prefix() { - return pb_1.Message.getField(this, 40) as string; + return pb_1.Message.getFieldWithDefault(this, 40, "") as string; } set php_class_prefix(value: string) { pb_1.Message.setField(this, 40, value); } + get has_php_class_prefix() { + return pb_1.Message.getField(this, 40) != null; + } get php_namespace() { - return pb_1.Message.getField(this, 41) as string; + return pb_1.Message.getFieldWithDefault(this, 41, "") as string; } set php_namespace(value: string) { pb_1.Message.setField(this, 41, value); } + get has_php_namespace() { + return pb_1.Message.getField(this, 41) != null; + } get php_metadata_namespace() { - return pb_1.Message.getField(this, 44) as string; + return pb_1.Message.getFieldWithDefault(this, 44, "") as string; } set php_metadata_namespace(value: string) { pb_1.Message.setField(this, 44, value); } + get has_php_metadata_namespace() { + return pb_1.Message.getField(this, 44) != null; + } get ruby_package() { - return pb_1.Message.getField(this, 45) as string; + return pb_1.Message.getFieldWithDefault(this, 45, "") as string; } set ruby_package(value: string) { pb_1.Message.setField(this, 45, value); } + get has_ruby_package() { + return pb_1.Message.getField(this, 45) != null; + } get uninterpreted_option() { return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; } @@ -2126,8 +2350,8 @@ export namespace google.protobuf { php_namespace?: string; php_metadata_namespace?: string; ruby_package?: string; - uninterpreted_option: ReturnType[]; - }) { + uninterpreted_option?: ReturnType[]; + }): FileOptions { const message = new FileOptions({ uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) }); @@ -2215,10 +2439,8 @@ export namespace google.protobuf { php_namespace?: string; php_metadata_namespace?: string; ruby_package?: string; - uninterpreted_option: ReturnType[]; - } = { - uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) - }; + uninterpreted_option?: ReturnType[]; + } = {}; if (this.java_package != null) { data.java_package = this.java_package; } @@ -2279,53 +2501,56 @@ export namespace google.protobuf { if (this.ruby_package != null) { data.ruby_package = this.ruby_package; } + if (this.uninterpreted_option != null) { + data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()); + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.java_package === "string" && this.java_package.length) + if (this.has_java_package && this.java_package.length) writer.writeString(1, this.java_package); - if (typeof this.java_outer_classname === "string" && this.java_outer_classname.length) + if (this.has_java_outer_classname && this.java_outer_classname.length) writer.writeString(8, this.java_outer_classname); - if (this.java_multiple_files !== undefined) + if (this.has_java_multiple_files) writer.writeBool(10, this.java_multiple_files); - if (this.java_generate_equals_and_hash !== undefined) + if (this.has_java_generate_equals_and_hash) writer.writeBool(20, this.java_generate_equals_and_hash); - if (this.java_string_check_utf8 !== undefined) + if (this.has_java_string_check_utf8) writer.writeBool(27, this.java_string_check_utf8); - if (this.optimize_for !== undefined) + if (this.has_optimize_for) writer.writeEnum(9, this.optimize_for); - if (typeof this.go_package === "string" && this.go_package.length) + if (this.has_go_package && this.go_package.length) writer.writeString(11, this.go_package); - if (this.cc_generic_services !== undefined) + if (this.has_cc_generic_services) writer.writeBool(16, this.cc_generic_services); - if (this.java_generic_services !== undefined) + if (this.has_java_generic_services) writer.writeBool(17, this.java_generic_services); - if (this.py_generic_services !== undefined) + if (this.has_py_generic_services) writer.writeBool(18, this.py_generic_services); - if (this.php_generic_services !== undefined) + if (this.has_php_generic_services) writer.writeBool(42, this.php_generic_services); - if (this.deprecated !== undefined) + if (this.has_deprecated) writer.writeBool(23, this.deprecated); - if (this.cc_enable_arenas !== undefined) + if (this.has_cc_enable_arenas) writer.writeBool(31, this.cc_enable_arenas); - if (typeof this.objc_class_prefix === "string" && this.objc_class_prefix.length) + if (this.has_objc_class_prefix && this.objc_class_prefix.length) writer.writeString(36, this.objc_class_prefix); - if (typeof this.csharp_namespace === "string" && this.csharp_namespace.length) + if (this.has_csharp_namespace && this.csharp_namespace.length) writer.writeString(37, this.csharp_namespace); - if (typeof this.swift_prefix === "string" && this.swift_prefix.length) + if (this.has_swift_prefix && this.swift_prefix.length) writer.writeString(39, this.swift_prefix); - if (typeof this.php_class_prefix === "string" && this.php_class_prefix.length) + if (this.has_php_class_prefix && this.php_class_prefix.length) writer.writeString(40, this.php_class_prefix); - if (typeof this.php_namespace === "string" && this.php_namespace.length) + if (this.has_php_namespace && this.php_namespace.length) writer.writeString(41, this.php_namespace); - if (typeof this.php_metadata_namespace === "string" && this.php_metadata_namespace.length) + if (this.has_php_metadata_namespace && this.php_metadata_namespace.length) writer.writeString(44, this.php_metadata_namespace); - if (typeof this.ruby_package === "string" && this.ruby_package.length) + if (this.has_ruby_package && this.ruby_package.length) writer.writeString(45, this.ruby_package); - if (this.uninterpreted_option !== undefined) + if (this.uninterpreted_option.length) writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -2419,6 +2644,7 @@ export namespace google.protobuf { } } export class MessageOptions extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { message_set_wire_format?: boolean; no_standard_descriptor_accessor?: boolean; @@ -2427,7 +2653,7 @@ export namespace google.protobuf { uninterpreted_option: UninterpretedOption[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("message_set_wire_format" in data && data.message_set_wire_format != undefined) { this.message_set_wire_format = data.message_set_wire_format; @@ -2450,24 +2676,36 @@ export namespace google.protobuf { set message_set_wire_format(value: boolean) { pb_1.Message.setField(this, 1, value); } + get has_message_set_wire_format() { + return pb_1.Message.getField(this, 1) != null; + } get no_standard_descriptor_accessor() { return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean; } set no_standard_descriptor_accessor(value: boolean) { pb_1.Message.setField(this, 2, value); } + get has_no_standard_descriptor_accessor() { + return pb_1.Message.getField(this, 2) != null; + } get deprecated() { return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; } set deprecated(value: boolean) { pb_1.Message.setField(this, 3, value); } + get has_deprecated() { + return pb_1.Message.getField(this, 3) != null; + } get map_entry() { - return pb_1.Message.getField(this, 7) as boolean; + return pb_1.Message.getFieldWithDefault(this, 7, false) as boolean; } set map_entry(value: boolean) { pb_1.Message.setField(this, 7, value); } + get has_map_entry() { + return pb_1.Message.getField(this, 7) != null; + } get uninterpreted_option() { return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; } @@ -2479,8 +2717,8 @@ export namespace google.protobuf { no_standard_descriptor_accessor?: boolean; deprecated?: boolean; map_entry?: boolean; - uninterpreted_option: ReturnType[]; - }) { + uninterpreted_option?: ReturnType[]; + }): MessageOptions { const message = new MessageOptions({ uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) }); @@ -2504,10 +2742,8 @@ export namespace google.protobuf { no_standard_descriptor_accessor?: boolean; deprecated?: boolean; map_entry?: boolean; - uninterpreted_option: ReturnType[]; - } = { - uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) - }; + uninterpreted_option?: ReturnType[]; + } = {}; if (this.message_set_wire_format != null) { data.message_set_wire_format = this.message_set_wire_format; } @@ -2520,21 +2756,24 @@ export namespace google.protobuf { if (this.map_entry != null) { data.map_entry = this.map_entry; } + if (this.uninterpreted_option != null) { + data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()); + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.message_set_wire_format !== undefined) + if (this.has_message_set_wire_format) writer.writeBool(1, this.message_set_wire_format); - if (this.no_standard_descriptor_accessor !== undefined) + if (this.has_no_standard_descriptor_accessor) writer.writeBool(2, this.no_standard_descriptor_accessor); - if (this.deprecated !== undefined) + if (this.has_deprecated) writer.writeBool(3, this.deprecated); - if (this.map_entry !== undefined) + if (this.has_map_entry) writer.writeBool(7, this.map_entry); - if (this.uninterpreted_option !== undefined) + if (this.uninterpreted_option.length) writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -2573,6 +2812,7 @@ export namespace google.protobuf { } } export class FieldOptions extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { ctype?: FieldOptions.CType; packed?: boolean; @@ -2583,7 +2823,7 @@ export namespace google.protobuf { uninterpreted_option: UninterpretedOption[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("ctype" in data && data.ctype != undefined) { this.ctype = data.ctype; @@ -2612,36 +2852,54 @@ export namespace google.protobuf { set ctype(value: FieldOptions.CType) { pb_1.Message.setField(this, 1, value); } + get has_ctype() { + return pb_1.Message.getField(this, 1) != null; + } get packed() { - return pb_1.Message.getField(this, 2) as boolean; + return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean; } set packed(value: boolean) { pb_1.Message.setField(this, 2, value); } + get has_packed() { + return pb_1.Message.getField(this, 2) != null; + } get jstype() { return pb_1.Message.getFieldWithDefault(this, 6, FieldOptions.JSType.JS_NORMAL) as FieldOptions.JSType; } set jstype(value: FieldOptions.JSType) { pb_1.Message.setField(this, 6, value); } + get has_jstype() { + return pb_1.Message.getField(this, 6) != null; + } get lazy() { return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean; } set lazy(value: boolean) { pb_1.Message.setField(this, 5, value); } + get has_lazy() { + return pb_1.Message.getField(this, 5) != null; + } get deprecated() { return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; } set deprecated(value: boolean) { pb_1.Message.setField(this, 3, value); } + get has_deprecated() { + return pb_1.Message.getField(this, 3) != null; + } get weak() { return pb_1.Message.getFieldWithDefault(this, 10, false) as boolean; } set weak(value: boolean) { pb_1.Message.setField(this, 10, value); } + get has_weak() { + return pb_1.Message.getField(this, 10) != null; + } get uninterpreted_option() { return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; } @@ -2655,8 +2913,8 @@ export namespace google.protobuf { lazy?: boolean; deprecated?: boolean; weak?: boolean; - uninterpreted_option: ReturnType[]; - }) { + uninterpreted_option?: ReturnType[]; + }): FieldOptions { const message = new FieldOptions({ uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) }); @@ -2688,10 +2946,8 @@ export namespace google.protobuf { lazy?: boolean; deprecated?: boolean; weak?: boolean; - uninterpreted_option: ReturnType[]; - } = { - uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) - }; + uninterpreted_option?: ReturnType[]; + } = {}; if (this.ctype != null) { data.ctype = this.ctype; } @@ -2710,25 +2966,28 @@ export namespace google.protobuf { if (this.weak != null) { data.weak = this.weak; } + if (this.uninterpreted_option != null) { + data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()); + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.ctype !== undefined) + if (this.has_ctype) writer.writeEnum(1, this.ctype); - if (this.packed !== undefined) + if (this.has_packed) writer.writeBool(2, this.packed); - if (this.jstype !== undefined) + if (this.has_jstype) writer.writeEnum(6, this.jstype); - if (this.lazy !== undefined) + if (this.has_lazy) writer.writeBool(5, this.lazy); - if (this.deprecated !== undefined) + if (this.has_deprecated) writer.writeBool(3, this.deprecated); - if (this.weak !== undefined) + if (this.has_weak) writer.writeBool(10, this.weak); - if (this.uninterpreted_option !== undefined) + if (this.uninterpreted_option.length) writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -2785,11 +3044,12 @@ export namespace google.protobuf { } } export class OneofOptions extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { uninterpreted_option: UninterpretedOption[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { this.uninterpreted_option = data.uninterpreted_option; } @@ -2801,8 +3061,8 @@ export namespace google.protobuf { pb_1.Message.setRepeatedWrapperField(this, 999, value); } static fromObject(data: { - uninterpreted_option: ReturnType[]; - }) { + uninterpreted_option?: ReturnType[]; + }): OneofOptions { const message = new OneofOptions({ uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) }); @@ -2810,17 +3070,18 @@ export namespace google.protobuf { } toObject() { const data: { - uninterpreted_option: ReturnType[]; - } = { - uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) - }; + uninterpreted_option?: ReturnType[]; + } = {}; + if (this.uninterpreted_option != null) { + data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()); + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.uninterpreted_option !== undefined) + if (this.uninterpreted_option.length) writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -2847,13 +3108,14 @@ export namespace google.protobuf { } } export class EnumOptions extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { allow_alias?: boolean; deprecated?: boolean; uninterpreted_option: UninterpretedOption[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("allow_alias" in data && data.allow_alias != undefined) { this.allow_alias = data.allow_alias; @@ -2865,17 +3127,23 @@ export namespace google.protobuf { } } get allow_alias() { - return pb_1.Message.getField(this, 2) as boolean; + return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean; } set allow_alias(value: boolean) { pb_1.Message.setField(this, 2, value); } + get has_allow_alias() { + return pb_1.Message.getField(this, 2) != null; + } get deprecated() { return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; } set deprecated(value: boolean) { pb_1.Message.setField(this, 3, value); } + get has_deprecated() { + return pb_1.Message.getField(this, 3) != null; + } get uninterpreted_option() { return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; } @@ -2885,8 +3153,8 @@ export namespace google.protobuf { static fromObject(data: { allow_alias?: boolean; deprecated?: boolean; - uninterpreted_option: ReturnType[]; - }) { + uninterpreted_option?: ReturnType[]; + }): EnumOptions { const message = new EnumOptions({ uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) }); @@ -2902,27 +3170,28 @@ export namespace google.protobuf { const data: { allow_alias?: boolean; deprecated?: boolean; - uninterpreted_option: ReturnType[]; - } = { - uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) - }; + uninterpreted_option?: ReturnType[]; + } = {}; if (this.allow_alias != null) { data.allow_alias = this.allow_alias; } if (this.deprecated != null) { data.deprecated = this.deprecated; } + if (this.uninterpreted_option != null) { + data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()); + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.allow_alias !== undefined) + if (this.has_allow_alias) writer.writeBool(2, this.allow_alias); - if (this.deprecated !== undefined) + if (this.has_deprecated) writer.writeBool(3, this.deprecated); - if (this.uninterpreted_option !== undefined) + if (this.uninterpreted_option.length) writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -2955,12 +3224,13 @@ export namespace google.protobuf { } } export class EnumValueOptions extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { deprecated?: boolean; uninterpreted_option: UninterpretedOption[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("deprecated" in data && data.deprecated != undefined) { this.deprecated = data.deprecated; @@ -2974,6 +3244,9 @@ export namespace google.protobuf { set deprecated(value: boolean) { pb_1.Message.setField(this, 1, value); } + get has_deprecated() { + return pb_1.Message.getField(this, 1) != null; + } get uninterpreted_option() { return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; } @@ -2982,8 +3255,8 @@ export namespace google.protobuf { } static fromObject(data: { deprecated?: boolean; - uninterpreted_option: ReturnType[]; - }) { + uninterpreted_option?: ReturnType[]; + }): EnumValueOptions { const message = new EnumValueOptions({ uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) }); @@ -2995,22 +3268,23 @@ export namespace google.protobuf { toObject() { const data: { deprecated?: boolean; - uninterpreted_option: ReturnType[]; - } = { - uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) - }; + uninterpreted_option?: ReturnType[]; + } = {}; if (this.deprecated != null) { data.deprecated = this.deprecated; } + if (this.uninterpreted_option != null) { + data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()); + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.deprecated !== undefined) + if (this.has_deprecated) writer.writeBool(1, this.deprecated); - if (this.uninterpreted_option !== undefined) + if (this.uninterpreted_option.length) writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -3040,12 +3314,13 @@ export namespace google.protobuf { } } export class ServiceOptions extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { deprecated?: boolean; uninterpreted_option: UninterpretedOption[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("deprecated" in data && data.deprecated != undefined) { this.deprecated = data.deprecated; @@ -3059,6 +3334,9 @@ export namespace google.protobuf { set deprecated(value: boolean) { pb_1.Message.setField(this, 33, value); } + get has_deprecated() { + return pb_1.Message.getField(this, 33) != null; + } get uninterpreted_option() { return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; } @@ -3067,8 +3345,8 @@ export namespace google.protobuf { } static fromObject(data: { deprecated?: boolean; - uninterpreted_option: ReturnType[]; - }) { + uninterpreted_option?: ReturnType[]; + }): ServiceOptions { const message = new ServiceOptions({ uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) }); @@ -3080,22 +3358,23 @@ export namespace google.protobuf { toObject() { const data: { deprecated?: boolean; - uninterpreted_option: ReturnType[]; - } = { - uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) - }; + uninterpreted_option?: ReturnType[]; + } = {}; if (this.deprecated != null) { data.deprecated = this.deprecated; } + if (this.uninterpreted_option != null) { + data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()); + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.deprecated !== undefined) + if (this.has_deprecated) writer.writeBool(33, this.deprecated); - if (this.uninterpreted_option !== undefined) + if (this.uninterpreted_option.length) writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -3125,13 +3404,14 @@ export namespace google.protobuf { } } export class MethodOptions extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { deprecated?: boolean; idempotency_level?: MethodOptions.IdempotencyLevel; uninterpreted_option: UninterpretedOption[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("deprecated" in data && data.deprecated != undefined) { this.deprecated = data.deprecated; @@ -3148,12 +3428,18 @@ export namespace google.protobuf { set deprecated(value: boolean) { pb_1.Message.setField(this, 33, value); } + get has_deprecated() { + return pb_1.Message.getField(this, 33) != null; + } get idempotency_level() { return pb_1.Message.getFieldWithDefault(this, 34, MethodOptions.IdempotencyLevel.IDEMPOTENCY_UNKNOWN) as MethodOptions.IdempotencyLevel; } set idempotency_level(value: MethodOptions.IdempotencyLevel) { pb_1.Message.setField(this, 34, value); } + get has_idempotency_level() { + return pb_1.Message.getField(this, 34) != null; + } get uninterpreted_option() { return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; } @@ -3163,8 +3449,8 @@ export namespace google.protobuf { static fromObject(data: { deprecated?: boolean; idempotency_level?: MethodOptions.IdempotencyLevel; - uninterpreted_option: ReturnType[]; - }) { + uninterpreted_option?: ReturnType[]; + }): MethodOptions { const message = new MethodOptions({ uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) }); @@ -3180,27 +3466,28 @@ export namespace google.protobuf { const data: { deprecated?: boolean; idempotency_level?: MethodOptions.IdempotencyLevel; - uninterpreted_option: ReturnType[]; - } = { - uninterpreted_option: this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()) - }; + uninterpreted_option?: ReturnType[]; + } = {}; if (this.deprecated != null) { data.deprecated = this.deprecated; } if (this.idempotency_level != null) { data.idempotency_level = this.idempotency_level; } + if (this.uninterpreted_option != null) { + data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => item.toObject()); + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.deprecated !== undefined) + if (this.has_deprecated) writer.writeBool(33, this.deprecated); - if (this.idempotency_level !== undefined) + if (this.has_idempotency_level) writer.writeEnum(34, this.idempotency_level); - if (this.uninterpreted_option !== undefined) + if (this.uninterpreted_option.length) writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -3240,6 +3527,7 @@ export namespace google.protobuf { } } export class UninterpretedOption extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name: UninterpretedOption.NamePart[]; identifier_value?: string; @@ -3250,7 +3538,7 @@ export namespace google.protobuf { aggregate_value?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { this.name = data.name; if ("identifier_value" in data && data.identifier_value != undefined) { @@ -3280,50 +3568,68 @@ export namespace google.protobuf { pb_1.Message.setRepeatedWrapperField(this, 2, value); } get identifier_value() { - return pb_1.Message.getField(this, 3) as string; + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set identifier_value(value: string) { pb_1.Message.setField(this, 3, value); } + get has_identifier_value() { + return pb_1.Message.getField(this, 3) != null; + } get positive_int_value() { - return pb_1.Message.getField(this, 4) as number; + return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; } set positive_int_value(value: number) { pb_1.Message.setField(this, 4, value); } + get has_positive_int_value() { + return pb_1.Message.getField(this, 4) != null; + } get negative_int_value() { - return pb_1.Message.getField(this, 5) as number; + return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; } set negative_int_value(value: number) { pb_1.Message.setField(this, 5, value); } + get has_negative_int_value() { + return pb_1.Message.getField(this, 5) != null; + } get double_value() { - return pb_1.Message.getField(this, 6) as number; + return pb_1.Message.getFieldWithDefault(this, 6, 0) as number; } set double_value(value: number) { pb_1.Message.setField(this, 6, value); } + get has_double_value() { + return pb_1.Message.getField(this, 6) != null; + } get string_value() { - return pb_1.Message.getField(this, 7) as Uint8Array; + return pb_1.Message.getFieldWithDefault(this, 7, new Uint8Array()) as Uint8Array; } set string_value(value: Uint8Array) { pb_1.Message.setField(this, 7, value); } + get has_string_value() { + return pb_1.Message.getField(this, 7) != null; + } get aggregate_value() { - return pb_1.Message.getField(this, 8) as string; + return pb_1.Message.getFieldWithDefault(this, 8, "") as string; } set aggregate_value(value: string) { pb_1.Message.setField(this, 8, value); } + get has_aggregate_value() { + return pb_1.Message.getField(this, 8) != null; + } static fromObject(data: { - name: ReturnType[]; + name?: ReturnType[]; identifier_value?: string; positive_int_value?: number; negative_int_value?: number; double_value?: number; string_value?: Uint8Array; aggregate_value?: string; - }) { + }): UninterpretedOption { const message = new UninterpretedOption({ name: data.name.map(item => UninterpretedOption.NamePart.fromObject(item)) }); @@ -3349,16 +3655,17 @@ export namespace google.protobuf { } toObject() { const data: { - name: ReturnType[]; + name?: ReturnType[]; identifier_value?: string; positive_int_value?: number; negative_int_value?: number; double_value?: number; string_value?: Uint8Array; aggregate_value?: string; - } = { - name: this.name.map((item: UninterpretedOption.NamePart) => item.toObject()) - }; + } = {}; + if (this.name != null) { + data.name = this.name.map((item: UninterpretedOption.NamePart) => item.toObject()); + } if (this.identifier_value != null) { data.identifier_value = this.identifier_value; } @@ -3383,19 +3690,19 @@ export namespace google.protobuf { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.name !== undefined) + if (this.name.length) writer.writeRepeatedMessage(2, this.name, (item: UninterpretedOption.NamePart) => item.serialize(writer)); - if (typeof this.identifier_value === "string" && this.identifier_value.length) + if (this.has_identifier_value && this.identifier_value.length) writer.writeString(3, this.identifier_value); - if (this.positive_int_value !== undefined) + if (this.has_positive_int_value) writer.writeUint64(4, this.positive_int_value); - if (this.negative_int_value !== undefined) + if (this.has_negative_int_value) writer.writeInt64(5, this.negative_int_value); - if (this.double_value !== undefined) + if (this.has_double_value) writer.writeDouble(6, this.double_value); - if (this.string_value !== undefined) + if (this.has_string_value && this.string_value.length) writer.writeBytes(7, this.string_value); - if (typeof this.aggregate_value === "string" && this.aggregate_value.length) + if (this.has_aggregate_value && this.aggregate_value.length) writer.writeString(8, this.aggregate_value); if (!w) return writer.getResultBuffer(); @@ -3441,12 +3748,13 @@ export namespace google.protobuf { } export namespace UninterpretedOption { export class NamePart extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name_part: string; is_extension: boolean; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { this.name_part = data.name_part; this.is_extension = data.is_extension; @@ -3458,16 +3766,22 @@ export namespace google.protobuf { set name_part(value: string) { pb_1.Message.setField(this, 1, value); } + get has_name_part() { + return pb_1.Message.getField(this, 1) != null; + } get is_extension() { return pb_1.Message.getField(this, 2) as boolean; } set is_extension(value: boolean) { pb_1.Message.setField(this, 2, value); } + get has_is_extension() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { - name_part: string; - is_extension: boolean; - }) { + name_part?: string; + is_extension?: boolean; + }): NamePart { const message = new NamePart({ name_part: data.name_part, is_extension: data.is_extension @@ -3476,21 +3790,24 @@ export namespace google.protobuf { } toObject() { const data: { - name_part: string; - is_extension: boolean; - } = { - name_part: this.name_part, - is_extension: this.is_extension - }; + name_part?: string; + is_extension?: boolean; + } = {}; + if (this.name_part != null) { + data.name_part = this.name_part; + } + if (this.is_extension != null) { + data.is_extension = this.is_extension; + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.name_part === "string" && this.name_part.length) + if (this.has_name_part && this.name_part.length) writer.writeString(1, this.name_part); - if (this.is_extension !== undefined) + if (this.has_is_extension) writer.writeBool(2, this.is_extension); if (!w) return writer.getResultBuffer(); @@ -3521,11 +3838,12 @@ export namespace google.protobuf { } } export class SourceCodeInfo extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { location: SourceCodeInfo.Location[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { this.location = data.location; } @@ -3537,8 +3855,8 @@ export namespace google.protobuf { pb_1.Message.setRepeatedWrapperField(this, 1, value); } static fromObject(data: { - location: ReturnType[]; - }) { + location?: ReturnType[]; + }): SourceCodeInfo { const message = new SourceCodeInfo({ location: data.location.map(item => SourceCodeInfo.Location.fromObject(item)) }); @@ -3546,17 +3864,18 @@ export namespace google.protobuf { } toObject() { const data: { - location: ReturnType[]; - } = { - location: this.location.map((item: SourceCodeInfo.Location) => item.toObject()) - }; + location?: ReturnType[]; + } = {}; + if (this.location != null) { + data.location = this.location.map((item: SourceCodeInfo.Location) => item.toObject()); + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.location !== undefined) + if (this.location.length) writer.writeRepeatedMessage(1, this.location, (item: SourceCodeInfo.Location) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -3584,6 +3903,7 @@ export namespace google.protobuf { } export namespace SourceCodeInfo { export class Location extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { path: number[]; span: number[]; @@ -3592,7 +3912,7 @@ export namespace google.protobuf { leading_detached_comments: string[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2, 6], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2, 6], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { this.path = data.path; this.span = data.span; @@ -3606,31 +3926,37 @@ export namespace google.protobuf { } } get path() { - return pb_1.Message.getField(this, 1) as number[]; + return pb_1.Message.getFieldWithDefault(this, 1, []) as number[]; } set path(value: number[]) { pb_1.Message.setField(this, 1, value); } get span() { - return pb_1.Message.getField(this, 2) as number[]; + return pb_1.Message.getFieldWithDefault(this, 2, []) as number[]; } set span(value: number[]) { pb_1.Message.setField(this, 2, value); } get leading_comments() { - return pb_1.Message.getField(this, 3) as string; + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set leading_comments(value: string) { pb_1.Message.setField(this, 3, value); } + get has_leading_comments() { + return pb_1.Message.getField(this, 3) != null; + } get trailing_comments() { - return pb_1.Message.getField(this, 4) as string; + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; } set trailing_comments(value: string) { pb_1.Message.setField(this, 4, value); } + get has_trailing_comments() { + return pb_1.Message.getField(this, 4) != null; + } get leading_detached_comments() { - return pb_1.Message.getField(this, 6) as string[]; + return pb_1.Message.getFieldWithDefault(this, 6, []) as string[]; } set leading_detached_comments(value: string[]) { pb_1.Message.setField(this, 6, value); @@ -3641,7 +3967,7 @@ export namespace google.protobuf { leading_comments?: string; trailing_comments?: string; leading_detached_comments: string[]; - }) { + }): Location { const message = new Location({ path: data.path, span: data.span, @@ -3679,15 +4005,15 @@ export namespace google.protobuf { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.path !== undefined) + if (this.path.length) writer.writePackedInt32(1, this.path); - if (this.span !== undefined) + if (this.span.length) writer.writePackedInt32(2, this.span); - if (typeof this.leading_comments === "string" && this.leading_comments.length) + if (this.has_leading_comments && this.leading_comments.length) writer.writeString(3, this.leading_comments); - if (typeof this.trailing_comments === "string" && this.trailing_comments.length) + if (this.has_trailing_comments && this.trailing_comments.length) writer.writeString(4, this.trailing_comments); - if (this.leading_detached_comments !== undefined) + if (this.leading_detached_comments.length) writer.writeRepeatedString(6, this.leading_detached_comments); if (!w) return writer.getResultBuffer(); @@ -3727,11 +4053,12 @@ export namespace google.protobuf { } } export class GeneratedCodeInfo extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { annotation: GeneratedCodeInfo.Annotation[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { this.annotation = data.annotation; } @@ -3743,8 +4070,8 @@ export namespace google.protobuf { pb_1.Message.setRepeatedWrapperField(this, 1, value); } static fromObject(data: { - annotation: ReturnType[]; - }) { + annotation?: ReturnType[]; + }): GeneratedCodeInfo { const message = new GeneratedCodeInfo({ annotation: data.annotation.map(item => GeneratedCodeInfo.Annotation.fromObject(item)) }); @@ -3752,17 +4079,18 @@ export namespace google.protobuf { } toObject() { const data: { - annotation: ReturnType[]; - } = { - annotation: this.annotation.map((item: GeneratedCodeInfo.Annotation) => item.toObject()) - }; + annotation?: ReturnType[]; + } = {}; + if (this.annotation != null) { + data.annotation = this.annotation.map((item: GeneratedCodeInfo.Annotation) => item.toObject()); + } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.annotation !== undefined) + if (this.annotation.length) writer.writeRepeatedMessage(1, this.annotation, (item: GeneratedCodeInfo.Annotation) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -3790,6 +4118,7 @@ export namespace google.protobuf { } export namespace GeneratedCodeInfo { export class Annotation extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { path: number[]; source_file?: string; @@ -3797,7 +4126,7 @@ export namespace google.protobuf { end?: number; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { this.path = data.path; if ("source_file" in data && data.source_file != undefined) { @@ -3812,35 +4141,44 @@ export namespace google.protobuf { } } get path() { - return pb_1.Message.getField(this, 1) as number[]; + return pb_1.Message.getFieldWithDefault(this, 1, []) as number[]; } set path(value: number[]) { pb_1.Message.setField(this, 1, value); } get source_file() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set source_file(value: string) { pb_1.Message.setField(this, 2, value); } + get has_source_file() { + return pb_1.Message.getField(this, 2) != null; + } get begin() { - return pb_1.Message.getField(this, 3) as number; + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; } set begin(value: number) { pb_1.Message.setField(this, 3, value); } + get has_begin() { + return pb_1.Message.getField(this, 3) != null; + } get end() { - return pb_1.Message.getField(this, 4) as number; + return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; } set end(value: number) { pb_1.Message.setField(this, 4, value); } + get has_end() { + return pb_1.Message.getField(this, 4) != null; + } static fromObject(data: { path: number[]; source_file?: string; begin?: number; end?: number; - }) { + }): Annotation { const message = new Annotation({ path: data.path }); @@ -3879,13 +4217,13 @@ export namespace google.protobuf { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.path !== undefined) + if (this.path.length) writer.writePackedInt32(1, this.path); - if (typeof this.source_file === "string" && this.source_file.length) + if (this.has_source_file && this.source_file.length) writer.writeString(2, this.source_file); - if (this.begin !== undefined) + if (this.has_begin) writer.writeInt32(3, this.begin); - if (this.end !== undefined) + if (this.has_end) writer.writeInt32(4, this.end); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/google/protobuf/duration.ts b/src/proto/google/protobuf/duration.ts index 7934a4b..60b5bbb 100644 --- a/src/proto/google/protobuf/duration.ts +++ b/src/proto/google/protobuf/duration.ts @@ -2,18 +2,19 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: google/protobuf/duration.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as pb_1 from "google-protobuf"; export namespace google.protobuf { export class Duration extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { seconds?: number; nanos?: number; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("seconds" in data && data.seconds != undefined) { this.seconds = data.seconds; @@ -24,13 +25,13 @@ export namespace google.protobuf { } } get seconds() { - return pb_1.Message.getField(this, 1) as number; + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; } set seconds(value: number) { pb_1.Message.setField(this, 1, value); } get nanos() { - return pb_1.Message.getField(this, 2) as number; + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; } set nanos(value: number) { pb_1.Message.setField(this, 2, value); @@ -38,7 +39,7 @@ export namespace google.protobuf { static fromObject(data: { seconds?: number; nanos?: number; - }) { + }): Duration { const message = new Duration({}); if (data.seconds != null) { message.seconds = data.seconds; @@ -65,9 +66,9 @@ export namespace google.protobuf { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.seconds !== undefined) + if (this.seconds != 0) writer.writeInt64(1, this.seconds); - if (this.nanos !== undefined) + if (this.nanos != 0) writer.writeInt32(2, this.nanos); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/google/protobuf/timestamp.ts b/src/proto/google/protobuf/timestamp.ts index 4ddcd9d..57b6456 100644 --- a/src/proto/google/protobuf/timestamp.ts +++ b/src/proto/google/protobuf/timestamp.ts @@ -2,18 +2,19 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: google/protobuf/timestamp.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as pb_1 from "google-protobuf"; export namespace google.protobuf { export class Timestamp extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { seconds?: number; nanos?: number; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("seconds" in data && data.seconds != undefined) { this.seconds = data.seconds; @@ -24,13 +25,13 @@ export namespace google.protobuf { } } get seconds() { - return pb_1.Message.getField(this, 1) as number; + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; } set seconds(value: number) { pb_1.Message.setField(this, 1, value); } get nanos() { - return pb_1.Message.getField(this, 2) as number; + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; } set nanos(value: number) { pb_1.Message.setField(this, 2, value); @@ -38,7 +39,7 @@ export namespace google.protobuf { static fromObject(data: { seconds?: number; nanos?: number; - }) { + }): Timestamp { const message = new Timestamp({}); if (data.seconds != null) { message.seconds = data.seconds; @@ -65,9 +66,9 @@ export namespace google.protobuf { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.seconds !== undefined) + if (this.seconds != 0) writer.writeInt64(1, this.seconds); - if (this.nanos !== undefined) + if (this.nanos != 0) writer.writeInt32(2, this.nanos); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/vulcanize/auction/v1beta1/genesis.ts b/src/proto/vulcanize/auction/v1beta1/genesis.ts index 0cc3c81..71963a7 100644 --- a/src/proto/vulcanize/auction/v1beta1/genesis.ts +++ b/src/proto/vulcanize/auction/v1beta1/genesis.ts @@ -2,7 +2,7 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: vulcanize/auction/v1beta1/genesis.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../gogoproto/gogo"; @@ -10,12 +10,13 @@ import * as dependency_2 from "./types"; import * as pb_1 from "google-protobuf"; export namespace vulcanize.auction.v1beta1 { export class GenesisState extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { params?: dependency_2.vulcanize.auction.v1beta1.Params; auctions?: dependency_2.vulcanize.auction.v1beta1.Auction[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("params" in data && data.params != undefined) { this.params = data.params; @@ -31,6 +32,9 @@ export namespace vulcanize.auction.v1beta1 { set params(value: dependency_2.vulcanize.auction.v1beta1.Params) { pb_1.Message.setWrapperField(this, 1, value); } + get has_params() { + return pb_1.Message.getField(this, 1) != null; + } get auctions() { return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.auction.v1beta1.Auction, 2) as dependency_2.vulcanize.auction.v1beta1.Auction[]; } @@ -40,7 +44,7 @@ export namespace vulcanize.auction.v1beta1 { static fromObject(data: { params?: ReturnType; auctions?: ReturnType[]; - }) { + }): GenesisState { const message = new GenesisState({}); if (data.params != null) { message.params = dependency_2.vulcanize.auction.v1beta1.Params.fromObject(data.params); @@ -67,9 +71,9 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.params !== undefined) + if (this.has_params) writer.writeMessage(1, this.params, () => this.params.serialize(writer)); - if (this.auctions !== undefined) + if (this.auctions.length) writer.writeRepeatedMessage(2, this.auctions, (item: dependency_2.vulcanize.auction.v1beta1.Auction) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/vulcanize/auction/v1beta1/query.ts b/src/proto/vulcanize/auction/v1beta1/query.ts index 31d280e..5861ba9 100644 --- a/src/proto/vulcanize/auction/v1beta1/query.ts +++ b/src/proto/vulcanize/auction/v1beta1/query.ts @@ -2,7 +2,7 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: vulcanize/auction/v1beta1/query.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../gogoproto/gogo"; @@ -13,11 +13,12 @@ import * as dependency_5 from "./types"; import * as pb_1 from "google-protobuf"; export namespace vulcanize.auction.v1beta1 { export class AuctionsRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("pagination" in data && data.pagination != undefined) { this.pagination = data.pagination; @@ -30,9 +31,12 @@ export namespace vulcanize.auction.v1beta1 { set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { pb_1.Message.setWrapperField(this, 1, value); } + get has_pagination() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { pagination?: ReturnType; - }) { + }): AuctionsRequest { const message = new AuctionsRequest({}); if (data.pagination != null) { message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); @@ -52,7 +56,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -79,12 +83,13 @@ export namespace vulcanize.auction.v1beta1 { } } export class AuctionsResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions; pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("auctions" in data && data.auctions != undefined) { this.auctions = data.auctions; @@ -100,16 +105,22 @@ export namespace vulcanize.auction.v1beta1 { set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) { pb_1.Message.setWrapperField(this, 1, value); } + get has_auctions() { + return pb_1.Message.getField(this, 1) != null; + } get pagination() { return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 2) as dependency_3.cosmos.base.query.v1beta1.PageRequest; } set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { pb_1.Message.setWrapperField(this, 2, value); } + get has_pagination() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { auctions?: ReturnType; pagination?: ReturnType; - }) { + }): AuctionsResponse { const message = new AuctionsResponse({}); if (data.auctions != null) { message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions); @@ -136,9 +147,9 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.auctions !== undefined) + if (this.has_auctions) writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer)); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -168,11 +179,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class AuctionRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -180,14 +192,14 @@ export namespace vulcanize.auction.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { id?: string; - }) { + }): AuctionRequest { const message = new AuctionRequest({}); if (data.id != null) { message.id = data.id; @@ -207,7 +219,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); if (!w) return writer.getResultBuffer(); @@ -234,11 +246,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class AuctionResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { auction?: dependency_5.vulcanize.auction.v1beta1.Auction; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("auction" in data && data.auction != undefined) { this.auction = data.auction; @@ -251,9 +264,12 @@ export namespace vulcanize.auction.v1beta1 { set auction(value: dependency_5.vulcanize.auction.v1beta1.Auction) { pb_1.Message.setWrapperField(this, 1, value); } + get has_auction() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { auction?: ReturnType; - }) { + }): AuctionResponse { const message = new AuctionResponse({}); if (data.auction != null) { message.auction = dependency_5.vulcanize.auction.v1beta1.Auction.fromObject(data.auction); @@ -273,7 +289,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.auction !== undefined) + if (this.has_auction) writer.writeMessage(1, this.auction, () => this.auction.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -300,12 +316,13 @@ export namespace vulcanize.auction.v1beta1 { } } export class BidRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { auction_id?: string; bidder?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("auction_id" in data && data.auction_id != undefined) { this.auction_id = data.auction_id; @@ -316,13 +333,13 @@ export namespace vulcanize.auction.v1beta1 { } } get auction_id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set auction_id(value: string) { pb_1.Message.setField(this, 1, value); } get bidder() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set bidder(value: string) { pb_1.Message.setField(this, 2, value); @@ -330,7 +347,7 @@ export namespace vulcanize.auction.v1beta1 { static fromObject(data: { auction_id?: string; bidder?: string; - }) { + }): BidRequest { const message = new BidRequest({}); if (data.auction_id != null) { message.auction_id = data.auction_id; @@ -357,9 +374,9 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.auction_id === "string" && this.auction_id.length) + if (this.auction_id.length) writer.writeString(1, this.auction_id); - if (typeof this.bidder === "string" && this.bidder.length) + if (this.bidder.length) writer.writeString(2, this.bidder); if (!w) return writer.getResultBuffer(); @@ -389,11 +406,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class BidResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { bid?: dependency_5.vulcanize.auction.v1beta1.Bid; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("bid" in data && data.bid != undefined) { this.bid = data.bid; @@ -406,9 +424,12 @@ export namespace vulcanize.auction.v1beta1 { set bid(value: dependency_5.vulcanize.auction.v1beta1.Bid) { pb_1.Message.setWrapperField(this, 1, value); } + get has_bid() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { bid?: ReturnType; - }) { + }): BidResponse { const message = new BidResponse({}); if (data.bid != null) { message.bid = dependency_5.vulcanize.auction.v1beta1.Bid.fromObject(data.bid); @@ -428,7 +449,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.bid !== undefined) + if (this.has_bid) writer.writeMessage(1, this.bid, () => this.bid.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -455,11 +476,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class BidsRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { auction_id?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("auction_id" in data && data.auction_id != undefined) { this.auction_id = data.auction_id; @@ -467,14 +489,14 @@ export namespace vulcanize.auction.v1beta1 { } } get auction_id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set auction_id(value: string) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { auction_id?: string; - }) { + }): BidsRequest { const message = new BidsRequest({}); if (data.auction_id != null) { message.auction_id = data.auction_id; @@ -494,7 +516,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.auction_id === "string" && this.auction_id.length) + if (this.auction_id.length) writer.writeString(1, this.auction_id); if (!w) return writer.getResultBuffer(); @@ -521,11 +543,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class BidsResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { bids?: dependency_5.vulcanize.auction.v1beta1.Bid[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("bids" in data && data.bids != undefined) { this.bids = data.bids; @@ -540,7 +563,7 @@ export namespace vulcanize.auction.v1beta1 { } static fromObject(data: { bids?: ReturnType[]; - }) { + }): BidsResponse { const message = new BidsResponse({}); if (data.bids != null) { message.bids = data.bids.map(item => dependency_5.vulcanize.auction.v1beta1.Bid.fromObject(item)); @@ -560,7 +583,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.bids !== undefined) + if (this.bids.length) writer.writeRepeatedMessage(1, this.bids, (item: dependency_5.vulcanize.auction.v1beta1.Bid) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -587,11 +610,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class AuctionsByBidderRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { bidder_address?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("bidder_address" in data && data.bidder_address != undefined) { this.bidder_address = data.bidder_address; @@ -599,14 +623,14 @@ export namespace vulcanize.auction.v1beta1 { } } get bidder_address() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set bidder_address(value: string) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { bidder_address?: string; - }) { + }): AuctionsByBidderRequest { const message = new AuctionsByBidderRequest({}); if (data.bidder_address != null) { message.bidder_address = data.bidder_address; @@ -626,7 +650,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.bidder_address === "string" && this.bidder_address.length) + if (this.bidder_address.length) writer.writeString(1, this.bidder_address); if (!w) return writer.getResultBuffer(); @@ -653,11 +677,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class AuctionsByBidderResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("auctions" in data && data.auctions != undefined) { this.auctions = data.auctions; @@ -670,9 +695,12 @@ export namespace vulcanize.auction.v1beta1 { set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) { pb_1.Message.setWrapperField(this, 1, value); } + get has_auctions() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { auctions?: ReturnType; - }) { + }): AuctionsByBidderResponse { const message = new AuctionsByBidderResponse({}); if (data.auctions != null) { message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions); @@ -692,7 +720,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.auctions !== undefined) + if (this.has_auctions) writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -719,11 +747,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class AuctionsByOwnerRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { owner_address?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("owner_address" in data && data.owner_address != undefined) { this.owner_address = data.owner_address; @@ -731,14 +760,14 @@ export namespace vulcanize.auction.v1beta1 { } } get owner_address() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set owner_address(value: string) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { owner_address?: string; - }) { + }): AuctionsByOwnerRequest { const message = new AuctionsByOwnerRequest({}); if (data.owner_address != null) { message.owner_address = data.owner_address; @@ -758,7 +787,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.owner_address === "string" && this.owner_address.length) + if (this.owner_address.length) writer.writeString(1, this.owner_address); if (!w) return writer.getResultBuffer(); @@ -785,11 +814,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class AuctionsByOwnerResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("auctions" in data && data.auctions != undefined) { this.auctions = data.auctions; @@ -802,9 +832,12 @@ export namespace vulcanize.auction.v1beta1 { set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) { pb_1.Message.setWrapperField(this, 1, value); } + get has_auctions() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { auctions?: ReturnType; - }) { + }): AuctionsByOwnerResponse { const message = new AuctionsByOwnerResponse({}); if (data.auctions != null) { message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions); @@ -824,7 +857,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.auctions !== undefined) + if (this.has_auctions) writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -851,12 +884,13 @@ export namespace vulcanize.auction.v1beta1 { } } export class QueryParamsRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): QueryParamsRequest { const message = new QueryParamsRequest({}); return message; } @@ -890,11 +924,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class QueryParamsResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { params?: dependency_5.vulcanize.auction.v1beta1.Params; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("params" in data && data.params != undefined) { this.params = data.params; @@ -907,9 +942,12 @@ export namespace vulcanize.auction.v1beta1 { set params(value: dependency_5.vulcanize.auction.v1beta1.Params) { pb_1.Message.setWrapperField(this, 1, value); } + get has_params() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { params?: ReturnType; - }) { + }): QueryParamsResponse { const message = new QueryParamsResponse({}); if (data.params != null) { message.params = dependency_5.vulcanize.auction.v1beta1.Params.fromObject(data.params); @@ -929,7 +967,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.params !== undefined) + if (this.has_params) writer.writeMessage(1, this.params, () => this.params.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -956,12 +994,13 @@ export namespace vulcanize.auction.v1beta1 { } } export class BalanceRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): BalanceRequest { const message = new BalanceRequest({}); return message; } @@ -995,11 +1034,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class BalanceResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { balance?: dependency_4.cosmos.base.v1beta1.Coin[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("balance" in data && data.balance != undefined) { this.balance = data.balance; @@ -1014,7 +1054,7 @@ export namespace vulcanize.auction.v1beta1 { } static fromObject(data: { balance?: ReturnType[]; - }) { + }): BalanceResponse { const message = new BalanceResponse({}); if (data.balance != null) { message.balance = data.balance.map(item => dependency_4.cosmos.base.v1beta1.Coin.fromObject(item)); @@ -1034,7 +1074,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.balance !== undefined) + if (this.balance.length) writer.writeRepeatedMessage(1, this.balance, (item: dependency_4.cosmos.base.v1beta1.Coin) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/vulcanize/auction/v1beta1/tx.ts b/src/proto/vulcanize/auction/v1beta1/tx.ts index 96ee727..07444f2 100644 --- a/src/proto/vulcanize/auction/v1beta1/tx.ts +++ b/src/proto/vulcanize/auction/v1beta1/tx.ts @@ -2,7 +2,7 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: vulcanize/auction/v1beta1/tx.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../gogoproto/gogo"; @@ -12,6 +12,7 @@ import * as dependency_4 from "./types"; import * as pb_1 from "google-protobuf"; export namespace vulcanize.auction.v1beta1 { export class MsgCreateAuction extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { commits_duration?: dependency_2.google.protobuf.Duration; reveals_duration?: dependency_2.google.protobuf.Duration; @@ -21,7 +22,7 @@ export namespace vulcanize.auction.v1beta1 { signer?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("commits_duration" in data && data.commits_duration != undefined) { this.commits_duration = data.commits_duration; @@ -49,32 +50,47 @@ export namespace vulcanize.auction.v1beta1 { set commits_duration(value: dependency_2.google.protobuf.Duration) { pb_1.Message.setWrapperField(this, 1, value); } + get has_commits_duration() { + return pb_1.Message.getField(this, 1) != null; + } get reveals_duration() { return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 2) as dependency_2.google.protobuf.Duration; } set reveals_duration(value: dependency_2.google.protobuf.Duration) { pb_1.Message.setWrapperField(this, 2, value); } + get has_reveals_duration() { + return pb_1.Message.getField(this, 2) != null; + } get commit_fee() { return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 3) as dependency_3.cosmos.base.v1beta1.Coin; } set commit_fee(value: dependency_3.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 3, value); } + get has_commit_fee() { + return pb_1.Message.getField(this, 3) != null; + } get reveal_fee() { return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 4) as dependency_3.cosmos.base.v1beta1.Coin; } set reveal_fee(value: dependency_3.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 4, value); } + get has_reveal_fee() { + return pb_1.Message.getField(this, 4) != null; + } get minimum_bid() { return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 5) as dependency_3.cosmos.base.v1beta1.Coin; } set minimum_bid(value: dependency_3.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 5, value); } + get has_minimum_bid() { + return pb_1.Message.getField(this, 5) != null; + } get signer() { - return pb_1.Message.getField(this, 6) as string; + return pb_1.Message.getFieldWithDefault(this, 6, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 6, value); @@ -86,7 +102,7 @@ export namespace vulcanize.auction.v1beta1 { reveal_fee?: ReturnType; minimum_bid?: ReturnType; signer?: string; - }) { + }): MsgCreateAuction { const message = new MsgCreateAuction({}); if (data.commits_duration != null) { message.commits_duration = dependency_2.google.protobuf.Duration.fromObject(data.commits_duration); @@ -141,17 +157,17 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.commits_duration !== undefined) + if (this.has_commits_duration) writer.writeMessage(1, this.commits_duration, () => this.commits_duration.serialize(writer)); - if (this.reveals_duration !== undefined) + if (this.has_reveals_duration) writer.writeMessage(2, this.reveals_duration, () => this.reveals_duration.serialize(writer)); - if (this.commit_fee !== undefined) + if (this.has_commit_fee) writer.writeMessage(3, this.commit_fee, () => this.commit_fee.serialize(writer)); - if (this.reveal_fee !== undefined) + if (this.has_reveal_fee) writer.writeMessage(4, this.reveal_fee, () => this.reveal_fee.serialize(writer)); - if (this.minimum_bid !== undefined) + if (this.has_minimum_bid) writer.writeMessage(5, this.minimum_bid, () => this.minimum_bid.serialize(writer)); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(6, this.signer); if (!w) return writer.getResultBuffer(); @@ -193,11 +209,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class MsgCreateAuctionResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { auction?: dependency_4.vulcanize.auction.v1beta1.Auction; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("auction" in data && data.auction != undefined) { this.auction = data.auction; @@ -210,9 +227,12 @@ export namespace vulcanize.auction.v1beta1 { set auction(value: dependency_4.vulcanize.auction.v1beta1.Auction) { pb_1.Message.setWrapperField(this, 1, value); } + get has_auction() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { auction?: ReturnType; - }) { + }): MsgCreateAuctionResponse { const message = new MsgCreateAuctionResponse({}); if (data.auction != null) { message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.fromObject(data.auction); @@ -232,7 +252,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.auction !== undefined) + if (this.has_auction) writer.writeMessage(1, this.auction, () => this.auction.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -259,13 +279,14 @@ export namespace vulcanize.auction.v1beta1 { } } export class MsgCommitBid extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { auction_id?: string; commit_hash?: string; signer?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("auction_id" in data && data.auction_id != undefined) { this.auction_id = data.auction_id; @@ -279,19 +300,19 @@ export namespace vulcanize.auction.v1beta1 { } } get auction_id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set auction_id(value: string) { pb_1.Message.setField(this, 1, value); } get commit_hash() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set commit_hash(value: string) { pb_1.Message.setField(this, 2, value); } get signer() { - return pb_1.Message.getField(this, 3) as string; + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 3, value); @@ -300,7 +321,7 @@ export namespace vulcanize.auction.v1beta1 { auction_id?: string; commit_hash?: string; signer?: string; - }) { + }): MsgCommitBid { const message = new MsgCommitBid({}); if (data.auction_id != null) { message.auction_id = data.auction_id; @@ -334,11 +355,11 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.auction_id === "string" && this.auction_id.length) + if (this.auction_id.length) writer.writeString(1, this.auction_id); - if (typeof this.commit_hash === "string" && this.commit_hash.length) + if (this.commit_hash.length) writer.writeString(2, this.commit_hash); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(3, this.signer); if (!w) return writer.getResultBuffer(); @@ -371,13 +392,14 @@ export namespace vulcanize.auction.v1beta1 { } } export class MsgRevealBid extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { auction_id?: string; reveal?: string; signer?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("auction_id" in data && data.auction_id != undefined) { this.auction_id = data.auction_id; @@ -391,19 +413,19 @@ export namespace vulcanize.auction.v1beta1 { } } get auction_id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set auction_id(value: string) { pb_1.Message.setField(this, 1, value); } get reveal() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set reveal(value: string) { pb_1.Message.setField(this, 2, value); } get signer() { - return pb_1.Message.getField(this, 3) as string; + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 3, value); @@ -412,7 +434,7 @@ export namespace vulcanize.auction.v1beta1 { auction_id?: string; reveal?: string; signer?: string; - }) { + }): MsgRevealBid { const message = new MsgRevealBid({}); if (data.auction_id != null) { message.auction_id = data.auction_id; @@ -446,11 +468,11 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.auction_id === "string" && this.auction_id.length) + if (this.auction_id.length) writer.writeString(1, this.auction_id); - if (typeof this.reveal === "string" && this.reveal.length) + if (this.reveal.length) writer.writeString(2, this.reveal); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(3, this.signer); if (!w) return writer.getResultBuffer(); @@ -483,11 +505,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class MsgCommitBidResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { bid?: dependency_4.vulcanize.auction.v1beta1.Bid; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("bid" in data && data.bid != undefined) { this.bid = data.bid; @@ -500,9 +523,12 @@ export namespace vulcanize.auction.v1beta1 { set bid(value: dependency_4.vulcanize.auction.v1beta1.Bid) { pb_1.Message.setWrapperField(this, 1, value); } + get has_bid() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { bid?: ReturnType; - }) { + }): MsgCommitBidResponse { const message = new MsgCommitBidResponse({}); if (data.bid != null) { message.bid = dependency_4.vulcanize.auction.v1beta1.Bid.fromObject(data.bid); @@ -522,7 +548,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.bid !== undefined) + if (this.has_bid) writer.writeMessage(1, this.bid, () => this.bid.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -549,11 +575,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class MsgRevealBidResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { auction?: dependency_4.vulcanize.auction.v1beta1.Auction; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("auction" in data && data.auction != undefined) { this.auction = data.auction; @@ -566,9 +593,12 @@ export namespace vulcanize.auction.v1beta1 { set auction(value: dependency_4.vulcanize.auction.v1beta1.Auction) { pb_1.Message.setWrapperField(this, 1, value); } + get has_auction() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { auction?: ReturnType; - }) { + }): MsgRevealBidResponse { const message = new MsgRevealBidResponse({}); if (data.auction != null) { message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.fromObject(data.auction); @@ -588,7 +618,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.auction !== undefined) + if (this.has_auction) writer.writeMessage(1, this.auction, () => this.auction.serialize(writer)); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/vulcanize/auction/v1beta1/types.ts b/src/proto/vulcanize/auction/v1beta1/types.ts index 6e6c324..ef54a88 100644 --- a/src/proto/vulcanize/auction/v1beta1/types.ts +++ b/src/proto/vulcanize/auction/v1beta1/types.ts @@ -2,7 +2,7 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: vulcanize/auction/v1beta1/types.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../gogoproto/gogo"; @@ -12,6 +12,7 @@ import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin"; import * as pb_1 from "google-protobuf"; export namespace vulcanize.auction.v1beta1 { export class Params extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { commits_duration?: dependency_2.google.protobuf.Duration; reveals_duration?: dependency_2.google.protobuf.Duration; @@ -20,7 +21,7 @@ export namespace vulcanize.auction.v1beta1 { minimum_bid?: dependency_4.cosmos.base.v1beta1.Coin; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("commits_duration" in data && data.commits_duration != undefined) { this.commits_duration = data.commits_duration; @@ -45,37 +46,52 @@ export namespace vulcanize.auction.v1beta1 { set commits_duration(value: dependency_2.google.protobuf.Duration) { pb_1.Message.setWrapperField(this, 1, value); } + get has_commits_duration() { + return pb_1.Message.getField(this, 1) != null; + } get reveals_duration() { return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 2) as dependency_2.google.protobuf.Duration; } set reveals_duration(value: dependency_2.google.protobuf.Duration) { pb_1.Message.setWrapperField(this, 2, value); } + get has_reveals_duration() { + return pb_1.Message.getField(this, 2) != null; + } get commit_fee() { return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 3) as dependency_4.cosmos.base.v1beta1.Coin; } set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 3, value); } + get has_commit_fee() { + return pb_1.Message.getField(this, 3) != null; + } get reveal_fee() { return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 4) as dependency_4.cosmos.base.v1beta1.Coin; } set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 4, value); } + get has_reveal_fee() { + return pb_1.Message.getField(this, 4) != null; + } get minimum_bid() { return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 5) as dependency_4.cosmos.base.v1beta1.Coin; } set minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 5, value); } + get has_minimum_bid() { + return pb_1.Message.getField(this, 5) != null; + } static fromObject(data: { commits_duration?: ReturnType; reveals_duration?: ReturnType; commit_fee?: ReturnType; reveal_fee?: ReturnType; minimum_bid?: ReturnType; - }) { + }): Params { const message = new Params({}); if (data.commits_duration != null) { message.commits_duration = dependency_2.google.protobuf.Duration.fromObject(data.commits_duration); @@ -123,15 +139,15 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.commits_duration !== undefined) + if (this.has_commits_duration) writer.writeMessage(1, this.commits_duration, () => this.commits_duration.serialize(writer)); - if (this.reveals_duration !== undefined) + if (this.has_reveals_duration) writer.writeMessage(2, this.reveals_duration, () => this.reveals_duration.serialize(writer)); - if (this.commit_fee !== undefined) + if (this.has_commit_fee) writer.writeMessage(3, this.commit_fee, () => this.commit_fee.serialize(writer)); - if (this.reveal_fee !== undefined) + if (this.has_reveal_fee) writer.writeMessage(4, this.reveal_fee, () => this.reveal_fee.serialize(writer)); - if (this.minimum_bid !== undefined) + if (this.has_minimum_bid) writer.writeMessage(5, this.minimum_bid, () => this.minimum_bid.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -170,6 +186,7 @@ export namespace vulcanize.auction.v1beta1 { } } export class Auction extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; status?: string; @@ -185,7 +202,7 @@ export namespace vulcanize.auction.v1beta1 { winning_price?: dependency_4.cosmos.base.v1beta1.Coin; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -226,19 +243,19 @@ export namespace vulcanize.auction.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } get status() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set status(value: string) { pb_1.Message.setField(this, 2, value); } get owner_address() { - return pb_1.Message.getField(this, 3) as string; + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set owner_address(value: string) { pb_1.Message.setField(this, 3, value); @@ -249,38 +266,56 @@ export namespace vulcanize.auction.v1beta1 { set create_time(value: dependency_3.google.protobuf.Timestamp) { pb_1.Message.setWrapperField(this, 4, value); } + get has_create_time() { + return pb_1.Message.getField(this, 4) != null; + } get commits_end_time() { return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 5) as dependency_3.google.protobuf.Timestamp; } set commits_end_time(value: dependency_3.google.protobuf.Timestamp) { pb_1.Message.setWrapperField(this, 5, value); } + get has_commits_end_time() { + return pb_1.Message.getField(this, 5) != null; + } get reveals_end_time() { return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 6) as dependency_3.google.protobuf.Timestamp; } set reveals_end_time(value: dependency_3.google.protobuf.Timestamp) { pb_1.Message.setWrapperField(this, 6, value); } + get has_reveals_end_time() { + return pb_1.Message.getField(this, 6) != null; + } get commit_fee() { return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 7) as dependency_4.cosmos.base.v1beta1.Coin; } set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 7, value); } + get has_commit_fee() { + return pb_1.Message.getField(this, 7) != null; + } get reveal_fee() { return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 8) as dependency_4.cosmos.base.v1beta1.Coin; } set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 8, value); } + get has_reveal_fee() { + return pb_1.Message.getField(this, 8) != null; + } get minimum_bid() { return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9) as dependency_4.cosmos.base.v1beta1.Coin; } set minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 9, value); } + get has_minimum_bid() { + return pb_1.Message.getField(this, 9) != null; + } get winner_address() { - return pb_1.Message.getField(this, 10) as string; + return pb_1.Message.getFieldWithDefault(this, 10, "") as string; } set winner_address(value: string) { pb_1.Message.setField(this, 10, value); @@ -291,12 +326,18 @@ export namespace vulcanize.auction.v1beta1 { set winning_bid(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 11, value); } + get has_winning_bid() { + return pb_1.Message.getField(this, 11) != null; + } get winning_price() { return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 12) as dependency_4.cosmos.base.v1beta1.Coin; } set winning_price(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 12, value); } + get has_winning_price() { + return pb_1.Message.getField(this, 12) != null; + } static fromObject(data: { id?: string; status?: string; @@ -310,7 +351,7 @@ export namespace vulcanize.auction.v1beta1 { winner_address?: string; winning_bid?: ReturnType; winning_price?: ReturnType; - }) { + }): Auction { const message = new Auction({}); if (data.id != null) { message.id = data.id; @@ -407,29 +448,29 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); - if (typeof this.status === "string" && this.status.length) + if (this.status.length) writer.writeString(2, this.status); - if (typeof this.owner_address === "string" && this.owner_address.length) + if (this.owner_address.length) writer.writeString(3, this.owner_address); - if (this.create_time !== undefined) + if (this.has_create_time) writer.writeMessage(4, this.create_time, () => this.create_time.serialize(writer)); - if (this.commits_end_time !== undefined) + if (this.has_commits_end_time) writer.writeMessage(5, this.commits_end_time, () => this.commits_end_time.serialize(writer)); - if (this.reveals_end_time !== undefined) + if (this.has_reveals_end_time) writer.writeMessage(6, this.reveals_end_time, () => this.reveals_end_time.serialize(writer)); - if (this.commit_fee !== undefined) + if (this.has_commit_fee) writer.writeMessage(7, this.commit_fee, () => this.commit_fee.serialize(writer)); - if (this.reveal_fee !== undefined) + if (this.has_reveal_fee) writer.writeMessage(8, this.reveal_fee, () => this.reveal_fee.serialize(writer)); - if (this.minimum_bid !== undefined) + if (this.has_minimum_bid) writer.writeMessage(9, this.minimum_bid, () => this.minimum_bid.serialize(writer)); - if (typeof this.winner_address === "string" && this.winner_address.length) + if (this.winner_address.length) writer.writeString(10, this.winner_address); - if (this.winning_bid !== undefined) + if (this.has_winning_bid) writer.writeMessage(11, this.winning_bid, () => this.winning_bid.serialize(writer)); - if (this.winning_price !== undefined) + if (this.has_winning_price) writer.writeMessage(12, this.winning_price, () => this.winning_price.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -489,11 +530,12 @@ export namespace vulcanize.auction.v1beta1 { } } export class Auctions extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { auctions?: Auction[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("auctions" in data && data.auctions != undefined) { this.auctions = data.auctions; @@ -508,7 +550,7 @@ export namespace vulcanize.auction.v1beta1 { } static fromObject(data: { auctions?: ReturnType[]; - }) { + }): Auctions { const message = new Auctions({}); if (data.auctions != null) { message.auctions = data.auctions.map(item => Auction.fromObject(item)); @@ -528,7 +570,7 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.auctions !== undefined) + if (this.auctions.length) writer.writeRepeatedMessage(1, this.auctions, (item: Auction) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -555,6 +597,7 @@ export namespace vulcanize.auction.v1beta1 { } } export class Bid extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { auction_id?: string; bidder_address?: string; @@ -567,7 +610,7 @@ export namespace vulcanize.auction.v1beta1 { bid_amount?: dependency_4.cosmos.base.v1beta1.Coin; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("auction_id" in data && data.auction_id != undefined) { this.auction_id = data.auction_id; @@ -599,25 +642,25 @@ export namespace vulcanize.auction.v1beta1 { } } get auction_id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set auction_id(value: string) { pb_1.Message.setField(this, 1, value); } get bidder_address() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set bidder_address(value: string) { pb_1.Message.setField(this, 2, value); } get status() { - return pb_1.Message.getField(this, 3) as string; + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set status(value: string) { pb_1.Message.setField(this, 3, value); } get commit_hash() { - return pb_1.Message.getField(this, 4) as string; + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; } set commit_hash(value: string) { pb_1.Message.setField(this, 4, value); @@ -628,30 +671,45 @@ export namespace vulcanize.auction.v1beta1 { set commit_time(value: dependency_3.google.protobuf.Timestamp) { pb_1.Message.setWrapperField(this, 5, value); } + get has_commit_time() { + return pb_1.Message.getField(this, 5) != null; + } get commit_fee() { return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 6) as dependency_4.cosmos.base.v1beta1.Coin; } set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 6, value); } + get has_commit_fee() { + return pb_1.Message.getField(this, 6) != null; + } get reveal_time() { return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 7) as dependency_3.google.protobuf.Timestamp; } set reveal_time(value: dependency_3.google.protobuf.Timestamp) { pb_1.Message.setWrapperField(this, 7, value); } + get has_reveal_time() { + return pb_1.Message.getField(this, 7) != null; + } get reveal_fee() { return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 8) as dependency_4.cosmos.base.v1beta1.Coin; } set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 8, value); } + get has_reveal_fee() { + return pb_1.Message.getField(this, 8) != null; + } get bid_amount() { return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9) as dependency_4.cosmos.base.v1beta1.Coin; } set bid_amount(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 9, value); } + get has_bid_amount() { + return pb_1.Message.getField(this, 9) != null; + } static fromObject(data: { auction_id?: string; bidder_address?: string; @@ -662,7 +720,7 @@ export namespace vulcanize.auction.v1beta1 { reveal_time?: ReturnType; reveal_fee?: ReturnType; bid_amount?: ReturnType; - }) { + }): Bid { const message = new Bid({}); if (data.auction_id != null) { message.auction_id = data.auction_id; @@ -738,23 +796,23 @@ export namespace vulcanize.auction.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.auction_id === "string" && this.auction_id.length) + if (this.auction_id.length) writer.writeString(1, this.auction_id); - if (typeof this.bidder_address === "string" && this.bidder_address.length) + if (this.bidder_address.length) writer.writeString(2, this.bidder_address); - if (typeof this.status === "string" && this.status.length) + if (this.status.length) writer.writeString(3, this.status); - if (typeof this.commit_hash === "string" && this.commit_hash.length) + if (this.commit_hash.length) writer.writeString(4, this.commit_hash); - if (this.commit_time !== undefined) + if (this.has_commit_time) writer.writeMessage(5, this.commit_time, () => this.commit_time.serialize(writer)); - if (this.commit_fee !== undefined) + if (this.has_commit_fee) writer.writeMessage(6, this.commit_fee, () => this.commit_fee.serialize(writer)); - if (this.reveal_time !== undefined) + if (this.has_reveal_time) writer.writeMessage(7, this.reveal_time, () => this.reveal_time.serialize(writer)); - if (this.reveal_fee !== undefined) + if (this.has_reveal_fee) writer.writeMessage(8, this.reveal_fee, () => this.reveal_fee.serialize(writer)); - if (this.bid_amount !== undefined) + if (this.has_bid_amount) writer.writeMessage(9, this.bid_amount, () => this.bid_amount.serialize(writer)); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/vulcanize/bond/v1beta1/bond.ts b/src/proto/vulcanize/bond/v1beta1/bond.ts index 099c0e2..43ec165 100644 --- a/src/proto/vulcanize/bond/v1beta1/bond.ts +++ b/src/proto/vulcanize/bond/v1beta1/bond.ts @@ -2,7 +2,7 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: vulcanize/bond/v1beta1/bond.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../gogoproto/gogo"; @@ -10,11 +10,12 @@ import * as dependency_2 from "./../../../cosmos/base/v1beta1/coin"; import * as pb_1 from "google-protobuf"; export namespace vulcanize.bond.v1beta1 { export class Params extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { max_bond_amount?: dependency_2.cosmos.base.v1beta1.Coin; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("max_bond_amount" in data && data.max_bond_amount != undefined) { this.max_bond_amount = data.max_bond_amount; @@ -27,9 +28,12 @@ export namespace vulcanize.bond.v1beta1 { set max_bond_amount(value: dependency_2.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 1, value); } + get has_max_bond_amount() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { max_bond_amount?: ReturnType; - }) { + }): Params { const message = new Params({}); if (data.max_bond_amount != null) { message.max_bond_amount = dependency_2.cosmos.base.v1beta1.Coin.fromObject(data.max_bond_amount); @@ -49,7 +53,7 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.max_bond_amount !== undefined) + if (this.has_max_bond_amount) writer.writeMessage(1, this.max_bond_amount, () => this.max_bond_amount.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -76,13 +80,14 @@ export namespace vulcanize.bond.v1beta1 { } } export class Bond extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; owner?: string; balance?: dependency_2.cosmos.base.v1beta1.Coin[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -96,13 +101,13 @@ export namespace vulcanize.bond.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } get owner() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set owner(value: string) { pb_1.Message.setField(this, 2, value); @@ -117,7 +122,7 @@ export namespace vulcanize.bond.v1beta1 { id?: string; owner?: string; balance?: ReturnType[]; - }) { + }): Bond { const message = new Bond({}); if (data.id != null) { message.id = data.id; @@ -151,11 +156,11 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); - if (typeof this.owner === "string" && this.owner.length) + if (this.owner.length) writer.writeString(2, this.owner); - if (this.balance !== undefined) + if (this.balance.length) writer.writeRepeatedMessage(3, this.balance, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/vulcanize/bond/v1beta1/genesis.ts b/src/proto/vulcanize/bond/v1beta1/genesis.ts index e930dba..84df411 100644 --- a/src/proto/vulcanize/bond/v1beta1/genesis.ts +++ b/src/proto/vulcanize/bond/v1beta1/genesis.ts @@ -2,7 +2,7 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: vulcanize/bond/v1beta1/genesis.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../gogoproto/gogo"; @@ -10,12 +10,13 @@ import * as dependency_2 from "./bond"; import * as pb_1 from "google-protobuf"; export namespace vulcanize.bond.v1beta1 { export class GenesisState extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { params?: dependency_2.vulcanize.bond.v1beta1.Params; bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("params" in data && data.params != undefined) { this.params = data.params; @@ -31,6 +32,9 @@ export namespace vulcanize.bond.v1beta1 { set params(value: dependency_2.vulcanize.bond.v1beta1.Params) { pb_1.Message.setWrapperField(this, 1, value); } + get has_params() { + return pb_1.Message.getField(this, 1) != null; + } get bonds() { return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 2) as dependency_2.vulcanize.bond.v1beta1.Bond[]; } @@ -40,7 +44,7 @@ export namespace vulcanize.bond.v1beta1 { static fromObject(data: { params?: ReturnType; bonds?: ReturnType[]; - }) { + }): GenesisState { const message = new GenesisState({}); if (data.params != null) { message.params = dependency_2.vulcanize.bond.v1beta1.Params.fromObject(data.params); @@ -67,9 +71,9 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.params !== undefined) + if (this.has_params) writer.writeMessage(1, this.params, () => this.params.serialize(writer)); - if (this.bonds !== undefined) + if (this.bonds.length) writer.writeRepeatedMessage(2, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/vulcanize/bond/v1beta1/query.ts b/src/proto/vulcanize/bond/v1beta1/query.ts index c12adb2..14ca51f 100644 --- a/src/proto/vulcanize/bond/v1beta1/query.ts +++ b/src/proto/vulcanize/bond/v1beta1/query.ts @@ -2,7 +2,7 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: vulcanize/bond/v1beta1/query.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../gogoproto/gogo"; @@ -13,12 +13,13 @@ import * as dependency_5 from "./../../../cosmos/base/v1beta1/coin"; import * as pb_1 from "google-protobuf"; export namespace vulcanize.bond.v1beta1 { export class QueryParamsRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): QueryParamsRequest { const message = new QueryParamsRequest({}); return message; } @@ -52,11 +53,12 @@ export namespace vulcanize.bond.v1beta1 { } } export class QueryParamsResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { params?: dependency_2.vulcanize.bond.v1beta1.Params; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("params" in data && data.params != undefined) { this.params = data.params; @@ -69,9 +71,12 @@ export namespace vulcanize.bond.v1beta1 { set params(value: dependency_2.vulcanize.bond.v1beta1.Params) { pb_1.Message.setWrapperField(this, 1, value); } + get has_params() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { params?: ReturnType; - }) { + }): QueryParamsResponse { const message = new QueryParamsResponse({}); if (data.params != null) { message.params = dependency_2.vulcanize.bond.v1beta1.Params.fromObject(data.params); @@ -91,7 +96,7 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.params !== undefined) + if (this.has_params) writer.writeMessage(1, this.params, () => this.params.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -118,11 +123,12 @@ export namespace vulcanize.bond.v1beta1 { } } export class QueryGetBondsRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { pagination?: dependency_4.cosmos.base.query.v1beta1.PageRequest; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("pagination" in data && data.pagination != undefined) { this.pagination = data.pagination; @@ -135,9 +141,12 @@ export namespace vulcanize.bond.v1beta1 { set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageRequest) { pb_1.Message.setWrapperField(this, 1, value); } + get has_pagination() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { pagination?: ReturnType; - }) { + }): QueryGetBondsRequest { const message = new QueryGetBondsRequest({}); if (data.pagination != null) { message.pagination = dependency_4.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); @@ -157,7 +166,7 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -184,12 +193,13 @@ export namespace vulcanize.bond.v1beta1 { } } export class QueryGetBondsResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[]; pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("bonds" in data && data.bonds != undefined) { this.bonds = data.bonds; @@ -211,10 +221,13 @@ export namespace vulcanize.bond.v1beta1 { set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) { pb_1.Message.setWrapperField(this, 2, value); } + get has_pagination() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { bonds?: ReturnType[]; pagination?: ReturnType; - }) { + }): QueryGetBondsResponse { const message = new QueryGetBondsResponse({}); if (data.bonds != null) { message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item)); @@ -241,9 +254,9 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.bonds !== undefined) + if (this.bonds.length) writer.writeRepeatedMessage(1, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer)); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -273,11 +286,12 @@ export namespace vulcanize.bond.v1beta1 { } } export class QueryGetBondByIdRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -285,14 +299,14 @@ export namespace vulcanize.bond.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { id?: string; - }) { + }): QueryGetBondByIdRequest { const message = new QueryGetBondByIdRequest({}); if (data.id != null) { message.id = data.id; @@ -312,7 +326,7 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); if (!w) return writer.getResultBuffer(); @@ -339,11 +353,12 @@ export namespace vulcanize.bond.v1beta1 { } } export class QueryGetBondByIdResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { bond?: dependency_2.vulcanize.bond.v1beta1.Bond; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("bond" in data && data.bond != undefined) { this.bond = data.bond; @@ -356,9 +371,12 @@ export namespace vulcanize.bond.v1beta1 { set bond(value: dependency_2.vulcanize.bond.v1beta1.Bond) { pb_1.Message.setWrapperField(this, 1, value); } + get has_bond() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { bond?: ReturnType; - }) { + }): QueryGetBondByIdResponse { const message = new QueryGetBondByIdResponse({}); if (data.bond != null) { message.bond = dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(data.bond); @@ -378,7 +396,7 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.bond !== undefined) + if (this.has_bond) writer.writeMessage(1, this.bond, () => this.bond.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -405,12 +423,13 @@ export namespace vulcanize.bond.v1beta1 { } } export class QueryGetBondsByOwnerRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { owner?: string; pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("owner" in data && data.owner != undefined) { this.owner = data.owner; @@ -421,7 +440,7 @@ export namespace vulcanize.bond.v1beta1 { } } get owner() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set owner(value: string) { pb_1.Message.setField(this, 1, value); @@ -432,10 +451,13 @@ export namespace vulcanize.bond.v1beta1 { set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) { pb_1.Message.setWrapperField(this, 2, value); } + get has_pagination() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { owner?: string; pagination?: ReturnType; - }) { + }): QueryGetBondsByOwnerRequest { const message = new QueryGetBondsByOwnerRequest({}); if (data.owner != null) { message.owner = data.owner; @@ -462,9 +484,9 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.owner === "string" && this.owner.length) + if (this.owner.length) writer.writeString(1, this.owner); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -494,12 +516,13 @@ export namespace vulcanize.bond.v1beta1 { } } export class QueryGetBondsByOwnerResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[]; pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("bonds" in data && data.bonds != undefined) { this.bonds = data.bonds; @@ -521,10 +544,13 @@ export namespace vulcanize.bond.v1beta1 { set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) { pb_1.Message.setWrapperField(this, 2, value); } + get has_pagination() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { bonds?: ReturnType[]; pagination?: ReturnType; - }) { + }): QueryGetBondsByOwnerResponse { const message = new QueryGetBondsByOwnerResponse({}); if (data.bonds != null) { message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item)); @@ -551,9 +577,9 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.bonds !== undefined) + if (this.bonds.length) writer.writeRepeatedMessage(1, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer)); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -583,12 +609,13 @@ export namespace vulcanize.bond.v1beta1 { } } export class QueryGetBondModuleBalanceRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): QueryGetBondModuleBalanceRequest { const message = new QueryGetBondModuleBalanceRequest({}); return message; } @@ -622,11 +649,12 @@ export namespace vulcanize.bond.v1beta1 { } } export class QueryGetBondModuleBalanceResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { balance?: dependency_5.cosmos.base.v1beta1.Coin[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("balance" in data && data.balance != undefined) { this.balance = data.balance; @@ -641,7 +669,7 @@ export namespace vulcanize.bond.v1beta1 { } static fromObject(data: { balance?: ReturnType[]; - }) { + }): QueryGetBondModuleBalanceResponse { const message = new QueryGetBondModuleBalanceResponse({}); if (data.balance != null) { message.balance = data.balance.map(item => dependency_5.cosmos.base.v1beta1.Coin.fromObject(item)); @@ -661,7 +689,7 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.balance !== undefined) + if (this.balance.length) writer.writeRepeatedMessage(2, this.balance, (item: dependency_5.cosmos.base.v1beta1.Coin) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/vulcanize/bond/v1beta1/tx.ts b/src/proto/vulcanize/bond/v1beta1/tx.ts index 2931056..d75ff91 100644 --- a/src/proto/vulcanize/bond/v1beta1/tx.ts +++ b/src/proto/vulcanize/bond/v1beta1/tx.ts @@ -2,7 +2,7 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: vulcanize/bond/v1beta1/tx.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../gogoproto/gogo"; @@ -10,12 +10,13 @@ import * as dependency_2 from "./../../../cosmos/base/v1beta1/coin"; import * as pb_1 from "google-protobuf"; export namespace vulcanize.bond.v1beta1 { export class MsgCreateBond extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { signer?: string; coins?: dependency_2.cosmos.base.v1beta1.Coin[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("signer" in data && data.signer != undefined) { this.signer = data.signer; @@ -26,7 +27,7 @@ export namespace vulcanize.bond.v1beta1 { } } get signer() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 1, value); @@ -40,7 +41,7 @@ export namespace vulcanize.bond.v1beta1 { static fromObject(data: { signer?: string; coins?: ReturnType[]; - }) { + }): MsgCreateBond { const message = new MsgCreateBond({}); if (data.signer != null) { message.signer = data.signer; @@ -67,9 +68,9 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(1, this.signer); - if (this.coins !== undefined) + if (this.coins.length) writer.writeRepeatedMessage(2, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -99,11 +100,12 @@ export namespace vulcanize.bond.v1beta1 { } } export class MsgCreateBondResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -111,14 +113,14 @@ export namespace vulcanize.bond.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { id?: string; - }) { + }): MsgCreateBondResponse { const message = new MsgCreateBondResponse({}); if (data.id != null) { message.id = data.id; @@ -138,7 +140,7 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); if (!w) return writer.getResultBuffer(); @@ -165,13 +167,14 @@ export namespace vulcanize.bond.v1beta1 { } } export class MsgRefillBond extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; signer?: string; coins?: dependency_2.cosmos.base.v1beta1.Coin[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -185,13 +188,13 @@ export namespace vulcanize.bond.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } get signer() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 2, value); @@ -206,7 +209,7 @@ export namespace vulcanize.bond.v1beta1 { id?: string; signer?: string; coins?: ReturnType[]; - }) { + }): MsgRefillBond { const message = new MsgRefillBond({}); if (data.id != null) { message.id = data.id; @@ -240,11 +243,11 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(2, this.signer); - if (this.coins !== undefined) + if (this.coins.length) writer.writeRepeatedMessage(3, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -277,12 +280,13 @@ export namespace vulcanize.bond.v1beta1 { } } export class MsgRefillBondResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): MsgRefillBondResponse { const message = new MsgRefillBondResponse({}); return message; } @@ -316,13 +320,14 @@ export namespace vulcanize.bond.v1beta1 { } } export class MsgWithdrawBond extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; signer?: string; coins?: dependency_2.cosmos.base.v1beta1.Coin[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -336,13 +341,13 @@ export namespace vulcanize.bond.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } get signer() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 2, value); @@ -357,7 +362,7 @@ export namespace vulcanize.bond.v1beta1 { id?: string; signer?: string; coins?: ReturnType[]; - }) { + }): MsgWithdrawBond { const message = new MsgWithdrawBond({}); if (data.id != null) { message.id = data.id; @@ -391,11 +396,11 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(2, this.signer); - if (this.coins !== undefined) + if (this.coins.length) writer.writeRepeatedMessage(3, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -428,12 +433,13 @@ export namespace vulcanize.bond.v1beta1 { } } export class MsgWithdrawBondResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): MsgWithdrawBondResponse { const message = new MsgWithdrawBondResponse({}); return message; } @@ -467,12 +473,13 @@ export namespace vulcanize.bond.v1beta1 { } } export class MsgCancelBond extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; signer?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -483,13 +490,13 @@ export namespace vulcanize.bond.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } get signer() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 2, value); @@ -497,7 +504,7 @@ export namespace vulcanize.bond.v1beta1 { static fromObject(data: { id?: string; signer?: string; - }) { + }): MsgCancelBond { const message = new MsgCancelBond({}); if (data.id != null) { message.id = data.id; @@ -524,9 +531,9 @@ export namespace vulcanize.bond.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(2, this.signer); if (!w) return writer.getResultBuffer(); @@ -556,12 +563,13 @@ export namespace vulcanize.bond.v1beta1 { } } export class MsgCancelBondResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): MsgCancelBondResponse { const message = new MsgCancelBondResponse({}); return message; } diff --git a/src/proto/vulcanize/nameservice/v1beta1/attributes.ts b/src/proto/vulcanize/nameservice/v1beta1/attributes.ts new file mode 100644 index 0000000..9019b37 --- /dev/null +++ b/src/proto/vulcanize/nameservice/v1beta1/attributes.ts @@ -0,0 +1,491 @@ +// @ts-nocheck +/* eslint-disable */ +/** + * Generated by the protoc-gen-ts. DO NOT EDIT! + * compiler version: 3.12.4 + * source: vulcanize/nameservice/v1beta1/attributes.proto + * git: https://github.com/thesayyn/protoc-gen-ts */ +import * as dependency_1 from "./../../../gogoproto/gogo"; +import * as pb_1 from "google-protobuf"; +export namespace vulcanize.nameservice.v1beta1 { + export class ServiceProviderRegistration extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + bond_id?: string; + laconic_id?: string; + x500?: X500; + type?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("bond_id" in data && data.bond_id != undefined) { + this.bond_id = data.bond_id; + } + if ("laconic_id" in data && data.laconic_id != undefined) { + this.laconic_id = data.laconic_id; + } + if ("x500" in data && data.x500 != undefined) { + this.x500 = data.x500; + } + if ("type" in data && data.type != undefined) { + this.type = data.type; + } + } + } + get bond_id() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set bond_id(value: string) { + pb_1.Message.setField(this, 1, value); + } + get laconic_id() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set laconic_id(value: string) { + pb_1.Message.setField(this, 2, value); + } + get x500() { + return pb_1.Message.getWrapperField(this, X500, 3) as X500; + } + set x500(value: X500) { + pb_1.Message.setWrapperField(this, 3, value); + } + get has_x500() { + return pb_1.Message.getField(this, 3) != null; + } + get type() { + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; + } + set type(value: string) { + pb_1.Message.setField(this, 4, value); + } + static fromObject(data: { + bond_id?: string; + laconic_id?: string; + x500?: ReturnType; + type?: string; + }): ServiceProviderRegistration { + const message = new ServiceProviderRegistration({}); + if (data.bond_id != null) { + message.bond_id = data.bond_id; + } + if (data.laconic_id != null) { + message.laconic_id = data.laconic_id; + } + if (data.x500 != null) { + message.x500 = X500.fromObject(data.x500); + } + if (data.type != null) { + message.type = data.type; + } + return message; + } + toObject() { + const data: { + bond_id?: string; + laconic_id?: string; + x500?: ReturnType; + type?: string; + } = {}; + if (this.bond_id != null) { + data.bond_id = this.bond_id; + } + if (this.laconic_id != null) { + data.laconic_id = this.laconic_id; + } + if (this.x500 != null) { + data.x500 = this.x500.toObject(); + } + if (this.type != null) { + data.type = this.type; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.bond_id.length) + writer.writeString(1, this.bond_id); + if (this.laconic_id.length) + writer.writeString(2, this.laconic_id); + if (this.has_x500) + writer.writeMessage(3, this.x500, () => this.x500.serialize(writer)); + if (this.type.length) + writer.writeString(4, this.type); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ServiceProviderRegistration { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ServiceProviderRegistration(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.bond_id = reader.readString(); + break; + case 2: + message.laconic_id = reader.readString(); + break; + case 3: + reader.readMessage(message.x500, () => message.x500 = X500.deserialize(reader)); + break; + case 4: + message.type = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): ServiceProviderRegistration { + return ServiceProviderRegistration.deserialize(bytes); + } + } + export class X500 extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + common_name?: string; + organization_unit?: string; + organization_name?: string; + locality_name?: string; + state_name?: string; + country?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("common_name" in data && data.common_name != undefined) { + this.common_name = data.common_name; + } + if ("organization_unit" in data && data.organization_unit != undefined) { + this.organization_unit = data.organization_unit; + } + if ("organization_name" in data && data.organization_name != undefined) { + this.organization_name = data.organization_name; + } + if ("locality_name" in data && data.locality_name != undefined) { + this.locality_name = data.locality_name; + } + if ("state_name" in data && data.state_name != undefined) { + this.state_name = data.state_name; + } + if ("country" in data && data.country != undefined) { + this.country = data.country; + } + } + } + get common_name() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set common_name(value: string) { + pb_1.Message.setField(this, 1, value); + } + get organization_unit() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set organization_unit(value: string) { + pb_1.Message.setField(this, 2, value); + } + get organization_name() { + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; + } + set organization_name(value: string) { + pb_1.Message.setField(this, 3, value); + } + get locality_name() { + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; + } + set locality_name(value: string) { + pb_1.Message.setField(this, 4, value); + } + get state_name() { + return pb_1.Message.getFieldWithDefault(this, 5, "") as string; + } + set state_name(value: string) { + pb_1.Message.setField(this, 5, value); + } + get country() { + return pb_1.Message.getFieldWithDefault(this, 6, "") as string; + } + set country(value: string) { + pb_1.Message.setField(this, 6, value); + } + static fromObject(data: { + common_name?: string; + organization_unit?: string; + organization_name?: string; + locality_name?: string; + state_name?: string; + country?: string; + }): X500 { + const message = new X500({}); + if (data.common_name != null) { + message.common_name = data.common_name; + } + if (data.organization_unit != null) { + message.organization_unit = data.organization_unit; + } + if (data.organization_name != null) { + message.organization_name = data.organization_name; + } + if (data.locality_name != null) { + message.locality_name = data.locality_name; + } + if (data.state_name != null) { + message.state_name = data.state_name; + } + if (data.country != null) { + message.country = data.country; + } + return message; + } + toObject() { + const data: { + common_name?: string; + organization_unit?: string; + organization_name?: string; + locality_name?: string; + state_name?: string; + country?: string; + } = {}; + if (this.common_name != null) { + data.common_name = this.common_name; + } + if (this.organization_unit != null) { + data.organization_unit = this.organization_unit; + } + if (this.organization_name != null) { + data.organization_name = this.organization_name; + } + if (this.locality_name != null) { + data.locality_name = this.locality_name; + } + if (this.state_name != null) { + data.state_name = this.state_name; + } + if (this.country != null) { + data.country = this.country; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.common_name.length) + writer.writeString(1, this.common_name); + if (this.organization_unit.length) + writer.writeString(2, this.organization_unit); + if (this.organization_name.length) + writer.writeString(3, this.organization_name); + if (this.locality_name.length) + writer.writeString(4, this.locality_name); + if (this.state_name.length) + writer.writeString(5, this.state_name); + if (this.country.length) + writer.writeString(6, this.country); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): X500 { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new X500(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.common_name = reader.readString(); + break; + case 2: + message.organization_unit = reader.readString(); + break; + case 3: + message.organization_name = reader.readString(); + break; + case 4: + message.locality_name = reader.readString(); + break; + case 5: + message.state_name = reader.readString(); + break; + case 6: + message.country = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): X500 { + return X500.deserialize(bytes); + } + } + export class WebsiteRegistrationRecord extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + url?: string; + repo_registration_record_cid?: string; + build_artifact_cid?: string; + tls_cert_cid?: string; + type?: string; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("url" in data && data.url != undefined) { + this.url = data.url; + } + if ("repo_registration_record_cid" in data && data.repo_registration_record_cid != undefined) { + this.repo_registration_record_cid = data.repo_registration_record_cid; + } + if ("build_artifact_cid" in data && data.build_artifact_cid != undefined) { + this.build_artifact_cid = data.build_artifact_cid; + } + if ("tls_cert_cid" in data && data.tls_cert_cid != undefined) { + this.tls_cert_cid = data.tls_cert_cid; + } + if ("type" in data && data.type != undefined) { + this.type = data.type; + } + } + } + get url() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set url(value: string) { + pb_1.Message.setField(this, 1, value); + } + get repo_registration_record_cid() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set repo_registration_record_cid(value: string) { + pb_1.Message.setField(this, 2, value); + } + get build_artifact_cid() { + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; + } + set build_artifact_cid(value: string) { + pb_1.Message.setField(this, 3, value); + } + get tls_cert_cid() { + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; + } + set tls_cert_cid(value: string) { + pb_1.Message.setField(this, 4, value); + } + get type() { + return pb_1.Message.getFieldWithDefault(this, 5, "") as string; + } + set type(value: string) { + pb_1.Message.setField(this, 5, value); + } + static fromObject(data: { + url?: string; + repo_registration_record_cid?: string; + build_artifact_cid?: string; + tls_cert_cid?: string; + type?: string; + }): WebsiteRegistrationRecord { + const message = new WebsiteRegistrationRecord({}); + if (data.url != null) { + message.url = data.url; + } + if (data.repo_registration_record_cid != null) { + message.repo_registration_record_cid = data.repo_registration_record_cid; + } + if (data.build_artifact_cid != null) { + message.build_artifact_cid = data.build_artifact_cid; + } + if (data.tls_cert_cid != null) { + message.tls_cert_cid = data.tls_cert_cid; + } + if (data.type != null) { + message.type = data.type; + } + return message; + } + toObject() { + const data: { + url?: string; + repo_registration_record_cid?: string; + build_artifact_cid?: string; + tls_cert_cid?: string; + type?: string; + } = {}; + if (this.url != null) { + data.url = this.url; + } + if (this.repo_registration_record_cid != null) { + data.repo_registration_record_cid = this.repo_registration_record_cid; + } + if (this.build_artifact_cid != null) { + data.build_artifact_cid = this.build_artifact_cid; + } + if (this.tls_cert_cid != null) { + data.tls_cert_cid = this.tls_cert_cid; + } + if (this.type != null) { + data.type = this.type; + } + return data; + } + serialize(): Uint8Array; + serialize(w: pb_1.BinaryWriter): void; + serialize(w?: pb_1.BinaryWriter): Uint8Array | void { + const writer = w || new pb_1.BinaryWriter(); + if (this.url.length) + writer.writeString(1, this.url); + if (this.repo_registration_record_cid.length) + writer.writeString(2, this.repo_registration_record_cid); + if (this.build_artifact_cid.length) + writer.writeString(3, this.build_artifact_cid); + if (this.tls_cert_cid.length) + writer.writeString(4, this.tls_cert_cid); + if (this.type.length) + writer.writeString(5, this.type); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): WebsiteRegistrationRecord { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new WebsiteRegistrationRecord(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.url = reader.readString(); + break; + case 2: + message.repo_registration_record_cid = reader.readString(); + break; + case 3: + message.build_artifact_cid = reader.readString(); + break; + case 4: + message.tls_cert_cid = reader.readString(); + break; + case 5: + message.type = reader.readString(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): WebsiteRegistrationRecord { + return WebsiteRegistrationRecord.deserialize(bytes); + } + } +} diff --git a/src/proto/vulcanize/nameservice/v1beta1/genesis.ts b/src/proto/vulcanize/nameservice/v1beta1/genesis.ts index f84b8eb..fdb7bd9 100644 --- a/src/proto/vulcanize/nameservice/v1beta1/genesis.ts +++ b/src/proto/vulcanize/nameservice/v1beta1/genesis.ts @@ -2,7 +2,7 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: vulcanize/nameservice/v1beta1/genesis.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../gogoproto/gogo"; @@ -10,6 +10,7 @@ import * as dependency_2 from "./nameservice"; import * as pb_1 from "google-protobuf"; export namespace vulcanize.nameservice.v1beta1 { export class GenesisState extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { params?: dependency_2.vulcanize.nameservice.v1beta1.Params; records?: dependency_2.vulcanize.nameservice.v1beta1.Record[]; @@ -17,7 +18,7 @@ export namespace vulcanize.nameservice.v1beta1 { names?: dependency_2.vulcanize.nameservice.v1beta1.NameEntry[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("params" in data && data.params != undefined) { this.params = data.params; @@ -39,6 +40,9 @@ export namespace vulcanize.nameservice.v1beta1 { set params(value: dependency_2.vulcanize.nameservice.v1beta1.Params) { pb_1.Message.setWrapperField(this, 1, value); } + get has_params() { + return pb_1.Message.getField(this, 1) != null; + } get records() { return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Record, 2) as dependency_2.vulcanize.nameservice.v1beta1.Record[]; } @@ -62,7 +66,7 @@ export namespace vulcanize.nameservice.v1beta1 { records?: ReturnType[]; authorities?: ReturnType[]; names?: ReturnType[]; - }) { + }): GenesisState { const message = new GenesisState({}); if (data.params != null) { message.params = dependency_2.vulcanize.nameservice.v1beta1.Params.fromObject(data.params); @@ -103,13 +107,13 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.params !== undefined) + if (this.has_params) writer.writeMessage(1, this.params, () => this.params.serialize(writer)); - if (this.records !== undefined) + if (this.records.length) writer.writeRepeatedMessage(2, this.records, (item: dependency_2.vulcanize.nameservice.v1beta1.Record) => item.serialize(writer)); - if (this.authorities !== undefined) + if (this.authorities.length) writer.writeRepeatedMessage(3, this.authorities, (item: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry) => item.serialize(writer)); - if (this.names !== undefined) + if (this.names.length) writer.writeRepeatedMessage(4, this.names, (item: dependency_2.vulcanize.nameservice.v1beta1.NameEntry) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/vulcanize/nameservice/v1beta1/nameservice.ts b/src/proto/vulcanize/nameservice/v1beta1/nameservice.ts index dcbe317..03785d1 100644 --- a/src/proto/vulcanize/nameservice/v1beta1/nameservice.ts +++ b/src/proto/vulcanize/nameservice/v1beta1/nameservice.ts @@ -2,16 +2,18 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: vulcanize/nameservice/v1beta1/nameservice.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../google/protobuf/duration"; import * as dependency_2 from "./../../../google/protobuf/timestamp"; -import * as dependency_3 from "./../../../gogoproto/gogo"; +import * as dependency_3 from "./../../../google/protobuf/any"; import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin"; +import * as dependency_5 from "./../../../gogoproto/gogo"; import * as pb_1 from "google-protobuf"; export namespace vulcanize.nameservice.v1beta1 { export class Params extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { record_rent?: dependency_4.cosmos.base.v1beta1.Coin; record_rent_duration?: dependency_1.google.protobuf.Duration; @@ -26,7 +28,7 @@ export namespace vulcanize.nameservice.v1beta1 { authority_auction_minimum_bid?: dependency_4.cosmos.base.v1beta1.Coin; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("record_rent" in data && data.record_rent != undefined) { this.record_rent = data.record_rent; @@ -69,32 +71,47 @@ export namespace vulcanize.nameservice.v1beta1 { set record_rent(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 1, value); } + get has_record_rent() { + return pb_1.Message.getField(this, 1) != null; + } get record_rent_duration() { return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 2) as dependency_1.google.protobuf.Duration; } set record_rent_duration(value: dependency_1.google.protobuf.Duration) { pb_1.Message.setWrapperField(this, 2, value); } + get has_record_rent_duration() { + return pb_1.Message.getField(this, 2) != null; + } get authority_rent() { return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 3) as dependency_4.cosmos.base.v1beta1.Coin; } set authority_rent(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 3, value); } + get has_authority_rent() { + return pb_1.Message.getField(this, 3) != null; + } get authority_rent_duration() { return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 4) as dependency_1.google.protobuf.Duration; } set authority_rent_duration(value: dependency_1.google.protobuf.Duration) { pb_1.Message.setWrapperField(this, 4, value); } + get has_authority_rent_duration() { + return pb_1.Message.getField(this, 4) != null; + } get authority_grace_period() { return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 5) as dependency_1.google.protobuf.Duration; } set authority_grace_period(value: dependency_1.google.protobuf.Duration) { pb_1.Message.setWrapperField(this, 5, value); } + get has_authority_grace_period() { + return pb_1.Message.getField(this, 5) != null; + } get authority_auction_enabled() { - return pb_1.Message.getField(this, 6) as boolean; + return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean; } set authority_auction_enabled(value: boolean) { pb_1.Message.setField(this, 6, value); @@ -105,30 +122,45 @@ export namespace vulcanize.nameservice.v1beta1 { set authority_auction_commits_duration(value: dependency_1.google.protobuf.Duration) { pb_1.Message.setWrapperField(this, 7, value); } + get has_authority_auction_commits_duration() { + return pb_1.Message.getField(this, 7) != null; + } get authority_auction_reveals_duration() { return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 8) as dependency_1.google.protobuf.Duration; } set authority_auction_reveals_duration(value: dependency_1.google.protobuf.Duration) { pb_1.Message.setWrapperField(this, 8, value); } + get has_authority_auction_reveals_duration() { + return pb_1.Message.getField(this, 8) != null; + } get authority_auction_commit_fee() { return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9) as dependency_4.cosmos.base.v1beta1.Coin; } set authority_auction_commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 9, value); } + get has_authority_auction_commit_fee() { + return pb_1.Message.getField(this, 9) != null; + } get authority_auction_reveal_fee() { return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 10) as dependency_4.cosmos.base.v1beta1.Coin; } set authority_auction_reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 10, value); } + get has_authority_auction_reveal_fee() { + return pb_1.Message.getField(this, 10) != null; + } get authority_auction_minimum_bid() { return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 11) as dependency_4.cosmos.base.v1beta1.Coin; } set authority_auction_minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin) { pb_1.Message.setWrapperField(this, 11, value); } + get has_authority_auction_minimum_bid() { + return pb_1.Message.getField(this, 11) != null; + } static fromObject(data: { record_rent?: ReturnType; record_rent_duration?: ReturnType; @@ -141,7 +173,7 @@ export namespace vulcanize.nameservice.v1beta1 { authority_auction_commit_fee?: ReturnType; authority_auction_reveal_fee?: ReturnType; authority_auction_minimum_bid?: ReturnType; - }) { + }): Params { const message = new Params({}); if (data.record_rent != null) { message.record_rent = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.record_rent); @@ -231,27 +263,27 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.record_rent !== undefined) + if (this.has_record_rent) writer.writeMessage(1, this.record_rent, () => this.record_rent.serialize(writer)); - if (this.record_rent_duration !== undefined) + if (this.has_record_rent_duration) writer.writeMessage(2, this.record_rent_duration, () => this.record_rent_duration.serialize(writer)); - if (this.authority_rent !== undefined) + if (this.has_authority_rent) writer.writeMessage(3, this.authority_rent, () => this.authority_rent.serialize(writer)); - if (this.authority_rent_duration !== undefined) + if (this.has_authority_rent_duration) writer.writeMessage(4, this.authority_rent_duration, () => this.authority_rent_duration.serialize(writer)); - if (this.authority_grace_period !== undefined) + if (this.has_authority_grace_period) writer.writeMessage(5, this.authority_grace_period, () => this.authority_grace_period.serialize(writer)); - if (this.authority_auction_enabled !== undefined) + if (this.authority_auction_enabled != false) writer.writeBool(6, this.authority_auction_enabled); - if (this.authority_auction_commits_duration !== undefined) + if (this.has_authority_auction_commits_duration) writer.writeMessage(7, this.authority_auction_commits_duration, () => this.authority_auction_commits_duration.serialize(writer)); - if (this.authority_auction_reveals_duration !== undefined) + if (this.has_authority_auction_reveals_duration) writer.writeMessage(8, this.authority_auction_reveals_duration, () => this.authority_auction_reveals_duration.serialize(writer)); - if (this.authority_auction_commit_fee !== undefined) + if (this.has_authority_auction_commit_fee) writer.writeMessage(9, this.authority_auction_commit_fee, () => this.authority_auction_commit_fee.serialize(writer)); - if (this.authority_auction_reveal_fee !== undefined) + if (this.has_authority_auction_reveal_fee) writer.writeMessage(10, this.authority_auction_reveal_fee, () => this.authority_auction_reveal_fee.serialize(writer)); - if (this.authority_auction_minimum_bid !== undefined) + if (this.has_authority_auction_minimum_bid) writer.writeMessage(11, this.authority_auction_minimum_bid, () => this.authority_auction_minimum_bid.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -308,6 +340,7 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class Record extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; bond_id?: string; @@ -315,11 +348,11 @@ export namespace vulcanize.nameservice.v1beta1 { expiry_time?: string; deleted?: boolean; owners?: string[]; - attributes?: string; + attributes?: dependency_3.google.protobuf.Any; names?: string[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6, 8], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6, 8], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -348,49 +381,52 @@ export namespace vulcanize.nameservice.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } get bond_id() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set bond_id(value: string) { pb_1.Message.setField(this, 2, value); } get create_time() { - return pb_1.Message.getField(this, 3) as string; + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set create_time(value: string) { pb_1.Message.setField(this, 3, value); } get expiry_time() { - return pb_1.Message.getField(this, 4) as string; + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; } set expiry_time(value: string) { pb_1.Message.setField(this, 4, value); } get deleted() { - return pb_1.Message.getField(this, 5) as boolean; + return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean; } set deleted(value: boolean) { pb_1.Message.setField(this, 5, value); } get owners() { - return pb_1.Message.getField(this, 6) as string[]; + return pb_1.Message.getFieldWithDefault(this, 6, []) as string[]; } set owners(value: string[]) { pb_1.Message.setField(this, 6, value); } get attributes() { - return pb_1.Message.getField(this, 7) as string; + return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Any, 7) as dependency_3.google.protobuf.Any; } - set attributes(value: string) { - pb_1.Message.setField(this, 7, value); + set attributes(value: dependency_3.google.protobuf.Any) { + pb_1.Message.setWrapperField(this, 7, value); + } + get has_attributes() { + return pb_1.Message.getField(this, 7) != null; } get names() { - return pb_1.Message.getField(this, 8) as string[]; + return pb_1.Message.getFieldWithDefault(this, 8, []) as string[]; } set names(value: string[]) { pb_1.Message.setField(this, 8, value); @@ -402,9 +438,9 @@ export namespace vulcanize.nameservice.v1beta1 { expiry_time?: string; deleted?: boolean; owners?: string[]; - attributes?: string; + attributes?: ReturnType; names?: string[]; - }) { + }): Record { const message = new Record({}); if (data.id != null) { message.id = data.id; @@ -425,7 +461,7 @@ export namespace vulcanize.nameservice.v1beta1 { message.owners = data.owners; } if (data.attributes != null) { - message.attributes = data.attributes; + message.attributes = dependency_3.google.protobuf.Any.fromObject(data.attributes); } if (data.names != null) { message.names = data.names; @@ -440,7 +476,7 @@ export namespace vulcanize.nameservice.v1beta1 { expiry_time?: string; deleted?: boolean; owners?: string[]; - attributes?: string; + attributes?: ReturnType; names?: string[]; } = {}; if (this.id != null) { @@ -462,7 +498,7 @@ export namespace vulcanize.nameservice.v1beta1 { data.owners = this.owners; } if (this.attributes != null) { - data.attributes = this.attributes; + data.attributes = this.attributes.toObject(); } if (this.names != null) { data.names = this.names; @@ -473,21 +509,21 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); - if (typeof this.bond_id === "string" && this.bond_id.length) + if (this.bond_id.length) writer.writeString(2, this.bond_id); - if (typeof this.create_time === "string" && this.create_time.length) + if (this.create_time.length) writer.writeString(3, this.create_time); - if (typeof this.expiry_time === "string" && this.expiry_time.length) + if (this.expiry_time.length) writer.writeString(4, this.expiry_time); - if (this.deleted !== undefined) + if (this.deleted != false) writer.writeBool(5, this.deleted); - if (this.owners !== undefined) + if (this.owners.length) writer.writeRepeatedString(6, this.owners); - if (typeof this.attributes === "string" && this.attributes.length) - writer.writeString(7, this.attributes); - if (this.names !== undefined) + if (this.has_attributes) + writer.writeMessage(7, this.attributes, () => this.attributes.serialize(writer)); + if (this.names.length) writer.writeRepeatedString(8, this.names); if (!w) return writer.getResultBuffer(); @@ -517,7 +553,7 @@ export namespace vulcanize.nameservice.v1beta1 { pb_1.Message.addToRepeatedField(message, 6, reader.readString()); break; case 7: - message.attributes = reader.readString(); + reader.readMessage(message.attributes, () => message.attributes = dependency_3.google.protobuf.Any.deserialize(reader)); break; case 8: pb_1.Message.addToRepeatedField(message, 8, reader.readString()); @@ -535,12 +571,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class AuthorityEntry extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name?: string; entry?: NameAuthority; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; @@ -551,7 +588,7 @@ export namespace vulcanize.nameservice.v1beta1 { } } get name() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set name(value: string) { pb_1.Message.setField(this, 1, value); @@ -562,10 +599,13 @@ export namespace vulcanize.nameservice.v1beta1 { set entry(value: NameAuthority) { pb_1.Message.setWrapperField(this, 2, value); } + get has_entry() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { name?: string; entry?: ReturnType; - }) { + }): AuthorityEntry { const message = new AuthorityEntry({}); if (data.name != null) { message.name = data.name; @@ -592,9 +632,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.name === "string" && this.name.length) + if (this.name.length) writer.writeString(1, this.name); - if (this.entry !== undefined) + if (this.has_entry) writer.writeMessage(2, this.entry, () => this.entry.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -624,6 +664,7 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class NameAuthority extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { owner_public_key?: string; owner_address?: string; @@ -634,7 +675,7 @@ export namespace vulcanize.nameservice.v1beta1 { expiry_time?: dependency_2.google.protobuf.Timestamp; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("owner_public_key" in data && data.owner_public_key != undefined) { this.owner_public_key = data.owner_public_key; @@ -660,37 +701,37 @@ export namespace vulcanize.nameservice.v1beta1 { } } get owner_public_key() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set owner_public_key(value: string) { pb_1.Message.setField(this, 1, value); } get owner_address() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set owner_address(value: string) { pb_1.Message.setField(this, 2, value); } get height() { - return pb_1.Message.getField(this, 3) as number; + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; } set height(value: number) { pb_1.Message.setField(this, 3, value); } get status() { - return pb_1.Message.getField(this, 4) as string; + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; } set status(value: string) { pb_1.Message.setField(this, 4, value); } get auction_id() { - return pb_1.Message.getField(this, 5) as string; + return pb_1.Message.getFieldWithDefault(this, 5, "") as string; } set auction_id(value: string) { pb_1.Message.setField(this, 5, value); } get bond_id() { - return pb_1.Message.getField(this, 6) as string; + return pb_1.Message.getFieldWithDefault(this, 6, "") as string; } set bond_id(value: string) { pb_1.Message.setField(this, 6, value); @@ -701,6 +742,9 @@ export namespace vulcanize.nameservice.v1beta1 { set expiry_time(value: dependency_2.google.protobuf.Timestamp) { pb_1.Message.setWrapperField(this, 7, value); } + get has_expiry_time() { + return pb_1.Message.getField(this, 7) != null; + } static fromObject(data: { owner_public_key?: string; owner_address?: string; @@ -709,7 +753,7 @@ export namespace vulcanize.nameservice.v1beta1 { auction_id?: string; bond_id?: string; expiry_time?: ReturnType; - }) { + }): NameAuthority { const message = new NameAuthority({}); if (data.owner_public_key != null) { message.owner_public_key = data.owner_public_key; @@ -771,19 +815,19 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.owner_public_key === "string" && this.owner_public_key.length) + if (this.owner_public_key.length) writer.writeString(1, this.owner_public_key); - if (typeof this.owner_address === "string" && this.owner_address.length) + if (this.owner_address.length) writer.writeString(2, this.owner_address); - if (this.height !== undefined) + if (this.height != 0) writer.writeUint64(3, this.height); - if (typeof this.status === "string" && this.status.length) + if (this.status.length) writer.writeString(4, this.status); - if (typeof this.auction_id === "string" && this.auction_id.length) + if (this.auction_id.length) writer.writeString(5, this.auction_id); - if (typeof this.bond_id === "string" && this.bond_id.length) + if (this.bond_id.length) writer.writeString(6, this.bond_id); - if (this.expiry_time !== undefined) + if (this.has_expiry_time) writer.writeMessage(7, this.expiry_time, () => this.expiry_time.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -828,12 +872,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class NameEntry extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name?: string; entry?: NameRecord; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; @@ -844,7 +889,7 @@ export namespace vulcanize.nameservice.v1beta1 { } } get name() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set name(value: string) { pb_1.Message.setField(this, 1, value); @@ -855,10 +900,13 @@ export namespace vulcanize.nameservice.v1beta1 { set entry(value: NameRecord) { pb_1.Message.setWrapperField(this, 2, value); } + get has_entry() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { name?: string; entry?: ReturnType; - }) { + }): NameEntry { const message = new NameEntry({}); if (data.name != null) { message.name = data.name; @@ -885,9 +933,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.name === "string" && this.name.length) + if (this.name.length) writer.writeString(1, this.name); - if (this.entry !== undefined) + if (this.has_entry) writer.writeMessage(2, this.entry, () => this.entry.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -917,12 +965,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class NameRecord extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { latest?: NameRecordEntry; history?: NameRecordEntry[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("latest" in data && data.latest != undefined) { this.latest = data.latest; @@ -938,6 +987,9 @@ export namespace vulcanize.nameservice.v1beta1 { set latest(value: NameRecordEntry) { pb_1.Message.setWrapperField(this, 1, value); } + get has_latest() { + return pb_1.Message.getField(this, 1) != null; + } get history() { return pb_1.Message.getRepeatedWrapperField(this, NameRecordEntry, 2) as NameRecordEntry[]; } @@ -947,7 +999,7 @@ export namespace vulcanize.nameservice.v1beta1 { static fromObject(data: { latest?: ReturnType; history?: ReturnType[]; - }) { + }): NameRecord { const message = new NameRecord({}); if (data.latest != null) { message.latest = NameRecordEntry.fromObject(data.latest); @@ -974,9 +1026,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.latest !== undefined) + if (this.has_latest) writer.writeMessage(1, this.latest, () => this.latest.serialize(writer)); - if (this.history !== undefined) + if (this.history.length) writer.writeRepeatedMessage(2, this.history, (item: NameRecordEntry) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -1006,12 +1058,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class NameRecordEntry extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; height?: number; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -1022,13 +1075,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } get height() { - return pb_1.Message.getField(this, 2) as number; + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; } set height(value: number) { pb_1.Message.setField(this, 2, value); @@ -1036,7 +1089,7 @@ export namespace vulcanize.nameservice.v1beta1 { static fromObject(data: { id?: string; height?: number; - }) { + }): NameRecordEntry { const message = new NameRecordEntry({}); if (data.id != null) { message.id = data.id; @@ -1063,9 +1116,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); - if (this.height !== undefined) + if (this.height != 0) writer.writeUint64(2, this.height); if (!w) return writer.getResultBuffer(); @@ -1095,12 +1148,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class Signature extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { sig?: string; pub_key?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("sig" in data && data.sig != undefined) { this.sig = data.sig; @@ -1111,13 +1165,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } get sig() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set sig(value: string) { pb_1.Message.setField(this, 1, value); } get pub_key() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set pub_key(value: string) { pb_1.Message.setField(this, 2, value); @@ -1125,7 +1179,7 @@ export namespace vulcanize.nameservice.v1beta1 { static fromObject(data: { sig?: string; pub_key?: string; - }) { + }): Signature { const message = new Signature({}); if (data.sig != null) { message.sig = data.sig; @@ -1152,9 +1206,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.sig === "string" && this.sig.length) + if (this.sig.length) writer.writeString(1, this.sig); - if (typeof this.pub_key === "string" && this.pub_key.length) + if (this.pub_key.length) writer.writeString(2, this.pub_key); if (!w) return writer.getResultBuffer(); @@ -1184,6 +1238,7 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class BlockChangeSet extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { height?: number; records?: string[]; @@ -1193,7 +1248,7 @@ export namespace vulcanize.nameservice.v1beta1 { names?: string[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("height" in data && data.height != undefined) { this.height = data.height; @@ -1216,19 +1271,19 @@ export namespace vulcanize.nameservice.v1beta1 { } } get height() { - return pb_1.Message.getField(this, 1) as number; + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; } set height(value: number) { pb_1.Message.setField(this, 1, value); } get records() { - return pb_1.Message.getField(this, 2) as string[]; + return pb_1.Message.getFieldWithDefault(this, 2, []) as string[]; } set records(value: string[]) { pb_1.Message.setField(this, 2, value); } get auctions() { - return pb_1.Message.getField(this, 3) as string[]; + return pb_1.Message.getFieldWithDefault(this, 3, []) as string[]; } set auctions(value: string[]) { pb_1.Message.setField(this, 3, value); @@ -1240,13 +1295,13 @@ export namespace vulcanize.nameservice.v1beta1 { pb_1.Message.setRepeatedWrapperField(this, 4, value); } get authorities() { - return pb_1.Message.getField(this, 5) as string[]; + return pb_1.Message.getFieldWithDefault(this, 5, []) as string[]; } set authorities(value: string[]) { pb_1.Message.setField(this, 5, value); } get names() { - return pb_1.Message.getField(this, 6) as string[]; + return pb_1.Message.getFieldWithDefault(this, 6, []) as string[]; } set names(value: string[]) { pb_1.Message.setField(this, 6, value); @@ -1258,7 +1313,7 @@ export namespace vulcanize.nameservice.v1beta1 { auction_bids?: ReturnType[]; authorities?: string[]; names?: string[]; - }) { + }): BlockChangeSet { const message = new BlockChangeSet({}); if (data.height != null) { message.height = data.height; @@ -1313,17 +1368,17 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.height !== undefined) + if (this.height != 0) writer.writeInt64(1, this.height); - if (this.records !== undefined) + if (this.records.length) writer.writeRepeatedString(2, this.records); - if (this.auctions !== undefined) + if (this.auctions.length) writer.writeRepeatedString(3, this.auctions); - if (this.auction_bids !== undefined) + if (this.auction_bids.length) writer.writeRepeatedMessage(4, this.auction_bids, (item: AuctionBidInfo) => item.serialize(writer)); - if (this.authorities !== undefined) + if (this.authorities.length) writer.writeRepeatedString(5, this.authorities); - if (this.names !== undefined) + if (this.names.length) writer.writeRepeatedString(6, this.names); if (!w) return writer.getResultBuffer(); @@ -1365,12 +1420,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class AuctionBidInfo extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { auction_id?: string; bidder_address?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("auction_id" in data && data.auction_id != undefined) { this.auction_id = data.auction_id; @@ -1381,13 +1437,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } get auction_id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set auction_id(value: string) { pb_1.Message.setField(this, 1, value); } get bidder_address() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set bidder_address(value: string) { pb_1.Message.setField(this, 2, value); @@ -1395,7 +1451,7 @@ export namespace vulcanize.nameservice.v1beta1 { static fromObject(data: { auction_id?: string; bidder_address?: string; - }) { + }): AuctionBidInfo { const message = new AuctionBidInfo({}); if (data.auction_id != null) { message.auction_id = data.auction_id; @@ -1422,9 +1478,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.auction_id === "string" && this.auction_id.length) + if (this.auction_id.length) writer.writeString(1, this.auction_id); - if (typeof this.bidder_address === "string" && this.bidder_address.length) + if (this.bidder_address.length) writer.writeString(2, this.bidder_address); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/vulcanize/nameservice/v1beta1/query.ts b/src/proto/vulcanize/nameservice/v1beta1/query.ts index fad3a03..9250d96 100644 --- a/src/proto/vulcanize/nameservice/v1beta1/query.ts +++ b/src/proto/vulcanize/nameservice/v1beta1/query.ts @@ -2,7 +2,7 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: vulcanize/nameservice/v1beta1/query.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./nameservice"; @@ -13,12 +13,13 @@ import * as dependency_5 from "./../../../cosmos/base/v1beta1/coin"; import * as pb_1 from "google-protobuf"; export namespace vulcanize.nameservice.v1beta1 { export class QueryParamsRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): QueryParamsRequest { const message = new QueryParamsRequest({}); return message; } @@ -52,11 +53,12 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryParamsResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { params?: dependency_1.vulcanize.nameservice.v1beta1.Params; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("params" in data && data.params != undefined) { this.params = data.params; @@ -69,9 +71,12 @@ export namespace vulcanize.nameservice.v1beta1 { set params(value: dependency_1.vulcanize.nameservice.v1beta1.Params) { pb_1.Message.setWrapperField(this, 1, value); } + get has_params() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { params?: ReturnType; - }) { + }): QueryParamsResponse { const message = new QueryParamsResponse({}); if (data.params != null) { message.params = dependency_1.vulcanize.nameservice.v1beta1.Params.fromObject(data.params); @@ -91,7 +96,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.params !== undefined) + if (this.has_params) writer.writeMessage(1, this.params, () => this.params.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -118,13 +123,14 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryListRecordsRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { attributes?: QueryListRecordsRequest.KeyValueInput[]; all?: boolean; pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("attributes" in data && data.attributes != undefined) { this.attributes = data.attributes; @@ -144,7 +150,7 @@ export namespace vulcanize.nameservice.v1beta1 { pb_1.Message.setRepeatedWrapperField(this, 1, value); } get all() { - return pb_1.Message.getField(this, 2) as boolean; + return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean; } set all(value: boolean) { pb_1.Message.setField(this, 2, value); @@ -155,11 +161,14 @@ export namespace vulcanize.nameservice.v1beta1 { set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { pb_1.Message.setWrapperField(this, 3, value); } + get has_pagination() { + return pb_1.Message.getField(this, 3) != null; + } static fromObject(data: { attributes?: ReturnType[]; all?: boolean; pagination?: ReturnType; - }) { + }): QueryListRecordsRequest { const message = new QueryListRecordsRequest({}); if (data.attributes != null) { message.attributes = data.attributes.map(item => QueryListRecordsRequest.KeyValueInput.fromObject(item)); @@ -193,11 +202,11 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.attributes !== undefined) + if (this.attributes.length) writer.writeRepeatedMessage(1, this.attributes, (item: QueryListRecordsRequest.KeyValueInput) => item.serialize(writer)); - if (this.all !== undefined) + if (this.all != false) writer.writeBool(2, this.all); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(3, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -231,11 +240,12 @@ export namespace vulcanize.nameservice.v1beta1 { } export namespace QueryListRecordsRequest { export class ReferenceInput extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -243,14 +253,14 @@ export namespace vulcanize.nameservice.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { id?: string; - }) { + }): ReferenceInput { const message = new ReferenceInput({}); if (data.id != null) { message.id = data.id; @@ -270,7 +280,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); if (!w) return writer.getResultBuffer(); @@ -297,6 +307,7 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class ValueInput extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { type?: string; string?: string; @@ -307,7 +318,7 @@ export namespace vulcanize.nameservice.v1beta1 { values?: QueryListRecordsRequest.ValueInput[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [7], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [7], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("type" in data && data.type != undefined) { this.type = data.type; @@ -333,31 +344,31 @@ export namespace vulcanize.nameservice.v1beta1 { } } get type() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set type(value: string) { pb_1.Message.setField(this, 1, value); } get string() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set string(value: string) { pb_1.Message.setField(this, 2, value); } get int() { - return pb_1.Message.getField(this, 3) as number; + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; } set int(value: number) { pb_1.Message.setField(this, 3, value); } get float() { - return pb_1.Message.getField(this, 4) as number; + return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; } set float(value: number) { pb_1.Message.setField(this, 4, value); } get boolean() { - return pb_1.Message.getField(this, 5) as boolean; + return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean; } set boolean(value: boolean) { pb_1.Message.setField(this, 5, value); @@ -368,6 +379,9 @@ export namespace vulcanize.nameservice.v1beta1 { set reference(value: QueryListRecordsRequest.ReferenceInput) { pb_1.Message.setWrapperField(this, 6, value); } + get has_reference() { + return pb_1.Message.getField(this, 6) != null; + } get values() { return pb_1.Message.getRepeatedWrapperField(this, QueryListRecordsRequest.ValueInput, 7) as QueryListRecordsRequest.ValueInput[]; } @@ -382,7 +396,7 @@ export namespace vulcanize.nameservice.v1beta1 { boolean?: boolean; reference?: ReturnType; values?: ReturnType[]; - }) { + }): ValueInput { const message = new ValueInput({}); if (data.type != null) { message.type = data.type; @@ -444,19 +458,19 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.type === "string" && this.type.length) + if (this.type.length) writer.writeString(1, this.type); - if (typeof this.string === "string" && this.string.length) + if (this.string.length) writer.writeString(2, this.string); - if (this.int !== undefined) + if (this.int != 0) writer.writeInt64(3, this.int); - if (this.float !== undefined) + if (this.float != 0) writer.writeDouble(4, this.float); - if (this.boolean !== undefined) + if (this.boolean != false) writer.writeBool(5, this.boolean); - if (this.reference !== undefined) + if (this.has_reference) writer.writeMessage(6, this.reference, () => this.reference.serialize(writer)); - if (this.values !== undefined) + if (this.values.length) writer.writeRepeatedMessage(7, this.values, (item: QueryListRecordsRequest.ValueInput) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -501,12 +515,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class KeyValueInput extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { key?: string; value?: QueryListRecordsRequest.ValueInput; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("key" in data && data.key != undefined) { this.key = data.key; @@ -517,7 +532,7 @@ export namespace vulcanize.nameservice.v1beta1 { } } get key() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set key(value: string) { pb_1.Message.setField(this, 1, value); @@ -528,10 +543,13 @@ export namespace vulcanize.nameservice.v1beta1 { set value(value: QueryListRecordsRequest.ValueInput) { pb_1.Message.setWrapperField(this, 2, value); } + get has_value() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { key?: string; value?: ReturnType; - }) { + }): KeyValueInput { const message = new KeyValueInput({}); if (data.key != null) { message.key = data.key; @@ -558,9 +576,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.key === "string" && this.key.length) + if (this.key.length) writer.writeString(1, this.key); - if (this.value !== undefined) + if (this.has_value) writer.writeMessage(2, this.value, () => this.value.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -591,12 +609,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryListRecordsResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { records?: dependency_1.vulcanize.nameservice.v1beta1.Record[]; pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("records" in data && data.records != undefined) { this.records = data.records; @@ -618,10 +637,13 @@ export namespace vulcanize.nameservice.v1beta1 { set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse) { pb_1.Message.setWrapperField(this, 2, value); } + get has_pagination() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { records?: ReturnType[]; pagination?: ReturnType; - }) { + }): QueryListRecordsResponse { const message = new QueryListRecordsResponse({}); if (data.records != null) { message.records = data.records.map(item => dependency_1.vulcanize.nameservice.v1beta1.Record.fromObject(item)); @@ -648,9 +670,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.records !== undefined) + if (this.records.length) writer.writeRepeatedMessage(1, this.records, (item: dependency_1.vulcanize.nameservice.v1beta1.Record) => item.serialize(writer)); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -680,11 +702,12 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryRecordByIdRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -692,14 +715,14 @@ export namespace vulcanize.nameservice.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { id?: string; - }) { + }): QueryRecordByIdRequest { const message = new QueryRecordByIdRequest({}); if (data.id != null) { message.id = data.id; @@ -719,7 +742,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); if (!w) return writer.getResultBuffer(); @@ -746,11 +769,12 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryRecordByIdResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { record?: dependency_1.vulcanize.nameservice.v1beta1.Record; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("record" in data && data.record != undefined) { this.record = data.record; @@ -763,9 +787,12 @@ export namespace vulcanize.nameservice.v1beta1 { set record(value: dependency_1.vulcanize.nameservice.v1beta1.Record) { pb_1.Message.setWrapperField(this, 1, value); } + get has_record() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { record?: ReturnType; - }) { + }): QueryRecordByIdResponse { const message = new QueryRecordByIdResponse({}); if (data.record != null) { message.record = dependency_1.vulcanize.nameservice.v1beta1.Record.fromObject(data.record); @@ -785,7 +812,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.record !== undefined) + if (this.has_record) writer.writeMessage(1, this.record, () => this.record.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -812,12 +839,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryRecordByBondIdRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -828,7 +856,7 @@ export namespace vulcanize.nameservice.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); @@ -839,10 +867,13 @@ export namespace vulcanize.nameservice.v1beta1 { set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { pb_1.Message.setWrapperField(this, 2, value); } + get has_pagination() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { id?: string; pagination?: ReturnType; - }) { + }): QueryRecordByBondIdRequest { const message = new QueryRecordByBondIdRequest({}); if (data.id != null) { message.id = data.id; @@ -869,9 +900,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -901,12 +932,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryRecordByBondIdResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { records?: dependency_1.vulcanize.nameservice.v1beta1.Record[]; pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("records" in data && data.records != undefined) { this.records = data.records; @@ -928,10 +960,13 @@ export namespace vulcanize.nameservice.v1beta1 { set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse) { pb_1.Message.setWrapperField(this, 2, value); } + get has_pagination() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { records?: ReturnType[]; pagination?: ReturnType; - }) { + }): QueryRecordByBondIdResponse { const message = new QueryRecordByBondIdResponse({}); if (data.records != null) { message.records = data.records.map(item => dependency_1.vulcanize.nameservice.v1beta1.Record.fromObject(item)); @@ -958,9 +993,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.records !== undefined) + if (this.records.length) writer.writeRepeatedMessage(1, this.records, (item: dependency_1.vulcanize.nameservice.v1beta1.Record) => item.serialize(writer)); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -990,12 +1025,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class GetNameServiceModuleBalanceRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): GetNameServiceModuleBalanceRequest { const message = new GetNameServiceModuleBalanceRequest({}); return message; } @@ -1029,11 +1065,12 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class GetNameServiceModuleBalanceResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { balances?: AccountBalance[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("balances" in data && data.balances != undefined) { this.balances = data.balances; @@ -1048,7 +1085,7 @@ export namespace vulcanize.nameservice.v1beta1 { } static fromObject(data: { balances?: ReturnType[]; - }) { + }): GetNameServiceModuleBalanceResponse { const message = new GetNameServiceModuleBalanceResponse({}); if (data.balances != null) { message.balances = data.balances.map(item => AccountBalance.fromObject(item)); @@ -1068,7 +1105,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.balances !== undefined) + if (this.balances.length) writer.writeRepeatedMessage(1, this.balances, (item: AccountBalance) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -1095,12 +1132,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class AccountBalance extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { account_name?: string; balance?: dependency_5.cosmos.base.v1beta1.Coin[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("account_name" in data && data.account_name != undefined) { this.account_name = data.account_name; @@ -1111,7 +1149,7 @@ export namespace vulcanize.nameservice.v1beta1 { } } get account_name() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set account_name(value: string) { pb_1.Message.setField(this, 1, value); @@ -1125,7 +1163,7 @@ export namespace vulcanize.nameservice.v1beta1 { static fromObject(data: { account_name?: string; balance?: ReturnType[]; - }) { + }): AccountBalance { const message = new AccountBalance({}); if (data.account_name != null) { message.account_name = data.account_name; @@ -1152,9 +1190,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.account_name === "string" && this.account_name.length) + if (this.account_name.length) writer.writeString(1, this.account_name); - if (this.balance !== undefined) + if (this.balance.length) writer.writeRepeatedMessage(3, this.balance, (item: dependency_5.cosmos.base.v1beta1.Coin) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -1184,11 +1222,12 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryListNameRecordsRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("pagination" in data && data.pagination != undefined) { this.pagination = data.pagination; @@ -1201,9 +1240,12 @@ export namespace vulcanize.nameservice.v1beta1 { set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { pb_1.Message.setWrapperField(this, 1, value); } + get has_pagination() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { pagination?: ReturnType; - }) { + }): QueryListNameRecordsRequest { const message = new QueryListNameRecordsRequest({}); if (data.pagination != null) { message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); @@ -1223,7 +1265,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -1250,12 +1292,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryListNameRecordsResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { names?: dependency_1.vulcanize.nameservice.v1beta1.NameEntry[]; pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("names" in data && data.names != undefined) { this.names = data.names; @@ -1277,10 +1320,13 @@ export namespace vulcanize.nameservice.v1beta1 { set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse) { pb_1.Message.setWrapperField(this, 2, value); } + get has_pagination() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { names?: ReturnType[]; pagination?: ReturnType; - }) { + }): QueryListNameRecordsResponse { const message = new QueryListNameRecordsResponse({}); if (data.names != null) { message.names = data.names.map(item => dependency_1.vulcanize.nameservice.v1beta1.NameEntry.fromObject(item)); @@ -1307,9 +1353,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.names !== undefined) + if (this.names.length) writer.writeRepeatedMessage(1, this.names, (item: dependency_1.vulcanize.nameservice.v1beta1.NameEntry) => item.serialize(writer)); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -1339,11 +1385,12 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryWhoisRequest extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; @@ -1351,14 +1398,14 @@ export namespace vulcanize.nameservice.v1beta1 { } } get name() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set name(value: string) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { name?: string; - }) { + }): QueryWhoisRequest { const message = new QueryWhoisRequest({}); if (data.name != null) { message.name = data.name; @@ -1378,7 +1425,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.name === "string" && this.name.length) + if (this.name.length) writer.writeString(1, this.name); if (!w) return writer.getResultBuffer(); @@ -1405,11 +1452,12 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryWhoisResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name_authority?: dependency_1.vulcanize.nameservice.v1beta1.NameAuthority; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name_authority" in data && data.name_authority != undefined) { this.name_authority = data.name_authority; @@ -1422,9 +1470,12 @@ export namespace vulcanize.nameservice.v1beta1 { set name_authority(value: dependency_1.vulcanize.nameservice.v1beta1.NameAuthority) { pb_1.Message.setWrapperField(this, 1, value); } + get has_name_authority() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { name_authority?: ReturnType; - }) { + }): QueryWhoisResponse { const message = new QueryWhoisResponse({}); if (data.name_authority != null) { message.name_authority = dependency_1.vulcanize.nameservice.v1beta1.NameAuthority.fromObject(data.name_authority); @@ -1444,7 +1495,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.name_authority !== undefined) + if (this.has_name_authority) writer.writeMessage(1, this.name_authority, () => this.name_authority.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -1471,11 +1522,12 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryLookupCrn extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { crn?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("crn" in data && data.crn != undefined) { this.crn = data.crn; @@ -1483,14 +1535,14 @@ export namespace vulcanize.nameservice.v1beta1 { } } get crn() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set crn(value: string) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { crn?: string; - }) { + }): QueryLookupCrn { const message = new QueryLookupCrn({}); if (data.crn != null) { message.crn = data.crn; @@ -1510,7 +1562,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.crn === "string" && this.crn.length) + if (this.crn.length) writer.writeString(1, this.crn); if (!w) return writer.getResultBuffer(); @@ -1537,11 +1589,12 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryLookupCrnResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name?: dependency_1.vulcanize.nameservice.v1beta1.NameRecord; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; @@ -1554,9 +1607,12 @@ export namespace vulcanize.nameservice.v1beta1 { set name(value: dependency_1.vulcanize.nameservice.v1beta1.NameRecord) { pb_1.Message.setWrapperField(this, 1, value); } + get has_name() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { name?: ReturnType; - }) { + }): QueryLookupCrnResponse { const message = new QueryLookupCrnResponse({}); if (data.name != null) { message.name = dependency_1.vulcanize.nameservice.v1beta1.NameRecord.fromObject(data.name); @@ -1576,7 +1632,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.name !== undefined) + if (this.has_name) writer.writeMessage(1, this.name, () => this.name.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -1603,11 +1659,12 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryResolveCrn extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { crn?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("crn" in data && data.crn != undefined) { this.crn = data.crn; @@ -1615,14 +1672,14 @@ export namespace vulcanize.nameservice.v1beta1 { } } get crn() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set crn(value: string) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { crn?: string; - }) { + }): QueryResolveCrn { const message = new QueryResolveCrn({}); if (data.crn != null) { message.crn = data.crn; @@ -1642,7 +1699,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.crn === "string" && this.crn.length) + if (this.crn.length) writer.writeString(1, this.crn); if (!w) return writer.getResultBuffer(); @@ -1669,11 +1726,12 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryResolveCrnResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { record?: dependency_1.vulcanize.nameservice.v1beta1.Record; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("record" in data && data.record != undefined) { this.record = data.record; @@ -1686,9 +1744,12 @@ export namespace vulcanize.nameservice.v1beta1 { set record(value: dependency_1.vulcanize.nameservice.v1beta1.Record) { pb_1.Message.setWrapperField(this, 1, value); } + get has_record() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { record?: ReturnType; - }) { + }): QueryResolveCrnResponse { const message = new QueryResolveCrnResponse({}); if (data.record != null) { message.record = dependency_1.vulcanize.nameservice.v1beta1.Record.fromObject(data.record); @@ -1708,7 +1769,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.record !== undefined) + if (this.has_record) writer.writeMessage(1, this.record, () => this.record.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -1735,11 +1796,12 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryGetRecordExpiryQueue extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("pagination" in data && data.pagination != undefined) { this.pagination = data.pagination; @@ -1752,9 +1814,12 @@ export namespace vulcanize.nameservice.v1beta1 { set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { pb_1.Message.setWrapperField(this, 1, value); } + get has_pagination() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { pagination?: ReturnType; - }) { + }): QueryGetRecordExpiryQueue { const message = new QueryGetRecordExpiryQueue({}); if (data.pagination != null) { message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); @@ -1774,7 +1839,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -1801,12 +1866,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryGetRecordExpiryQueueResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { records?: ExpiryQueueRecord[]; pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("records" in data && data.records != undefined) { this.records = data.records; @@ -1828,10 +1894,13 @@ export namespace vulcanize.nameservice.v1beta1 { set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse) { pb_1.Message.setWrapperField(this, 2, value); } + get has_pagination() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { records?: ReturnType[]; pagination?: ReturnType; - }) { + }): QueryGetRecordExpiryQueueResponse { const message = new QueryGetRecordExpiryQueueResponse({}); if (data.records != null) { message.records = data.records.map(item => ExpiryQueueRecord.fromObject(item)); @@ -1858,9 +1927,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.records !== undefined) + if (this.records.length) writer.writeRepeatedMessage(1, this.records, (item: ExpiryQueueRecord) => item.serialize(writer)); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -1890,12 +1959,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class ExpiryQueueRecord extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; value?: string[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -1906,13 +1976,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } get value() { - return pb_1.Message.getField(this, 2) as string[]; + return pb_1.Message.getFieldWithDefault(this, 2, []) as string[]; } set value(value: string[]) { pb_1.Message.setField(this, 2, value); @@ -1920,7 +1990,7 @@ export namespace vulcanize.nameservice.v1beta1 { static fromObject(data: { id?: string; value?: string[]; - }) { + }): ExpiryQueueRecord { const message = new ExpiryQueueRecord({}); if (data.id != null) { message.id = data.id; @@ -1947,9 +2017,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); - if (this.value !== undefined) + if (this.value.length) writer.writeRepeatedString(2, this.value); if (!w) return writer.getResultBuffer(); @@ -1979,11 +2049,12 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryGetAuthorityExpiryQueue extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("pagination" in data && data.pagination != undefined) { this.pagination = data.pagination; @@ -1996,9 +2067,12 @@ export namespace vulcanize.nameservice.v1beta1 { set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { pb_1.Message.setWrapperField(this, 1, value); } + get has_pagination() { + return pb_1.Message.getField(this, 1) != null; + } static fromObject(data: { pagination?: ReturnType; - }) { + }): QueryGetAuthorityExpiryQueue { const message = new QueryGetAuthorityExpiryQueue({}); if (data.pagination != null) { message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); @@ -2018,7 +2092,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -2045,12 +2119,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class QueryGetAuthorityExpiryQueueResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { authorities?: ExpiryQueueRecord[]; pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("authorities" in data && data.authorities != undefined) { this.authorities = data.authorities; @@ -2072,10 +2147,13 @@ export namespace vulcanize.nameservice.v1beta1 { set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageResponse) { pb_1.Message.setWrapperField(this, 2, value); } + get has_pagination() { + return pb_1.Message.getField(this, 2) != null; + } static fromObject(data: { authorities?: ReturnType[]; pagination?: ReturnType; - }) { + }): QueryGetAuthorityExpiryQueueResponse { const message = new QueryGetAuthorityExpiryQueueResponse({}); if (data.authorities != null) { message.authorities = data.authorities.map(item => ExpiryQueueRecord.fromObject(item)); @@ -2102,9 +2180,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.authorities !== undefined) + if (this.authorities.length) writer.writeRepeatedMessage(1, this.authorities, (item: ExpiryQueueRecord) => item.serialize(writer)); - if (this.pagination !== undefined) + if (this.has_pagination) writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); diff --git a/src/proto/vulcanize/nameservice/v1beta1/tx.ts b/src/proto/vulcanize/nameservice/v1beta1/tx.ts index ce4ad77..872cbac 100644 --- a/src/proto/vulcanize/nameservice/v1beta1/tx.ts +++ b/src/proto/vulcanize/nameservice/v1beta1/tx.ts @@ -2,7 +2,7 @@ /* eslint-disable */ /** * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 3.14.0 + * compiler version: 3.12.4 * source: vulcanize/nameservice/v1beta1/tx.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../gogoproto/gogo"; @@ -10,13 +10,14 @@ import * as dependency_2 from "./nameservice"; import * as pb_1 from "google-protobuf"; export namespace vulcanize.nameservice.v1beta1 { export class MsgSetRecord extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { bond_id?: string; signer?: string; payload?: Payload; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("bond_id" in data && data.bond_id != undefined) { this.bond_id = data.bond_id; @@ -30,13 +31,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } get bond_id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set bond_id(value: string) { pb_1.Message.setField(this, 1, value); } get signer() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 2, value); @@ -47,11 +48,14 @@ export namespace vulcanize.nameservice.v1beta1 { set payload(value: Payload) { pb_1.Message.setWrapperField(this, 3, value); } + get has_payload() { + return pb_1.Message.getField(this, 3) != null; + } static fromObject(data: { bond_id?: string; signer?: string; payload?: ReturnType; - }) { + }): MsgSetRecord { const message = new MsgSetRecord({}); if (data.bond_id != null) { message.bond_id = data.bond_id; @@ -85,11 +89,11 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.bond_id === "string" && this.bond_id.length) + if (this.bond_id.length) writer.writeString(1, this.bond_id); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(2, this.signer); - if (this.payload !== undefined) + if (this.has_payload) writer.writeMessage(3, this.payload, () => this.payload.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -122,11 +126,12 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgSetRecordResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("id" in data && data.id != undefined) { this.id = data.id; @@ -134,14 +139,14 @@ export namespace vulcanize.nameservice.v1beta1 { } } get id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set id(value: string) { pb_1.Message.setField(this, 1, value); } static fromObject(data: { id?: string; - }) { + }): MsgSetRecordResponse { const message = new MsgSetRecordResponse({}); if (data.id != null) { message.id = data.id; @@ -161,7 +166,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.id === "string" && this.id.length) + if (this.id.length) writer.writeString(1, this.id); if (!w) return writer.getResultBuffer(); @@ -188,12 +193,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class Payload extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { record?: dependency_2.vulcanize.nameservice.v1beta1.Record; signatures?: dependency_2.vulcanize.nameservice.v1beta1.Signature[]; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("record" in data && data.record != undefined) { this.record = data.record; @@ -209,6 +215,9 @@ export namespace vulcanize.nameservice.v1beta1 { set record(value: dependency_2.vulcanize.nameservice.v1beta1.Record) { pb_1.Message.setWrapperField(this, 1, value); } + get has_record() { + return pb_1.Message.getField(this, 1) != null; + } get signatures() { return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Signature, 2) as dependency_2.vulcanize.nameservice.v1beta1.Signature[]; } @@ -218,7 +227,7 @@ export namespace vulcanize.nameservice.v1beta1 { static fromObject(data: { record?: ReturnType; signatures?: ReturnType[]; - }) { + }): Payload { const message = new Payload({}); if (data.record != null) { message.record = dependency_2.vulcanize.nameservice.v1beta1.Record.fromObject(data.record); @@ -245,9 +254,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (this.record !== undefined) + if (this.has_record) writer.writeMessage(1, this.record, () => this.record.serialize(writer)); - if (this.signatures !== undefined) + if (this.signatures.length) writer.writeRepeatedMessage(2, this.signatures, (item: dependency_2.vulcanize.nameservice.v1beta1.Signature) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); @@ -277,13 +286,14 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgSetName extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { crn?: string; cid?: string; signer?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("crn" in data && data.crn != undefined) { this.crn = data.crn; @@ -297,19 +307,19 @@ export namespace vulcanize.nameservice.v1beta1 { } } get crn() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set crn(value: string) { pb_1.Message.setField(this, 1, value); } get cid() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set cid(value: string) { pb_1.Message.setField(this, 2, value); } get signer() { - return pb_1.Message.getField(this, 3) as string; + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 3, value); @@ -318,7 +328,7 @@ export namespace vulcanize.nameservice.v1beta1 { crn?: string; cid?: string; signer?: string; - }) { + }): MsgSetName { const message = new MsgSetName({}); if (data.crn != null) { message.crn = data.crn; @@ -352,11 +362,11 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.crn === "string" && this.crn.length) + if (this.crn.length) writer.writeString(1, this.crn); - if (typeof this.cid === "string" && this.cid.length) + if (this.cid.length) writer.writeString(2, this.cid); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(3, this.signer); if (!w) return writer.getResultBuffer(); @@ -389,12 +399,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgSetNameResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): MsgSetNameResponse { const message = new MsgSetNameResponse({}); return message; } @@ -428,13 +439,14 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgReserveAuthority extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name?: string; signer?: string; owner?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; @@ -448,19 +460,19 @@ export namespace vulcanize.nameservice.v1beta1 { } } get name() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set name(value: string) { pb_1.Message.setField(this, 1, value); } get signer() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 2, value); } get owner() { - return pb_1.Message.getField(this, 3) as string; + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set owner(value: string) { pb_1.Message.setField(this, 3, value); @@ -469,7 +481,7 @@ export namespace vulcanize.nameservice.v1beta1 { name?: string; signer?: string; owner?: string; - }) { + }): MsgReserveAuthority { const message = new MsgReserveAuthority({}); if (data.name != null) { message.name = data.name; @@ -503,11 +515,11 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.name === "string" && this.name.length) + if (this.name.length) writer.writeString(1, this.name); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(2, this.signer); - if (typeof this.owner === "string" && this.owner.length) + if (this.owner.length) writer.writeString(3, this.owner); if (!w) return writer.getResultBuffer(); @@ -540,12 +552,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgReserveAuthorityResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): MsgReserveAuthorityResponse { const message = new MsgReserveAuthorityResponse({}); return message; } @@ -579,13 +592,14 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgSetAuthorityBond extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { name?: string; bond_id?: string; signer?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("name" in data && data.name != undefined) { this.name = data.name; @@ -599,19 +613,19 @@ export namespace vulcanize.nameservice.v1beta1 { } } get name() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set name(value: string) { pb_1.Message.setField(this, 1, value); } get bond_id() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set bond_id(value: string) { pb_1.Message.setField(this, 2, value); } get signer() { - return pb_1.Message.getField(this, 3) as string; + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 3, value); @@ -620,7 +634,7 @@ export namespace vulcanize.nameservice.v1beta1 { name?: string; bond_id?: string; signer?: string; - }) { + }): MsgSetAuthorityBond { const message = new MsgSetAuthorityBond({}); if (data.name != null) { message.name = data.name; @@ -654,11 +668,11 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.name === "string" && this.name.length) + if (this.name.length) writer.writeString(1, this.name); - if (typeof this.bond_id === "string" && this.bond_id.length) + if (this.bond_id.length) writer.writeString(2, this.bond_id); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(3, this.signer); if (!w) return writer.getResultBuffer(); @@ -691,12 +705,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgSetAuthorityBondResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): MsgSetAuthorityBondResponse { const message = new MsgSetAuthorityBondResponse({}); return message; } @@ -730,12 +745,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgDeleteNameAuthority extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { crn?: string; signer?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("crn" in data && data.crn != undefined) { this.crn = data.crn; @@ -746,13 +762,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } get crn() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set crn(value: string) { pb_1.Message.setField(this, 1, value); } get signer() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 2, value); @@ -760,7 +776,7 @@ export namespace vulcanize.nameservice.v1beta1 { static fromObject(data: { crn?: string; signer?: string; - }) { + }): MsgDeleteNameAuthority { const message = new MsgDeleteNameAuthority({}); if (data.crn != null) { message.crn = data.crn; @@ -787,9 +803,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.crn === "string" && this.crn.length) + if (this.crn.length) writer.writeString(1, this.crn); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(2, this.signer); if (!w) return writer.getResultBuffer(); @@ -819,12 +835,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgDeleteNameAuthorityResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): MsgDeleteNameAuthorityResponse { const message = new MsgDeleteNameAuthorityResponse({}); return message; } @@ -858,12 +875,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgRenewRecord extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { record_id?: string; signer?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("record_id" in data && data.record_id != undefined) { this.record_id = data.record_id; @@ -874,13 +892,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } get record_id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set record_id(value: string) { pb_1.Message.setField(this, 1, value); } get signer() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 2, value); @@ -888,7 +906,7 @@ export namespace vulcanize.nameservice.v1beta1 { static fromObject(data: { record_id?: string; signer?: string; - }) { + }): MsgRenewRecord { const message = new MsgRenewRecord({}); if (data.record_id != null) { message.record_id = data.record_id; @@ -915,9 +933,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.record_id === "string" && this.record_id.length) + if (this.record_id.length) writer.writeString(1, this.record_id); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(2, this.signer); if (!w) return writer.getResultBuffer(); @@ -947,12 +965,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgRenewRecordResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): MsgRenewRecordResponse { const message = new MsgRenewRecordResponse({}); return message; } @@ -986,13 +1005,14 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgAssociateBond extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { record_id?: string; bond_id?: string; signer?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("record_id" in data && data.record_id != undefined) { this.record_id = data.record_id; @@ -1006,19 +1026,19 @@ export namespace vulcanize.nameservice.v1beta1 { } } get record_id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set record_id(value: string) { pb_1.Message.setField(this, 1, value); } get bond_id() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set bond_id(value: string) { pb_1.Message.setField(this, 2, value); } get signer() { - return pb_1.Message.getField(this, 3) as string; + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 3, value); @@ -1027,7 +1047,7 @@ export namespace vulcanize.nameservice.v1beta1 { record_id?: string; bond_id?: string; signer?: string; - }) { + }): MsgAssociateBond { const message = new MsgAssociateBond({}); if (data.record_id != null) { message.record_id = data.record_id; @@ -1061,11 +1081,11 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.record_id === "string" && this.record_id.length) + if (this.record_id.length) writer.writeString(1, this.record_id); - if (typeof this.bond_id === "string" && this.bond_id.length) + if (this.bond_id.length) writer.writeString(2, this.bond_id); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(3, this.signer); if (!w) return writer.getResultBuffer(); @@ -1098,12 +1118,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgAssociateBondResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): MsgAssociateBondResponse { const message = new MsgAssociateBondResponse({}); return message; } @@ -1137,12 +1158,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgDissociateBond extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { record_id?: string; signer?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("record_id" in data && data.record_id != undefined) { this.record_id = data.record_id; @@ -1153,13 +1175,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } get record_id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set record_id(value: string) { pb_1.Message.setField(this, 1, value); } get signer() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 2, value); @@ -1167,7 +1189,7 @@ export namespace vulcanize.nameservice.v1beta1 { static fromObject(data: { record_id?: string; signer?: string; - }) { + }): MsgDissociateBond { const message = new MsgDissociateBond({}); if (data.record_id != null) { message.record_id = data.record_id; @@ -1194,9 +1216,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.record_id === "string" && this.record_id.length) + if (this.record_id.length) writer.writeString(1, this.record_id); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(2, this.signer); if (!w) return writer.getResultBuffer(); @@ -1226,12 +1248,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgDissociateBondResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): MsgDissociateBondResponse { const message = new MsgDissociateBondResponse({}); return message; } @@ -1265,12 +1288,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgDissociateRecords extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { bond_id?: string; signer?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("bond_id" in data && data.bond_id != undefined) { this.bond_id = data.bond_id; @@ -1281,13 +1305,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } get bond_id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set bond_id(value: string) { pb_1.Message.setField(this, 1, value); } get signer() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 2, value); @@ -1295,7 +1319,7 @@ export namespace vulcanize.nameservice.v1beta1 { static fromObject(data: { bond_id?: string; signer?: string; - }) { + }): MsgDissociateRecords { const message = new MsgDissociateRecords({}); if (data.bond_id != null) { message.bond_id = data.bond_id; @@ -1322,9 +1346,9 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.bond_id === "string" && this.bond_id.length) + if (this.bond_id.length) writer.writeString(1, this.bond_id); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(2, this.signer); if (!w) return writer.getResultBuffer(); @@ -1354,12 +1378,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgDissociateRecordsResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): MsgDissociateRecordsResponse { const message = new MsgDissociateRecordsResponse({}); return message; } @@ -1393,13 +1418,14 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgReAssociateRecords extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | { new_bond_id?: string; old_bond_id?: string; signer?: string; }) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("new_bond_id" in data && data.new_bond_id != undefined) { this.new_bond_id = data.new_bond_id; @@ -1413,19 +1439,19 @@ export namespace vulcanize.nameservice.v1beta1 { } } get new_bond_id() { - return pb_1.Message.getField(this, 1) as string; + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; } set new_bond_id(value: string) { pb_1.Message.setField(this, 1, value); } get old_bond_id() { - return pb_1.Message.getField(this, 2) as string; + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; } set old_bond_id(value: string) { pb_1.Message.setField(this, 2, value); } get signer() { - return pb_1.Message.getField(this, 3) as string; + return pb_1.Message.getFieldWithDefault(this, 3, "") as string; } set signer(value: string) { pb_1.Message.setField(this, 3, value); @@ -1434,7 +1460,7 @@ export namespace vulcanize.nameservice.v1beta1 { new_bond_id?: string; old_bond_id?: string; signer?: string; - }) { + }): MsgReAssociateRecords { const message = new MsgReAssociateRecords({}); if (data.new_bond_id != null) { message.new_bond_id = data.new_bond_id; @@ -1468,11 +1494,11 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); - if (typeof this.new_bond_id === "string" && this.new_bond_id.length) + if (this.new_bond_id.length) writer.writeString(1, this.new_bond_id); - if (typeof this.old_bond_id === "string" && this.old_bond_id.length) + if (this.old_bond_id.length) writer.writeString(2, this.old_bond_id); - if (typeof this.signer === "string" && this.signer.length) + if (this.signer.length) writer.writeString(3, this.signer); if (!w) return writer.getResultBuffer(); @@ -1505,12 +1531,13 @@ export namespace vulcanize.nameservice.v1beta1 { } } export class MsgReAssociateRecordsResponse extends pb_1.Message { + #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}) { + static fromObject(data: {}): MsgReAssociateRecordsResponse { const message = new MsgReAssociateRecordsResponse({}); return message; } diff --git a/src/testing/data/watcher.yml b/src/testing/data/watcher.yml index 0d4f9cf..f6357f5 100644 --- a/src/testing/data/watcher.yml +++ b/src/testing/data/watcher.yml @@ -1,6 +1,7 @@ record: - type: watcher - name: ERC20 Watcher - version: 1.0.0 - protocol: - /: QmdeazkS38aCrqG6qKwaio2fQnShE6RGpmNdqStLkkZcQN + type: WebsiteRegistrationRecord + url: 'https://cerc.io' + repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D + build_artifact_cid: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9 + tls_cert_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR + version: null diff --git a/src/types.ts b/src/types.ts index 0a506e5..f3111b0 100644 --- a/src/types.ts +++ b/src/types.ts @@ -3,6 +3,8 @@ import { Validator } from 'jsonschema'; import RecordSchema from './schema/record.json'; import { Util } from './util'; +import * as attributes from './proto/vulcanize/nameservice/v1beta1/attributes'; +import * as any from './proto/google/protobuf/any'; /** * Record. @@ -27,7 +29,17 @@ export class Record { } get attributes() { - return Buffer.from(JSON.stringify(this._record), 'binary').toString('base64') + + var a = new any.google.protobuf.Any() + + if (this._record.type=="WebsiteRegistrationRecord"){ + var attr= new attributes.vulcanize.nameservice.v1beta1.WebsiteRegistrationRecord(this._record) + a= new any.google.protobuf.Any({ + type_url: "/vulcanize.nameservice.v1beta1.WebsiteRegistrationRecord", + value: attr.serialize() + }) + } + return a } /** -- 2.45.2 From eaafeb910763677cd0ea360cd060a4a018cab59c Mon Sep 17 00:00:00 2001 From: 0xmuralik Date: Mon, 19 Dec 2022 11:44:18 +0530 Subject: [PATCH 2/7] rename to registry --- .../nameservice/v1beta1/genesis.proto | 30 --- .../nameservice/v1beta1/nameservice.proto | 170 ------------- .../vulcanize/nameservice/v1beta1/query.proto | 231 ------------------ proto/vulcanize/nameservice/v1beta1/tx.proto | 168 ------------- .../v1beta1/attributes.proto | 4 +- .../vulcanize/registry/v1beta1/genesis.proto | 21 ++ proto/vulcanize/registry/v1beta1/query.proto | 217 ++++++++++++++++ .../vulcanize/registry/v1beta1/registry.proto | 134 ++++++++++ proto/vulcanize/registry/v1beta1/tx.proto | 137 +++++++++++ src/index.ts | 2 +- src/messages/bond.ts | 26 +- src/messages/{nameservice.ts => registry.ts} | 40 +-- .../v1beta1/attributes.ts | 4 +- .../v1beta1/genesis.ts | 74 +++--- .../v1beta1/query.ts | 214 ++++++++-------- .../v1beta1/registry.ts} | 45 +++- .../{nameservice => registry}/v1beta1/tx.ts | 38 +-- src/types.ts | 6 +- 18 files changed, 747 insertions(+), 814 deletions(-) delete mode 100644 proto/vulcanize/nameservice/v1beta1/genesis.proto delete mode 100644 proto/vulcanize/nameservice/v1beta1/nameservice.proto delete mode 100644 proto/vulcanize/nameservice/v1beta1/query.proto delete mode 100644 proto/vulcanize/nameservice/v1beta1/tx.proto rename proto/vulcanize/{nameservice => registry}/v1beta1/attributes.proto (93%) create mode 100644 proto/vulcanize/registry/v1beta1/genesis.proto create mode 100644 proto/vulcanize/registry/v1beta1/query.proto create mode 100644 proto/vulcanize/registry/v1beta1/registry.proto create mode 100644 proto/vulcanize/registry/v1beta1/tx.proto rename src/messages/{nameservice.ts => registry.ts} (82%) rename src/proto/vulcanize/{nameservice => registry}/v1beta1/attributes.ts (99%) rename src/proto/vulcanize/{nameservice => registry}/v1beta1/genesis.ts (64%) rename src/proto/vulcanize/{nameservice => registry}/v1beta1/query.ts (92%) rename src/proto/vulcanize/{nameservice/v1beta1/nameservice.ts => registry/v1beta1/registry.ts} (97%) rename src/proto/vulcanize/{nameservice => registry}/v1beta1/tx.ts (97%) diff --git a/proto/vulcanize/nameservice/v1beta1/genesis.proto b/proto/vulcanize/nameservice/v1beta1/genesis.proto deleted file mode 100644 index 8d71c3e..0000000 --- a/proto/vulcanize/nameservice/v1beta1/genesis.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; -package vulcanize.nameservice.v1beta1; - -import "gogoproto/gogo.proto"; -import "vulcanize/nameservice/v1beta1/nameservice.proto"; - -option go_package = "github.com/tharsis/ethermint/x/nameservice/types"; - -// GenesisState defines the nameservice module's genesis state. -message GenesisState { - // params defines all the params of nameservice module. - Params params = 1 [ - (gogoproto.nullable) = false - ]; - // records - repeated Record records = 2 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"records\" yaml:\"records\"" - ]; - // authorities - repeated AuthorityEntry authorities = 3 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"authorities\" yaml:\"authorities\"" - ]; - // names - repeated NameEntry names = 4 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"names\" yaml:\"names\"" - ]; -} diff --git a/proto/vulcanize/nameservice/v1beta1/nameservice.proto b/proto/vulcanize/nameservice/v1beta1/nameservice.proto deleted file mode 100644 index ea0351d..0000000 --- a/proto/vulcanize/nameservice/v1beta1/nameservice.proto +++ /dev/null @@ -1,170 +0,0 @@ -syntax = "proto3"; -package vulcanize.nameservice.v1beta1; - -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/any.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "github.com/tharsis/ethermint/x/nameservice/types"; - -// Params defines the nameservice module parameters -message Params { - cosmos.base.v1beta1.Coin record_rent = 1 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"record_rent\" yaml:\"record_rent\"" - ]; - google.protobuf.Duration record_rent_duration = 2 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "json:\"record_rent_duration\" yaml:\"record_rent_duration\"" - ]; - cosmos.base.v1beta1.Coin authority_rent = 3 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"authority_rent\" yaml:\"authority_rent\"" - ]; - google.protobuf.Duration authority_rent_duration = 4 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "json:\"authority_rent_duration\" yaml:\"authority_rent_duration\"" - ]; - google.protobuf.Duration authority_grace_period = 5 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "json:\"authority_grace_period\" yaml:\"authority_grace_period\"" - ]; - bool authority_auction_enabled = 6 [ - (gogoproto.moretags) = "json:\"authority_auction_enabled\" yaml:\"authority_auction_enabled\"" - ]; - google.protobuf.Duration authority_auction_commits_duration = 7 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "json:\"authority_auction_commits_duration\" yaml:\"authority_auction_commits_duration\"" - ]; - google.protobuf.Duration authority_auction_reveals_duration = 8 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "json:\"authority_auction_reveals_duration\" yaml:\"authority_auction_reveals_duration\"" - ]; - cosmos.base.v1beta1.Coin authority_auction_commit_fee = 9 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"authority_auction_commit_fee\" yaml:\"authority_auction_commit_fee\"" - ]; - cosmos.base.v1beta1.Coin authority_auction_reveal_fee = 10 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"authority_auction_reveal_fee\" yaml:\"authority_auction_reveal_fee\"" - ]; - cosmos.base.v1beta1.Coin authority_auction_minimum_bid = 11 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"authority_auction_minimum_bid\" yaml:\"authority_auction_minimum_bid\"" - ]; -} - -// Params defines the nameservice module records -message Record { - string id = 1 [ - (gogoproto.moretags) = "json:\"id\" yaml:\"id\"" - ]; - string bond_id = 2 [ - (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" - ]; - string create_time = 3 [ - (gogoproto.moretags) = "json:\"createTime\" yaml:\"createTime\"" - ]; - string expiry_time = 4 [ - (gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\"" - ]; - bool deleted = 5; - repeated string owners = 6 [ - (gogoproto.moretags) = "json:\"owners\" yaml:\"owners\"" - ]; - google.protobuf.Any attributes = 7 [ - (gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\"" - ]; - repeated string names = 8 [ - (gogoproto.moretags) = "json:\"names\" yaml:\"names\"" - ]; -} - -// AuthorityEntry defines the nameservice module AuthorityEntries -message AuthorityEntry{ - string name = 1; - NameAuthority entry = 2; -} - -// NameAuthority -message NameAuthority { - // Owner public key. - string owner_public_key = 1 [ - (gogoproto.moretags) = "json:\"ownerPublicKey\" yaml:\"ownerPublicKey\"" - ]; - // Owner address. - string owner_address = 2 [ - (gogoproto.moretags) = "json:\"ownerAddress\" yaml:\"ownerAddress\"" - ]; - // height at which name/authority was created. - uint64 height = 3; - string status = 4; - string auction_id = 5 [ - (gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\"" - ]; - string bond_id = 6 [ - (gogoproto.moretags) = "json:\"bondID\" yaml:\"bondID\"" - ]; - google.protobuf.Timestamp expiry_time = 7 [ - (gogoproto.nullable) = false, - (gogoproto.stdtime) = true, - (gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\"" - ]; -} - -// NameEntry -message NameEntry{ - string name = 1; - NameRecord entry = 2; -} - -// NameRecord -message NameRecord { - NameRecordEntry latest = 1; - repeated NameRecordEntry history = 2; -} - -// NameRecordEntry -message NameRecordEntry{ - string id = 1; - uint64 height = 2; -} - -// Signature -message Signature{ - string sig = 1 [ - (gogoproto.moretags) = "json:\"sig\" yaml:\"sig\"" - ]; - string pub_key = 2 [ - (gogoproto.moretags) = "json:\"pubKey\" yaml:\"pubKey\"" - ]; -} - -// BlockChangeSet -message BlockChangeSet{ - int64 height = 1; - repeated string records = 2; - repeated string auctions = 3; - repeated AuctionBidInfo auction_bids = 4 [ - (gogoproto.moretags) = "json:\"auctionBids\" yaml:\"auctionBids\"" - ]; - repeated string authorities = 5; - repeated string names = 6; -} - -// AuctionBidInfo -message AuctionBidInfo { - string auction_id = 1 [ - (gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\"" - ]; - string bidder_address = 2 [ - (gogoproto.moretags) = "json:\"bidderAddress\" yaml:\"bidderAddress\"" - ]; -} \ No newline at end of file diff --git a/proto/vulcanize/nameservice/v1beta1/query.proto b/proto/vulcanize/nameservice/v1beta1/query.proto deleted file mode 100644 index c6dd8e0..0000000 --- a/proto/vulcanize/nameservice/v1beta1/query.proto +++ /dev/null @@ -1,231 +0,0 @@ -syntax = "proto3"; -package vulcanize.nameservice.v1beta1; - -import "vulcanize/nameservice/v1beta1/nameservice.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/tharsis/ethermint/x/nameservice/types"; - -// Query defines the gRPC querier service for nameservice module -service Query { - // Params queries the nameservice module params. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/vulcanize/nameservice/v1beta1/params"; - } - // List records - rpc ListRecords(QueryListRecordsRequest) returns (QueryListRecordsResponse){ - option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records"; - } - // Get record by id - rpc GetRecord(QueryRecordByIdRequest) returns (QueryRecordByIdResponse){ - option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records/{id}"; - } - // Get records by bond id - rpc GetRecordByBondId(QueryRecordByBondIdRequest) returns (QueryRecordByBondIdResponse){ - option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records-by-bond-id/{id}"; - } - // Get nameservice module balance - rpc GetNameServiceModuleBalance(GetNameServiceModuleBalanceRequest) returns (GetNameServiceModuleBalanceResponse){ - option (google.api.http).get = "/vulcanize/nameservice/v1beta1/balance"; - } - // List name records - rpc ListNameRecords(QueryListNameRecordsRequest) returns (QueryListNameRecordsResponse){ - option (google.api.http).get = "/vulcanize/nameservice/v1beta1/names"; - } - // Whois method retrieve the name authority info - rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse){ - option (google.api.http).get = "/vulcanize/nameservice/v1beta1/whois/{name}"; - } - // LookupCrn - rpc LookupCrn(QueryLookupCrn) returns (QueryLookupCrnResponse){ - option (google.api.http).get = "/vulcanize/nameservice/v1beta1/lookup"; - } - // ResolveCrn - rpc ResolveCrn(QueryResolveCrn) returns (QueryResolveCrnResponse){ - option (google.api.http).get = "/vulcanize/nameservice/v1beta1/resolve"; - } - // GetRecordExpiryQueue - rpc GetRecordExpiryQueue(QueryGetRecordExpiryQueue) returns (QueryGetRecordExpiryQueueResponse){ - option (google.api.http).get = "/vulcanize/nameservice/v1beta1/record-expiry"; - } - // GetAuthorityExpiryQueue - rpc GetAuthorityExpiryQueue(QueryGetAuthorityExpiryQueue) returns (QueryGetAuthorityExpiryQueueResponse){ - option (google.api.http).get = "/vulcanize/nameservice/v1beta1/authority-expiry"; - } -} - -// QueryParamsRequest is request type for nameservice params -message QueryParamsRequest{ -} - -// QueryParamsResponse is response type for nameservice params -message QueryParamsResponse{ - Params params = 1; -} - -// QueryListRecordsRequest is request type for nameservice records list -message QueryListRecordsRequest{ - message ReferenceInput { - string id = 1; - } - message ValueInput { - string type = 1; - string string = 2; - int64 int = 3; - double float = 4; - bool boolean = 5; - ReferenceInput reference = 6; - repeated ValueInput values = 7; - } - message KeyValueInput { - string key = 1; - ValueInput value = 2; - } - repeated KeyValueInput attributes = 1; - - bool all = 2; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 3; -} - -// QueryListRecordsResponse is response type for nameservice records list -message QueryListRecordsResponse{ - repeated Record records = 1 [ - (gogoproto.nullable) = false - ]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -//QueryRecordByIdRequest is request type for nameservice records by id -message QueryRecordByIdRequest{ - string id = 1 ; -} - -// QueryRecordByIdResponse is response type for nameservice records by id -message QueryRecordByIdResponse{ - Record record = 1[ - (gogoproto.nullable) = false - ]; -} - -// QueryRecordByBondIdRequest is request type for get the records by bond-id -message QueryRecordByBondIdRequest{ - string id = 1; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryRecordByBondIdResponse is response type for records list by bond-id -message QueryRecordByBondIdResponse{ - repeated Record records = 1 [ - (gogoproto.nullable) = false - ]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// GetNameServiceModuleBalanceRequest is request type for nameservice module accounts balance -message GetNameServiceModuleBalanceRequest{ -} - -// GetNameServiceModuleBalanceResponse is response type for nameservice module accounts balance -message GetNameServiceModuleBalanceResponse{ - repeated AccountBalance balances = 1; -} - -// AccountBalance is nameservice module account balance -message AccountBalance { - string account_name = 1 [ - (gogoproto.moretags) = "json:\"accountName\" yaml:\"accountName\"" - ]; - repeated cosmos.base.v1beta1.Coin balance = 3 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "json:\"balance\" yaml:\"balance\"" - ]; -} - -// QueryListNameRecordsRequest is request type for nameservice names records -message QueryListNameRecordsRequest{ - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryListNameRecordsResponse is response type for nameservice names records -message QueryListNameRecordsResponse{ - repeated NameEntry names = 1 [ - (gogoproto.nullable) = false - ]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryWhoisRequest is request type for Get NameAuthority -message QueryWhoisRequest{ - string name = 1; -} - -// QueryWhoisResponse is response type for whois request -message QueryWhoisResponse{ - NameAuthority name_authority = 1 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"nameAuthority\" yaml:\"nameAuthority\"" - ]; -} - -// QueryLookupCrn is request type for LookupCrn -message QueryLookupCrn{ - string crn = 1; -} - -// QueryLookupCrnResponse is response type for QueryLookupCrn -message QueryLookupCrnResponse{ - NameRecord name = 1; -} - -// QueryResolveCrn is request type for ResolveCrn -message QueryResolveCrn{ - string crn = 1; -} - -// QueryResolveCrnResponse is response type for QueryResolveCrn -message QueryResolveCrnResponse{ - Record record = 1; -} - -// QueryGetRecordExpiryQueue -message QueryGetRecordExpiryQueue{ - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryGetRecordExpiryQueueResponse -message QueryGetRecordExpiryQueueResponse{ - repeated ExpiryQueueRecord records = 1; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// ExpiryQueueRecord -message ExpiryQueueRecord{ - string id = 1; - repeated string value = 2; -} - -// QueryGetAuthorityExpiryQueue -message QueryGetAuthorityExpiryQueue{ - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryGetAuthorityExpiryQueueResponse -message QueryGetAuthorityExpiryQueueResponse{ - repeated ExpiryQueueRecord authorities = 1; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/proto/vulcanize/nameservice/v1beta1/tx.proto b/proto/vulcanize/nameservice/v1beta1/tx.proto deleted file mode 100644 index f66d3a1..0000000 --- a/proto/vulcanize/nameservice/v1beta1/tx.proto +++ /dev/null @@ -1,168 +0,0 @@ -syntax = "proto3"; -package vulcanize.nameservice.v1beta1; - -import "gogoproto/gogo.proto"; -import "vulcanize/nameservice/v1beta1/nameservice.proto"; - -option go_package = "github.com/tharsis/ethermint/x/nameservice/types"; - -// Msg -service Msg { - // SetRecord will records a new record with given payload and bond id - rpc SetRecord(MsgSetRecord) returns(MsgSetRecordResponse){} - // Renew Record will renew the expire record - rpc RenewRecord(MsgRenewRecord) returns (MsgRenewRecordResponse){} - // AssociateBond - rpc AssociateBond(MsgAssociateBond) returns (MsgAssociateBondResponse){} - // DissociateBond - rpc DissociateBond(MsgDissociateBond) returns (MsgDissociateBondResponse){} - // DissociateRecords - rpc DissociateRecords(MsgDissociateRecords) returns (MsgDissociateRecordsResponse){} - // ReAssociateRecords - rpc ReAssociateRecords(MsgReAssociateRecords) returns (MsgReAssociateRecordsResponse){} - // SetName will store the name with given crn and name - rpc SetName(MsgSetName) returns (MsgSetNameResponse){} - // Reserve name - rpc ReserveName(MsgReserveAuthority) returns (MsgReserveAuthorityResponse){} - // Delete Name method will remove authority name - rpc DeleteName(MsgDeleteNameAuthority) returns (MsgDeleteNameAuthorityResponse){} - // SetAuthorityBond - rpc SetAuthorityBond(MsgSetAuthorityBond) returns (MsgSetAuthorityBondResponse){} -} - -// MsgSetRecord -message MsgSetRecord{ - string bond_id = 1 [ - (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" - ]; - string signer = 2; - Payload payload = 3 [ - (gogoproto.nullable) = false - ]; -} - -// MsgSetRecordResponse -message MsgSetRecordResponse{ - string id = 1; -} - -// Payload -message Payload { - Record record = 1; - repeated Signature signatures = 2 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"signatures\" yaml:\"signatures\"" - ]; -} - -// MsgSetName -message MsgSetName{ - string crn = 1; - string cid = 2; - string signer = 3; -} - -// MsgSetNameResponse -message MsgSetNameResponse{ -} - -// MsgReserveName -message MsgReserveAuthority{ - string name = 1; - string signer = 2; - // if creating a sub-authority. - string owner = 3; -} - -// MsgReserveNameResponse -message MsgReserveAuthorityResponse{ -} - -// MsgSetAuthorityBond is SDK message for SetAuthorityBond -message MsgSetAuthorityBond{ - string name = 1; - string bond_id = 2 [ - (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" - ]; - string signer = 3; -} - -// MsgSetAuthorityBondResponse -message MsgSetAuthorityBondResponse{ -} - -// MsgDeleteNameAuthority is SDK message for DeleteNameAuthority -message MsgDeleteNameAuthority{ - string crn = 1; - string signer = 2; -} - -// MsgDeleteNameAuthorityResponse -message MsgDeleteNameAuthorityResponse{ -} - -//MsgRenewRecord is SDK message for Renew a record -message MsgRenewRecord{ - string record_id = 1 [ - (gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\"" - ]; - string signer = 2; -} - -// MsgRenewRecordResponse -message MsgRenewRecordResponse{ -} - -// MsgAssociateBond -message MsgAssociateBond{ - string record_id = 1 [ - (gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\"" - ]; - string bond_id = 2 [ - (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" - ]; - string signer = 3; -} - -// MsgAssociateBondResponse -message MsgAssociateBondResponse{ -} - -// MsgDissociateBond is SDK message for Msg/DissociateBond -message MsgDissociateBond{ - string record_id = 1 [ - (gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\"" - ]; - string signer = 2; -} - -// MsgDissociateBondResponse is response type for MsgDissociateBond -message MsgDissociateBondResponse{ -} - -// MsgDissociateRecords is SDK message for Msg/DissociateRecords -message MsgDissociateRecords{ - string bond_id = 1 [ - (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" - ]; - string signer = 2; -} - -// MsgDissociateRecordsResponse is response type for MsgDissociateRecords -message MsgDissociateRecordsResponse{ -} - -// MsgReAssociateRecords is SDK message for Msg/ReAssociateRecords -message MsgReAssociateRecords{ - string new_bond_id = 1 [ - (gogoproto.moretags) = "json:\"newBondId\" yaml:\"newBondId\"" - ]; - string old_bond_id = 2 [ - (gogoproto.moretags) = "json:\"oldBondId\" yaml:\"oldBondId\"" - ]; - string signer = 3; -} - -// MsgReAssociateRecordsResponse is response type for MsgReAssociateRecords -message MsgReAssociateRecordsResponse{ -} diff --git a/proto/vulcanize/nameservice/v1beta1/attributes.proto b/proto/vulcanize/registry/v1beta1/attributes.proto similarity index 93% rename from proto/vulcanize/nameservice/v1beta1/attributes.proto rename to proto/vulcanize/registry/v1beta1/attributes.proto index 0173d81..8ec3b6a 100644 --- a/proto/vulcanize/nameservice/v1beta1/attributes.proto +++ b/proto/vulcanize/registry/v1beta1/attributes.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package vulcanize.nameservice.v1beta1; +package vulcanize.registry.v1beta1; import "gogoproto/gogo.proto"; -option go_package = "github.com/cerc-io/laconicd/x/nameservice/types"; +option go_package = "github.com/cerc-io/laconicd/x/registry/types"; message ServiceProviderRegistration { string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""]; diff --git a/proto/vulcanize/registry/v1beta1/genesis.proto b/proto/vulcanize/registry/v1beta1/genesis.proto new file mode 100644 index 0000000..19a34b6 --- /dev/null +++ b/proto/vulcanize/registry/v1beta1/genesis.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +package vulcanize.registry.v1beta1; + +import "gogoproto/gogo.proto"; +import "vulcanize/registry/v1beta1/registry.proto"; + +option go_package = "github.com/cerc-io/laconicd/x/registry/types"; + +// GenesisState defines the registry module's genesis state. +message GenesisState { + // params defines all the params of registry module. + Params params = 1 [(gogoproto.nullable) = false]; + // records + repeated Record records = 2 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"records\" yaml:\"records\""]; + // authorities + repeated AuthorityEntry authorities = 3 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"authorities\" yaml:\"authorities\""]; + // names + repeated NameEntry names = 4 [(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"names\" yaml:\"names\""]; +} diff --git a/proto/vulcanize/registry/v1beta1/query.proto b/proto/vulcanize/registry/v1beta1/query.proto new file mode 100644 index 0000000..f30fdb4 --- /dev/null +++ b/proto/vulcanize/registry/v1beta1/query.proto @@ -0,0 +1,217 @@ +syntax = "proto3"; +package vulcanize.registry.v1beta1; + +import "vulcanize/registry/v1beta1/registry.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cerc-io/laconicd/x/registry/types"; + +// Query defines the gRPC querier service for registry module +service Query { + // Params queries the registry module params. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/vulcanize/registry/v1beta1/params"; + } + // List records + rpc ListRecords(QueryListRecordsRequest) returns (QueryListRecordsResponse) { + option (google.api.http).get = "/vulcanize/registry/v1beta1/records"; + } + // Get record by id + rpc GetRecord(QueryRecordByIDRequest) returns (QueryRecordByIDResponse) { + option (google.api.http).get = "/vulcanize/registry/v1beta1/records/{id}"; + } + // Get records by bond id + rpc GetRecordByBondID(QueryRecordByBondIDRequest) returns (QueryRecordByBondIDResponse) { + option (google.api.http).get = "/vulcanize/registry/v1beta1/records-by-bond-id/{id}"; + } + // Get registry module balance + rpc GetRegistryModuleBalance(GetRegistryModuleBalanceRequest) returns (GetRegistryModuleBalanceResponse) { + option (google.api.http).get = "/vulcanize/registry/v1beta1/balance"; + } + // List name records + rpc ListNameRecords(QueryListNameRecordsRequest) returns (QueryListNameRecordsResponse) { + option (google.api.http).get = "/vulcanize/registry/v1beta1/names"; + } + // Whois method retrieve the name authority info + rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse) { + option (google.api.http).get = "/vulcanize/registry/v1beta1/whois/{name}"; + } + // LookupCrn + rpc LookupCrn(QueryLookupCrn) returns (QueryLookupCrnResponse) { + option (google.api.http).get = "/vulcanize/registry/v1beta1/lookup"; + } + // ResolveCrn + rpc ResolveCrn(QueryResolveCrn) returns (QueryResolveCrnResponse) { + option (google.api.http).get = "/vulcanize/registry/v1beta1/resolve"; + } + // GetRecordExpiryQueue + rpc GetRecordExpiryQueue(QueryGetRecordExpiryQueue) returns (QueryGetRecordExpiryQueueResponse) { + option (google.api.http).get = "/vulcanize/registry/v1beta1/record-expiry"; + } + // GetAuthorityExpiryQueue + rpc GetAuthorityExpiryQueue(QueryGetAuthorityExpiryQueue) returns (QueryGetAuthorityExpiryQueueResponse) { + option (google.api.http).get = "/vulcanize/registry/v1beta1/authority-expiry"; + } +} + +// QueryParamsRequest is request type for registry params +message QueryParamsRequest {} + +// QueryParamsResponse is response type for registry params +message QueryParamsResponse { + Params params = 1; +} + +// QueryListRecordsRequest is request type for registry records list +message QueryListRecordsRequest { + message ReferenceInput { + string id = 1; + } + message ValueInput { + string type = 1; + string string = 2; + int64 int = 3; + double float = 4; + bool boolean = 5; + ReferenceInput reference = 6; + repeated ValueInput values = 7; + } + message KeyValueInput { + string key = 1; + ValueInput value = 2; + } + repeated KeyValueInput attributes = 1; + + bool all = 2; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryListRecordsResponse is response type for registry records list +message QueryListRecordsResponse { + repeated Record records = 1 [(gogoproto.nullable) = false]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryRecordByIDRequest is request type for registry records by id +message QueryRecordByIDRequest { + string id = 1; +} + +// QueryRecordByIDResponse is response type for registry records by id +message QueryRecordByIDResponse { + Record record = 1 [(gogoproto.nullable) = false]; +} + +// QueryRecordByBondIdRequest is request type for get the records by bond-id +message QueryRecordByBondIDRequest { + string id = 1; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryRecordByBondIdResponse is response type for records list by bond-id +message QueryRecordByBondIDResponse { + repeated Record records = 1 [(gogoproto.nullable) = false]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// GetRegistryModuleBalanceRequest is request type for registry module accounts balance +message GetRegistryModuleBalanceRequest {} + +// GetRegistryModuleBalanceResponse is response type for registry module accounts balance +message GetRegistryModuleBalanceResponse { + repeated AccountBalance balances = 1; +} + +// AccountBalance is registry module account balance +message AccountBalance { + string account_name = 1 [(gogoproto.moretags) = "json:\"accountName\" yaml:\"accountName\""]; + repeated cosmos.base.v1beta1.Coin balance = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "json:\"balance\" yaml:\"balance\"" + ]; +} + +// QueryListNameRecordsRequest is request type for registry names records +message QueryListNameRecordsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryListNameRecordsResponse is response type for registry names records +message QueryListNameRecordsResponse { + repeated NameEntry names = 1 [(gogoproto.nullable) = false]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryWhoisRequest is request type for Get NameAuthority +message QueryWhoisRequest { + string name = 1; +} + +// QueryWhoisResponse is response type for whois request +message QueryWhoisResponse { + NameAuthority name_authority = 1 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"nameAuthority\" yaml:\"nameAuthority\""]; +} + +// QueryLookupCrn is request type for LookupCrn +message QueryLookupCrn { + string crn = 1; +} + +// QueryLookupCrnResponse is response type for QueryLookupCrn +message QueryLookupCrnResponse { + NameRecord name = 1; +} + +// QueryResolveCrn is request type for ResolveCrn +message QueryResolveCrn { + string crn = 1; +} + +// QueryResolveCrnResponse is response type for QueryResolveCrn +message QueryResolveCrnResponse { + Record record = 1; +} + +// QueryGetRecordExpiryQueue +message QueryGetRecordExpiryQueue { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryGetRecordExpiryQueueResponse +message QueryGetRecordExpiryQueueResponse { + repeated ExpiryQueueRecord records = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// ExpiryQueueRecord +message ExpiryQueueRecord { + string id = 1; + repeated string value = 2; +} + +// QueryGetAuthorityExpiryQueue +message QueryGetAuthorityExpiryQueue { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryGetAuthorityExpiryQueueResponse +message QueryGetAuthorityExpiryQueueResponse { + repeated ExpiryQueueRecord authorities = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/vulcanize/registry/v1beta1/registry.proto b/proto/vulcanize/registry/v1beta1/registry.proto new file mode 100644 index 0000000..2c0e280 --- /dev/null +++ b/proto/vulcanize/registry/v1beta1/registry.proto @@ -0,0 +1,134 @@ +syntax = "proto3"; +package vulcanize.registry.v1beta1; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cerc-io/laconicd/x/registry/types"; + +// Params defines the registry module parameters +message Params { + cosmos.base.v1beta1.Coin record_rent = 1 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"record_rent\" yaml:\"record_rent\""]; + google.protobuf.Duration record_rent_duration = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"record_rent_duration\" yaml:\"record_rent_duration\"" + ]; + cosmos.base.v1beta1.Coin authority_rent = 3 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"authority_rent\" yaml:\"authority_rent\""]; + google.protobuf.Duration authority_rent_duration = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"authority_rent_duration\" yaml:\"authority_rent_duration\"" + ]; + google.protobuf.Duration authority_grace_period = 5 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"authority_grace_period\" yaml:\"authority_grace_period\"" + ]; + bool authority_auction_enabled = 6 + [(gogoproto.moretags) = "json:\"authority_auction_enabled\" yaml:\"authority_auction_enabled\""]; + google.protobuf.Duration authority_auction_commits_duration = 7 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"authority_auction_commits_duration\" yaml:\"authority_auction_commits_duration\"" + ]; + google.protobuf.Duration authority_auction_reveals_duration = 8 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"authority_auction_reveals_duration\" yaml:\"authority_auction_reveals_duration\"" + ]; + cosmos.base.v1beta1.Coin authority_auction_commit_fee = 9 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"authority_auction_commit_fee\" yaml:\"authority_auction_commit_fee\"" + ]; + cosmos.base.v1beta1.Coin authority_auction_reveal_fee = 10 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"authority_auction_reveal_fee\" yaml:\"authority_auction_reveal_fee\"" + ]; + cosmos.base.v1beta1.Coin authority_auction_minimum_bid = 11 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"authority_auction_minimum_bid\" yaml:\"authority_auction_minimum_bid\"" + ]; +} + +// Params defines the registry module records +message Record { + string id = 1 [(gogoproto.moretags) = "json:\"id\" yaml:\"id\""]; + string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""]; + string create_time = 3 [(gogoproto.moretags) = "json:\"createTime\" yaml:\"createTime\""]; + string expiry_time = 4 [(gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\""]; + bool deleted = 5; + repeated string owners = 6 [(gogoproto.moretags) = "json:\"owners\" yaml:\"owners\""]; + google.protobuf.Any attributes = 7 [(gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\""]; + repeated string names = 8 [(gogoproto.moretags) = "json:\"names\" yaml:\"names\""]; + string type = 9 [(gogoproto.moretags) = "json:\"types\" yaml:\"types\""]; +} + +// AuthorityEntry defines the registry module AuthorityEntries +message AuthorityEntry { + string name = 1; + NameAuthority entry = 2; +} + +// NameAuthority +message NameAuthority { + // Owner public key. + string owner_public_key = 1 [(gogoproto.moretags) = "json:\"ownerPublicKey\" yaml:\"ownerPublicKey\""]; + // Owner address. + string owner_address = 2 [(gogoproto.moretags) = "json:\"ownerAddress\" yaml:\"ownerAddress\""]; + // height at which name/authority was created. + uint64 height = 3; + string status = 4; + string auction_id = 5 [(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""]; + string bond_id = 6 [(gogoproto.moretags) = "json:\"bondID\" yaml:\"bondID\""]; + google.protobuf.Timestamp expiry_time = 7 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\"" + ]; +} + +// NameEntry +message NameEntry { + string name = 1; + NameRecord entry = 2; +} + +// NameRecord +message NameRecord { + NameRecordEntry latest = 1; + repeated NameRecordEntry history = 2; +} + +// NameRecordEntry +message NameRecordEntry { + string id = 1; + uint64 height = 2; +} + +// Signature +message Signature { + string sig = 1 [(gogoproto.moretags) = "json:\"sig\" yaml:\"sig\""]; + string pub_key = 2 [(gogoproto.moretags) = "json:\"pubKey\" yaml:\"pubKey\""]; +} + +// BlockChangeSet +message BlockChangeSet { + int64 height = 1; + repeated string records = 2; + repeated string auctions = 3; + repeated AuctionBidInfo auction_bids = 4 [(gogoproto.moretags) = "json:\"auctionBids\" yaml:\"auctionBids\""]; + repeated string authorities = 5; + repeated string names = 6; +} + +// AuctionBidInfo +message AuctionBidInfo { + string auction_id = 1 [(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""]; + string bidder_address = 2 [(gogoproto.moretags) = "json:\"bidderAddress\" yaml:\"bidderAddress\""]; +} \ No newline at end of file diff --git a/proto/vulcanize/registry/v1beta1/tx.proto b/proto/vulcanize/registry/v1beta1/tx.proto new file mode 100644 index 0000000..c9e11bc --- /dev/null +++ b/proto/vulcanize/registry/v1beta1/tx.proto @@ -0,0 +1,137 @@ +syntax = "proto3"; +package vulcanize.registry.v1beta1; + +import "gogoproto/gogo.proto"; +import "vulcanize/registry/v1beta1/registry.proto"; + +option go_package = "github.com/cerc-io/laconicd/x/registry/types"; + +// Msg +service Msg { + // SetRecord will records a new record with given payload and bond id + rpc SetRecord(MsgSetRecord) returns (MsgSetRecordResponse) {} + // Renew Record will renew the expire record + rpc RenewRecord(MsgRenewRecord) returns (MsgRenewRecordResponse) {} + // AssociateBond + rpc AssociateBond(MsgAssociateBond) returns (MsgAssociateBondResponse) {} + // DissociateBond + rpc DissociateBond(MsgDissociateBond) returns (MsgDissociateBondResponse) {} + // DissociateRecords + rpc DissociateRecords(MsgDissociateRecords) returns (MsgDissociateRecordsResponse) {} + // ReAssociateRecords + rpc ReAssociateRecords(MsgReAssociateRecords) returns (MsgReAssociateRecordsResponse) {} + // SetName will store the name with given crn and name + rpc SetName(MsgSetName) returns (MsgSetNameResponse) {} + // Reserve name + rpc ReserveName(MsgReserveAuthority) returns (MsgReserveAuthorityResponse) {} + // Delete Name method will remove authority name + rpc DeleteName(MsgDeleteNameAuthority) returns (MsgDeleteNameAuthorityResponse) {} + // SetAuthorityBond + rpc SetAuthorityBond(MsgSetAuthorityBond) returns (MsgSetAuthorityBondResponse) {} +} + +// MsgSetRecord +message MsgSetRecord { + string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""]; + string signer = 2; + Payload payload = 3 [(gogoproto.nullable) = false]; +} + +// MsgSetRecordResponse +message MsgSetRecordResponse { + string id = 1; +} + +// Payload +message Payload { + Record record = 1; + repeated Signature signatures = 2 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"signatures\" yaml:\"signatures\""]; +} + +// MsgSetName +message MsgSetName { + string crn = 1; + string cid = 2; + string signer = 3; +} + +// MsgSetNameResponse +message MsgSetNameResponse {} + +// MsgReserveName +message MsgReserveAuthority { + string name = 1; + string signer = 2; + // if creating a sub-authority. + string owner = 3; +} + +// MsgReserveNameResponse +message MsgReserveAuthorityResponse {} + +// MsgSetAuthorityBond is SDK message for SetAuthorityBond +message MsgSetAuthorityBond { + string name = 1; + string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""]; + string signer = 3; +} + +// MsgSetAuthorityBondResponse +message MsgSetAuthorityBondResponse {} + +// MsgDeleteNameAuthority is SDK message for DeleteNameAuthority +message MsgDeleteNameAuthority { + string crn = 1; + string signer = 2; +} + +// MsgDeleteNameAuthorityResponse +message MsgDeleteNameAuthorityResponse {} + +// MsgRenewRecord is SDK message for Renew a record +message MsgRenewRecord { + string record_id = 1 [(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""]; + string signer = 2; +} + +// MsgRenewRecordResponse +message MsgRenewRecordResponse {} + +// MsgAssociateBond +message MsgAssociateBond { + string record_id = 1 [(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""]; + string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""]; + string signer = 3; +} + +// MsgAssociateBondResponse +message MsgAssociateBondResponse {} + +// MsgDissociateBond is SDK message for Msg/DissociateBond +message MsgDissociateBond { + string record_id = 1 [(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""]; + string signer = 2; +} + +// MsgDissociateBondResponse is response type for MsgDissociateBond +message MsgDissociateBondResponse {} + +// MsgDissociateRecords is SDK message for Msg/DissociateRecords +message MsgDissociateRecords { + string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""]; + string signer = 2; +} + +// MsgDissociateRecordsResponse is response type for MsgDissociateRecords +message MsgDissociateRecordsResponse {} + +// MsgReAssociateRecords is SDK message for Msg/ReAssociateRecords +message MsgReAssociateRecords { + string new_bond_id = 1 [(gogoproto.moretags) = "json:\"newBondId\" yaml:\"newBondId\""]; + string old_bond_id = 2 [(gogoproto.moretags) = "json:\"oldBondId\" yaml:\"oldBondId\""]; + string signer = 3; +} + +// MsgReAssociateRecordsResponse is response type for MsgReAssociateRecords +message MsgReAssociateRecordsResponse {} diff --git a/src/index.ts b/src/index.ts index 0c4f83b..696a424 100644 --- a/src/index.ts +++ b/src/index.ts @@ -45,7 +45,7 @@ import { MessageMsgSetRecord, NAMESERVICE_ERRORS, parseMsgSetRecordResponse -} from './messages/nameservice'; +} from './messages/registry'; import { createTxMsgCommitBid, createTxMsgRevealBid, diff --git a/src/messages/bond.ts b/src/messages/bond.ts index a8e004f..af42aaf 100644 --- a/src/messages/bond.ts +++ b/src/messages/bond.ts @@ -8,7 +8,7 @@ import { } from '@tharsis/transactions' import * as bondTx from '../proto/vulcanize/bond/v1beta1/tx' -import * as nameserviceTx from '../proto/vulcanize/nameservice/v1beta1/tx' +import * as registryTx from '../proto/vulcanize/registry/v1beta1/tx' import * as coin from '../proto/cosmos/base/v1beta1/coin' import { createTx } from './util' @@ -475,7 +475,7 @@ function createMsgAssociateBond( signer: string ) { return { - type: 'nameservice/AssociateBond', + type: 'registry/AssociateBond', value: { record_id: recordId, bond_id: bondId, @@ -489,7 +489,7 @@ const protoCreateMsgAssociateBond = ( bondId: string, signer: string ) => { - const associateBondMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgAssociateBond({ + const associateBondMessage = new registryTx.vulcanize.registry.v1beta1.MsgAssociateBond({ record_id: recordId, bond_id: bondId, signer @@ -497,7 +497,7 @@ const protoCreateMsgAssociateBond = ( return { message: associateBondMessage, - path: 'vulcanize.nameservice.v1beta1.MsgAssociateBond', + path: 'vulcanize.registry.v1beta1.MsgAssociateBond', } } @@ -506,7 +506,7 @@ function createMsgDissociateBond( signer: string ) { return { - type: 'nameservice/DissociateBond', + type: 'registry/DissociateBond', value: { record_id: recordId, signer @@ -518,14 +518,14 @@ const protoCreateMsgDissociateBond = ( recordId: string, signer: string ) => { - const dissociateBondMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgDissociateBond({ + const dissociateBondMessage = new registryTx.vulcanize.registry.v1beta1.MsgDissociateBond({ record_id: recordId, signer }) return { message: dissociateBondMessage, - path: 'vulcanize.nameservice.v1beta1.MsgDissociateBond', + path: 'vulcanize.registry.v1beta1.MsgDissociateBond', } } @@ -534,7 +534,7 @@ function createMsgDissociateRecords( signer: string ) { return { - type: 'nameservice/DissociateRecords', + type: 'registry/DissociateRecords', value: { bond_id: bondId, signer @@ -546,14 +546,14 @@ const protoCreateMsgDissociateRecords = ( bondId: string, signer: string ) => { - const dissociateRecordsMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgDissociateRecords({ + const dissociateRecordsMessage = new registryTx.vulcanize.registry.v1beta1.MsgDissociateRecords({ bond_id: bondId, signer }) return { message: dissociateRecordsMessage, - path: 'vulcanize.nameservice.v1beta1.MsgDissociateRecords', + path: 'vulcanize.registry.v1beta1.MsgDissociateRecords', } } @@ -563,7 +563,7 @@ function createMsgReAssociateRecords( signer: string ) { return { - type: 'nameservice/ReassociateRecords', + type: 'registry/ReassociateRecords', value: { new_bond_id: newBondId, old_bond_id: oldBondId, @@ -577,7 +577,7 @@ const protoCreateMsgReAssociateRecords = ( oldBondId: string, signer: string ) => { - const reAssociateRecordsMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgReAssociateRecords({ + const reAssociateRecordsMessage = new registryTx.vulcanize.registry.v1beta1.MsgReAssociateRecords({ new_bond_id: newBondId, old_bond_id: oldBondId, signer @@ -585,6 +585,6 @@ const protoCreateMsgReAssociateRecords = ( return { message: reAssociateRecordsMessage, - path: 'vulcanize.nameservice.v1beta1.MsgReAssociateRecords', + path: 'vulcanize.registry.v1beta1.MsgReAssociateRecords', } } diff --git a/src/messages/nameservice.ts b/src/messages/registry.ts similarity index 82% rename from src/messages/nameservice.ts rename to src/messages/registry.ts index ce24773..904dd17 100644 --- a/src/messages/nameservice.ts +++ b/src/messages/registry.ts @@ -7,8 +7,8 @@ import { Fee, } from '@tharsis/transactions' -import * as nameserviceTx from '../proto/vulcanize/nameservice/v1beta1/tx' -import * as nameservice from '../proto/vulcanize/nameservice/v1beta1/nameservice' +import * as registryTx from '../proto/vulcanize/registry/v1beta1/tx' +import * as registry from '../proto/vulcanize/registry/v1beta1/registry' import { createTx } from './util' import { Payload } from '../types' @@ -235,7 +235,7 @@ function createMsgReserveAuthority( owner: string ) { return { - type: 'nameservice/ReserveAuthority', + type: 'registry/ReserveAuthority', value: { name, signer, @@ -249,7 +249,7 @@ const protoCreateMsgReserveAuthority = ( signer: string, owner: string, ) => { - const reserveAuthorityMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgReserveAuthority({ + const reserveAuthorityMessage = new registryTx.vulcanize.registry.v1beta1.MsgReserveAuthority({ name, signer, owner @@ -257,7 +257,7 @@ const protoCreateMsgReserveAuthority = ( return { message: reserveAuthorityMessage, - path: 'vulcanize.nameservice.v1beta1.MsgReserveAuthority', + path: 'vulcanize.registry.v1beta1.MsgReserveAuthority', } } @@ -267,7 +267,7 @@ function createMsgSetName( signer: string ) { return { - type: 'nameservice/SetName', + type: 'registry/SetName', value: { crn, cid, @@ -281,7 +281,7 @@ const protoCreateMsgSetName = ( cid: string, signer: string ) => { - const setNameMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgSetName({ + const setNameMessage = new registryTx.vulcanize.registry.v1beta1.MsgSetName({ crn, cid, signer, @@ -289,7 +289,7 @@ const protoCreateMsgSetName = ( return { message: setNameMessage, - path: 'vulcanize.nameservice.v1beta1.MsgSetName', + path: 'vulcanize.registry.v1beta1.MsgSetName', } } @@ -299,7 +299,7 @@ function createMsgSetRecord( signer: string ) { return { - type: 'nameservice/SetRecord', + type: 'registry/SetRecord', value: { bond_id: bondId, signer, @@ -313,20 +313,20 @@ const protoCreateMsgSetRecord = ( payloadData: Payload, signer: string ) => { - const record = new nameservice.vulcanize.nameservice.v1beta1.Record(payloadData.record.serialize()) + const record = new registry.vulcanize.registry.v1beta1.Record(payloadData.record.serialize()) const signatures = payloadData.signatures.map( - signature => new nameservice.vulcanize.nameservice.v1beta1.Signature( + signature => new registry.vulcanize.registry.v1beta1.Signature( signature.serialize() ) ) - const payload = new nameserviceTx.vulcanize.nameservice.v1beta1.Payload({ + const payload = new registryTx.vulcanize.registry.v1beta1.Payload({ record, signatures }) - const setNameMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgSetRecord({ + const setNameMessage = new registryTx.vulcanize.registry.v1beta1.MsgSetRecord({ bond_id: bondId, signer, payload @@ -334,7 +334,7 @@ const protoCreateMsgSetRecord = ( return { message: setNameMessage, - path: 'vulcanize.nameservice.v1beta1.MsgSetRecord', + path: 'vulcanize.registry.v1beta1.MsgSetRecord', } } @@ -344,7 +344,7 @@ function createMsgSetAuthorityBond( signer: string ) { return { - type: 'nameservice/SetAuthorityBond', + type: 'registry/SetAuthorityBond', value: { name, bond_id: bondId, @@ -358,7 +358,7 @@ const protoCreateMsgSetAuthorityBond = ( bondId: string, signer: string ) => { - const setAuthorityBondMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgSetAuthorityBond({ + const setAuthorityBondMessage = new registryTx.vulcanize.registry.v1beta1.MsgSetAuthorityBond({ name, bond_id: bondId, signer, @@ -366,7 +366,7 @@ const protoCreateMsgSetAuthorityBond = ( return { message: setAuthorityBondMessage, - path: 'vulcanize.nameservice.v1beta1.MsgSetAuthorityBond', + path: 'vulcanize.registry.v1beta1.MsgSetAuthorityBond', } } @@ -375,7 +375,7 @@ function createMsgDeleteName( signer: string ) { return { - type: 'nameservice/DeleteAuthority', + type: 'registry/DeleteAuthority', value: { crn, signer @@ -387,13 +387,13 @@ const protoCreateMsgDeleteName = ( crn: string, signer: string ) => { - const deleteNameAutorityMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgDeleteNameAuthority({ + const deleteNameAutorityMessage = new registryTx.vulcanize.registry.v1beta1.MsgDeleteNameAuthority({ crn, signer, }) return { message: deleteNameAutorityMessage, - path: 'vulcanize.nameservice.v1beta1.MsgDeleteNameAuthority', + path: 'vulcanize.registry.v1beta1.MsgDeleteNameAuthority', } } diff --git a/src/proto/vulcanize/nameservice/v1beta1/attributes.ts b/src/proto/vulcanize/registry/v1beta1/attributes.ts similarity index 99% rename from src/proto/vulcanize/nameservice/v1beta1/attributes.ts rename to src/proto/vulcanize/registry/v1beta1/attributes.ts index 9019b37..dfe131e 100644 --- a/src/proto/vulcanize/nameservice/v1beta1/attributes.ts +++ b/src/proto/vulcanize/registry/v1beta1/attributes.ts @@ -3,11 +3,11 @@ /** * Generated by the protoc-gen-ts. DO NOT EDIT! * compiler version: 3.12.4 - * source: vulcanize/nameservice/v1beta1/attributes.proto + * source: vulcanize/registry/v1beta1/attributes.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../gogoproto/gogo"; import * as pb_1 from "google-protobuf"; -export namespace vulcanize.nameservice.v1beta1 { +export namespace vulcanize.registry.v1beta1 { export class ServiceProviderRegistration extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { diff --git a/src/proto/vulcanize/nameservice/v1beta1/genesis.ts b/src/proto/vulcanize/registry/v1beta1/genesis.ts similarity index 64% rename from src/proto/vulcanize/nameservice/v1beta1/genesis.ts rename to src/proto/vulcanize/registry/v1beta1/genesis.ts index fdb7bd9..0a12e8a 100644 --- a/src/proto/vulcanize/nameservice/v1beta1/genesis.ts +++ b/src/proto/vulcanize/registry/v1beta1/genesis.ts @@ -3,19 +3,19 @@ /** * Generated by the protoc-gen-ts. DO NOT EDIT! * compiler version: 3.12.4 - * source: vulcanize/nameservice/v1beta1/genesis.proto + * source: vulcanize/registry/v1beta1/genesis.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../gogoproto/gogo"; -import * as dependency_2 from "./nameservice"; +import * as dependency_2 from "./registry"; import * as pb_1 from "google-protobuf"; -export namespace vulcanize.nameservice.v1beta1 { +export namespace vulcanize.registry.v1beta1 { export class GenesisState extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - params?: dependency_2.vulcanize.nameservice.v1beta1.Params; - records?: dependency_2.vulcanize.nameservice.v1beta1.Record[]; - authorities?: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry[]; - names?: dependency_2.vulcanize.nameservice.v1beta1.NameEntry[]; + params?: dependency_2.vulcanize.registry.v1beta1.Params; + records?: dependency_2.vulcanize.registry.v1beta1.Record[]; + authorities?: dependency_2.vulcanize.registry.v1beta1.AuthorityEntry[]; + names?: dependency_2.vulcanize.registry.v1beta1.NameEntry[]; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4], this.#one_of_decls); @@ -35,71 +35,71 @@ export namespace vulcanize.nameservice.v1beta1 { } } get params() { - return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Params, 1) as dependency_2.vulcanize.nameservice.v1beta1.Params; + return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.registry.v1beta1.Params, 1) as dependency_2.vulcanize.registry.v1beta1.Params; } - set params(value: dependency_2.vulcanize.nameservice.v1beta1.Params) { + set params(value: dependency_2.vulcanize.registry.v1beta1.Params) { pb_1.Message.setWrapperField(this, 1, value); } get has_params() { return pb_1.Message.getField(this, 1) != null; } get records() { - return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Record, 2) as dependency_2.vulcanize.nameservice.v1beta1.Record[]; + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.registry.v1beta1.Record, 2) as dependency_2.vulcanize.registry.v1beta1.Record[]; } - set records(value: dependency_2.vulcanize.nameservice.v1beta1.Record[]) { + set records(value: dependency_2.vulcanize.registry.v1beta1.Record[]) { pb_1.Message.setRepeatedWrapperField(this, 2, value); } get authorities() { - return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry, 3) as dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry[]; + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.registry.v1beta1.AuthorityEntry, 3) as dependency_2.vulcanize.registry.v1beta1.AuthorityEntry[]; } - set authorities(value: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry[]) { + set authorities(value: dependency_2.vulcanize.registry.v1beta1.AuthorityEntry[]) { pb_1.Message.setRepeatedWrapperField(this, 3, value); } get names() { - return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.NameEntry, 4) as dependency_2.vulcanize.nameservice.v1beta1.NameEntry[]; + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.registry.v1beta1.NameEntry, 4) as dependency_2.vulcanize.registry.v1beta1.NameEntry[]; } - set names(value: dependency_2.vulcanize.nameservice.v1beta1.NameEntry[]) { + set names(value: dependency_2.vulcanize.registry.v1beta1.NameEntry[]) { pb_1.Message.setRepeatedWrapperField(this, 4, value); } static fromObject(data: { - params?: ReturnType; - records?: ReturnType[]; - authorities?: ReturnType[]; - names?: ReturnType[]; + params?: ReturnType; + records?: ReturnType[]; + authorities?: ReturnType[]; + names?: ReturnType[]; }): GenesisState { const message = new GenesisState({}); if (data.params != null) { - message.params = dependency_2.vulcanize.nameservice.v1beta1.Params.fromObject(data.params); + message.params = dependency_2.vulcanize.registry.v1beta1.Params.fromObject(data.params); } if (data.records != null) { - message.records = data.records.map(item => dependency_2.vulcanize.nameservice.v1beta1.Record.fromObject(item)); + message.records = data.records.map(item => dependency_2.vulcanize.registry.v1beta1.Record.fromObject(item)); } if (data.authorities != null) { - message.authorities = data.authorities.map(item => dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry.fromObject(item)); + message.authorities = data.authorities.map(item => dependency_2.vulcanize.registry.v1beta1.AuthorityEntry.fromObject(item)); } if (data.names != null) { - message.names = data.names.map(item => dependency_2.vulcanize.nameservice.v1beta1.NameEntry.fromObject(item)); + message.names = data.names.map(item => dependency_2.vulcanize.registry.v1beta1.NameEntry.fromObject(item)); } return message; } toObject() { const data: { - params?: ReturnType; - records?: ReturnType[]; - authorities?: ReturnType[]; - names?: ReturnType[]; + params?: ReturnType; + records?: ReturnType[]; + authorities?: ReturnType[]; + names?: ReturnType[]; } = {}; if (this.params != null) { data.params = this.params.toObject(); } if (this.records != null) { - data.records = this.records.map((item: dependency_2.vulcanize.nameservice.v1beta1.Record) => item.toObject()); + data.records = this.records.map((item: dependency_2.vulcanize.registry.v1beta1.Record) => item.toObject()); } if (this.authorities != null) { - data.authorities = this.authorities.map((item: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry) => item.toObject()); + data.authorities = this.authorities.map((item: dependency_2.vulcanize.registry.v1beta1.AuthorityEntry) => item.toObject()); } if (this.names != null) { - data.names = this.names.map((item: dependency_2.vulcanize.nameservice.v1beta1.NameEntry) => item.toObject()); + data.names = this.names.map((item: dependency_2.vulcanize.registry.v1beta1.NameEntry) => item.toObject()); } return data; } @@ -110,11 +110,11 @@ export namespace vulcanize.nameservice.v1beta1 { if (this.has_params) writer.writeMessage(1, this.params, () => this.params.serialize(writer)); if (this.records.length) - writer.writeRepeatedMessage(2, this.records, (item: dependency_2.vulcanize.nameservice.v1beta1.Record) => item.serialize(writer)); + writer.writeRepeatedMessage(2, this.records, (item: dependency_2.vulcanize.registry.v1beta1.Record) => item.serialize(writer)); if (this.authorities.length) - writer.writeRepeatedMessage(3, this.authorities, (item: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry) => item.serialize(writer)); + writer.writeRepeatedMessage(3, this.authorities, (item: dependency_2.vulcanize.registry.v1beta1.AuthorityEntry) => item.serialize(writer)); if (this.names.length) - writer.writeRepeatedMessage(4, this.names, (item: dependency_2.vulcanize.nameservice.v1beta1.NameEntry) => item.serialize(writer)); + writer.writeRepeatedMessage(4, this.names, (item: dependency_2.vulcanize.registry.v1beta1.NameEntry) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); } @@ -125,16 +125,16 @@ export namespace vulcanize.nameservice.v1beta1 { break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.nameservice.v1beta1.Params.deserialize(reader)); + reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.registry.v1beta1.Params.deserialize(reader)); break; case 2: - reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.nameservice.v1beta1.Record.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.Record)); + reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.registry.v1beta1.Record.deserialize(reader), dependency_2.vulcanize.registry.v1beta1.Record)); break; case 3: - reader.readMessage(message.authorities, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry)); + reader.readMessage(message.authorities, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.vulcanize.registry.v1beta1.AuthorityEntry.deserialize(reader), dependency_2.vulcanize.registry.v1beta1.AuthorityEntry)); break; case 4: - reader.readMessage(message.names, () => pb_1.Message.addToRepeatedWrapperField(message, 4, dependency_2.vulcanize.nameservice.v1beta1.NameEntry.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.NameEntry)); + reader.readMessage(message.names, () => pb_1.Message.addToRepeatedWrapperField(message, 4, dependency_2.vulcanize.registry.v1beta1.NameEntry.deserialize(reader), dependency_2.vulcanize.registry.v1beta1.NameEntry)); break; default: reader.skipField(); } diff --git a/src/proto/vulcanize/nameservice/v1beta1/query.ts b/src/proto/vulcanize/registry/v1beta1/query.ts similarity index 92% rename from src/proto/vulcanize/nameservice/v1beta1/query.ts rename to src/proto/vulcanize/registry/v1beta1/query.ts index 9250d96..ab26f6f 100644 --- a/src/proto/vulcanize/nameservice/v1beta1/query.ts +++ b/src/proto/vulcanize/registry/v1beta1/query.ts @@ -3,15 +3,15 @@ /** * Generated by the protoc-gen-ts. DO NOT EDIT! * compiler version: 3.12.4 - * source: vulcanize/nameservice/v1beta1/query.proto + * source: vulcanize/registry/v1beta1/query.proto * git: https://github.com/thesayyn/protoc-gen-ts */ -import * as dependency_1 from "./nameservice"; +import * as dependency_1 from "./registry"; import * as dependency_2 from "./../../../google/api/annotations"; import * as dependency_3 from "./../../../cosmos/base/query/v1beta1/pagination"; import * as dependency_4 from "./../../../gogoproto/gogo"; import * as dependency_5 from "./../../../cosmos/base/v1beta1/coin"; import * as pb_1 from "google-protobuf"; -export namespace vulcanize.nameservice.v1beta1 { +export namespace vulcanize.registry.v1beta1 { export class QueryParamsRequest extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { @@ -55,7 +55,7 @@ export namespace vulcanize.nameservice.v1beta1 { export class QueryParamsResponse extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - params?: dependency_1.vulcanize.nameservice.v1beta1.Params; + params?: dependency_1.vulcanize.registry.v1beta1.Params; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -66,26 +66,26 @@ export namespace vulcanize.nameservice.v1beta1 { } } get params() { - return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.Params, 1) as dependency_1.vulcanize.nameservice.v1beta1.Params; + return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.registry.v1beta1.Params, 1) as dependency_1.vulcanize.registry.v1beta1.Params; } - set params(value: dependency_1.vulcanize.nameservice.v1beta1.Params) { + set params(value: dependency_1.vulcanize.registry.v1beta1.Params) { pb_1.Message.setWrapperField(this, 1, value); } get has_params() { return pb_1.Message.getField(this, 1) != null; } static fromObject(data: { - params?: ReturnType; + params?: ReturnType; }): QueryParamsResponse { const message = new QueryParamsResponse({}); if (data.params != null) { - message.params = dependency_1.vulcanize.nameservice.v1beta1.Params.fromObject(data.params); + message.params = dependency_1.vulcanize.registry.v1beta1.Params.fromObject(data.params); } return message; } toObject() { const data: { - params?: ReturnType; + params?: ReturnType; } = {}; if (this.params != null) { data.params = this.params.toObject(); @@ -108,7 +108,7 @@ export namespace vulcanize.nameservice.v1beta1 { break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.params, () => message.params = dependency_1.vulcanize.nameservice.v1beta1.Params.deserialize(reader)); + reader.readMessage(message.params, () => message.params = dependency_1.vulcanize.registry.v1beta1.Params.deserialize(reader)); break; default: reader.skipField(); } @@ -611,7 +611,7 @@ export namespace vulcanize.nameservice.v1beta1 { export class QueryListRecordsResponse extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - records?: dependency_1.vulcanize.nameservice.v1beta1.Record[]; + records?: dependency_1.vulcanize.registry.v1beta1.Record[]; pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse; }) { super(); @@ -626,9 +626,9 @@ export namespace vulcanize.nameservice.v1beta1 { } } get records() { - return pb_1.Message.getRepeatedWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.Record, 1) as dependency_1.vulcanize.nameservice.v1beta1.Record[]; + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.vulcanize.registry.v1beta1.Record, 1) as dependency_1.vulcanize.registry.v1beta1.Record[]; } - set records(value: dependency_1.vulcanize.nameservice.v1beta1.Record[]) { + set records(value: dependency_1.vulcanize.registry.v1beta1.Record[]) { pb_1.Message.setRepeatedWrapperField(this, 1, value); } get pagination() { @@ -641,12 +641,12 @@ export namespace vulcanize.nameservice.v1beta1 { return pb_1.Message.getField(this, 2) != null; } static fromObject(data: { - records?: ReturnType[]; + records?: ReturnType[]; pagination?: ReturnType; }): QueryListRecordsResponse { const message = new QueryListRecordsResponse({}); if (data.records != null) { - message.records = data.records.map(item => dependency_1.vulcanize.nameservice.v1beta1.Record.fromObject(item)); + message.records = data.records.map(item => dependency_1.vulcanize.registry.v1beta1.Record.fromObject(item)); } if (data.pagination != null) { message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); @@ -655,11 +655,11 @@ export namespace vulcanize.nameservice.v1beta1 { } toObject() { const data: { - records?: ReturnType[]; + records?: ReturnType[]; pagination?: ReturnType; } = {}; if (this.records != null) { - data.records = this.records.map((item: dependency_1.vulcanize.nameservice.v1beta1.Record) => item.toObject()); + data.records = this.records.map((item: dependency_1.vulcanize.registry.v1beta1.Record) => item.toObject()); } if (this.pagination != null) { data.pagination = this.pagination.toObject(); @@ -671,7 +671,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); if (this.records.length) - writer.writeRepeatedMessage(1, this.records, (item: dependency_1.vulcanize.nameservice.v1beta1.Record) => item.serialize(writer)); + writer.writeRepeatedMessage(1, this.records, (item: dependency_1.vulcanize.registry.v1beta1.Record) => item.serialize(writer)); if (this.has_pagination) writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); if (!w) @@ -684,7 +684,7 @@ export namespace vulcanize.nameservice.v1beta1 { break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_1.vulcanize.nameservice.v1beta1.Record.deserialize(reader), dependency_1.vulcanize.nameservice.v1beta1.Record)); + reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_1.vulcanize.registry.v1beta1.Record.deserialize(reader), dependency_1.vulcanize.registry.v1beta1.Record)); break; case 2: reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); @@ -701,7 +701,7 @@ export namespace vulcanize.nameservice.v1beta1 { return QueryListRecordsResponse.deserialize(bytes); } } - export class QueryRecordByIdRequest extends pb_1.Message { + export class QueryRecordByIDRequest extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; @@ -722,8 +722,8 @@ export namespace vulcanize.nameservice.v1beta1 { } static fromObject(data: { id?: string; - }): QueryRecordByIdRequest { - const message = new QueryRecordByIdRequest({}); + }): QueryRecordByIDRequest { + const message = new QueryRecordByIDRequest({}); if (data.id != null) { message.id = data.id; } @@ -747,8 +747,8 @@ export namespace vulcanize.nameservice.v1beta1 { if (!w) return writer.getResultBuffer(); } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByIdRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByIdRequest(); + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByIDRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByIDRequest(); while (reader.nextField()) { if (reader.isEndGroup()) break; @@ -764,14 +764,14 @@ export namespace vulcanize.nameservice.v1beta1 { serializeBinary(): Uint8Array { return this.serialize(); } - static deserializeBinary(bytes: Uint8Array): QueryRecordByIdRequest { - return QueryRecordByIdRequest.deserialize(bytes); + static deserializeBinary(bytes: Uint8Array): QueryRecordByIDRequest { + return QueryRecordByIDRequest.deserialize(bytes); } } - export class QueryRecordByIdResponse extends pb_1.Message { + export class QueryRecordByIDResponse extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - record?: dependency_1.vulcanize.nameservice.v1beta1.Record; + record?: dependency_1.vulcanize.registry.v1beta1.Record; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -782,26 +782,26 @@ export namespace vulcanize.nameservice.v1beta1 { } } get record() { - return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.Record, 1) as dependency_1.vulcanize.nameservice.v1beta1.Record; + return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.registry.v1beta1.Record, 1) as dependency_1.vulcanize.registry.v1beta1.Record; } - set record(value: dependency_1.vulcanize.nameservice.v1beta1.Record) { + set record(value: dependency_1.vulcanize.registry.v1beta1.Record) { pb_1.Message.setWrapperField(this, 1, value); } get has_record() { return pb_1.Message.getField(this, 1) != null; } static fromObject(data: { - record?: ReturnType; - }): QueryRecordByIdResponse { - const message = new QueryRecordByIdResponse({}); + record?: ReturnType; + }): QueryRecordByIDResponse { + const message = new QueryRecordByIDResponse({}); if (data.record != null) { - message.record = dependency_1.vulcanize.nameservice.v1beta1.Record.fromObject(data.record); + message.record = dependency_1.vulcanize.registry.v1beta1.Record.fromObject(data.record); } return message; } toObject() { const data: { - record?: ReturnType; + record?: ReturnType; } = {}; if (this.record != null) { data.record = this.record.toObject(); @@ -817,14 +817,14 @@ export namespace vulcanize.nameservice.v1beta1 { if (!w) return writer.getResultBuffer(); } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByIdResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByIdResponse(); + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByIDResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByIDResponse(); while (reader.nextField()) { if (reader.isEndGroup()) break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.record, () => message.record = dependency_1.vulcanize.nameservice.v1beta1.Record.deserialize(reader)); + reader.readMessage(message.record, () => message.record = dependency_1.vulcanize.registry.v1beta1.Record.deserialize(reader)); break; default: reader.skipField(); } @@ -834,11 +834,11 @@ export namespace vulcanize.nameservice.v1beta1 { serializeBinary(): Uint8Array { return this.serialize(); } - static deserializeBinary(bytes: Uint8Array): QueryRecordByIdResponse { - return QueryRecordByIdResponse.deserialize(bytes); + static deserializeBinary(bytes: Uint8Array): QueryRecordByIDResponse { + return QueryRecordByIDResponse.deserialize(bytes); } } - export class QueryRecordByBondIdRequest extends pb_1.Message { + export class QueryRecordByBondIDRequest extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { id?: string; @@ -873,8 +873,8 @@ export namespace vulcanize.nameservice.v1beta1 { static fromObject(data: { id?: string; pagination?: ReturnType; - }): QueryRecordByBondIdRequest { - const message = new QueryRecordByBondIdRequest({}); + }): QueryRecordByBondIDRequest { + const message = new QueryRecordByBondIDRequest({}); if (data.id != null) { message.id = data.id; } @@ -907,8 +907,8 @@ export namespace vulcanize.nameservice.v1beta1 { if (!w) return writer.getResultBuffer(); } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByBondIdRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByBondIdRequest(); + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByBondIDRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByBondIDRequest(); while (reader.nextField()) { if (reader.isEndGroup()) break; @@ -927,14 +927,14 @@ export namespace vulcanize.nameservice.v1beta1 { serializeBinary(): Uint8Array { return this.serialize(); } - static deserializeBinary(bytes: Uint8Array): QueryRecordByBondIdRequest { - return QueryRecordByBondIdRequest.deserialize(bytes); + static deserializeBinary(bytes: Uint8Array): QueryRecordByBondIDRequest { + return QueryRecordByBondIDRequest.deserialize(bytes); } } - export class QueryRecordByBondIdResponse extends pb_1.Message { + export class QueryRecordByBondIDResponse extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - records?: dependency_1.vulcanize.nameservice.v1beta1.Record[]; + records?: dependency_1.vulcanize.registry.v1beta1.Record[]; pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse; }) { super(); @@ -949,9 +949,9 @@ export namespace vulcanize.nameservice.v1beta1 { } } get records() { - return pb_1.Message.getRepeatedWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.Record, 1) as dependency_1.vulcanize.nameservice.v1beta1.Record[]; + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.vulcanize.registry.v1beta1.Record, 1) as dependency_1.vulcanize.registry.v1beta1.Record[]; } - set records(value: dependency_1.vulcanize.nameservice.v1beta1.Record[]) { + set records(value: dependency_1.vulcanize.registry.v1beta1.Record[]) { pb_1.Message.setRepeatedWrapperField(this, 1, value); } get pagination() { @@ -964,12 +964,12 @@ export namespace vulcanize.nameservice.v1beta1 { return pb_1.Message.getField(this, 2) != null; } static fromObject(data: { - records?: ReturnType[]; + records?: ReturnType[]; pagination?: ReturnType; - }): QueryRecordByBondIdResponse { - const message = new QueryRecordByBondIdResponse({}); + }): QueryRecordByBondIDResponse { + const message = new QueryRecordByBondIDResponse({}); if (data.records != null) { - message.records = data.records.map(item => dependency_1.vulcanize.nameservice.v1beta1.Record.fromObject(item)); + message.records = data.records.map(item => dependency_1.vulcanize.registry.v1beta1.Record.fromObject(item)); } if (data.pagination != null) { message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); @@ -978,11 +978,11 @@ export namespace vulcanize.nameservice.v1beta1 { } toObject() { const data: { - records?: ReturnType[]; + records?: ReturnType[]; pagination?: ReturnType; } = {}; if (this.records != null) { - data.records = this.records.map((item: dependency_1.vulcanize.nameservice.v1beta1.Record) => item.toObject()); + data.records = this.records.map((item: dependency_1.vulcanize.registry.v1beta1.Record) => item.toObject()); } if (this.pagination != null) { data.pagination = this.pagination.toObject(); @@ -994,20 +994,20 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); if (this.records.length) - writer.writeRepeatedMessage(1, this.records, (item: dependency_1.vulcanize.nameservice.v1beta1.Record) => item.serialize(writer)); + writer.writeRepeatedMessage(1, this.records, (item: dependency_1.vulcanize.registry.v1beta1.Record) => item.serialize(writer)); if (this.has_pagination) writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); if (!w) return writer.getResultBuffer(); } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByBondIdResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByBondIdResponse(); + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByBondIDResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByBondIDResponse(); while (reader.nextField()) { if (reader.isEndGroup()) break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_1.vulcanize.nameservice.v1beta1.Record.deserialize(reader), dependency_1.vulcanize.nameservice.v1beta1.Record)); + reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_1.vulcanize.registry.v1beta1.Record.deserialize(reader), dependency_1.vulcanize.registry.v1beta1.Record)); break; case 2: reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); @@ -1020,19 +1020,19 @@ export namespace vulcanize.nameservice.v1beta1 { serializeBinary(): Uint8Array { return this.serialize(); } - static deserializeBinary(bytes: Uint8Array): QueryRecordByBondIdResponse { - return QueryRecordByBondIdResponse.deserialize(bytes); + static deserializeBinary(bytes: Uint8Array): QueryRecordByBondIDResponse { + return QueryRecordByBondIDResponse.deserialize(bytes); } } - export class GetNameServiceModuleBalanceRequest extends pb_1.Message { + export class GetRegistryModuleBalanceRequest extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | {}) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { } } - static fromObject(data: {}): GetNameServiceModuleBalanceRequest { - const message = new GetNameServiceModuleBalanceRequest({}); + static fromObject(data: {}): GetRegistryModuleBalanceRequest { + const message = new GetRegistryModuleBalanceRequest({}); return message; } toObject() { @@ -1046,8 +1046,8 @@ export namespace vulcanize.nameservice.v1beta1 { if (!w) return writer.getResultBuffer(); } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetNameServiceModuleBalanceRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetNameServiceModuleBalanceRequest(); + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetRegistryModuleBalanceRequest { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetRegistryModuleBalanceRequest(); while (reader.nextField()) { if (reader.isEndGroup()) break; @@ -1060,11 +1060,11 @@ export namespace vulcanize.nameservice.v1beta1 { serializeBinary(): Uint8Array { return this.serialize(); } - static deserializeBinary(bytes: Uint8Array): GetNameServiceModuleBalanceRequest { - return GetNameServiceModuleBalanceRequest.deserialize(bytes); + static deserializeBinary(bytes: Uint8Array): GetRegistryModuleBalanceRequest { + return GetRegistryModuleBalanceRequest.deserialize(bytes); } } - export class GetNameServiceModuleBalanceResponse extends pb_1.Message { + export class GetRegistryModuleBalanceResponse extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { balances?: AccountBalance[]; @@ -1085,8 +1085,8 @@ export namespace vulcanize.nameservice.v1beta1 { } static fromObject(data: { balances?: ReturnType[]; - }): GetNameServiceModuleBalanceResponse { - const message = new GetNameServiceModuleBalanceResponse({}); + }): GetRegistryModuleBalanceResponse { + const message = new GetRegistryModuleBalanceResponse({}); if (data.balances != null) { message.balances = data.balances.map(item => AccountBalance.fromObject(item)); } @@ -1110,8 +1110,8 @@ export namespace vulcanize.nameservice.v1beta1 { if (!w) return writer.getResultBuffer(); } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetNameServiceModuleBalanceResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetNameServiceModuleBalanceResponse(); + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetRegistryModuleBalanceResponse { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetRegistryModuleBalanceResponse(); while (reader.nextField()) { if (reader.isEndGroup()) break; @@ -1127,8 +1127,8 @@ export namespace vulcanize.nameservice.v1beta1 { serializeBinary(): Uint8Array { return this.serialize(); } - static deserializeBinary(bytes: Uint8Array): GetNameServiceModuleBalanceResponse { - return GetNameServiceModuleBalanceResponse.deserialize(bytes); + static deserializeBinary(bytes: Uint8Array): GetRegistryModuleBalanceResponse { + return GetRegistryModuleBalanceResponse.deserialize(bytes); } } export class AccountBalance extends pb_1.Message { @@ -1294,7 +1294,7 @@ export namespace vulcanize.nameservice.v1beta1 { export class QueryListNameRecordsResponse extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - names?: dependency_1.vulcanize.nameservice.v1beta1.NameEntry[]; + names?: dependency_1.vulcanize.registry.v1beta1.NameEntry[]; pagination?: dependency_3.cosmos.base.query.v1beta1.PageResponse; }) { super(); @@ -1309,9 +1309,9 @@ export namespace vulcanize.nameservice.v1beta1 { } } get names() { - return pb_1.Message.getRepeatedWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.NameEntry, 1) as dependency_1.vulcanize.nameservice.v1beta1.NameEntry[]; + return pb_1.Message.getRepeatedWrapperField(this, dependency_1.vulcanize.registry.v1beta1.NameEntry, 1) as dependency_1.vulcanize.registry.v1beta1.NameEntry[]; } - set names(value: dependency_1.vulcanize.nameservice.v1beta1.NameEntry[]) { + set names(value: dependency_1.vulcanize.registry.v1beta1.NameEntry[]) { pb_1.Message.setRepeatedWrapperField(this, 1, value); } get pagination() { @@ -1324,12 +1324,12 @@ export namespace vulcanize.nameservice.v1beta1 { return pb_1.Message.getField(this, 2) != null; } static fromObject(data: { - names?: ReturnType[]; + names?: ReturnType[]; pagination?: ReturnType; }): QueryListNameRecordsResponse { const message = new QueryListNameRecordsResponse({}); if (data.names != null) { - message.names = data.names.map(item => dependency_1.vulcanize.nameservice.v1beta1.NameEntry.fromObject(item)); + message.names = data.names.map(item => dependency_1.vulcanize.registry.v1beta1.NameEntry.fromObject(item)); } if (data.pagination != null) { message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); @@ -1338,11 +1338,11 @@ export namespace vulcanize.nameservice.v1beta1 { } toObject() { const data: { - names?: ReturnType[]; + names?: ReturnType[]; pagination?: ReturnType; } = {}; if (this.names != null) { - data.names = this.names.map((item: dependency_1.vulcanize.nameservice.v1beta1.NameEntry) => item.toObject()); + data.names = this.names.map((item: dependency_1.vulcanize.registry.v1beta1.NameEntry) => item.toObject()); } if (this.pagination != null) { data.pagination = this.pagination.toObject(); @@ -1354,7 +1354,7 @@ export namespace vulcanize.nameservice.v1beta1 { serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); if (this.names.length) - writer.writeRepeatedMessage(1, this.names, (item: dependency_1.vulcanize.nameservice.v1beta1.NameEntry) => item.serialize(writer)); + writer.writeRepeatedMessage(1, this.names, (item: dependency_1.vulcanize.registry.v1beta1.NameEntry) => item.serialize(writer)); if (this.has_pagination) writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); if (!w) @@ -1367,7 +1367,7 @@ export namespace vulcanize.nameservice.v1beta1 { break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.names, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_1.vulcanize.nameservice.v1beta1.NameEntry.deserialize(reader), dependency_1.vulcanize.nameservice.v1beta1.NameEntry)); + reader.readMessage(message.names, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_1.vulcanize.registry.v1beta1.NameEntry.deserialize(reader), dependency_1.vulcanize.registry.v1beta1.NameEntry)); break; case 2: reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); @@ -1454,7 +1454,7 @@ export namespace vulcanize.nameservice.v1beta1 { export class QueryWhoisResponse extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - name_authority?: dependency_1.vulcanize.nameservice.v1beta1.NameAuthority; + name_authority?: dependency_1.vulcanize.registry.v1beta1.NameAuthority; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -1465,26 +1465,26 @@ export namespace vulcanize.nameservice.v1beta1 { } } get name_authority() { - return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.NameAuthority, 1) as dependency_1.vulcanize.nameservice.v1beta1.NameAuthority; + return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.registry.v1beta1.NameAuthority, 1) as dependency_1.vulcanize.registry.v1beta1.NameAuthority; } - set name_authority(value: dependency_1.vulcanize.nameservice.v1beta1.NameAuthority) { + set name_authority(value: dependency_1.vulcanize.registry.v1beta1.NameAuthority) { pb_1.Message.setWrapperField(this, 1, value); } get has_name_authority() { return pb_1.Message.getField(this, 1) != null; } static fromObject(data: { - name_authority?: ReturnType; + name_authority?: ReturnType; }): QueryWhoisResponse { const message = new QueryWhoisResponse({}); if (data.name_authority != null) { - message.name_authority = dependency_1.vulcanize.nameservice.v1beta1.NameAuthority.fromObject(data.name_authority); + message.name_authority = dependency_1.vulcanize.registry.v1beta1.NameAuthority.fromObject(data.name_authority); } return message; } toObject() { const data: { - name_authority?: ReturnType; + name_authority?: ReturnType; } = {}; if (this.name_authority != null) { data.name_authority = this.name_authority.toObject(); @@ -1507,7 +1507,7 @@ export namespace vulcanize.nameservice.v1beta1 { break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.name_authority, () => message.name_authority = dependency_1.vulcanize.nameservice.v1beta1.NameAuthority.deserialize(reader)); + reader.readMessage(message.name_authority, () => message.name_authority = dependency_1.vulcanize.registry.v1beta1.NameAuthority.deserialize(reader)); break; default: reader.skipField(); } @@ -1591,7 +1591,7 @@ export namespace vulcanize.nameservice.v1beta1 { export class QueryLookupCrnResponse extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - name?: dependency_1.vulcanize.nameservice.v1beta1.NameRecord; + name?: dependency_1.vulcanize.registry.v1beta1.NameRecord; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -1602,26 +1602,26 @@ export namespace vulcanize.nameservice.v1beta1 { } } get name() { - return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.NameRecord, 1) as dependency_1.vulcanize.nameservice.v1beta1.NameRecord; + return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.registry.v1beta1.NameRecord, 1) as dependency_1.vulcanize.registry.v1beta1.NameRecord; } - set name(value: dependency_1.vulcanize.nameservice.v1beta1.NameRecord) { + set name(value: dependency_1.vulcanize.registry.v1beta1.NameRecord) { pb_1.Message.setWrapperField(this, 1, value); } get has_name() { return pb_1.Message.getField(this, 1) != null; } static fromObject(data: { - name?: ReturnType; + name?: ReturnType; }): QueryLookupCrnResponse { const message = new QueryLookupCrnResponse({}); if (data.name != null) { - message.name = dependency_1.vulcanize.nameservice.v1beta1.NameRecord.fromObject(data.name); + message.name = dependency_1.vulcanize.registry.v1beta1.NameRecord.fromObject(data.name); } return message; } toObject() { const data: { - name?: ReturnType; + name?: ReturnType; } = {}; if (this.name != null) { data.name = this.name.toObject(); @@ -1644,7 +1644,7 @@ export namespace vulcanize.nameservice.v1beta1 { break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.name, () => message.name = dependency_1.vulcanize.nameservice.v1beta1.NameRecord.deserialize(reader)); + reader.readMessage(message.name, () => message.name = dependency_1.vulcanize.registry.v1beta1.NameRecord.deserialize(reader)); break; default: reader.skipField(); } @@ -1728,7 +1728,7 @@ export namespace vulcanize.nameservice.v1beta1 { export class QueryResolveCrnResponse extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - record?: dependency_1.vulcanize.nameservice.v1beta1.Record; + record?: dependency_1.vulcanize.registry.v1beta1.Record; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -1739,26 +1739,26 @@ export namespace vulcanize.nameservice.v1beta1 { } } get record() { - return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.nameservice.v1beta1.Record, 1) as dependency_1.vulcanize.nameservice.v1beta1.Record; + return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.registry.v1beta1.Record, 1) as dependency_1.vulcanize.registry.v1beta1.Record; } - set record(value: dependency_1.vulcanize.nameservice.v1beta1.Record) { + set record(value: dependency_1.vulcanize.registry.v1beta1.Record) { pb_1.Message.setWrapperField(this, 1, value); } get has_record() { return pb_1.Message.getField(this, 1) != null; } static fromObject(data: { - record?: ReturnType; + record?: ReturnType; }): QueryResolveCrnResponse { const message = new QueryResolveCrnResponse({}); if (data.record != null) { - message.record = dependency_1.vulcanize.nameservice.v1beta1.Record.fromObject(data.record); + message.record = dependency_1.vulcanize.registry.v1beta1.Record.fromObject(data.record); } return message; } toObject() { const data: { - record?: ReturnType; + record?: ReturnType; } = {}; if (this.record != null) { data.record = this.record.toObject(); @@ -1781,7 +1781,7 @@ export namespace vulcanize.nameservice.v1beta1 { break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.record, () => message.record = dependency_1.vulcanize.nameservice.v1beta1.Record.deserialize(reader)); + reader.readMessage(message.record, () => message.record = dependency_1.vulcanize.registry.v1beta1.Record.deserialize(reader)); break; default: reader.skipField(); } diff --git a/src/proto/vulcanize/nameservice/v1beta1/nameservice.ts b/src/proto/vulcanize/registry/v1beta1/registry.ts similarity index 97% rename from src/proto/vulcanize/nameservice/v1beta1/nameservice.ts rename to src/proto/vulcanize/registry/v1beta1/registry.ts index 03785d1..194f1e1 100644 --- a/src/proto/vulcanize/nameservice/v1beta1/nameservice.ts +++ b/src/proto/vulcanize/registry/v1beta1/registry.ts @@ -3,15 +3,15 @@ /** * Generated by the protoc-gen-ts. DO NOT EDIT! * compiler version: 3.12.4 - * source: vulcanize/nameservice/v1beta1/nameservice.proto + * source: vulcanize/registry/v1beta1/registry.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../google/protobuf/duration"; import * as dependency_2 from "./../../../google/protobuf/timestamp"; -import * as dependency_3 from "./../../../google/protobuf/any"; +import * as dependency_3 from "./../../../gogoproto/gogo"; import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin"; -import * as dependency_5 from "./../../../gogoproto/gogo"; +import * as dependency_5 from "./../../../google/protobuf/any"; import * as pb_1 from "google-protobuf"; -export namespace vulcanize.nameservice.v1beta1 { +export namespace vulcanize.registry.v1beta1 { export class Params extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { @@ -348,8 +348,9 @@ export namespace vulcanize.nameservice.v1beta1 { expiry_time?: string; deleted?: boolean; owners?: string[]; - attributes?: dependency_3.google.protobuf.Any; + attributes?: dependency_5.google.protobuf.Any; names?: string[]; + type?: string; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6, 8], this.#one_of_decls); @@ -378,6 +379,9 @@ export namespace vulcanize.nameservice.v1beta1 { if ("names" in data && data.names != undefined) { this.names = data.names; } + if ("type" in data && data.type != undefined) { + this.type = data.type; + } } } get id() { @@ -417,9 +421,9 @@ export namespace vulcanize.nameservice.v1beta1 { pb_1.Message.setField(this, 6, value); } get attributes() { - return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Any, 7) as dependency_3.google.protobuf.Any; + return pb_1.Message.getWrapperField(this, dependency_5.google.protobuf.Any, 7) as dependency_5.google.protobuf.Any; } - set attributes(value: dependency_3.google.protobuf.Any) { + set attributes(value: dependency_5.google.protobuf.Any) { pb_1.Message.setWrapperField(this, 7, value); } get has_attributes() { @@ -431,6 +435,12 @@ export namespace vulcanize.nameservice.v1beta1 { set names(value: string[]) { pb_1.Message.setField(this, 8, value); } + get type() { + return pb_1.Message.getFieldWithDefault(this, 9, "") as string; + } + set type(value: string) { + pb_1.Message.setField(this, 9, value); + } static fromObject(data: { id?: string; bond_id?: string; @@ -438,8 +448,9 @@ export namespace vulcanize.nameservice.v1beta1 { expiry_time?: string; deleted?: boolean; owners?: string[]; - attributes?: ReturnType; + attributes?: ReturnType; names?: string[]; + type?: string; }): Record { const message = new Record({}); if (data.id != null) { @@ -461,11 +472,14 @@ export namespace vulcanize.nameservice.v1beta1 { message.owners = data.owners; } if (data.attributes != null) { - message.attributes = dependency_3.google.protobuf.Any.fromObject(data.attributes); + message.attributes = dependency_5.google.protobuf.Any.fromObject(data.attributes); } if (data.names != null) { message.names = data.names; } + if (data.type != null) { + message.type = data.type; + } return message; } toObject() { @@ -476,8 +490,9 @@ export namespace vulcanize.nameservice.v1beta1 { expiry_time?: string; deleted?: boolean; owners?: string[]; - attributes?: ReturnType; + attributes?: ReturnType; names?: string[]; + type?: string; } = {}; if (this.id != null) { data.id = this.id; @@ -503,6 +518,9 @@ export namespace vulcanize.nameservice.v1beta1 { if (this.names != null) { data.names = this.names; } + if (this.type != null) { + data.type = this.type; + } return data; } serialize(): Uint8Array; @@ -525,6 +543,8 @@ export namespace vulcanize.nameservice.v1beta1 { writer.writeMessage(7, this.attributes, () => this.attributes.serialize(writer)); if (this.names.length) writer.writeRepeatedString(8, this.names); + if (this.type.length) + writer.writeString(9, this.type); if (!w) return writer.getResultBuffer(); } @@ -553,11 +573,14 @@ export namespace vulcanize.nameservice.v1beta1 { pb_1.Message.addToRepeatedField(message, 6, reader.readString()); break; case 7: - reader.readMessage(message.attributes, () => message.attributes = dependency_3.google.protobuf.Any.deserialize(reader)); + reader.readMessage(message.attributes, () => message.attributes = dependency_5.google.protobuf.Any.deserialize(reader)); break; case 8: pb_1.Message.addToRepeatedField(message, 8, reader.readString()); break; + case 9: + message.type = reader.readString(); + break; default: reader.skipField(); } } diff --git a/src/proto/vulcanize/nameservice/v1beta1/tx.ts b/src/proto/vulcanize/registry/v1beta1/tx.ts similarity index 97% rename from src/proto/vulcanize/nameservice/v1beta1/tx.ts rename to src/proto/vulcanize/registry/v1beta1/tx.ts index 872cbac..56f4f2f 100644 --- a/src/proto/vulcanize/nameservice/v1beta1/tx.ts +++ b/src/proto/vulcanize/registry/v1beta1/tx.ts @@ -3,12 +3,12 @@ /** * Generated by the protoc-gen-ts. DO NOT EDIT! * compiler version: 3.12.4 - * source: vulcanize/nameservice/v1beta1/tx.proto + * source: vulcanize/registry/v1beta1/tx.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as dependency_1 from "./../../../gogoproto/gogo"; -import * as dependency_2 from "./nameservice"; +import * as dependency_2 from "./registry"; import * as pb_1 from "google-protobuf"; -export namespace vulcanize.nameservice.v1beta1 { +export namespace vulcanize.registry.v1beta1 { export class MsgSetRecord extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { @@ -195,8 +195,8 @@ export namespace vulcanize.nameservice.v1beta1 { export class Payload extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { - record?: dependency_2.vulcanize.nameservice.v1beta1.Record; - signatures?: dependency_2.vulcanize.nameservice.v1beta1.Signature[]; + record?: dependency_2.vulcanize.registry.v1beta1.Record; + signatures?: dependency_2.vulcanize.registry.v1beta1.Signature[]; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); @@ -210,43 +210,43 @@ export namespace vulcanize.nameservice.v1beta1 { } } get record() { - return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Record, 1) as dependency_2.vulcanize.nameservice.v1beta1.Record; + return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.registry.v1beta1.Record, 1) as dependency_2.vulcanize.registry.v1beta1.Record; } - set record(value: dependency_2.vulcanize.nameservice.v1beta1.Record) { + set record(value: dependency_2.vulcanize.registry.v1beta1.Record) { pb_1.Message.setWrapperField(this, 1, value); } get has_record() { return pb_1.Message.getField(this, 1) != null; } get signatures() { - return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Signature, 2) as dependency_2.vulcanize.nameservice.v1beta1.Signature[]; + return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.registry.v1beta1.Signature, 2) as dependency_2.vulcanize.registry.v1beta1.Signature[]; } - set signatures(value: dependency_2.vulcanize.nameservice.v1beta1.Signature[]) { + set signatures(value: dependency_2.vulcanize.registry.v1beta1.Signature[]) { pb_1.Message.setRepeatedWrapperField(this, 2, value); } static fromObject(data: { - record?: ReturnType; - signatures?: ReturnType[]; + record?: ReturnType; + signatures?: ReturnType[]; }): Payload { const message = new Payload({}); if (data.record != null) { - message.record = dependency_2.vulcanize.nameservice.v1beta1.Record.fromObject(data.record); + message.record = dependency_2.vulcanize.registry.v1beta1.Record.fromObject(data.record); } if (data.signatures != null) { - message.signatures = data.signatures.map(item => dependency_2.vulcanize.nameservice.v1beta1.Signature.fromObject(item)); + message.signatures = data.signatures.map(item => dependency_2.vulcanize.registry.v1beta1.Signature.fromObject(item)); } return message; } toObject() { const data: { - record?: ReturnType; - signatures?: ReturnType[]; + record?: ReturnType; + signatures?: ReturnType[]; } = {}; if (this.record != null) { data.record = this.record.toObject(); } if (this.signatures != null) { - data.signatures = this.signatures.map((item: dependency_2.vulcanize.nameservice.v1beta1.Signature) => item.toObject()); + data.signatures = this.signatures.map((item: dependency_2.vulcanize.registry.v1beta1.Signature) => item.toObject()); } return data; } @@ -257,7 +257,7 @@ export namespace vulcanize.nameservice.v1beta1 { if (this.has_record) writer.writeMessage(1, this.record, () => this.record.serialize(writer)); if (this.signatures.length) - writer.writeRepeatedMessage(2, this.signatures, (item: dependency_2.vulcanize.nameservice.v1beta1.Signature) => item.serialize(writer)); + writer.writeRepeatedMessage(2, this.signatures, (item: dependency_2.vulcanize.registry.v1beta1.Signature) => item.serialize(writer)); if (!w) return writer.getResultBuffer(); } @@ -268,10 +268,10 @@ export namespace vulcanize.nameservice.v1beta1 { break; switch (reader.getFieldNumber()) { case 1: - reader.readMessage(message.record, () => message.record = dependency_2.vulcanize.nameservice.v1beta1.Record.deserialize(reader)); + reader.readMessage(message.record, () => message.record = dependency_2.vulcanize.registry.v1beta1.Record.deserialize(reader)); break; case 2: - reader.readMessage(message.signatures, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.nameservice.v1beta1.Signature.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.Signature)); + reader.readMessage(message.signatures, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.registry.v1beta1.Signature.deserialize(reader), dependency_2.vulcanize.registry.v1beta1.Signature)); break; default: reader.skipField(); } diff --git a/src/types.ts b/src/types.ts index f3111b0..49d687a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -3,7 +3,7 @@ import { Validator } from 'jsonschema'; import RecordSchema from './schema/record.json'; import { Util } from './util'; -import * as attributes from './proto/vulcanize/nameservice/v1beta1/attributes'; +import * as attributes from './proto/vulcanize/registry/v1beta1/attributes'; import * as any from './proto/google/protobuf/any'; /** @@ -33,9 +33,9 @@ export class Record { var a = new any.google.protobuf.Any() if (this._record.type=="WebsiteRegistrationRecord"){ - var attr= new attributes.vulcanize.nameservice.v1beta1.WebsiteRegistrationRecord(this._record) + var attr= new attributes.vulcanize.registry.v1beta1.WebsiteRegistrationRecord(this._record) a= new any.google.protobuf.Any({ - type_url: "/vulcanize.nameservice.v1beta1.WebsiteRegistrationRecord", + type_url: "/vulcanize.registry.v1beta1.WebsiteRegistrationRecord", value: attr.serialize() }) } -- 2.45.2 From c0f71b0b8fce16891cf1561b799baf09be913421 Mon Sep 17 00:00:00 2001 From: 0xmuralik Date: Mon, 26 Dec 2022 11:22:03 +0530 Subject: [PATCH 3/7] record attribute types in registry.ts --- src/messages/registry.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/messages/registry.ts b/src/messages/registry.ts index 904dd17..44faf95 100644 --- a/src/messages/registry.ts +++ b/src/messages/registry.ts @@ -46,6 +46,13 @@ const MSG_SET_RECORD_TYPES = { { name: 'deleted', type: 'bool' }, { name: 'attributes', type: 'string' }, ], + TypePayloadRecordAttributes: [ + { name: 'url', type: 'string' }, + { name: 'repo_registration_record_cid', type: 'string' }, + { name: 'build_artifact_cid', type: 'string' }, + { name: 'tls_cert_cid', type: 'string' }, + { name: 'type', type: 'string' }, + ], TypePayloadSignatures: [ { name: 'sig', type: 'string' }, { name: 'pub_key', type: 'string' } -- 2.45.2 From e295b8de3682da9d21b2b8d6c88cb8ca24078d21 Mon Sep 17 00:00:00 2001 From: 0xmuralik Date: Tue, 27 Dec 2022 12:17:02 +0530 Subject: [PATCH 4/7] to byte array --- src/account.ts | 4 ++++ src/messages/registry.ts | 9 +++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/account.ts b/src/account.ts index 070f4f2..f0e929e 100644 --- a/src/account.ts +++ b/src/account.ts @@ -166,6 +166,10 @@ export class Account { assert(message); const eipMessageDomain: any = message.eipToSign.domain; + if(message.eipToSign.message.msgs[0].value.payload!=null){ + message.eipToSign.message.msgs[0].value.payload.record.attributes.value=Array.from(message.eipToSign.message.msgs[0].value.payload.record.attributes.value) + } + const signature = signTypedData({ data: { types: message.eipToSign.types as MessageTypes, diff --git a/src/messages/registry.ts b/src/messages/registry.ts index 44faf95..7ad4a32 100644 --- a/src/messages/registry.ts +++ b/src/messages/registry.ts @@ -44,14 +44,11 @@ const MSG_SET_RECORD_TYPES = { { name: 'create_time', type: 'string' }, { name: 'expiry_time', type: 'string' }, { name: 'deleted', type: 'bool' }, - { name: 'attributes', type: 'string' }, + { name: 'attributes', type: 'TypePayloadRecordAttributes' }, ], TypePayloadRecordAttributes: [ - { name: 'url', type: 'string' }, - { name: 'repo_registration_record_cid', type: 'string' }, - { name: 'build_artifact_cid', type: 'string' }, - { name: 'tls_cert_cid', type: 'string' }, - { name: 'type', type: 'string' }, + { name: 'type_url', type: 'string' }, + { name: 'value', type: 'uint8[]' }, ], TypePayloadSignatures: [ { name: 'sig', type: 'string' }, -- 2.45.2 From 1793a890d95979d17f39d1046686f7cda169e919 Mon Sep 17 00:00:00 2001 From: 0xmuralik Date: Wed, 28 Dec 2022 16:12:34 +0530 Subject: [PATCH 5/7] remove version from record --- src/testing/data/watcher.yml | 1 - src/testing/helper.ts | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/testing/data/watcher.yml b/src/testing/data/watcher.yml index f6357f5..06d66eb 100644 --- a/src/testing/data/watcher.yml +++ b/src/testing/data/watcher.yml @@ -4,4 +4,3 @@ record: repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D build_artifact_cid: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9 tls_cert_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR - version: null diff --git a/src/testing/helper.ts b/src/testing/helper.ts index 86cde9f..9db61ce 100644 --- a/src/testing/helper.ts +++ b/src/testing/helper.ts @@ -7,15 +7,15 @@ import { DEFAULT_CHAIN_ID, Registry } from '../index'; export const ensureUpdatedConfig = async (path: string) => { const conf = await yaml.read(path); - conf.record.version = semver.inc(conf.record.version, 'patch'); - await yaml.write(path, conf); + // conf.record.version = semver.inc(conf.record.version, 'patch'); + // await yaml.write(path, conf); return conf; }; export const getBaseConfig = async (path: string) => { const conf = await yaml.read(path); - conf.record.version = '0.0.1'; + // conf.record.version = '0.0.1'; return conf; }; -- 2.45.2 From 0ace77c778593f455b7d0c8e1f31d1fa762e94da Mon Sep 17 00:00:00 2001 From: 0xmuralik Date: Mon, 2 Jan 2023 17:44:06 +0530 Subject: [PATCH 6/7] versioning record attributes --- .../registry/v1beta1/attributes.proto | 2 + .../vulcanize/registry/v1beta1/attributes.ts | 46 +++++++++++++++++++ src/testing/data/watcher.yml | 1 + src/testing/helper.ts | 6 +-- 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/proto/vulcanize/registry/v1beta1/attributes.proto b/proto/vulcanize/registry/v1beta1/attributes.proto index 8ec3b6a..c5d2702 100644 --- a/proto/vulcanize/registry/v1beta1/attributes.proto +++ b/proto/vulcanize/registry/v1beta1/attributes.proto @@ -10,6 +10,7 @@ message ServiceProviderRegistration { string laconic_id = 2 [(gogoproto.moretags) = "json:\"laconicId\" yaml:\"laconicId\""]; X500 x500 = 3 [(gogoproto.moretags) = "json:\"x500\" yaml:\"x500\""]; string type = 4 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""]; + string version = 6 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""]; } message X500 { @@ -28,4 +29,5 @@ message WebsiteRegistrationRecord { string build_artifact_cid = 3 [(gogoproto.moretags) = "json:\"buildArtifactCID\" yaml:\"buildArtifactCID\""]; string tls_cert_cid = 4 [(gogoproto.moretags) = "json:\"TLSCertCID\" yaml:\"TLSCertCID\""]; string type = 5 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""]; + string version = 6 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""]; } \ No newline at end of file diff --git a/src/proto/vulcanize/registry/v1beta1/attributes.ts b/src/proto/vulcanize/registry/v1beta1/attributes.ts index dfe131e..c9aff83 100644 --- a/src/proto/vulcanize/registry/v1beta1/attributes.ts +++ b/src/proto/vulcanize/registry/v1beta1/attributes.ts @@ -15,6 +15,7 @@ export namespace vulcanize.registry.v1beta1 { laconic_id?: string; x500?: X500; type?: string; + version?: string; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -31,6 +32,9 @@ export namespace vulcanize.registry.v1beta1 { if ("type" in data && data.type != undefined) { this.type = data.type; } + if ("version" in data && data.version != undefined) { + this.version = data.version; + } } } get bond_id() { @@ -60,11 +64,18 @@ export namespace vulcanize.registry.v1beta1 { set type(value: string) { pb_1.Message.setField(this, 4, value); } + get version() { + return pb_1.Message.getFieldWithDefault(this, 6, "") as string; + } + set version(value: string) { + pb_1.Message.setField(this, 6, value); + } static fromObject(data: { bond_id?: string; laconic_id?: string; x500?: ReturnType; type?: string; + version?: string; }): ServiceProviderRegistration { const message = new ServiceProviderRegistration({}); if (data.bond_id != null) { @@ -79,6 +90,9 @@ export namespace vulcanize.registry.v1beta1 { if (data.type != null) { message.type = data.type; } + if (data.version != null) { + message.version = data.version; + } return message; } toObject() { @@ -87,6 +101,7 @@ export namespace vulcanize.registry.v1beta1 { laconic_id?: string; x500?: ReturnType; type?: string; + version?: string; } = {}; if (this.bond_id != null) { data.bond_id = this.bond_id; @@ -100,6 +115,9 @@ export namespace vulcanize.registry.v1beta1 { if (this.type != null) { data.type = this.type; } + if (this.version != null) { + data.version = this.version; + } return data; } serialize(): Uint8Array; @@ -114,6 +132,8 @@ export namespace vulcanize.registry.v1beta1 { writer.writeMessage(3, this.x500, () => this.x500.serialize(writer)); if (this.type.length) writer.writeString(4, this.type); + if (this.version.length) + writer.writeString(6, this.version); if (!w) return writer.getResultBuffer(); } @@ -135,6 +155,9 @@ export namespace vulcanize.registry.v1beta1 { case 4: message.type = reader.readString(); break; + case 6: + message.version = reader.readString(); + break; default: reader.skipField(); } } @@ -337,6 +360,7 @@ export namespace vulcanize.registry.v1beta1 { build_artifact_cid?: string; tls_cert_cid?: string; type?: string; + version?: string; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -356,6 +380,9 @@ export namespace vulcanize.registry.v1beta1 { if ("type" in data && data.type != undefined) { this.type = data.type; } + if ("version" in data && data.version != undefined) { + this.version = data.version; + } } } get url() { @@ -388,12 +415,19 @@ export namespace vulcanize.registry.v1beta1 { set type(value: string) { pb_1.Message.setField(this, 5, value); } + get version() { + return pb_1.Message.getFieldWithDefault(this, 6, "") as string; + } + set version(value: string) { + pb_1.Message.setField(this, 6, value); + } static fromObject(data: { url?: string; repo_registration_record_cid?: string; build_artifact_cid?: string; tls_cert_cid?: string; type?: string; + version?: string; }): WebsiteRegistrationRecord { const message = new WebsiteRegistrationRecord({}); if (data.url != null) { @@ -411,6 +445,9 @@ export namespace vulcanize.registry.v1beta1 { if (data.type != null) { message.type = data.type; } + if (data.version != null) { + message.version = data.version; + } return message; } toObject() { @@ -420,6 +457,7 @@ export namespace vulcanize.registry.v1beta1 { build_artifact_cid?: string; tls_cert_cid?: string; type?: string; + version?: string; } = {}; if (this.url != null) { data.url = this.url; @@ -436,6 +474,9 @@ export namespace vulcanize.registry.v1beta1 { if (this.type != null) { data.type = this.type; } + if (this.version != null) { + data.version = this.version; + } return data; } serialize(): Uint8Array; @@ -452,6 +493,8 @@ export namespace vulcanize.registry.v1beta1 { writer.writeString(4, this.tls_cert_cid); if (this.type.length) writer.writeString(5, this.type); + if (this.version.length) + writer.writeString(6, this.version); if (!w) return writer.getResultBuffer(); } @@ -476,6 +519,9 @@ export namespace vulcanize.registry.v1beta1 { case 5: message.type = reader.readString(); break; + case 6: + message.version = reader.readString(); + break; default: reader.skipField(); } } diff --git a/src/testing/data/watcher.yml b/src/testing/data/watcher.yml index 06d66eb..36d06fa 100644 --- a/src/testing/data/watcher.yml +++ b/src/testing/data/watcher.yml @@ -4,3 +4,4 @@ record: repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D build_artifact_cid: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9 tls_cert_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR + version: 1.0.11 diff --git a/src/testing/helper.ts b/src/testing/helper.ts index 9db61ce..86cde9f 100644 --- a/src/testing/helper.ts +++ b/src/testing/helper.ts @@ -7,15 +7,15 @@ import { DEFAULT_CHAIN_ID, Registry } from '../index'; export const ensureUpdatedConfig = async (path: string) => { const conf = await yaml.read(path); - // conf.record.version = semver.inc(conf.record.version, 'patch'); - // await yaml.write(path, conf); + conf.record.version = semver.inc(conf.record.version, 'patch'); + await yaml.write(path, conf); return conf; }; export const getBaseConfig = async (path: string) => { const conf = await yaml.read(path); - // conf.record.version = '0.0.1'; + conf.record.version = '0.0.1'; return conf; }; -- 2.45.2 From e8a56f2b979907c7e2943a8b7bd59609a6dee318 Mon Sep 17 00:00:00 2001 From: 0xmuralik Date: Tue, 3 Jan 2023 14:50:38 +0530 Subject: [PATCH 7/7] fix failing tests --- src/naming.test.ts | 6 +++--- src/sdk.test.ts | 13 +++++++------ src/testing/data/watcher.yml | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/naming.test.ts b/src/naming.test.ts index 7445e41..b3527fa 100644 --- a/src/naming.test.ts +++ b/src/naming.test.ts @@ -119,7 +119,7 @@ const namingTests = () => { await registry.setName({ crn, cid: watcherId }, privateKey, fee); // Query records should return it (some CRN points to it). - const records = await registry.queryRecords({ type: 'watcher', version: watcher.record.version }); + const records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }); expect(records).toBeDefined(); expect(records).toHaveLength(1); }); @@ -229,12 +229,12 @@ const namingTests = () => { expect(latest.height).toBeDefined(); // Query records should NOT return it (no CRN points to it). - records = await registry.queryRecords({ type: 'watcher', version: watcher.record.version }); + records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }); expect(records).toBeDefined(); expect(records).toHaveLength(0); // Query all records should return it (all: true). - records = await registry.queryRecords({ type: 'watcher', version: watcher.record.version }, true); + records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true); expect(records).toBeDefined(); expect(records).toHaveLength(1); }); diff --git a/src/sdk.test.ts b/src/sdk.test.ts index 80038cf..b59af12 100644 --- a/src/sdk.test.ts +++ b/src/sdk.test.ts @@ -45,12 +45,12 @@ describe('Querying', () => { }); test('Query records by reference.', async () => { - const { protocol } = watcher.record; - const records = await registry.queryRecords({ protocol }, true); + const { repo_registration_record_cid } = watcher.record; + const records = await registry.queryRecords({ repo_registration_record_cid }, true); expect(records.length).toBeGreaterThanOrEqual(1); - const { attributes: { protocol: recordProtocol } } = records[0]; - expect(protocol['/']).toBe(recordProtocol['/']); + const { attributes: { repo_registration_record_cid: record_repo_registration_record_cid } } = records[0]; + expect(repo_registration_record_cid).toBe(record_repo_registration_record_cid); }); test('Query records by attributes.', async () => { @@ -73,7 +73,8 @@ describe('Querying', () => { test('Query records passing refs true.', async () => { const [record] = await registry.getRecordsByIds([watcher.id], true); expect(record.id).toBe(watcher.id); - expect(record.references).toBeDefined(); - expect(record.references).toHaveLength(1); + // temp fix + expect(record.attributes.repo_registration_record_cid).toBeDefined(); + expect(record.attributes.repo_registration_record_cid).toHaveLength(46); }); }); diff --git a/src/testing/data/watcher.yml b/src/testing/data/watcher.yml index 36d06fa..95c9a83 100644 --- a/src/testing/data/watcher.yml +++ b/src/testing/data/watcher.yml @@ -4,4 +4,4 @@ record: repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D build_artifact_cid: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9 tls_cert_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR - version: 1.0.11 + version: 1.0.0 -- 2.45.2