From b73f9644efe0a1c5b4a43118ac59bef5ccd1f28a Mon Sep 17 00:00:00 2001 From: Gabriel Garrido Calvo <2728080+ggarri@users.noreply.github.com> Date: Mon, 28 Mar 2022 15:05:00 +0200 Subject: [PATCH] update protobuf messages (#239) --- CHANGELOG.md | 7 + README.md | 2 +- proto/tx/tx.proto | 58 ++++---- src/stubs/index.d.ts | 70 ++++----- src/stubs/index.js | 340 +++++++++++++++++++++---------------------- 5 files changed, 243 insertions(+), 234 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ec73a40..4a57847e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. + +## 7.0.0 (WIP) + +### ⚠ BREAKING CHANGES + +- Reformatted job notification message + ## 6.1.0 (2022-01-13) ### 🆕 Features diff --git a/README.md b/README.md index 38c99422..1e7753ce 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The Orchestrate library provides convenient access to the Orchestrate API from a | SDK versions | Orchestrate versions | | ------------------- | ------------------------------ | -| master/HEAD | Orchestrate v21.12.0 or higher | +| master/HEAD | Orchestrate main/HEAD | | SDK v6.1.x | Orchestrate v21.12.1 or higher | | SDK v6.0.x | Orchestrate v21.12.0 or higher | | ~~SDK v5.x.x~~ | Deprecated | diff --git a/proto/tx/tx.proto b/proto/tx/tx.proto index 7b07c56e..a2228c87 100644 --- a/proto/tx/tx.proto +++ b/proto/tx/tx.proto @@ -1,16 +1,17 @@ syntax = "proto3"; -import "types/error/error.proto"; -import "types/ethereum/receipt.proto"; -import "types/ethereum/transaction.proto"; +import "pkg/types/error/error.proto"; +import "pkg/types/ethereum/receipt.proto"; +import "pkg/types/ethereum/transaction.proto"; -option go_package = "github.com/consensys/orchestrate/types/tx"; +option go_package = "github.com/consensys/orchestrate/pkg/types/tx"; package tx; message TxRequest { - // Technical header (optional) - map headers = 1; + // ID of the Request in UUID RFC 4122, ISO/IEC 9834-8:2005 format + // e.g a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 + string id = 1; // Name of the Chain as registered on the chain registry // e.g. 1 for mainnet, 3 for Ropsten @@ -22,15 +23,14 @@ message TxRequest { // Params for the transaction Params params = 4; - // ID of the Request in UUID RFC 4122, ISO/IEC 9834-8:2005 format - // e.g a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 - string id = 5; + // Type of the job + JobType jobType = 5; - // [option] - map context_labels = 6; + // Technical header (optional) + map headers = 6; - // Type of the job - JobType jobType = 7; + // [option] + map context_labels = 7; } message TxEnvelope { @@ -59,10 +59,10 @@ enum Method { enum JobType { ETH_TX = 0; ETH_RAW_TX = 1; - ETH_EEA_MARKING_TX = 2; - ETH_EEA_PRIVATE_TX = 3; - ETH_TESSERA_MARKING_TX = 4; - ETH_TESSERA_PRIVATE_TX = 5; + EEA_MARKING_TX = 2; + EEA_PRIVATE_TX = 3; + GO_QUORUM_MARKING_TX = 4; + GO_QUORUM_PRIVATE_TX = 5; } message Params { @@ -134,25 +134,27 @@ message Params { } message TxResponse { - // Extra information (optional) - map headers = 1; // ID of the Response in UUID RFC 4122, ISO/IEC 9834-8:2005 format // e.g a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 - string id = 2; + string id = 1; + + // Name of the Chain as registered on the chain registry + // e.g. 1 for mainnet, 3 for Ropsten + string chain = 2; // ID of the Job created as part of transaction request // e.g 15276759-bbc6-4ead-ad51-ddfecf79cf09 - string jobUUID = 8; + string jobUUID = 3; + + // Extra information (optional) + map headers = 4; // [option] - map context_labels = 3; + map context_labels = 5; - ethereum.Transaction transaction = 4; - ethereum.Receipt receipt = 5; - // Name of the Chain as registered on the chain registry - // e.g. 1 for mainnet, 3 for Ropsten - string chain = 7; + ethereum.Transaction transaction = 6; + ethereum.Receipt receipt = 7; - repeated error.Error errors = 6; + repeated error.Error errors = 8; } diff --git a/src/stubs/index.d.ts b/src/stubs/index.d.ts index 12cacba2..939de86b 100644 --- a/src/stubs/index.d.ts +++ b/src/stubs/index.d.ts @@ -2830,19 +2830,19 @@ export namespace google { constructor(properties?: google.api.IHttpRule); /** HttpRule get. */ - public get: string; + public get?: (string|null); /** HttpRule put. */ - public put: string; + public put?: (string|null); /** HttpRule post. */ - public post: string; + public post?: (string|null); /** HttpRule delete. */ - public delete: string; + public delete?: (string|null); /** HttpRule patch. */ - public patch: string; + public patch?: (string|null); /** HttpRule custom. */ public custom?: (google.api.ICustomHttpPattern|null); @@ -6600,8 +6600,8 @@ export namespace tx { /** Properties of a TxRequest. */ interface ITxRequest { - /** TxRequest headers */ - headers?: ({ [k: string]: string }|null); + /** TxRequest id */ + id?: (string|null); /** TxRequest chain */ chain?: (string|null); @@ -6612,14 +6612,14 @@ export namespace tx { /** TxRequest params */ params?: (tx.IParams|null); - /** TxRequest id */ - id?: (string|null); + /** TxRequest jobType */ + jobType?: (tx.JobType|null); + + /** TxRequest headers */ + headers?: ({ [k: string]: string }|null); /** TxRequest contextLabels */ contextLabels?: ({ [k: string]: string }|null); - - /** TxRequest jobType */ - jobType?: (tx.JobType|null); } /** Represents a TxRequest. */ @@ -6631,8 +6631,8 @@ export namespace tx { */ constructor(properties?: tx.ITxRequest); - /** TxRequest headers. */ - public headers: { [k: string]: string }; + /** TxRequest id. */ + public id: string; /** TxRequest chain. */ public chain: string; @@ -6643,15 +6643,15 @@ export namespace tx { /** TxRequest params. */ public params?: (tx.IParams|null); - /** TxRequest id. */ - public id: string; + /** TxRequest jobType. */ + public jobType: tx.JobType; + + /** TxRequest headers. */ + public headers: { [k: string]: string }; /** TxRequest contextLabels. */ public contextLabels: { [k: string]: string }; - /** TxRequest jobType. */ - public jobType: tx.JobType; - /** * Creates a new TxRequest instance using the specified properties. * @param [properties] Properties to set @@ -6840,10 +6840,10 @@ export namespace tx { enum JobType { ETH_TX = 0, ETH_RAW_TX = 1, - ETH_EEA_MARKING_TX = 2, - ETH_EEA_PRIVATE_TX = 3, - ETH_TESSERA_MARKING_TX = 4, - ETH_TESSERA_PRIVATE_TX = 5 + EEA_MARKING_TX = 2, + EEA_PRIVATE_TX = 3, + GO_QUORUM_MARKING_TX = 4, + GO_QUORUM_PRIVATE_TX = 5 } /** Properties of a Params. */ @@ -7059,15 +7059,18 @@ export namespace tx { /** Properties of a TxResponse. */ interface ITxResponse { - /** TxResponse headers */ - headers?: ({ [k: string]: string }|null); - /** TxResponse id */ id?: (string|null); + /** TxResponse chain */ + chain?: (string|null); + /** TxResponse jobUUID */ jobUUID?: (string|null); + /** TxResponse headers */ + headers?: ({ [k: string]: string }|null); + /** TxResponse contextLabels */ contextLabels?: ({ [k: string]: string }|null); @@ -7077,9 +7080,6 @@ export namespace tx { /** TxResponse receipt */ receipt?: (ethereum.IReceipt|null); - /** TxResponse chain */ - chain?: (string|null); - /** TxResponse errors */ errors?: (error.IError[]|null); } @@ -7093,15 +7093,18 @@ export namespace tx { */ constructor(properties?: tx.ITxResponse); - /** TxResponse headers. */ - public headers: { [k: string]: string }; - /** TxResponse id. */ public id: string; + /** TxResponse chain. */ + public chain: string; + /** TxResponse jobUUID. */ public jobUUID: string; + /** TxResponse headers. */ + public headers: { [k: string]: string }; + /** TxResponse contextLabels. */ public contextLabels: { [k: string]: string }; @@ -7111,9 +7114,6 @@ export namespace tx { /** TxResponse receipt. */ public receipt?: (ethereum.IReceipt|null); - /** TxResponse chain. */ - public chain: string; - /** TxResponse errors. */ public errors: error.IError[]; diff --git a/src/stubs/index.js b/src/stubs/index.js index 38bcba2e..9225f9ad 100644 --- a/src/stubs/index.js +++ b/src/stubs/index.js @@ -5990,43 +5990,43 @@ /** * HttpRule get. - * @member {string} get + * @member {string|null|undefined} get * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.get = ""; + HttpRule.prototype.get = null; /** * HttpRule put. - * @member {string} put + * @member {string|null|undefined} put * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.put = ""; + HttpRule.prototype.put = null; /** * HttpRule post. - * @member {string} post + * @member {string|null|undefined} post * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.post = ""; + HttpRule.prototype.post = null; /** * HttpRule delete. - * @member {string} delete + * @member {string|null|undefined} delete * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype["delete"] = ""; + HttpRule.prototype["delete"] = null; /** * HttpRule patch. - * @member {string} patch + * @member {string|null|undefined} patch * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.patch = ""; + HttpRule.prototype.patch = null; /** * HttpRule custom. @@ -16549,13 +16549,13 @@ * Properties of a TxRequest. * @memberof tx * @interface ITxRequest - * @property {Object.|null} [headers] TxRequest headers + * @property {string|null} [id] TxRequest id * @property {string|null} [chain] TxRequest chain * @property {tx.Method|null} [method] TxRequest method * @property {tx.IParams|null} [params] TxRequest params - * @property {string|null} [id] TxRequest id - * @property {Object.|null} [contextLabels] TxRequest contextLabels * @property {tx.JobType|null} [jobType] TxRequest jobType + * @property {Object.|null} [headers] TxRequest headers + * @property {Object.|null} [contextLabels] TxRequest contextLabels */ /** @@ -16576,12 +16576,12 @@ } /** - * TxRequest headers. - * @member {Object.} headers + * TxRequest id. + * @member {string} id * @memberof tx.TxRequest * @instance */ - TxRequest.prototype.headers = $util.emptyObject; + TxRequest.prototype.id = ""; /** * TxRequest chain. @@ -16608,28 +16608,28 @@ TxRequest.prototype.params = null; /** - * TxRequest id. - * @member {string} id + * TxRequest jobType. + * @member {tx.JobType} jobType * @memberof tx.TxRequest * @instance */ - TxRequest.prototype.id = ""; + TxRequest.prototype.jobType = 0; /** - * TxRequest contextLabels. - * @member {Object.} contextLabels + * TxRequest headers. + * @member {Object.} headers * @memberof tx.TxRequest * @instance */ - TxRequest.prototype.contextLabels = $util.emptyObject; + TxRequest.prototype.headers = $util.emptyObject; /** - * TxRequest jobType. - * @member {tx.JobType} jobType + * TxRequest contextLabels. + * @member {Object.} contextLabels * @memberof tx.TxRequest * @instance */ - TxRequest.prototype.jobType = 0; + TxRequest.prototype.contextLabels = $util.emptyObject; /** * Creates a new TxRequest instance using the specified properties. @@ -16655,22 +16655,22 @@ TxRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.headers != null && Object.hasOwnProperty.call(message, "headers")) - for (var keys = Object.keys(message.headers), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.headers[keys[i]]).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.chain); if (message.method != null && Object.hasOwnProperty.call(message, "method")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.method); if (message.params != null && Object.hasOwnProperty.call(message, "params")) $root.tx.Params.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.id); + if (message.jobType != null && Object.hasOwnProperty.call(message, "jobType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.jobType); + if (message.headers != null && Object.hasOwnProperty.call(message, "headers")) + for (var keys = Object.keys(message.headers), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.headers[keys[i]]).ldelim(); if (message.contextLabels != null && Object.hasOwnProperty.call(message, "contextLabels")) for (var keys = Object.keys(message.contextLabels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.contextLabels[keys[i]]).ldelim(); - if (message.jobType != null && Object.hasOwnProperty.call(message, "jobType")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.jobType); + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.contextLabels[keys[i]]).ldelim(); return writer; }; @@ -16706,6 +16706,21 @@ var tag = reader.uint32(); switch (tag >>> 3) { case 1: + message.id = reader.string(); + break; + case 2: + message.chain = reader.string(); + break; + case 3: + message.method = reader.int32(); + break; + case 4: + message.params = $root.tx.Params.decode(reader, reader.uint32()); + break; + case 5: + message.jobType = reader.int32(); + break; + case 6: if (message.headers === $util.emptyObject) message.headers = {}; var end2 = reader.uint32() + reader.pos; @@ -16727,19 +16742,7 @@ } message.headers[key] = value; break; - case 2: - message.chain = reader.string(); - break; - case 3: - message.method = reader.int32(); - break; - case 4: - message.params = $root.tx.Params.decode(reader, reader.uint32()); - break; - case 5: - message.id = reader.string(); - break; - case 6: + case 7: if (message.contextLabels === $util.emptyObject) message.contextLabels = {}; var end2 = reader.uint32() + reader.pos; @@ -16761,9 +16764,6 @@ } message.contextLabels[key] = value; break; - case 7: - message.jobType = reader.int32(); - break; default: reader.skipType(tag & 7); break; @@ -16799,14 +16799,9 @@ TxRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.headers != null && message.hasOwnProperty("headers")) { - if (!$util.isObject(message.headers)) - return "headers: object expected"; - var key = Object.keys(message.headers); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.headers[key[i]])) - return "headers: string{k:string} expected"; - } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; if (message.chain != null && message.hasOwnProperty("chain")) if (!$util.isString(message.chain)) return "chain: string expected"; @@ -16825,17 +16820,6 @@ if (error) return "params." + error; } - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.contextLabels != null && message.hasOwnProperty("contextLabels")) { - if (!$util.isObject(message.contextLabels)) - return "contextLabels: object expected"; - var key = Object.keys(message.contextLabels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.contextLabels[key[i]])) - return "contextLabels: string{k:string} expected"; - } if (message.jobType != null && message.hasOwnProperty("jobType")) switch (message.jobType) { default: @@ -16848,6 +16832,22 @@ case 5: break; } + if (message.headers != null && message.hasOwnProperty("headers")) { + if (!$util.isObject(message.headers)) + return "headers: object expected"; + var key = Object.keys(message.headers); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.headers[key[i]])) + return "headers: string{k:string} expected"; + } + if (message.contextLabels != null && message.hasOwnProperty("contextLabels")) { + if (!$util.isObject(message.contextLabels)) + return "contextLabels: object expected"; + var key = Object.keys(message.contextLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.contextLabels[key[i]])) + return "contextLabels: string{k:string} expected"; + } return null; }; @@ -16863,13 +16863,8 @@ if (object instanceof $root.tx.TxRequest) return object; var message = new $root.tx.TxRequest(); - if (object.headers) { - if (typeof object.headers !== "object") - throw TypeError(".tx.TxRequest.headers: object expected"); - message.headers = {}; - for (var keys = Object.keys(object.headers), i = 0; i < keys.length; ++i) - message.headers[keys[i]] = String(object.headers[keys[i]]); - } + if (object.id != null) + message.id = String(object.id); if (object.chain != null) message.chain = String(object.chain); switch (object.method) { @@ -16895,15 +16890,6 @@ throw TypeError(".tx.TxRequest.params: object expected"); message.params = $root.tx.Params.fromObject(object.params); } - if (object.id != null) - message.id = String(object.id); - if (object.contextLabels) { - if (typeof object.contextLabels !== "object") - throw TypeError(".tx.TxRequest.contextLabels: object expected"); - message.contextLabels = {}; - for (var keys = Object.keys(object.contextLabels), i = 0; i < keys.length; ++i) - message.contextLabels[keys[i]] = String(object.contextLabels[keys[i]]); - } switch (object.jobType) { case "ETH_TX": case 0: @@ -16913,23 +16899,37 @@ case 1: message.jobType = 1; break; - case "ETH_EEA_MARKING_TX": + case "EEA_MARKING_TX": case 2: message.jobType = 2; break; - case "ETH_EEA_PRIVATE_TX": + case "EEA_PRIVATE_TX": case 3: message.jobType = 3; break; - case "ETH_TESSERA_MARKING_TX": + case "GO_QUORUM_MARKING_TX": case 4: message.jobType = 4; break; - case "ETH_TESSERA_PRIVATE_TX": + case "GO_QUORUM_PRIVATE_TX": case 5: message.jobType = 5; break; } + if (object.headers) { + if (typeof object.headers !== "object") + throw TypeError(".tx.TxRequest.headers: object expected"); + message.headers = {}; + for (var keys = Object.keys(object.headers), i = 0; i < keys.length; ++i) + message.headers[keys[i]] = String(object.headers[keys[i]]); + } + if (object.contextLabels) { + if (typeof object.contextLabels !== "object") + throw TypeError(".tx.TxRequest.contextLabels: object expected"); + message.contextLabels = {}; + for (var keys = Object.keys(object.contextLabels), i = 0; i < keys.length; ++i) + message.contextLabels[keys[i]] = String(object.contextLabels[keys[i]]); + } return message; }; @@ -16951,33 +16951,33 @@ object.contextLabels = {}; } if (options.defaults) { + object.id = ""; object.chain = ""; object.method = options.enums === String ? "ETH_SENDRAWTRANSACTION" : 0; object.params = null; - object.id = ""; object.jobType = options.enums === String ? "ETH_TX" : 0; } - var keys2; - if (message.headers && (keys2 = Object.keys(message.headers)).length) { - object.headers = {}; - for (var j = 0; j < keys2.length; ++j) - object.headers[keys2[j]] = message.headers[keys2[j]]; - } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; if (message.chain != null && message.hasOwnProperty("chain")) object.chain = message.chain; if (message.method != null && message.hasOwnProperty("method")) object.method = options.enums === String ? $root.tx.Method[message.method] : message.method; if (message.params != null && message.hasOwnProperty("params")) object.params = $root.tx.Params.toObject(message.params, options); - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; + if (message.jobType != null && message.hasOwnProperty("jobType")) + object.jobType = options.enums === String ? $root.tx.JobType[message.jobType] : message.jobType; + var keys2; + if (message.headers && (keys2 = Object.keys(message.headers)).length) { + object.headers = {}; + for (var j = 0; j < keys2.length; ++j) + object.headers[keys2[j]] = message.headers[keys2[j]]; + } if (message.contextLabels && (keys2 = Object.keys(message.contextLabels)).length) { object.contextLabels = {}; for (var j = 0; j < keys2.length; ++j) object.contextLabels[keys2[j]] = message.contextLabels[keys2[j]]; } - if (message.jobType != null && message.hasOwnProperty("jobType")) - object.jobType = options.enums === String ? $root.tx.JobType[message.jobType] : message.jobType; return object; }; @@ -17322,19 +17322,19 @@ * @enum {number} * @property {number} ETH_TX=0 ETH_TX value * @property {number} ETH_RAW_TX=1 ETH_RAW_TX value - * @property {number} ETH_EEA_MARKING_TX=2 ETH_EEA_MARKING_TX value - * @property {number} ETH_EEA_PRIVATE_TX=3 ETH_EEA_PRIVATE_TX value - * @property {number} ETH_TESSERA_MARKING_TX=4 ETH_TESSERA_MARKING_TX value - * @property {number} ETH_TESSERA_PRIVATE_TX=5 ETH_TESSERA_PRIVATE_TX value + * @property {number} EEA_MARKING_TX=2 EEA_MARKING_TX value + * @property {number} EEA_PRIVATE_TX=3 EEA_PRIVATE_TX value + * @property {number} GO_QUORUM_MARKING_TX=4 GO_QUORUM_MARKING_TX value + * @property {number} GO_QUORUM_PRIVATE_TX=5 GO_QUORUM_PRIVATE_TX value */ tx.JobType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "ETH_TX"] = 0; values[valuesById[1] = "ETH_RAW_TX"] = 1; - values[valuesById[2] = "ETH_EEA_MARKING_TX"] = 2; - values[valuesById[3] = "ETH_EEA_PRIVATE_TX"] = 3; - values[valuesById[4] = "ETH_TESSERA_MARKING_TX"] = 4; - values[valuesById[5] = "ETH_TESSERA_PRIVATE_TX"] = 5; + values[valuesById[2] = "EEA_MARKING_TX"] = 2; + values[valuesById[3] = "EEA_PRIVATE_TX"] = 3; + values[valuesById[4] = "GO_QUORUM_MARKING_TX"] = 4; + values[valuesById[5] = "GO_QUORUM_PRIVATE_TX"] = 5; return values; })(); @@ -18043,13 +18043,13 @@ * Properties of a TxResponse. * @memberof tx * @interface ITxResponse - * @property {Object.|null} [headers] TxResponse headers * @property {string|null} [id] TxResponse id + * @property {string|null} [chain] TxResponse chain * @property {string|null} [jobUUID] TxResponse jobUUID + * @property {Object.|null} [headers] TxResponse headers * @property {Object.|null} [contextLabels] TxResponse contextLabels * @property {ethereum.ITransaction|null} [transaction] TxResponse transaction * @property {ethereum.IReceipt|null} [receipt] TxResponse receipt - * @property {string|null} [chain] TxResponse chain * @property {Array.|null} [errors] TxResponse errors */ @@ -18072,20 +18072,20 @@ } /** - * TxResponse headers. - * @member {Object.} headers + * TxResponse id. + * @member {string} id * @memberof tx.TxResponse * @instance */ - TxResponse.prototype.headers = $util.emptyObject; + TxResponse.prototype.id = ""; /** - * TxResponse id. - * @member {string} id + * TxResponse chain. + * @member {string} chain * @memberof tx.TxResponse * @instance */ - TxResponse.prototype.id = ""; + TxResponse.prototype.chain = ""; /** * TxResponse jobUUID. @@ -18095,6 +18095,14 @@ */ TxResponse.prototype.jobUUID = ""; + /** + * TxResponse headers. + * @member {Object.} headers + * @memberof tx.TxResponse + * @instance + */ + TxResponse.prototype.headers = $util.emptyObject; + /** * TxResponse contextLabels. * @member {Object.} contextLabels @@ -18119,14 +18127,6 @@ */ TxResponse.prototype.receipt = null; - /** - * TxResponse chain. - * @member {string} chain - * @memberof tx.TxResponse - * @instance - */ - TxResponse.prototype.chain = ""; - /** * TxResponse errors. * @member {Array.} errors @@ -18159,25 +18159,25 @@ TxResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.chain); + if (message.jobUUID != null && Object.hasOwnProperty.call(message, "jobUUID")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobUUID); if (message.headers != null && Object.hasOwnProperty.call(message, "headers")) for (var keys = Object.keys(message.headers), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.headers[keys[i]]).ldelim(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.headers[keys[i]]).ldelim(); if (message.contextLabels != null && Object.hasOwnProperty.call(message, "contextLabels")) for (var keys = Object.keys(message.contextLabels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.contextLabels[keys[i]]).ldelim(); + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.contextLabels[keys[i]]).ldelim(); if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.ethereum.Transaction.encode(message.transaction, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.ethereum.Transaction.encode(message.transaction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.receipt != null && Object.hasOwnProperty.call(message, "receipt")) - $root.ethereum.Receipt.encode(message.receipt, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.ethereum.Receipt.encode(message.receipt, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.errors != null && message.errors.length) for (var i = 0; i < message.errors.length; ++i) - $root.error.Error.encode(message.errors[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.chain); - if (message.jobUUID != null && Object.hasOwnProperty.call(message, "jobUUID")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.jobUUID); + $root.error.Error.encode(message.errors[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -18213,6 +18213,15 @@ var tag = reader.uint32(); switch (tag >>> 3) { case 1: + message.id = reader.string(); + break; + case 2: + message.chain = reader.string(); + break; + case 3: + message.jobUUID = reader.string(); + break; + case 4: if (message.headers === $util.emptyObject) message.headers = {}; var end2 = reader.uint32() + reader.pos; @@ -18234,13 +18243,7 @@ } message.headers[key] = value; break; - case 2: - message.id = reader.string(); - break; - case 8: - message.jobUUID = reader.string(); - break; - case 3: + case 5: if (message.contextLabels === $util.emptyObject) message.contextLabels = {}; var end2 = reader.uint32() + reader.pos; @@ -18262,16 +18265,13 @@ } message.contextLabels[key] = value; break; - case 4: + case 6: message.transaction = $root.ethereum.Transaction.decode(reader, reader.uint32()); break; - case 5: - message.receipt = $root.ethereum.Receipt.decode(reader, reader.uint32()); - break; case 7: - message.chain = reader.string(); + message.receipt = $root.ethereum.Receipt.decode(reader, reader.uint32()); break; - case 6: + case 8: if (!(message.errors && message.errors.length)) message.errors = []; message.errors.push($root.error.Error.decode(reader, reader.uint32())); @@ -18311,6 +18311,15 @@ TxResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.chain != null && message.hasOwnProperty("chain")) + if (!$util.isString(message.chain)) + return "chain: string expected"; + if (message.jobUUID != null && message.hasOwnProperty("jobUUID")) + if (!$util.isString(message.jobUUID)) + return "jobUUID: string expected"; if (message.headers != null && message.hasOwnProperty("headers")) { if (!$util.isObject(message.headers)) return "headers: object expected"; @@ -18319,12 +18328,6 @@ if (!$util.isString(message.headers[key[i]])) return "headers: string{k:string} expected"; } - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.jobUUID != null && message.hasOwnProperty("jobUUID")) - if (!$util.isString(message.jobUUID)) - return "jobUUID: string expected"; if (message.contextLabels != null && message.hasOwnProperty("contextLabels")) { if (!$util.isObject(message.contextLabels)) return "contextLabels: object expected"; @@ -18343,9 +18346,6 @@ if (error) return "receipt." + error; } - if (message.chain != null && message.hasOwnProperty("chain")) - if (!$util.isString(message.chain)) - return "chain: string expected"; if (message.errors != null && message.hasOwnProperty("errors")) { if (!Array.isArray(message.errors)) return "errors: array expected"; @@ -18370,6 +18370,12 @@ if (object instanceof $root.tx.TxResponse) return object; var message = new $root.tx.TxResponse(); + if (object.id != null) + message.id = String(object.id); + if (object.chain != null) + message.chain = String(object.chain); + if (object.jobUUID != null) + message.jobUUID = String(object.jobUUID); if (object.headers) { if (typeof object.headers !== "object") throw TypeError(".tx.TxResponse.headers: object expected"); @@ -18377,10 +18383,6 @@ for (var keys = Object.keys(object.headers), i = 0; i < keys.length; ++i) message.headers[keys[i]] = String(object.headers[keys[i]]); } - if (object.id != null) - message.id = String(object.id); - if (object.jobUUID != null) - message.jobUUID = String(object.jobUUID); if (object.contextLabels) { if (typeof object.contextLabels !== "object") throw TypeError(".tx.TxResponse.contextLabels: object expected"); @@ -18398,8 +18400,6 @@ throw TypeError(".tx.TxResponse.receipt: object expected"); message.receipt = $root.ethereum.Receipt.fromObject(object.receipt); } - if (object.chain != null) - message.chain = String(object.chain); if (object.errors) { if (!Array.isArray(object.errors)) throw TypeError(".tx.TxResponse.errors: array expected"); @@ -18434,19 +18434,23 @@ } if (options.defaults) { object.id = ""; - object.transaction = null; - object.receipt = null; object.chain = ""; object.jobUUID = ""; + object.transaction = null; + object.receipt = null; } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.chain != null && message.hasOwnProperty("chain")) + object.chain = message.chain; + if (message.jobUUID != null && message.hasOwnProperty("jobUUID")) + object.jobUUID = message.jobUUID; var keys2; if (message.headers && (keys2 = Object.keys(message.headers)).length) { object.headers = {}; for (var j = 0; j < keys2.length; ++j) object.headers[keys2[j]] = message.headers[keys2[j]]; } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; if (message.contextLabels && (keys2 = Object.keys(message.contextLabels)).length) { object.contextLabels = {}; for (var j = 0; j < keys2.length; ++j) @@ -18461,10 +18465,6 @@ for (var j = 0; j < message.errors.length; ++j) object.errors[j] = $root.error.Error.toObject(message.errors[j], options); } - if (message.chain != null && message.hasOwnProperty("chain")) - object.chain = message.chain; - if (message.jobUUID != null && message.hasOwnProperty("jobUUID")) - object.jobUUID = message.jobUUID; return object; };